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/>.
26 \*---------------------------------------------------------------------------*/
28 #include "MaxwellViscoelastic.H"
29 #include "addToRunTimeSelectionTable.H"
30 #include "zeroGradientFvPatchFields.H"
32 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
36 defineTypeNameAndDebug(MaxwellViscoelastic, 0);
37 addToRunTimeSelectionTable(rheologyLaw, MaxwellViscoelastic, dictionary);
41 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
44 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
46 // Construct from dictionary
47 Foam::MaxwellViscoelastic::MaxwellViscoelastic
50 const volSymmTensorField& sigma,
51 const dictionary& dict
54 rheologyLaw(name, sigma, dict),
55 rho_(dict.lookup("rho")),
57 eta_(dict.lookup("eta")),
58 nu_(dict.lookup("nu"))
62 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
64 Foam::MaxwellViscoelastic::~MaxwellViscoelastic()
68 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
70 Foam::tmp<Foam::volScalarField> Foam::MaxwellViscoelastic::rho(scalar t) const
72 tmp<volScalarField> tresult
79 mesh().time().timeName(),
86 zeroGradientFvPatchScalarField::typeName
90 tresult().correctBoundaryConditions();
96 Foam::tmp<Foam::volScalarField> Foam::MaxwellViscoelastic::E(scalar t) const
98 scalar tau = eta_.value()/k_.value();
100 tmp<volScalarField> tE
107 mesh().time().timeName(),
114 zeroGradientFvPatchScalarField::typeName
120 tE().internalField() = 0.0;
121 tE().correctBoundaryConditions();
128 Foam::tmp<Foam::volScalarField> Foam::MaxwellViscoelastic::nu(scalar t) const
130 tmp<volScalarField> tresult
137 mesh().time().timeName(),
144 zeroGradientFvPatchScalarField::typeName
148 tresult().correctBoundaryConditions();
154 Foam::tmp<Foam::volScalarField> Foam::MaxwellViscoelastic::J(scalar t) const
156 tmp<volScalarField> tJ
163 mesh().time().timeName(),
172 dimless/k_.dimensions(),
173 1.0/k_.value() + t/eta_.value()
175 zeroGradientFvPatchScalarField::typeName
181 tJ().internalField() = 0.0;
182 tJ().correctBoundaryConditions();
189 // ************************************************************************* //