HerschelBulkley.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) 2018-2022 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 "HerschelBulkley.H"
28 
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33 namespace laminarModels
34 {
35 namespace generalisedNewtonianViscosityModels
36 {
38 
40  (
44  );
45 }
46 }
47 }
48 
49 
50 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
51 
54 (
55  const dictionary& viscosityProperties,
57  const volVectorField& U
58 )
59 :
60  strainRateViscosityModel(viscosityProperties, viscosity, U),
61  k_("k", dimViscosity, 0),
62  n_("n", dimless, 0),
63  tau0_("tau0", dimViscosity/dimTime, 0)
64 {
65  read(viscosityProperties);
66  correct();
67 }
68 
69 
70 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
71 
74 (
75  const dictionary& viscosityProperties
76 )
77 {
78  strainRateViscosityModel::read(viscosityProperties);
79 
80  const dictionary& coeffs =
81  viscosityProperties.optionalSubDict(typeName + "Coeffs");
82 
83  k_.read(coeffs);
84  n_.read(coeffs);
85  tau0_.read(coeffs);
86 
87  return true;
88 }
89 
90 
93 nu
94 (
95  const volScalarField& nu0,
96  const volScalarField& strainRate
97 ) const
98 {
99  dimensionedScalar tone("tone", dimTime, 1.0);
100  dimensionedScalar rtone("rtone", dimless/dimTime, 1.0);
101 
102  return
103  (
104  min
105  (
106  nu0,
107  (tau0_ + k_*rtone*pow(tone*strainRate, n_))
108  /max
109  (
110  strainRate,
111  dimensionedScalar ("vSmall", dimless/dimTime, vSmall)
112  )
113  )
114  );
115 }
116 
117 
118 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Generic GeometricField class.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
bool read(Istream &, const bool keepHeader=false)
Read dictionary from Istream, optionally keeping the header.
Definition: dictionaryIO.C:108
const dictionary & optionalSubDict(const word &) const
Find and return a sub-dictionary if found.
Definition: dictionary.C:1076
An abstract base class for generalised Newtonian viscosity models.
virtual bool read(const dictionary &viscosityProperties)=0
Read transportProperties dictionary.
Herschel-Bulkley generalised Newtonian viscosity model.
virtual bool read(const dictionary &viscosityProperties)
Read transportProperties dictionary.
HerschelBulkley(const dictionary &viscosityProperties, const Foam::viscosity &viscosity, const volVectorField &U)
Construct from components.
An abstract base class for strain-rate dependent generalised Newtonian viscosity models.
virtual tmp< volScalarField > nu() const
Return the laminar viscosity.
A class for managing temporary objects.
Definition: tmp.H:55
Abstract base class for all fluid physical properties.
Definition: viscosity.H:50
U
Definition: pEqn.H:72
addToRunTimeSelectionTable(generalisedNewtonianViscosityModel, Newtonian, dictionary)
Namespace for OpenFOAM.
const dimensionSet dimViscosity
const dimensionSet dimless
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
const dimensionSet dimTime
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)