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