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 | Copyright (C) 2016 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 Group
28  grpLaminar
29 
30 Description
31  Maxwell model for viscoelasticity using the upper-convected time
32  derivative of the stress tensor.
33  See http://en.wikipedia.org/wiki/Upper-convected_Maxwell_model
34 
35  The model includes an additional viscosity (nu) from the transport
36  model from which it is instantiated, which makes it equivalent to
37  the Oldroyd-B model for the case of an incompressible transport
38  model (where nu is non-zero).
39  See https://en.wikipedia.org/wiki/Oldroyd-B_model
40 
41  Reference:
42  \verbatim
43  Amoreira, L. J., & Oliveira, P. J. (2010).
44  Comparison of different formulations for the numerical calculation
45  of unsteady incompressible viscoelastic fluid flow.
46  Adv. Appl. Math. Mech, 4, 483-502.
47  \endverbatim
48 
49 SourceFiles
50  Maxwell.C
51 
52 \*---------------------------------------------------------------------------*/
53 
54 #ifndef Maxwell_H
55 #define Maxwell_H
56 
57 #include "laminarModel.H"
58 
59 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 
61 namespace Foam
62 {
63 namespace laminarModels
64 {
65 
66 /*---------------------------------------------------------------------------*\
67  Class Maxwell Declaration
68 \*---------------------------------------------------------------------------*/
69 
70 template<class BasicTurbulenceModel>
71 class Maxwell
72 :
73  public laminarModel<BasicTurbulenceModel>
74 {
75 
76 protected:
77 
78  // Protected data
79 
80  // Model coefficients
81 
84 
85 
86  // Fields
87 
89 
90 
91  // Protected Member Functions
92 
93  //- Return the turbulence viscosity
94  tmp<volScalarField> nu0() const
95  {
96  return this->nu() + nuM_;
97  }
98 
99 
100 public:
102  typedef typename BasicTurbulenceModel::alphaField alphaField;
103  typedef typename BasicTurbulenceModel::rhoField rhoField;
104  typedef typename BasicTurbulenceModel::transportModel transportModel;
105 
106 
107  //- Runtime type information
108  TypeName("Maxwell");
109 
110 
111  // Constructors
112 
113  //- Construct from components
114  Maxwell
115  (
116  const alphaField& alpha,
117  const rhoField& rho,
118  const volVectorField& U,
119  const surfaceScalarField& alphaRhoPhi,
120  const surfaceScalarField& phi,
121  const transportModel& transport,
122  const word& propertiesName = turbulenceModel::propertiesName,
123  const word& type = typeName
124  );
125 
126 
127  //- Destructor
128  virtual ~Maxwell()
129  {}
130 
131 
132  // Member Functions
133 
134  //- Read model coefficients if they have changed
135  virtual bool read();
136 
137  //- Return the Reynolds stress tensor
138  virtual tmp<volSymmTensorField> R() const;
139 
140  //- Return the effective stress tensor
141  virtual tmp<volSymmTensorField> devRhoReff() const;
142 
143  //- Return the source term for the momentum equation
145 
146  //- Return the source term for the momentum equation
148  (
149  const volScalarField& rho,
150  volVectorField& U
151  ) const;
152 
153  //- Solve the turbulence equations and correct eddy-Viscosity and
154  // related properties
155  virtual void correct();
156 };
157 
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 } // End namespace laminarModels
162 } // End namespace Foam
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #ifdef NoRepository
167  #include "Maxwell.C"
168 #endif
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 #endif
173 
174 // ************************************************************************* //
surfaceScalarField & phi
virtual tmp< fvVectorMatrix > divDevRhoReff(volVectorField &U) const
Return the source term for the momentum equation.
Definition: Maxwell.C:155
Templated abstract base class for laminar transport models.
Definition: laminarModel.H:49
U
Definition: pEqn.H:83
Maxwell model for viscoelasticity using the upper-convected time derivative of the stress tensor...
Definition: Maxwell.H:70
BasicTurbulenceModel::rhoField rhoField
Definition: Maxwell.H:102
virtual ~Maxwell()
Destructor.
Definition: Maxwell.H:127
virtual tmp< volSymmTensorField > devRhoReff() const
Return the effective stress tensor.
Definition: Maxwell.C:130
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:40
BasicTurbulenceModel::alphaField alphaField
Definition: Maxwell.H:101
virtual tmp< volSymmTensorField > R() const
Return the Reynolds stress tensor.
Definition: Maxwell.C:123
volSymmTensorField sigma_
Definition: Maxwell.H:87
dimensionedScalar lambda_
Definition: Maxwell.H:82
virtual bool read()
Read model coefficients if they have changed.
Definition: Maxwell.C:106
fileName::Type type(const fileName &, const bool followLink=true)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:485
virtual void correct()
Solve the turbulence equations and correct eddy-Viscosity and.
Definition: Maxwell.C:194
BasicTurbulenceModel::transportModel transportModel
Definition: Maxwell.H:103
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:93
volScalarField & nu
dimensionedScalar nuM_
Definition: Maxwell.H:81
Namespace for OpenFOAM.