1 /*---------------------------------------------------------------------------*\
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 -------------------------------------------------------------------------------
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/>.
28 Class in charge of constitutive laws and mechanical properties
35 philip.cardiff@gmail.com
37 \*---------------------------------------------------------------------------*/
39 #ifndef constitutiveModel_H
40 #define constitutiveModel_H
42 #include "IOdictionary.H"
43 #include "plasticityStressReturn.H"
45 #include "runTimeSelectionTables.H"
46 #include "volFields.H"
48 #include "rheologyLaw.H"
49 #include "cohesiveLaw.H"
52 #include "IOReferencer.H"
54 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59 // forward declaration
62 /*---------------------------------------------------------------------------*\
63 Class constitutiveModel Declaration
64 \*---------------------------------------------------------------------------*/
66 class constitutiveModel
72 //- Reference to stress field
73 const volSymmTensorField& sigma_;
76 autoPtr<rheologyLaw> rheologyLawPtr_;
78 //- Cohesive dictionary and law
79 IOdictionary* cohesiveDictPtr_;
80 autoPtr<cohesiveLaw> cohesiveLawPtr_;
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
94 autoPtr<plasticityStressReturn> plasticityStressReturnPtr_;
99 // Private Member Functions
101 //- Disallow default bitwise copy construct
102 constitutiveModel(const constitutiveModel&);
104 //- Disallow default bitwise assignment
105 void operator=(const constitutiveModel&);
110 //- Runtime type information
111 TypeName("constitutiveModel");
116 //- Construct from components
119 const volSymmTensorField& sigma,
120 const volVectorField& U
126 virtual ~constitutiveModel();
133 //- If plasticity is active
134 bool plasticityActive() const
136 if (plasticityStressReturnPtr_.valid())
138 return plasticityStressReturnPtr_->plasticityActive();
144 //- If visco effects are active
145 bool viscoActive() const
147 return rheologyLawPtr_->viscoActive();
150 //- Return reference to stress field
151 const volSymmTensorField& sigma() const
156 //- Return true for plane stress
157 const Switch& planeStress() const
162 //- Return rheology law
163 const rheologyLaw& law() const
165 return rheologyLawPtr_();
168 //- Return cohesive law
169 const cohesiveLaw& cohLaw() const
171 return cohesiveLawPtr_();
175 tmp<volScalarField> rho() const
177 return rheologyLawPtr_->rho();
180 tmp<volScalarField> rho(scalar t) const
182 return rheologyLawPtr_->rho(t);
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;
198 tmp<volScalarField> threeK() const;
199 tmp<surfaceScalarField> threeKf() const;
201 //- Return yield stress
202 tmp<volScalarField> sigmaY() const
204 return rheologyLawPtr_->sigmaY();
207 //- Return yield stress
208 scalar sigmaY(const scalar epsilonPEq, const label cellID) const
210 return rheologyLawPtr_->sigmaY(epsilonPEq, cellID);
213 //- Return plastic modulus
214 tmp<volScalarField> Ep() const
216 return rheologyLawPtr_->Ep();
218 tmp<volScalarField> Ep(const volScalarField& epsilonEq) const
220 return rheologyLawPtr_->Ep(epsilonEq);
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
241 return solidInterfacePtr_->operator()();
244 //- Return access to solidInterface
245 virtual solidInterface& solInterface()
247 return solidInterfacePtr_->operator()();
250 //- Return true if solidInterface is active
251 virtual bool solidInterfaceActive()
253 return solidInterfaceActive_;
256 //- Update yield stress
257 void updateYieldStress();
259 //- Read plasticityProperties dictionary
263 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
265 } // End namespace Foam
267 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
271 // ************************************************************************* //