lambdaThixotropic.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) 2020-2026 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::lambdaThixotropic
26 
27 Description
28  Thixotropic viscosity momentum transport model based on the evolution of
29  the structural parameter \f$ \lambda \f$:
30 
31  \f[
32  \frac{D\lambda}{Dt} = a(1 - \lambda)^b - c \lambda \dot{\gamma}^d
33  \f]
34 
35  The viscosity is then calculated using the expression
36 
37  \f[
38  \nu = \frac{\nu_{\infty}}{{1 - K \lambda}^2}
39  \f]
40 
41  Where the parameter K is given by:
42 
43  \f[
44  K = 1 - \sqrt{\frac{\nu_{\infty}}{\nu_{0}}}
45  \f]
46 
47  Here:
48  \vartable
49  \lambda | structural parameter
50  a | model coefficient
51  b | model coefficient
52  c | model coefficient
53  d | model coefficient
54  \dot{\gamma} | stress rate [1/s]
55  \nu_{0} | limiting viscosity when \f$ \lambda = 1 \f$
56  \nu_{\infty} | limiting viscosity when \f$ \lambda = 0 \f$
57  \endvartable
58 
59  Reference:
60  \verbatim
61  Barnes H A, 1997. Thixotropy - a review. J. Non-Newtonian Fluid
62  Mech 70, pp 1-33
63  \endverbatim
64 
65 SourceFiles
66  lambdaThixotropic.C
67 
68 \*---------------------------------------------------------------------------*/
69 
70 #ifndef lambdaThixotropic_H
71 #define lambdaThixotropic_H
72 
73 #include "laminarModel.H"
74 #include "linearViscousStress.H"
75 
76 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
77 
78 namespace Foam
79 {
80 namespace laminarModels
81 {
82 
83 /*---------------------------------------------------------------------------*\
84  Class lambdaThixotropic Declaration
85 \*---------------------------------------------------------------------------*/
86 
87 template
88 <
89  class BasicMomentumTransportModel,
90  template<class> class ViscousStress = linearViscousStress
91 >
92 class lambdaThixotropic
93 :
94  public ViscousStress<laminarModel<BasicMomentumTransportModel>>
95 {
96  // Private data
97 
98  //- Model a coefficient
100 
101  //- Model b coefficient
103 
104  //- Model d coefficient
106 
107  //- Model c coefficient (read after d since dims depend on d value)
109 
110  //- Limiting viscosity when lambda = 1
111  dimensionedScalar nu0_;
112 
113  //- Limiting viscosity when lambda = 0
114  dimensionedScalar nuInf_;
115 
116  //- Model coefficient
118 
119  //- Switch for optional Bingham plastic handling
120  // Set by the presence of the sigmay entry
121  bool BinghamPlastic_;
122 
123  //- Optional Bingham plastic yield stress [m^2/s^2]
124  dimensionedScalar sigmay_;
125 
126  //- Residual alpha
127  // Used to stabilise the solution of the lambda equation
128  // where the phase-fraction is below this value
129  // Defaults to 1e-6
130  dimensionedScalar residualAlpha_;
131 
132  //- Structural parameter
133  // 0 = freestream value (most liquid)
134  // 1 = fully built (most solid)
135  volScalarField lambda_;
136 
137  //- The non-Newtonian viscosity field
138  volScalarField nu_;
139 
140 
141  // Private Member Functions
142 
143  //- Calculates and returns the viscosity from the current lambda
144  tmp<volScalarField> calcNu
145  (
146  const volScalarField& strainRate
147  ) const;
148 
149  //- Returns the current strain rate from the velocity field
150  tmp<volScalarField> strainRate() const;
151 
152 
153 public:
154 
155  typedef typename BasicMomentumTransportModel::alphaField alphaField;
156  typedef typename BasicMomentumTransportModel::rhoField rhoField;
157 
158 
159  //- Runtime type information
160  TypeName("lambdaThixotropic");
161 
162 
163  // Constructors
164 
165  //- Construct from components
167  (
168  const alphaField& alpha,
169  const rhoField& rho,
170  const volVectorField& U,
171  const surfaceScalarField& alphaRhoPhi,
172  const surfaceScalarField& phi,
173  const viscosity& viscosity,
174  const word& type = typeName
175  );
176 
177 
178  //- Destructor
179  virtual ~lambdaThixotropic()
180  {}
181 
182 
183  // Member Functions
184 
185  //- Read momentumTransport dictionary
186  virtual bool read();
187 
188  //- Return the effective viscosity
189  // i.e. the lambdaThixotropic viscosity
190  virtual tmp<volScalarField> nuEff() const;
191 
192  //- Return the effective viscosity on patch
193  virtual tmp<scalarField> nuEff(const label patchi) const;
194 
195  //- The lambdaThixotropic viscosity is not predicted
196  virtual void predict()
197  {}
198 
199  //- Correct the lambdaThixotropic viscosity
200  virtual void correct();
201 };
202 
203 
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205 
206 } // End namespace laminarModels
207 } // End namespace Foam
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 #ifdef NoRepository
212  #include "lambdaThixotropic.C"
213 #endif
214 
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 
217 #endif
218 
219 // ************************************************************************* //
Generic GeometricField class.
BasicMomentumTransportModel::alphaField alphaField
virtual void correct()
Correct the lambdaThixotropic viscosity.
virtual void predict()
The lambdaThixotropic viscosity is not predicted.
TypeName("lambdaThixotropic")
Runtime type information.
lambdaThixotropic(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.
virtual tmp< volScalarField > nuEff() const
Return the effective viscosity.
virtual bool read()
Read momentumTransport dictionary.
BasicMomentumTransportModel::rhoField rhoField
A class for managing temporary objects.
Definition: tmp.H:55
Template function which returns the un-mangled name of a given type. Useful for types which do not ha...
Abstract base class for all fluid physical properties.
Definition: viscosity.H:50
A class for handling words, derived from string.
Definition: word.H:63
label patchi
U
Definition: pEqn.H:72
rho
Definition: pEqn.H:1
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
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
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488