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 {
37  defineTypeNameAndDebug(HerschelBulkley, 0);
38 
40  (
41  generalisedNewtonianViscosityModel,
42  HerschelBulkley,
43  dictionary
44  );
45 }
46 }
47 }
48 
49 
50 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
51 
54 (
55  const dictionary& viscosityProperties,
56  const Foam::viscosity& viscosity,
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 // ************************************************************************* //
const dimensionSet dimViscosity
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
Info<< "Predicted p max-min : "<< max(p).value()<< " "<< min(p).value()<< endl;rho==max(rho0+psi *p, rhoMin);# 1 "/home/ubuntu/OpenFOAM-10/applications/solvers/multiphase/cavitatingFoam/alphavPsi.H" 1{ alphav=max(min((rho - rholSat)/(rhovSat - rholSat), scalar(1)), scalar(0));alphal=1.0 - alphav;Info<< "max-min alphav: "<< max(alphav).value()<< " "<< min(alphav).value()<< endl;psiModel-> correct()
Definition: pEqn.H:68
HerschelBulkley(const dictionary &viscosityProperties, const Foam::viscosity &viscosity, const volVectorField &U)
Construct from components.
addToRunTimeSelectionTable(generalisedNewtonianViscosityModel, Newtonian, dictionary)
const dimensionSet dimless
virtual bool read(const dictionary &viscosityProperties)
Read transportProperties dictionary.
bool read(Istream &, const bool keepHeader=false)
Read dictionary from Istream, optionally keeping the header.
Definition: dictionaryIO.C:104
Macros for easy insertion into run-time selection tables.
const dimensionSet dimTime
bool read(const char *, int32_t &)
Definition: int32IO.C:85
const dictionary & optionalSubDict(const word &) const
Find and return a sub-dictionary if found.
Definition: dictionary.C:1060
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
An abstract base class for strain-rate dependent generalised Newtonian viscosity models.
Abstract base class for all fluid physical properties.
Definition: viscosity.H:49
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
A class for managing temporary objects.
Definition: PtrList.H:53
virtual tmp< volScalarField > nu() const
Return the laminar viscosity.
Namespace for OpenFOAM.
virtual bool read(const dictionary &viscosityProperties)=0
Read transportProperties dictionary.