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-2018 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 
97 public:
98 
99  typedef typename BasicTurbulenceModel::alphaField alphaField;
100  typedef typename BasicTurbulenceModel::rhoField rhoField;
101  typedef typename BasicTurbulenceModel::transportModel transportModel;
102 
103 
104  //- Runtime type information
105  TypeName("Maxwell");
106 
107 
108  // Constructors
109 
110  //- Construct from components
111  Maxwell
112  (
113  const alphaField& alpha,
114  const rhoField& rho,
115  const volVectorField& U,
116  const surfaceScalarField& alphaRhoPhi,
117  const surfaceScalarField& phi,
118  const transportModel& transport,
119  const word& propertiesName = turbulenceModel::propertiesName,
120  const word& type = typeName
121  );
122 
123 
124  //- Destructor
125  virtual ~Maxwell()
126  {}
127 
128 
129  // Member Functions
130 
131  //- Read model coefficients if they have changed
132  virtual bool read();
133 
134  //- Return the Reynolds stress tensor
135  virtual tmp<volSymmTensorField> R() const;
136 
137  //- Return the effective stress tensor
138  virtual tmp<volSymmTensorField> devRhoReff() const;
139 
140  //- Return the source term for the momentum equation
142 
143  //- Return the source term for the momentum equation
145  (
146  const volScalarField& rho,
147  volVectorField& U
148  ) const;
149 
150  //- Solve the turbulence equations and correct eddy-Viscosity and
151  // related properties
152  virtual void correct();
153 };
154 
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 } // End namespace laminarModels
159 } // End namespace Foam
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #ifdef NoRepository
164  #include "Maxwell.C"
165 #endif
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #endif
170 
171 // ************************************************************************* //
virtual tmp< fvVectorMatrix > divDevRhoReff(volVectorField &U) const
Return the source term for the momentum equation.
Definition: Maxwell.C:156
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:99
virtual ~Maxwell()
Destructor.
Definition: Maxwell.H:124
virtual tmp< volSymmTensorField > devRhoReff() const
Return the effective stress tensor.
Definition: Maxwell.C:131
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:41
BasicTurbulenceModel::alphaField alphaField
Definition: Maxwell.H:98
virtual tmp< volSymmTensorField > R() const
Return the Reynolds stress tensor.
Definition: Maxwell.C:124
volSymmTensorField sigma_
Definition: Maxwell.H:84
dimensionedScalar lambda_
Definition: Maxwell.H:79
virtual bool read()
Read model coefficients if they have changed.
Definition: Maxwell.C:107
fileName::Type type(const fileName &, const bool followLink=true)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:481
virtual void correct()
Solve the turbulence equations and correct eddy-Viscosity and.
Definition: Maxwell.C:195
BasicTurbulenceModel::transportModel transportModel
Definition: Maxwell.H:100
U
Definition: pEqn.H:72
TypeName("Maxwell")
Runtime type information.
A class for managing temporary objects.
Definition: PtrList.H:53
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
tmp< volScalarField > nu0() const
Return the turbulence viscosity.
Definition: Maxwell.H:90
volScalarField & nu
dimensionedScalar nuM_
Definition: Maxwell.H:78
Namespace for OpenFOAM.