Forward compatibility: flex
[foam-extend-3.2.git] / src / solidModels / constitutiveModel / rheologyLaws / linearElastic / linearElastic.C
blob8146a4606805e444a9c3c5cccfb075897fbcd5d1
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 \*---------------------------------------------------------------------------*/
26 #include "linearElastic.H"
27 #include "addToRunTimeSelectionTable.H"
28 #include "zeroGradientFvPatchFields.H"
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 namespace Foam
34     defineTypeNameAndDebug(linearElastic, 0);
35     addToRunTimeSelectionTable(rheologyLaw, linearElastic, dictionary);
39 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
42 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
44 // Construct from dictionary
45 Foam::linearElastic::linearElastic
47     const word& name,
48     const volSymmTensorField& sigma,
49     const dictionary& dict
52     rheologyLaw(name, sigma, dict),
53     rho_(dict.lookup("rho")),
54     E_(dict.lookup("E")),
55     nu_(dict.lookup("nu"))
59 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
61 Foam::linearElastic::~linearElastic()
65 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
67 Foam::tmp<Foam::volScalarField> Foam::linearElastic::rho() const
69     tmp<volScalarField> tresult
70     (
71         new volScalarField
72         (
73             IOobject
74             (
75                 "rho",
76                 mesh().time().timeName(),
77                 mesh(),
78                 IOobject::NO_READ,
79                 IOobject::NO_WRITE
80             ),
81             mesh(),
82             rho_,
83             zeroGradientFvPatchScalarField::typeName
84         )
85     );
87     tresult().correctBoundaryConditions();
89     return tresult;
93 Foam::tmp<Foam::volScalarField> Foam::linearElastic::E() const
95     tmp<volScalarField> tresult
96     (
97         new volScalarField
98         (
99             IOobject
100             (
101                 "E",
102                 mesh().time().timeName(),
103                 mesh(),
104                 IOobject::NO_READ,
105                 IOobject::NO_WRITE
106             ),
107             mesh(),
108             E_,
109             zeroGradientFvPatchScalarField::typeName
110         )
111     );
113     tresult().correctBoundaryConditions();
115     return tresult;
119 Foam::tmp<Foam::volScalarField> Foam::linearElastic::nu() const
121     tmp<volScalarField> tresult
122     (
123         new volScalarField
124         (
125             IOobject
126             (
127                 "nu",
128                 mesh().time().timeName(),
129                 mesh(),
130                 IOobject::NO_READ,
131                 IOobject::NO_WRITE
132             ),
133             mesh(),
134             nu_,
135             zeroGradientFvPatchScalarField::typeName
136         )
137     );
139     tresult().correctBoundaryConditions();
141     return tresult;
144 Foam::tmp<Foam::volScalarField> Foam::linearElastic::Ep() const
146 //     notImplemented(type() + "::Ep()");
148     return tmp<volScalarField>
149     (
150         new volScalarField
151         (
152             IOobject
153             (
154                 "Ep",
155                 mesh().time().timeName(),
156                 mesh(),
157                 IOobject::NO_READ,
158                 IOobject::NO_WRITE
159             ),
160             mesh(),
161             dimensionedScalar("zeroEp", dimForce/dimArea, 0.0),
162             zeroGradientFvPatchScalarField::typeName
163         )
164     );
167 Foam::tmp<Foam::volScalarField> Foam::linearElastic::sigmaY() const
169 //     notImplemented(type() + "::sigmaY()");
171     return tmp<volScalarField>
172     (
173         new volScalarField
174         (
175             IOobject
176             (
177                 "sigmaY",
178                 mesh().time().timeName(),
179                 mesh(),
180                 IOobject::NO_READ,
181                 IOobject::NO_WRITE
182             ),
183             mesh(),
184             dimensionedScalar("zeroSigmaY", dimForce/dimArea, GREAT),
185             zeroGradientFvPatchScalarField::typeName
186         )
187     );
190 Foam::scalar
191 Foam::linearElastic::sigmaY(const scalar epsilonPEq, const label cellID) const
193   return GREAT;
196 // ************************************************************************* //