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