thixotropicViscosity.C
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) 2013-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 \*---------------------------------------------------------------------------*/
25 
26 #include "thixotropicViscosity.H"
27 #include "kinematicSingleLayer.H"
29 
30 #include "fvmDdt.H"
31 #include "fvmDiv.H"
32 #include "fvcDiv.H"
33 #include "fvmSup.H"
34 
35 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
36 
37 namespace Foam
38 {
39 namespace regionModels
40 {
41 namespace surfaceFilmModels
42 {
43 
44 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
45 
46 defineTypeNameAndDebug(thixotropicViscosity, 0);
47 
49 (
50  filmViscosityModel,
51  thixotropicViscosity,
52  dictionary
53 );
54 
55 
56 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
57 
59 (
61  const dictionary& dict,
62  volScalarField& mu
63 )
64 :
65  filmViscosityModel(typeName, film, dict, mu),
66  a_("a", dimless/dimTime, coeffDict_),
67  b_("b", dimless, coeffDict_),
68  d_("d", dimless, coeffDict_),
69  c_("c", pow(dimTime, d_.value() - scalar(1)), coeffDict_),
70  mu0_("mu0", dimPressure*dimTime, coeffDict_),
71  muInf_("muInf", mu0_.dimensions(), coeffDict_),
72  BinghamPlastic_(coeffDict_.found("tauy")),
73  tauy_
74  (
75  BinghamPlastic_
76  ? dimensionedScalar("tauy", dimPressure, coeffDict_)
77  : dimensionedScalar("tauy", dimPressure, 0)
78  ),
79  K_(1 - sqrt(muInf_/mu0_)),
80  lambda_
81  (
82  IOobject
83  (
84  IOobject::modelName("lambda", typeName),
85  film.regionMesh().time().timeName(),
86  film.regionMesh(),
87  IOobject::MUST_READ,
88  IOobject::AUTO_WRITE
89  ),
90  film.regionMesh()
91  )
92 {
93  lambda_.min(1);
94  lambda_.max(0);
95 
96  // Initialise viscosity to inf value because it cannot be evaluated yet
97  mu_ = muInf_;
98  mu_.correctBoundaryConditions();
99 }
100 
101 
102 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
103 
105 {}
106 
107 
108 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
109 
111 (
112  const volScalarField& p,
113  const volScalarField& T
114 )
115 {
116  const kinematicSingleLayer& film = filmType<kinematicSingleLayer>();
117 
118  const volVectorField::Internal& Us = film.Us();
119  const volVectorField::Internal& Uw = film.Uw();
120  const volScalarField::Internal& delta = film.delta();
121  const volScalarField::Internal alphaRho(film.alpha()()*film.rho()());
122  const volScalarField::Internal& coverage = film.coverage();
123  const surfaceScalarField& phiU = film.phiU();
124 
125  // Shear rate
126  const volScalarField::Internal gDot
127  (
128  "gDot",
129  coverage*mag(Us - Uw)/(delta + film.deltaSmall())
130  );
131 
132  const dimensionedScalar alphaRho0
133  (
134  "alphaRho0",
135  alphaRho.dimensions(),
136  rootVSmall
137  );
138 
139  fvScalarMatrix lambdaEqn
140  (
142  + fvm::div(phiU, lambda_)
143  - fvm::Sp(fvc::div(phiU), lambda_)
144  ==
145  a_*pow((1 - lambda_), b_)
146  - fvm::Sp(c_*pow(gDot, d_), lambda_)
147 
148  // Include the effect of the impinging droplets added with lambda = 0
149  - fvm::Sp
150  (
151  max
152  (
153  -film.rhoSp(),
154  dimensionedScalar(film.rhoSp().dimensions(), 0)
155  )/(alphaRho + alphaRho0),
156  lambda_
157  )
158  );
159 
160  lambdaEqn.relax();
161  lambdaEqn.solve();
162 
163  lambda_.min(1);
164  lambda_.max(0);
165 
166  mu_ = muInf_/(sqr(1 - K_*lambda_) + rootVSmall);
167 
168  // Add optional yield stress contribution to the viscosity
169  if (BinghamPlastic_)
170  {
171  dimensionedScalar tauySmall("tauySmall", tauy_.dimensions(), small);
172  dimensionedScalar muMax_("muMax", 100*mu0_);
173 
174  mu_.ref() = min
175  (
176  tauy_/(gDot + 1.0e-4*(tauy_ + tauySmall)/mu0_) + mu_(),
177  muMax_
178  );
179  }
180 
182 }
183 
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 } // End namespace surfaceFilmModels
188 } // End namespace regionModels
189 } // End namespace Foam
190 
191 // ************************************************************************* //
scalar delta
const volVectorField::Internal & Uw() const
Return the film wall velocity [m/s].
Kinematic form of single-cell layer surface film model.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
thixotropicViscosity(surfaceFilmRegionModel &film, const dictionary &dict, volScalarField &mu)
Construct from surface film model.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
dimensionedScalar sqrt(const dimensionedScalar &ds)
tmp< fvMatrix< Type > > Sp(const volScalarField::Internal &, const GeometricField< Type, fvPatchField, volMesh > &)
dimensionedScalar mu0_
Limiting viscosity when lambda = 1.
volScalarField::Internal & rhoSp()
Mass [kg/m^2/s].
addToRunTimeSelectionTable(surfaceFilmRegionModel, kinematicSingleLayer, mesh)
Macros for easy insertion into run-time selection tables.
const dimensionSet & dimensions() const
Return dimensions.
Base class for surface film viscosity models.
const surfaceScalarField & phiU() const
Return the film velocity flux [m^3/s].
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
Definition: fvmDdt.C:46
Calculate the matrix for the first temporal derivative.
const dimensionedScalar & deltaSmall() const
Return small delta.
const volScalarField & coverage() const
Return the film coverage, 1 = covered, 0 = uncovered [].
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
Definition: fvPatchField.H:72
word timeName
Definition: getTimeIndex.H:3
void min(const dimensioned< Type > &)
virtual void correct(const volScalarField &p, const volScalarField &T)
Correct.
const dimensionSet dimPressure
dimensionedScalar muInf_
Limiting viscosity when lambda = 0.
Calculate the divergence of the given field.
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvmDiv.C:46
void relax(const scalar alpha)
Relax matrix (for steady-state solution).
Definition: fvMatrix.C:521
volScalarField & mu_
Reference to the viscosity field.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
const volScalarField & delta() const
Return const access to the film thickness [m].
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
Internal & ref()
Return a reference to the dimensioned internal field.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Calculate the matrix for the divergence of the given field and flux.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:47
const volVectorField::Internal & Us() const
Return the film surface velocity [m/s].
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
void max(const dimensioned< Type > &)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
const dimensionSet & dimensions() const
Return const reference to dimensions.
void correctBoundaryConditions()
Correct boundary field.
dimensionedScalar c_
Model `c&#39; coefficient (read after d since dims depend on d value)
dimensioned< scalar > mag(const dimensioned< Type > &)
const doubleScalar e
Elementary charge.
Definition: doubleScalar.H:105
const volScalarField & rho() const
Return the film density [kg/m^3].
volScalarField & p
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:92
defineTypeNameAndDebug(kinematicSingleLayer, 0)
Calculate the matrix for implicit and explicit sources.
const volScalarField & alpha() const
Return const access to the film volume fraction [].
Namespace for OpenFOAM.