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 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::laminarModels::Maxwell
29 
30 Group
31  grpLaminar
32 
33 Description
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 
53 SourceFiles
54  Maxwell.C
55 
56 \*---------------------------------------------------------------------------*/
57 
58 #ifndef Maxwell_H
59 #define Maxwell_H
60 
61 #include "laminarModel.H"
62 
63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 
65 namespace Foam
66 {
67 namespace laminarModels
68 {
69 
70 /*---------------------------------------------------------------------------*\
71  Class Maxwell Declaration
72 \*---------------------------------------------------------------------------*/
73 
74 template<class BasicTurbulenceModel>
75 class Maxwell
76 :
77  public laminarModel<BasicTurbulenceModel>
78 {
79 
80 protected:
81 
82  // Protected Data
83 
84  // Model coefficients
85 
88 
89 
90  // Fields
91 
93 
94 
95  // Protected Member Functions
96 
97  //- Return the turbulence viscosity
98  tmp<volScalarField> nu0() const
99  {
100  return this->nu() + nuM_;
101  }
102 
103 
104 public:
105 
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 // ************************************************************************* //
Foam::laminarModels::Maxwell::Maxwell
Maxwell(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transport, const word &propertiesName=turbulenceModel::propertiesName, const word &type=typeName)
Construct from components.
Definition: Maxwell.C:44
Foam::laminarModel::alphaField
BasicTurbulenceModel::alphaField alphaField
Definition: laminarModel.H:85
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::laminarModels::Maxwell
Maxwell model for viscoelasticity using the upper-convected time derivative of the stress tensor....
Definition: Maxwell.H:74
Foam::laminarModels::Maxwell::devRhoReff
virtual tmp< volSymmTensorField > devRhoReff() const
Return the effective stress tensor.
Definition: Maxwell.C:118
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::laminarModels::Maxwell::correct
virtual void correct()
Definition: Maxwell.C:190
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:212
Foam::laminarModels::Maxwell::TypeName
TypeName("Maxwell")
Runtime type information.
Foam::laminarModels::Maxwell::divDevRhoReff
virtual tmp< fvVectorMatrix > divDevRhoReff(volVectorField &U) const
Return the source term for the momentum equation.
Definition: Maxwell.C:151
Foam::turbulenceModel::propertiesName
static const word propertiesName
Default name of the turbulence properties dictionary.
Definition: turbulenceModel.H:100
Foam::laminarModels::Maxwell::~Maxwell
virtual ~Maxwell()=default
Destructor.
Foam::laminarModels::Maxwell::nu0
tmp< volScalarField > nu0() const
Return the turbulence viscosity.
Definition: Maxwell.H:97
Foam::laminarModels::Maxwell::nuM_
dimensionedScalar nuM_
Definition: Maxwell.H:85
rho
rho
Definition: readInitialConditions.H:88
Foam::laminarModel
Templated abstract base class for laminar transport models.
Definition: laminarModel.H:52
Foam::laminarModels::Maxwell::sigma_
volSymmTensorField sigma_
Definition: Maxwell.H:91
nu
volScalarField & nu
Definition: readMechanicalProperties.H:176
Foam::laminarModels::Maxwell::lambda_
dimensionedScalar lambda_
Definition: Maxwell.H:86
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::dimensioned< scalar >
Foam::laminarModels::Maxwell::transportModel
BasicTurbulenceModel::transportModel transportModel
Definition: Maxwell.H:107
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::laminarModel::transportModel
BasicTurbulenceModel::transportModel transportModel
Definition: laminarModel.H:87
Foam::laminarModels::Maxwell::read
virtual bool read()
Read model coefficients if they have changed.
Definition: Maxwell.C:94
U
U
Definition: pEqn.H:72
laminarModel.H
Maxwell.C
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:590
Foam::laminarModels::Maxwell::R
virtual tmp< volSymmTensorField > R() const
Return the Reynolds stress tensor.
Definition: Maxwell.C:110
Foam::laminarModels::Maxwell::rhoField
BasicTurbulenceModel::rhoField rhoField
Definition: Maxwell.H:106
Foam::laminarModels::Maxwell::alphaField
BasicTurbulenceModel::alphaField alphaField
Definition: Maxwell.H:105
Foam::GeometricField< symmTensor, fvPatchField, volMesh >
Foam::laminarModel::rhoField
BasicTurbulenceModel::rhoField rhoField
Definition: laminarModel.H:86