Maxwell.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2016 OpenFOAM Foundation
9 Copyright (C) 2019 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::laminarModels::Maxwell
29
30Group
31 grpLaminar
32
33Description
34 Maxwell model for viscoelasticity using the upper-convected time
35 derivative of the stress tensor.
36 See http://en.wikipedia.org/wiki/Upper-convected_Maxwell_model
37
38 The model includes an additional viscosity (nu) from the transport
39 model from which it is instantiated, which makes it equivalent to
40 the Oldroyd-B model for the case of an incompressible transport
41 model (where nu is non-zero).
42 See https://en.wikipedia.org/wiki/Oldroyd-B_model
43
44 Reference:
45 \verbatim
46 Amoreira, L. J., & Oliveira, P. J. (2010).
47 Comparison of different formulations for the numerical calculation
48 of unsteady incompressible viscoelastic fluid flow.
49 Adv. Appl. Math. Mech, 4, 483-502.
50 DOI:10.4208/aamm.10-m1010
51 \endverbatim
52
53SourceFiles
54 Maxwell.C
55
56\*---------------------------------------------------------------------------*/
57
58#ifndef Maxwell_H
59#define Maxwell_H
60
61#include "laminarModel.H"
62
63// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64
65namespace Foam
66{
67namespace laminarModels
68{
69
70/*---------------------------------------------------------------------------*\
71 Class Maxwell Declaration
72\*---------------------------------------------------------------------------*/
73
74template<class BasicTurbulenceModel>
75class Maxwell
76:
77 public laminarModel<BasicTurbulenceModel>
78{
79
80protected:
81
82 // Protected Data
83
84 // Model coefficients
88
89
90 // Fields
93
94
95 // Protected Member Functions
96
97 //- Return the turbulence viscosity
99 {
100 return this->nu() + nuM_;
101 }
102
103
104public:
106 typedef typename BasicTurbulenceModel::alphaField alphaField;
107 typedef typename BasicTurbulenceModel::rhoField rhoField;
108 typedef typename BasicTurbulenceModel::transportModel transportModel;
109
110
111 //- Runtime type information
112 TypeName("Maxwell");
113
114
115 // Constructors
116
117 //- Construct from components
118 Maxwell
119 (
120 const alphaField& alpha,
121 const rhoField& rho,
122 const volVectorField& U,
123 const surfaceScalarField& alphaRhoPhi,
124 const surfaceScalarField& phi,
125 const transportModel& transport,
126 const word& propertiesName = turbulenceModel::propertiesName,
127 const word& type = typeName
128 );
129
130
131 //- Destructor
132 virtual ~Maxwell() = default;
133
134
135 // Member Functions
136
137 //- Read model coefficients if they have changed
138 virtual bool read();
139
140 //- Return the Reynolds stress tensor
141 virtual tmp<volSymmTensorField> R() const;
142
143 //- Return the effective stress tensor
144 virtual tmp<volSymmTensorField> devRhoReff() const;
145
146 //- Return the effective stress tensor based on a given velocity field
148 (
149 const volVectorField& U
150 ) const;
151
152 //- Return the source term for the momentum equation
154
155 //- Return the source term for the momentum equation
157 (
158 const volScalarField& rho,
160 ) const;
161
162 //- Solve the turbulence equations and correct eddy-Viscosity and
163 //- related properties
164 virtual void correct();
165};
166
167
168// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169
170} // End namespace laminarModels
171} // End namespace Foam
172
173// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174
175#ifdef NoRepository
176 #include "Maxwell.C"
177#endif
178
179// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180
181#endif
182
183// ************************************************************************* //
surfaceScalarField & phi
Templated abstract base class for laminar transport models.
Definition: laminarModel.H:55
Maxwell model for viscoelasticity using the upper-convected time derivative of the stress tensor....
Definition: Maxwell.H:77
volSymmTensorField sigma_
Definition: Maxwell.H:91
BasicTurbulenceModel::alphaField alphaField
Definition: Maxwell.H:105
BasicTurbulenceModel::rhoField rhoField
Definition: Maxwell.H:106
dimensionedScalar lambda_
Definition: Maxwell.H:86
TypeName("Maxwell")
Runtime type information.
virtual void correct()
Definition: Maxwell.C:190
virtual tmp< volSymmTensorField > R() const
Return the Reynolds stress tensor.
Definition: Maxwell.C:110
virtual tmp< volSymmTensorField > devRhoReff() const
Return the effective stress tensor.
Definition: Maxwell.C:118
virtual tmp< fvVectorMatrix > divDevRhoReff(volVectorField &U) const
Return the source term for the momentum equation.
Definition: Maxwell.C:151
BasicTurbulenceModel::transportModel transportModel
Definition: Maxwell.H:107
virtual ~Maxwell()=default
Destructor.
dimensionedScalar nuM_
Definition: Maxwell.H:85
tmp< volScalarField > nu0() const
Return the turbulence viscosity.
Definition: Maxwell.H:97
virtual bool read()
Read model coefficients if they have changed.
Definition: Maxwell.C:94
A class for managing temporary objects.
Definition: tmp.H:65
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from Foam::string.
Definition: word.H:68
U
Definition: pEqn.H:72
Namespace for OpenFOAM.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:598
volScalarField & nu
volScalarField & alpha
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73