plastic.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-2023 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 "plastic.H"
29 
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34 namespace mixtureViscosityModels
35 {
37 
39  (
41  plastic,
43  );
44 }
45 }
46 
47 
48 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
49 
51 (
53 )
54 :
56  plasticCoeffs_(optionalSubDict(typeName + "Coeffs")),
57  plasticViscosityCoeff_
58  (
59  "coeff",
61  plasticCoeffs_.lookup("coeff")
62  ),
63  plasticViscosityExponent_
64  (
65  "exponent",
66  dimless,
67  plasticCoeffs_.lookup("exponent")
68  ),
69  muMax_("muMax", dimDynamicViscosity, plasticCoeffs_.lookup("muMax"))
70 {}
71 
72 
73 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
74 
77 (
78  const volScalarField& muc,
79  const volVectorField& U
80 ) const
81 {
82  return min
83  (
84  muc
85  + plasticViscosityCoeff_
86  *(
87  pow
88  (
89  scalar(10),
90  plasticViscosityExponent_*mixture_.alphad()
91  ) - scalar(1)
92  ),
93  muMax_
94  );
95 }
96 
97 
99 {
101  {
102  plasticCoeffs_ = optionalSubDict(typeName + "Coeffs");
103 
104  plasticCoeffs_.lookup("k") >> plasticViscosityCoeff_;
105  plasticCoeffs_.lookup("n") >> plasticViscosityExponent_;
106  plasticCoeffs_.lookup("muMax") >> muMax_;
107 
108  return true;
109  }
110  else
111  {
112  return false;
113  }
114 }
115 
116 
117 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Generic GeometricField class.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Class to represent a mixture of two constant density phases.
An abstract base class for incompressible mixtureViscosityModels.
Viscosity correction model for a generic power-law plastic.
Definition: plastic.H:58
virtual tmp< volScalarField > mu(const volScalarField &muc, const volVectorField &U) const
Return the mixture viscosity.
Definition: plastic.C:77
plastic(const incompressibleDriftFluxMixture &mixture)
Construct from mixture.
Definition: plastic.C:51
virtual bool read()
Read phaseProperties dictionary.
Definition: plastic.C:98
A class for managing temporary objects.
Definition: tmp.H:55
virtual bool read()=0
Read physicalProperties dictionary.
U
Definition: pEqn.H:72
defineTypeNameAndDebug(BinghamPlastic, 0)
addToRunTimeSelectionTable(mixtureViscosityModel, BinghamPlastic, dictionary)
Namespace for OpenFOAM.
const dimensionSet dimDynamicViscosity
const dimensionSet dimless
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)