JohnsonJacksonFrictionalStress.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 | Copyright (C) 2011-2015 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 "JohnsonJacksonFrictionalStress.H"
28 #include "mathematicalConstants.H"
29 
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34 namespace kineticTheoryModels
35 {
36 namespace frictionalStressModels
37 {
38  defineTypeNameAndDebug(JohnsonJackson, 0);
39 
41  (
42  frictionalStressModel,
43  JohnsonJackson,
44  dictionary
45  );
46 }
47 }
48 }
49 
50 
51 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
52 
55 (
56  const dictionary& dict
57 )
58 :
59  frictionalStressModel(dict),
60  coeffDict_(dict.subDict(typeName + "Coeffs")),
61  Fr_("Fr", dimensionSet(1, -1, -2, 0, 0), coeffDict_),
62  eta_("eta", dimless, coeffDict_),
63  p_("p", dimless, coeffDict_),
64  phi_("phi", dimless, coeffDict_),
65  alphaDeltaMin_("alphaDeltaMin", dimless, coeffDict_)
66 {
67  phi_ *= constant::mathematical::pi/180.0;
68 }
69 
70 
71 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
72 
75 {}
76 
77 
78 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
79 
83 (
84  const volScalarField& alpha1,
85  const dimensionedScalar& alphaMinFriction,
86  const dimensionedScalar& alphaMax
87 ) const
88 {
89 
90  return
91  Fr_*pow(max(alpha1 - alphaMinFriction, scalar(0)), eta_)
92  /pow(max(alphaMax - alpha1, alphaDeltaMin_), p_);
93 }
94 
95 
99 (
100  const volScalarField& alpha1,
101  const dimensionedScalar& alphaMinFriction,
102  const dimensionedScalar& alphaMax
103 ) const
104 {
105  return Fr_*
106  (
107  eta_*pow(max(alpha1 - alphaMinFriction, scalar(0)), eta_ - 1.0)
108  *(alphaMax-alpha1)
109  + p_*pow(max(alpha1 - alphaMinFriction, scalar(0)), eta_)
110  )/pow(max(alphaMax - alpha1, alphaDeltaMin_), p_ + 1.0);
111 }
112 
113 
116 (
117  const volScalarField& alpha1,
118  const dimensionedScalar& alphaMinFriction,
119  const dimensionedScalar& alphaMax,
120  const volScalarField& pf,
121  const volSymmTensorField& D
122 ) const
123 {
124  return dimensionedScalar("0.5", dimTime, 0.5)*pf*sin(phi_);
125 }
126 
127 
129 {
130  coeffDict_ <<= dict_.subDict(typeName + "Coeffs");
131 
132  Fr_.read(coeffDict_);
133  eta_.read(coeffDict_);
134  p_.read(coeffDict_);
135 
136  phi_.read(coeffDict_);
137  phi_ *= constant::mathematical::pi/180.0;
138 
139  alphaDeltaMin_.read(coeffDict_);
140 
141  return true;
142 }
143 
144 
145 // ************************************************************************* //
GeometricField< symmTensor, fvPatchField, volMesh > volSymmTensorField
Definition: volFieldsFwd.H:58
bool read(Istream &)
Read dictionary from Istream.
Definition: dictionaryIO.C:126
dictionary dict
virtual tmp< volScalarField > nu(const phaseModel &phase, const dimensionedScalar &alphaMinFriction, const dimensionedScalar &alphaMax, const volScalarField &pf, const volSymmTensorField &D) const
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
Definition: dictionary.C:633
Macros for easy insertion into run-time selection tables.
virtual tmp< volScalarField > frictionalPressure(const phaseModel &phase, const dimensionedScalar &alphaMinFriction, const dimensionedScalar &alphaMax) const
virtual tmp< volScalarField > frictionalPressurePrime(const phaseModel &phase, const dimensionedScalar &alphaMinFriction, const dimensionedScalar &alphaMax) const
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
dimensionedScalar sin(const dimensionedScalar &ds)
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
volScalarField & alpha1
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:47
const dictionary & dict_
Reference to higher-level dictionary for re-read.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
A class for managing temporary objects.
Definition: PtrList.H:54
JohnsonJackson(const dictionary &dict)
Construct from components.
Namespace for OpenFOAM.