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) 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 \*---------------------------------------------------------------------------*/
25 
26 #include "HerschelBulkley.H"
28 #include "fvcGrad.H"
30 
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35 namespace mixtureViscosityModels
36 {
38 
40  (
44  );
45 }
46 }
47 
48 
49 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
50 
52 (
54 )
55 :
57  n_("n", dimless, coeffDict()),
58  k_("k", dimDynamicViscosity*pow(dimTime, n_ - 1), coeffDict()),
59  tau0_("tau0", dimDynamicViscosity/dimTime, coeffDict())
60 {}
61 
62 
63 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
64 
67 (
68  const volScalarField& muc,
69  const volVectorField& U
70 ) const
71 {
72  const volScalarField strainRate(sqrt(2.0)*mag(symm(fvc::grad(U))));
73 
74  return min
75  (
76  muc,
77  (tau0_ + k_*pow(strainRate, n_))
78  /max(strainRate, dimensionedScalar(dimless/dimTime, rootVSmall))
79  );
80 }
81 
82 
84 {
86  {
87  const dictionary& dict = coeffDict();
88 
89  n_.read(dict);
90  k_.read(dict);
91  tau0_.read(dict);
92 
93  return true;
94  }
95  else
96  {
97  return false;
98  }
99 }
100 
101 
102 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Generic GeometricField class.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Class to represent a mixture of two constant density phases.
An abstract base class for incompressible mixtureViscosityModels.
HerschelBulkley viscosity model.
virtual tmp< volScalarField > mu(const volScalarField &muc, const volVectorField &U) const
Return the mixture viscosity.
HerschelBulkley(const incompressibleDriftFluxMixture &mixture)
Construct from mixture.
virtual bool read()
Read phaseProperties dictionary.
A class for managing temporary objects.
Definition: tmp.H:55
virtual bool read()=0
Read physicalProperties dictionary.
Calculate the gradient of the given field.
U
Definition: pEqn.H:72
tmp< VolField< typename outerProduct< vector, Type >::type > > grad(const SurfaceField< Type > &ssf)
Definition: fvcGrad.C:46
defineTypeNameAndDebug(BinghamPlastic, 0)
addToRunTimeSelectionTable(mixtureViscosityModel, BinghamPlastic, dictionary)
Namespace for OpenFOAM.
const dimensionSet dimDynamicViscosity
const dimensionSet dimless
void mag(LagrangianPatchField< scalar > &f, const LagrangianPatchField< Type > &f1)
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
const dimensionSet dimTime
void symm(LagrangianPatchField< tensor > &f, const LagrangianPatchField< tensor > &f1)
void pow(LagrangianPatchField< typename powProduct< Type, r >::type > &f, const LagrangianPatchField< Type > &f1)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
void sqrt(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
dictionary dict