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-2024 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  // Private member functions
82 
83  //- Return the source term for the momentum equation
84  template<class RhoFieldType>
85  tmp<fvVectorMatrix> DivDevTau
86  (
87  const RhoFieldType& rho,
89  ) const;
90 
91 
92 protected:
93 
94  // Protected data
95 
96  // Model coefficients
97 
99 
100  label nModes_;
101 
103 
105 
106 
107  // Fields
108 
109  //- Single or mode sum viscoelastic stress
111 
112  //- Mode viscoelastic stresses
114 
115 
116  // Protected Member Functions
117 
119  (
120  const word& name,
121  const dimensionSet& dims
122  ) const;
123 
124  //- Return the non-Newtonian viscosity
125  tmp<volScalarField> nu0() const
126  {
127  return this->nu() + nuM_;
128  }
129 
131  (
132  const label modei,
134  ) const;
135 
136 
137 public:
138 
139  typedef typename BasicMomentumTransportModel::alphaField alphaField;
140  typedef typename BasicMomentumTransportModel::rhoField rhoField;
141 
142 
143  //- Runtime type information
144  TypeName("Maxwell");
145 
146 
147  // Constructors
148 
149  //- Construct from components
150  Maxwell
151  (
152  const alphaField& alpha,
153  const rhoField& rho,
154  const volVectorField& U,
155  const surfaceScalarField& alphaRhoPhi,
156  const surfaceScalarField& phi,
157  const viscosity& viscosity,
158  const word& type = typeName
159  );
160 
161 
162  //- Destructor
163  virtual ~Maxwell()
164  {}
165 
166 
167  // Member Functions
168 
169  //- Read model coefficients if they have changed
170  virtual bool read();
171 
172  //- Return the effective viscosity, i.e. the laminar viscosity
173  virtual tmp<volScalarField> nuEff() const;
174 
175  //- Return the effective viscosity on patch
176  virtual tmp<scalarField> nuEff(const label patchi) const;
177 
178  //- Return the effective surface stress
179  virtual tmp<surfaceVectorField> devTau() const;
180 
181  //- Return the source term for the momentum equation
183 
184  //- Return the source term for the momentum equation
186  (
187  const volScalarField& rho,
189  ) const;
190 
191  //- The Maxwell stress is not predicted
192  virtual void predict()
193  {}
194 
195  //- Correct the Maxwell stress
196  virtual void correct();
197 };
198 
199 
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 
202 } // End namespace laminarModels
203 } // End namespace Foam
204 
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 
207 #ifdef NoRepository
208  #include "Maxwell.C"
209 #endif
210 
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 
213 #endif
214 
215 // ************************************************************************* //
Generic GeometricField class.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: PtrList.H:75
Dimension set for the base types.
Definition: dimensionSet.H:125
Templated abstract base class for laminar transport models.
Definition: laminarModel.H:52
BasicMomentumTransportModel::alphaField alphaField
Definition: laminarModel.H:67
BasicMomentumTransportModel::rhoField rhoField
Definition: laminarModel.H:68
Generalised Maxwell model for viscoelasticity using the upper-convected time derivative of the stress...
Definition: Maxwell.H:79
BasicMomentumTransportModel::alphaField alphaField
Definition: Maxwell.H:138
volSymmTensorField sigma_
Single or mode sum viscoelastic stress.
Definition: Maxwell.H:109
virtual tmp< fvSymmTensorMatrix > sigmaSource(const label modei, volSymmTensorField &sigma) const
Definition: Maxwell.C:93
TypeName("Maxwell")
Runtime type information.
virtual void correct()
Correct the Maxwell stress.
Definition: Maxwell.C:333
PtrList< dimensionedScalar > lambdas_
Definition: Maxwell.H:103
virtual void predict()
The Maxwell stress is not predicted.
Definition: Maxwell.H:191
virtual tmp< volScalarField > nuEff() const
Return the effective viscosity, i.e. the laminar viscosity.
Definition: Maxwell.C:243
virtual tmp< fvVectorMatrix > divDevTau(volVectorField &U) const
Return the source term for the momentum equation.
Definition: Maxwell.C:312
virtual tmp< surfaceVectorField > devTau() const
Return the effective surface stress.
Definition: Maxwell.C:264
PtrList< dictionary > modeCoefficients_
Definition: Maxwell.H:97
PtrList< volSymmTensorField > sigmas_
Mode viscoelastic stresses.
Definition: Maxwell.H:112
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
PtrList< dimensionedScalar > readModeCoefficients(const word &name, const dimensionSet &dims) const
Definition: Maxwell.C:43
virtual ~Maxwell()
Destructor.
Definition: Maxwell.H:162
dimensionedScalar nuM_
Definition: Maxwell.H:101
tmp< volScalarField > nu0() const
Return the non-Newtonian viscosity.
Definition: Maxwell.H:124
virtual bool read()
Read model coefficients if they have changed.
Definition: Maxwell.C:220
BasicMomentumTransportModel::rhoField rhoField
Definition: Maxwell.H:139
A class for managing temporary objects.
Definition: tmp.H:55
Abstract base class for all fluid physical properties.
Definition: viscosity.H:50
A class for handling words, derived from string.
Definition: word.H:62
label patchi
U
Definition: pEqn.H:72
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m^2/K^4].
Namespace for OpenFOAM.
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
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488