1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
5 \\ / A nd | 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 "PronyViscoelastic.H"
29 #include "addToRunTimeSelectionTable.H"
30 #include "zeroGradientFvPatchFields.H"
32 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
36 defineTypeNameAndDebug(PronyViscoelastic, 0);
37 addToRunTimeSelectionTable(rheologyLaw, PronyViscoelastic, dictionary);
41 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
44 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
46 // Construct from dictionary
47 Foam::PronyViscoelastic::PronyViscoelastic
50 const volSymmTensorField& sigma,
51 const dictionary& dict
54 rheologyLaw(name, sigma, dict),
55 rho_(dict.lookup("rho")),
56 k_("k", dict, readInt(dict.lookup("size"))),
57 kDimensions_(dict.lookup("kDimensions")),
58 tau_("tau", dict, readInt(dict.lookup("size"))),
59 tauDimensions_(dict.lookup("tauDimensions")),
60 nu_(dict.lookup("nu"))
64 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
66 Foam::PronyViscoelastic::~PronyViscoelastic()
70 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
72 Foam::tmp<Foam::volScalarField> Foam::PronyViscoelastic::rho(scalar t) const
74 tmp<volScalarField> tresult
81 mesh().time().timeName(),
88 zeroGradientFvPatchScalarField::typeName
92 tresult().correctBoundaryConditions();
97 Foam::tmp<Foam::volScalarField> Foam::PronyViscoelastic::E(scalar t) const
103 for(int i=1; i<k_.size(); i++)
105 E += k_[i]*exp(-t/tau_[i]);
113 tmp<volScalarField> tresult
120 mesh().time().timeName(),
126 dimensionedScalar("E", kDimensions_, E),
127 zeroGradientFvPatchScalarField::typeName
131 tresult().correctBoundaryConditions();
136 Foam::tmp<Foam::volScalarField> Foam::PronyViscoelastic::nu(scalar t) const
138 tmp<volScalarField> tresult
145 mesh().time().timeName(),
152 zeroGradientFvPatchScalarField::typeName
156 tresult().correctBoundaryConditions();
161 Foam::tmp<Foam::volScalarField> Foam::PronyViscoelastic::J(scalar t) const
163 notImplemented(type() + "::J(scalar t)");
169 // ************************************************************************* //