BinghamPlastic.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) 2014-2018 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 "BinghamPlastic.H"
28 #include "fvcGrad.H"
29 
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34 namespace mixtureViscosityModels
35 {
36  defineTypeNameAndDebug(BinghamPlastic, 0);
37 
39  (
40  mixtureViscosityModel,
41  BinghamPlastic,
42  dictionary
43  );
44 }
45 }
46 
47 
48 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
49 
51 (
52  const word& name,
53  const dictionary& viscosityProperties,
54  const volVectorField& U,
55  const surfaceScalarField& phi
56 )
57 :
58  plastic(name, viscosityProperties, U, phi, typeName),
59  yieldStressCoeff_
60  (
61  "BinghamCoeff",
62  dimensionSet(1, -1, -2, 0, 0),
63  plasticCoeffs_
64  ),
65  yieldStressExponent_
66  (
67  "BinghamExponent",
68  dimless,
69  plasticCoeffs_
70  ),
71  yieldStressOffset_
72  (
73  "BinghamOffset",
74  dimless,
75  plasticCoeffs_
76  ),
77  U_(U)
78 {}
79 
80 
81 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
82 
85 (
86  const volScalarField& muc
87 ) const
88 {
89  volScalarField tauy
90  (
91  yieldStressCoeff_
92  *(
93  pow
94  (
95  scalar(10),
96  yieldStressExponent_
97  *(max(alpha_, scalar(0)) + yieldStressOffset_)
98  )
99  - pow
100  (
101  scalar(10),
102  yieldStressExponent_*yieldStressOffset_
103  )
104  )
105  );
106 
107  volScalarField mup(plastic::mu(muc));
108 
109  dimensionedScalar tauySmall("tauySmall", tauy.dimensions(), small);
110 
111  return min
112  (
113  tauy
114  /(
115  sqrt(2.0)*mag(symm(fvc::grad(U_)))
116  + 1.0e-4*(tauy + tauySmall)/mup
117  )
118  + mup,
119  muMax_
120  );
121 }
122 
123 
125 (
126  const dictionary& viscosityProperties
127 )
128 {
129  plastic::read(viscosityProperties);
130 
131  plasticCoeffs_.lookup("yieldStressCoeff") >> yieldStressCoeff_;
132  plasticCoeffs_.lookup("yieldStressExponent") >> yieldStressExponent_;
133  plasticCoeffs_.lookup("yieldStressOffset") >> yieldStressOffset_;
134 
135  return true;
136 }
137 
138 
139 // ************************************************************************* //
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcGrad.C:52
surfaceScalarField & phi
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
dimensionedScalar sqrt(const dimensionedScalar &ds)
void read(Istream &, label &, const dictionary &)
In-place read with dictionary lookup.
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
Macros for easy insertion into run-time selection tables.
dictionary()
Construct top-level dictionary null.
Definition: dictionary.C:238
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
Calculate the gradient of the given field.
tmp< volScalarField > mu(const volScalarField &muc) const
Return the mixture viscosity.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
BinghamPlastic(const word &name, const dictionary &viscosityProperties, const volVectorField &U, const surfaceScalarField &phi)
Construct from components.
defineTypeNameAndDebug(combustionModel, 0)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
const dimensionedScalar mu
Atomic mass unit.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
U
Definition: pEqn.H:72
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:47
dimensionedSymmTensor symm(const dimensionedSymmTensor &dt)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
dimensioned< scalar > mag(const dimensioned< Type > &)
const doubleScalar e
Elementary charge.
Definition: doubleScalar.H:98
A class for managing temporary objects.
Definition: PtrList.H:53
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
bool read(const dictionary &viscosityProperties)
Read transportProperties dictionary.
Namespace for OpenFOAM.