All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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  min
97  (
98  log10(vGreat),
99  yieldStressExponent_
100  *(max(alpha_, scalar(0)) + yieldStressOffset_)
101  )
102  )
103  - pow
104  (
105  scalar(10),
106  yieldStressExponent_*yieldStressOffset_
107  )
108  )
109  );
110 
111  volScalarField mup(plastic::mu(muc));
112 
113  dimensionedScalar tauySmall("tauySmall", tauy.dimensions(), small);
114 
115  return min
116  (
117  tauy
118  /(
119  sqrt(2.0)*mag(symm(fvc::grad(U_)))
120  + 1.0e-4*(tauy + tauySmall)/mup
121  )
122  + mup,
123  muMax_
124  );
125 }
126 
127 
129 (
130  const dictionary& viscosityProperties
131 )
132 {
133  plastic::read(viscosityProperties);
134 
135  plasticCoeffs_.lookup("yieldStressCoeff") >> yieldStressCoeff_;
136  plasticCoeffs_.lookup("yieldStressExponent") >> yieldStressExponent_;
137  plasticCoeffs_.lookup("yieldStressOffset") >> yieldStressOffset_;
138 
139  return true;
140 }
141 
142 
143 // ************************************************************************* //
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcGrad.C:52
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:58
Macros for easy insertion into run-time selection tables.
phi
Definition: pEqn.H:104
dictionary()
Construct top-level dictionary null.
Definition: dictionary.C:464
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
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
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
const dimensionedScalar & mu
Atomic mass unit.
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:105
A class for managing temporary objects.
Definition: PtrList.H:53
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
dimensionedScalar log10(const dimensionedScalar &ds)
bool read(const dictionary &viscosityProperties)
Read transportProperties dictionary.
Namespace for OpenFOAM.