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-2020 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  Generalised Maxwell model for viscoelasticity using the upper-convected time
29  derivative of the stress tensor with support for multiple modes.
30 
31  See http://en.wikipedia.org/wiki/Upper-convected_Maxwell_model
32  http://en.wikipedia.org/wiki/Generalized_Maxwell_model
33 
34  The model includes an additional viscosity (nu) from the transport
35  model from which it is instantiated, which makes it equivalent to
36  the Oldroyd-B model for the case of an incompressible transport
37  model (where nu is non-zero).
38  See https://en.wikipedia.org/wiki/Oldroyd-B_model
39 
40  Reference:
41  \verbatim
42  Wiechert, E. (1889). Ueber elastische Nachwirkung.
43  (Doctoral dissertation, Hartungsche buchdr.).
44 
45  Wiechert, E. (1893).
46  Gesetze der elastischen Nachwirkung für constante Temperatur.
47  Annalen der Physik, 286(11), 546-570.
48 
49  Amoreira, L. J., & Oliveira, P. J. (2010).
50  Comparison of different formulations for the numerical calculation
51  of unsteady incompressible viscoelastic fluid flow.
52  Adv. Appl. Math. Mech, 4, 483-502.
53  \endverbatim
54 
55 SourceFiles
56  Maxwell.C
57 
58 \*---------------------------------------------------------------------------*/
59 
60 #ifndef Maxwell_H
61 #define Maxwell_H
62 
63 #include "laminarModel.H"
64 
65 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
66 
67 namespace Foam
68 {
69 namespace laminarModels
70 {
71 
72 /*---------------------------------------------------------------------------*\
73  Class Maxwell Declaration
74 \*---------------------------------------------------------------------------*/
75 
76 template<class BasicMomentumTransportModel>
77 class Maxwell
78 :
79  public laminarModel<BasicMomentumTransportModel>
80 {
81 
82 protected:
83 
84  // Protected data
85 
86  // Model coefficients
87 
89 
90  label nModes_;
91 
93 
95 
96 
97  // Fields
98 
99  //- Single or mode sum viscoelastic stress
101 
102  //- Mode viscoelastic stresses
104 
105 
106  // Protected Member Functions
107 
109  (
110  const word& name,
111  const dimensionSet& dims
112  ) const;
113 
114  //- Return the turbulence viscosity
115  tmp<volScalarField> nu0() const
116  {
117  return this->nu() + nuM_;
118  }
119 
121  (
122  const label modei,
124  ) const;
125 
126 
127 public:
129  typedef typename BasicMomentumTransportModel::alphaField alphaField;
130  typedef typename BasicMomentumTransportModel::rhoField rhoField;
131  typedef typename BasicMomentumTransportModel::transportModel transportModel;
132 
133 
134  //- Runtime type information
135  TypeName("Maxwell");
136 
137 
138  // Constructors
139 
140  //- Construct from components
141  Maxwell
142  (
143  const alphaField& alpha,
144  const rhoField& rho,
145  const volVectorField& U,
146  const surfaceScalarField& alphaRhoPhi,
147  const surfaceScalarField& phi,
148  const transportModel& transport,
149  const word& type = typeName
150  );
151 
152 
153  //- Destructor
154  virtual ~Maxwell()
155  {}
156 
157 
158  // Member Functions
159 
160  //- Read model coefficients if they have changed
161  virtual bool read();
162 
163  //- Return the stress tensor [m^2/s^2]
164  virtual tmp<volSymmTensorField> sigma() const;
165 
166  //- Return the effective stress tensor
167  virtual tmp<volSymmTensorField> devTau() const;
168 
169  //- Return the source term for the momentum equation
171 
172  //- Return the source term for the momentum equation
174  (
175  const volScalarField& rho,
176  volVectorField& U
177  ) const;
178 
179  //- Solve the turbulence equations and correct eddy-Viscosity and
180  // related properties
181  virtual void correct();
182 };
183 
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 } // End namespace laminarModels
188 } // End namespace Foam
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 #ifdef NoRepository
193  #include "Maxwell.C"
194 #endif
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 #endif
199 
200 // ************************************************************************* //
Templated abstract base class for laminar transport models.
Definition: laminarModel.H:49
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Maxwell(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transport, const word &type=typeName)
Construct from components.
Definition: Maxwell.C:105
PtrList< dimensionedScalar > readModeCoefficients(const word &name, const dimensionSet &dims) const
Definition: Maxwell.C:42
Generalised Maxwell model for viscoelasticity using the upper-convected time derivative of the stress...
Definition: Maxwell.H:76
virtual tmp< fvVectorMatrix > divDevTau(volVectorField &U) const
Return the source term for the momentum equation.
Definition: Maxwell.C:279
virtual tmp< volSymmTensorField > devTau() const
Return the effective stress tensor.
Definition: Maxwell.C:264
virtual ~Maxwell()
Destructor.
Definition: Maxwell.H:153
BasicMomentumTransportModel::alphaField alphaField
Definition: Maxwell.H:128
phi
Definition: pEqn.H:104
Dimension set for the base types.
Definition: dimensionSet.H:120
BasicMomentumTransportModel::rhoField rhoField
Definition: Maxwell.H:129
virtual tmp< fvSymmTensorMatrix > sigmaSource(const label modei, volSymmTensorField &sigma) const
Definition: Maxwell.C:92
A class for handling words, derived from string.
Definition: word.H:59
volSymmTensorField sigma_
Single or mode sum viscoelastic stress.
Definition: Maxwell.H:99
BasicMomentumTransportModel::transportModel transportModel
Definition: Maxwell.H:130
virtual bool read()
Read model coefficients if they have changed.
Definition: Maxwell.C:232
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
virtual void correct()
Solve the turbulence equations and correct eddy-Viscosity and.
Definition: Maxwell.C:318
virtual tmp< volSymmTensorField > sigma() const
Return the stress tensor [m^2/s^2].
Definition: Maxwell.C:256
U
Definition: pEqn.H:72
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:70
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
PtrList< volSymmTensorField > sigmas_
Mode viscoelastic stresses.
Definition: Maxwell.H:102
PtrList< dimensionedScalar > lambdas_
Definition: Maxwell.H:93
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:114
dimensionedScalar nuM_
Definition: Maxwell.H:91
Namespace for OpenFOAM.
PtrList< dictionary > modeCoefficients_
Definition: Maxwell.H:87