Final cumulative bug fix for 3.2. Author: Hrvoje Jasak. Merge: Hrvoje Jasak.
[foam-extend-3.2.git] / src / solidModels / constitutiveModel / constitutiveModel.H
blobe55b721d4094b18a59b11f23044afba9282f2315
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend is free software: you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation, either version 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     constitutiveModel
27 Description
28     Class in charge of constitutive laws and mechanical properties
30 SourceFiles
31     constitutiveModel.C
33 Author
34     Philip Cardiff UCD
35     philip.cardiff@gmail.com
37 \*---------------------------------------------------------------------------*/
39 #ifndef constitutiveModel_H
40 #define constitutiveModel_H
42 #include "IOdictionary.H"
43 #include "plasticityStressReturn.H"
44 #include "typeInfo.H"
45 #include "runTimeSelectionTables.H"
46 #include "volFields.H"
47 #include "tmp.H"
48 #include "rheologyLaw.H"
49 #include "cohesiveLaw.H"
50 #include "Switch.H"
51 #include "fvc.H"
52 #include "IOReferencer.H"
54 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 namespace Foam
59 // forward declaration
60 class solidInterface;
62 /*---------------------------------------------------------------------------*\
63                         Class constitutiveModel Declaration
64 \*---------------------------------------------------------------------------*/
66 class constitutiveModel
68   public IOdictionary
70     // Private data
72         //- Reference to stress field
73         const volSymmTensorField& sigma_;
75         //- Rheology law
76         autoPtr<rheologyLaw> rheologyLawPtr_;
78         //- Cohesive dictionary and law
79         IOdictionary* cohesiveDictPtr_;
80         autoPtr<cohesiveLaw> cohesiveLawPtr_;
82         //- Plane stress
83         Switch planeStress_;
85         //- Run-time selectable solidInterface method for correct
86         //  discretisation on bi-material interfaces
87         IOReferencer<solidInterface>* solidInterfacePtr_;
89         // if solidInterface is on/off
90         bool solidInterfaceActive_;
92         //- Run-time selectable method to calculate DEpsilonP
93         //- eg radial return
94         autoPtr<plasticityStressReturn> plasticityStressReturnPtr_;
97 private:
99     // Private Member Functions
101         //- Disallow default bitwise copy construct
102         constitutiveModel(const constitutiveModel&);
104         //- Disallow default bitwise assignment
105         void operator=(const constitutiveModel&);
108 public:
110     //- Runtime type information
111     TypeName("constitutiveModel");
114     // Constructors
116         //- Construct from components
117         constitutiveModel
118         (
119             const volSymmTensorField& sigma,
120             const volVectorField& U
121         );
124     // Destructor
126         virtual ~constitutiveModel();
129     // Member Functions
131         // Access
133         //- If plasticity is active
134         bool plasticityActive() const
135         {
136             if (plasticityStressReturnPtr_.valid())
137             {
138                 return plasticityStressReturnPtr_->plasticityActive();
139             }
141             return false;
142         }
144         //- If visco effects are active
145         bool viscoActive() const
146         {
147             return rheologyLawPtr_->viscoActive();
148         }
150         //- Return reference to stress field
151         const volSymmTensorField& sigma() const
152         {
153             return sigma_;
154         }
156         //- Return true for plane stress
157         const Switch& planeStress() const
158         {
159             return planeStress_;
160         }
162         //- Return rheology law
163         const rheologyLaw& law() const
164         {
165             return rheologyLawPtr_();
166         }
168         //- Return cohesive law
169         const cohesiveLaw& cohLaw() const
170         {
171             return cohesiveLawPtr_();
172         }
174         //- Return density
175         tmp<volScalarField> rho() const
176         {
177             return rheologyLawPtr_->rho();
178         }
180         tmp<volScalarField> rho(scalar t) const
181         {
182             return rheologyLawPtr_->rho(t);
183         }
185         //- Return first Lame's coefficient
186         tmp<volScalarField> mu() const;
187         tmp<volScalarField> mu(scalar t) const;
188         tmp<volScalarField> mu(const volScalarField& epsilonEq) const;
189         tmp<surfaceScalarField> muf() const;
191         //- Return second Lame's coefficient
192         tmp<volScalarField> lambda() const;
193         tmp<volScalarField> lambda(scalar t) const;
194         tmp<volScalarField> lambda(const volScalarField& epsilonEq) const;
195         tmp<surfaceScalarField> lambdaf() const;
197         //- Return threeK
198         tmp<volScalarField> threeK() const;
199         tmp<surfaceScalarField> threeKf() const;
201         //- Return yield stress
202         tmp<volScalarField> sigmaY() const
203         {
204             return rheologyLawPtr_->sigmaY();
205         }
207         //- Return yield stress
208         scalar sigmaY(const scalar epsilonPEq, const label cellID) const
209         {
210             return rheologyLawPtr_->sigmaY(epsilonPEq, cellID);
211         }
213         //- Return plastic modulus
214         tmp<volScalarField> Ep() const
215         {
216             return rheologyLawPtr_->Ep();
217         }
218         tmp<volScalarField> Ep(const volScalarField& epsilonEq) const
219         {
220             return rheologyLawPtr_->Ep(epsilonEq);
221         }
223         //- Return plastic strain increment
224         const volSymmTensorField& DEpsilonP() const;
226         //- orthotropic tensorial diffusivity
227         //- Note: this is not the bulk modulus
228         tmp<volDiagTensorField> K() const;
229         tmp<surfaceDiagTensorField> Kf() const;
231         //- fourth order elastic stiffness tensor
232         tmp<volSymmTensor4thOrderField> C() const;
233         tmp<surfaceSymmTensor4thOrderField> Cf() const;
235         //- Correct plastic strain increment
236         virtual void correct();
238         //- Return reference to solidInterface
239         virtual const solidInterface& solInterface() const
240         {
241             return solidInterfacePtr_->operator()();
242         }
244         //- Return access to solidInterface
245         virtual solidInterface& solInterface()
246         {
247             return solidInterfacePtr_->operator()();
248         }
250         //- Return true if solidInterface is active
251         virtual bool solidInterfaceActive()
252         {
253             return solidInterfaceActive_;
254         }
256         //- Update yield stress
257         void updateYieldStress();
259         //- Read plasticityProperties dictionary
260         virtual bool read();
263 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
265 } // End namespace Foam
267 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
269 #endif
271 // ************************************************************************* //