Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / src / solidModels / constitutiveModel / rheologyLaws / rheologyLaw / rheologyLaw.C
blobb9e6a1b1ce3e1e9d8ef88976d917ae080beefea7
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     rheologyLaw
27 Description
28     Material rheology for solids.
30 \*---------------------------------------------------------------------------*/
32 #include "rheologyLaw.H"
33 #include "volFields.H"
34 #include "fvc.H"
36 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 namespace Foam
41 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
43 defineTypeNameAndDebug(rheologyLaw, 0);
44 defineRunTimeSelectionTable(rheologyLaw, dictionary);
47 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
49 rheologyLaw::rheologyLaw
51     const word& name,
52     const volSymmTensorField& sigma,
53     const dictionary& dict
56     name_(name),
57     sigma_(sigma)
61 // * * * * * * * * * * * * * * * Member functions * * * * * * * * * * * * * * //
63 Foam::tmp<Foam::volDiagTensorField> Foam::rheologyLaw::K() const
65   volScalarField J =
66       ( (1 - nu()*nu() - nu()*nu() - nu()*nu() - 2*nu()*nu()*nu())
67         /(E()*E()*E()) );
68   volScalarField A11 = ( (1 - nu()*nu())/(J*E()*E()) );
69   volScalarField A22 = ( (1 - nu()*nu())/(J*E()*E()) );
70   volScalarField A33 = ( (1 - nu()*nu())/(J*E()*E()) );
72   tmp<volDiagTensorField> tresult
73     (
74         new volDiagTensorField
75         (
76             IOobject
77             (
78                 "K",
79                 mesh().time().timeName(),
80                 mesh(),
81                 IOobject::NO_READ,
82                 IOobject::NO_WRITE
83             ),
84             mesh(),
85         dimensionedDiagTensor("K", A11.dimensions(), diagTensor::zero)
86         )
87     );
89   volDiagTensorField& result = tresult();
91   result.replace(diagTensor::XX, A11);
92   result.replace(diagTensor::YY, A22);
93   result.replace(diagTensor::ZZ, A33);
95   tresult().correctBoundaryConditions();
97   return tresult;
101 Foam::tmp<Foam::volSymmTensor4thOrderField> Foam::rheologyLaw::C() const
103   volScalarField twoMu = 2.0*E()/(2.0*(1+nu()));
104   volScalarField lambda = nu()*E()/((1.0 + nu())*(1.0 - 2.0*nu()));
105   volScalarField twoMuLambda = twoMu + lambda;
107   // symmTensor4thOrder C (
108   //            2*mu + lambda, lambda, lambda,
109   //            2*mu + lambda, lambda,
110   //            2*mu + lambda,
111   //            2*mu,
112   //            2*mu,
113   //            2*mu
114   //            );
116   tmp<volSymmTensor4thOrderField> tresult
117     (
118         new volSymmTensor4thOrderField
119         (
120             IOobject
121             (
122                 "C",
123                 mesh().time().timeName(),
124                 mesh(),
125                 IOobject::NO_READ,
126                 IOobject::NO_WRITE
127             ),
128             mesh(),
129             dimensionedSymmTensor4thOrder
130             ("C", twoMu.dimensions(), symmTensor4thOrder::zero)
131         )
132     );
134   volSymmTensor4thOrderField& result = tresult();
136   result.replace(symmTensor4thOrder::XXXX, twoMuLambda);
137   result.replace(symmTensor4thOrder::XXYY, lambda);
138   result.replace(symmTensor4thOrder::XXZZ, lambda);
140   result.replace(symmTensor4thOrder::YYYY, twoMuLambda);
141   result.replace(symmTensor4thOrder::YYZZ, lambda);
143   result.replace(symmTensor4thOrder::ZZZZ, twoMuLambda);
145   result.replace(symmTensor4thOrder::XYXY, twoMu);
146   result.replace(symmTensor4thOrder::YZYZ, twoMu);
147   result.replace(symmTensor4thOrder::ZXZX, twoMu);
149   tresult().correctBoundaryConditions();
151   return tresult;
154 } // End namespace Foam
156 // ************************************************************************* //