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-2021 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/Generalised_Maxwell_model
33 
34  The model includes an additional viscosity (nu) from the viscosity
35  model from which it is instantiated, which makes it equivalent to
36  the Oldroyd-B model for the case of an incompressible viscosity
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 non-Newtonian 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 
132 
133  //- Runtime type information
134  TypeName("Maxwell");
135 
136 
137  // Constructors
138 
139  //- Construct from components
140  Maxwell
141  (
142  const alphaField& alpha,
143  const rhoField& rho,
144  const volVectorField& U,
145  const surfaceScalarField& alphaRhoPhi,
146  const surfaceScalarField& phi,
147  const viscosity& viscosity,
148  const word& type = typeName
149  );
150 
151 
152  //- Destructor
153  virtual ~Maxwell()
154  {}
155 
156 
157  // Member Functions
158 
159  //- Read model coefficients if they have changed
160  virtual bool read();
161 
162  //- Return the effective viscosity, i.e. the laminar viscosity
163  virtual tmp<volScalarField> nuEff() const;
164 
165  //- Return the effective viscosity on patch
166  virtual tmp<scalarField> nuEff(const label patchi) const;
167 
168  //- Return the stress tensor [m^2/s^2]
169  virtual tmp<volSymmTensorField> sigma() const;
170 
171  //- Return the effective stress tensor
172  virtual tmp<volSymmTensorField> devTau() const;
173 
174  //- Return the source term for the momentum equation
176 
177  //- Return the source term for the momentum equation
179  (
180  const volScalarField& rho,
181  volVectorField& U
182  ) const;
183 
184  //- Solve the turbulence equations and correct eddy-Viscosity and
185  // related properties
186  virtual void correct();
187 };
188 
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 } // End namespace laminarModels
193 } // End namespace Foam
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 #ifdef NoRepository
198  #include "Maxwell.C"
199 #endif
200 
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 
203 #endif
204 
205 // ************************************************************************* //
Templated abstract base class for laminar transport models.
Definition: laminarModel.H:49
virtual tmp< volSymmTensorField > devTau() const
Return the effective stress tensor.
Definition: Maxwell.C:276
U
Definition: pEqn.H:72
Generalised Maxwell model for viscoelasticity using the upper-convected time derivative of the stress...
Definition: Maxwell.H:76
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
PtrList< dimensionedScalar > readModeCoefficients(const word &name, const dimensionSet &dims) const
Definition: Maxwell.C:43
virtual ~Maxwell()
Destructor.
Definition: Maxwell.H:152
virtual tmp< volScalarField > nuEff() const
Return the effective viscosity, i.e. the laminar viscosity.
Definition: Maxwell.C:248
BasicMomentumTransportModel::alphaField alphaField
Definition: Maxwell.H:128
Dimension set for the base types.
Definition: dimensionSet.H:121
BasicMomentumTransportModel::rhoField rhoField
Definition: Maxwell.H:129
Maxwell(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const viscosity &viscosity, const word &type=typeName)
Construct from components.
Definition: Maxwell.C:106
virtual tmp< fvSymmTensorMatrix > sigmaSource(const label modei, volSymmTensorField &sigma) const
Definition: Maxwell.C:93
A class for handling words, derived from string.
Definition: word.H:59
virtual tmp< fvVectorMatrix > divDevTau(volVectorField &U) const
Return the source term for the momentum equation.
Definition: Maxwell.C:290
phi
Definition: correctPhi.H:3
volSymmTensorField sigma_
Single or mode sum viscoelastic stress.
Definition: Maxwell.H:99
virtual tmp< volSymmTensorField > sigma() const
Return the stress tensor [m^2/s^2].
Definition: Maxwell.C:269
virtual bool read()
Read model coefficients if they have changed.
Definition: Maxwell.C:225
Abstract base class for all fluid physical properties.
Definition: viscosity.H:49
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:329
label patchi
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.
A class for managing temporary objects.
Definition: PtrList.H:53
tmp< volScalarField > nu0() const
Return the non-Newtonian viscosity.
Definition: Maxwell.H:114
dimensionedScalar nuM_
Definition: Maxwell.H:91
Namespace for OpenFOAM.
PtrList< dictionary > modeCoefficients_
Definition: Maxwell.H:87