BinghamPlastic.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2014-2015 OpenFOAM Foundation
9  Copyright (C) 2021 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "BinghamPlastic.H"
31 #include "fvcGrad.H"
32 
33 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34 
35 namespace Foam
36 {
37 namespace mixtureViscosityModels
38 {
39  defineTypeNameAndDebug(BinghamPlastic, 0);
40 
42  (
43  mixtureViscosityModel,
44  BinghamPlastic,
45  dictionary
46  );
47 }
48 }
49 
50 
51 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
52 
54 (
55  const word& name,
56  const dictionary& viscosityProperties,
57  const volVectorField& U,
58  const surfaceScalarField& phi
59 )
60 :
61  plastic(name, viscosityProperties, U, phi, typeName),
62  yieldStressCoeff_
63  (
64  "BinghamCoeff",
65  dimensionSet(1, -1, -2, 0, 0),
66  plasticCoeffs_
67  ),
68  yieldStressExponent_
69  (
70  "BinghamExponent",
71  dimless,
72  plasticCoeffs_
73  ),
74  yieldStressOffset_
75  (
76  "BinghamOffset",
77  dimless,
78  plasticCoeffs_
79  ),
80  U_(U)
81 {}
82 
83 
84 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
85 
88 (
89  const volScalarField& muc
90 ) const
91 {
92  volScalarField tauy
93  (
94  yieldStressCoeff_
95  *(
96  pow
97  (
98  scalar(10),
99  yieldStressExponent_
100  *(max(alpha_, scalar(0)) + yieldStressOffset_)
101  )
102  - pow
103  (
104  scalar(10),
105  yieldStressExponent_*yieldStressOffset_
106  )
107  )
108  );
109 
110  volScalarField mup(plastic::mu(muc));
111 
112  dimensionedScalar tauySmall("tauySmall", tauy.dimensions(), SMALL);
113 
114  return min
115  (
116  tauy
117  /(
118  sqrt(2.0)*mag(symm(fvc::grad(U_)))
119  + 1.0e-4*(tauy + tauySmall)/mup
120  )
121  + mup,
122  muMax_
123  );
124 }
125 
126 
128 (
129  const dictionary& viscosityProperties
130 )
131 {
132  plastic::read(viscosityProperties);
133 
134  plasticCoeffs_.readEntry("BinghamCoeff", yieldStressCoeff_);
135  plasticCoeffs_.readEntry("BinghamExponent", yieldStressExponent_);
136  plasticCoeffs_.readEntry("BinghamOffset", yieldStressOffset_);
137 
138  return true;
139 }
140 
141 
142 // ************************************************************************* //
Foam::addToRunTimeSelectionTable
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
Foam::mixtureViscosityModels::BinghamPlastic::BinghamPlastic
BinghamPlastic(const word &name, const dictionary &viscosityProperties, const volVectorField &U, const surfaceScalarField &phi)
Foam::symm
dimensionedSymmTensor symm(const dimensionedSymmTensor &dt)
Definition: dimensionedSymmTensor.C:77
Foam::fvc::grad
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcGrad.C:47
Foam::constant::physicoChemical::mu
const dimensionedScalar mu
Definition: createFieldRefs.H:4
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:57
Foam::min
label min(const labelHashSet &set, label minValue=labelMax)
Definition: hashSets.C:26
Foam::mixtureViscosityModels::BinghamPlastic::read
bool read(const dictionary &viscosityProperties)
Foam::blockMeshTools::read
void read(Istream &, label &val, const dictionary &)
Definition: blockMeshTools.C:50
BinghamPlastic.H
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:36
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:53
Foam::pow
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Definition: dimensionedScalar.C:68
Foam::max
label max(const labelHashSet &set, label maxValue=labelMin)
Definition: hashSets.C:40
Foam::mixtureViscosityModels::BinghamPlastic::mu
tmp< volScalarField > mu(const volScalarField &muc) const
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam
Definition: atmBoundaryLayer.C:26
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:58
U
U
Definition: pEqn.H:72
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:50
Foam::sqrt
dimensionedScalar sqrt(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:137
fvcGrad.H
Calculate the gradient of the given field.
Foam::mag
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Foam::constant::electromagnetic::e
const dimensionedScalar e
Definition: createFields.H:11
Foam::name
word name(const expressions::valueTypeCode typeCode)
Definition: exprTraits.C:52
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
Foam::dimless
const dimensionSet dimless
Definition: dimensionSets.C:182