realizableKE.H
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) 2011-2017 OpenFOAM Foundation
9  Copyright (C) 2019-2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::RASModels::realizableKE
29 
30 Group
31  grpRASTurbulence
32 
33 Description
34  Realizable k-epsilon turbulence model for incompressible and compressible
35  flows.
36 
37  References:
38  \verbatim
39  Shih, T. H., Liou, W. W., Shabbir, A., Yang, Z., & Zhu, J. (1994).
40  A new k-epsilon eddy viscosity model for high Reynolds number
41  turbulent flows: Model development and validation.
42  NASA STI/Recon Technical Report N, 95, 11442.
43 
44  Shih, T. H., Liou, W. W., Shabbir, A., Yang, Z., & Zhu, J. (1995).
45  A New k-epsilon Eddy Viscosity Model for High Reynolds Number
46  Turbulent Flows.
47  Computers and Fluids, 24(3), 227-238.
48  \endverbatim
49 
50  The default model coefficients are
51  \verbatim
52  realizableKECoeffs
53  {
54  A0 4.0;
55  C2 1.9;
56  sigmak 1.0;
57  sigmaEps 1.2;
58  }
59  \endverbatim
60 
61 SourceFiles
62  realizableKE.C
63 
64 \*---------------------------------------------------------------------------*/
65 
66 #ifndef realizableKE_H
67 #define realizableKE_H
68 
69 #include "RASModel.H"
70 #include "eddyViscosity.H"
71 
72 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
73 
74 namespace Foam
75 {
76 namespace RASModels
77 {
78 
79 /*---------------------------------------------------------------------------*\
80  Class realizableKE Declaration
81 \*---------------------------------------------------------------------------*/
82 
83 template<class BasicTurbulenceModel>
84 class realizableKE
85 :
86  public eddyViscosity<RASModel<BasicTurbulenceModel>>
87 {
88 
89 protected:
90 
91  // Protected data
92 
93  // Model coefficients
94 
99 
100 
101  // Fields
102 
105 
106 
107  // Protected Member Functions
108 
110  (
111  const volTensorField& gradU,
112  const volScalarField& S2,
113  const volScalarField& magS
114  );
115 
116  virtual void correctNut
117  (
118  const volTensorField& gradU,
119  const volScalarField& S2,
120  const volScalarField& magS
121  );
122 
123  virtual void correctNut();
124  virtual tmp<fvScalarMatrix> kSource() const;
125  virtual tmp<fvScalarMatrix> epsilonSource() const;
126 
127 
128 public:
129 
130  typedef typename BasicTurbulenceModel::alphaField alphaField;
131  typedef typename BasicTurbulenceModel::rhoField rhoField;
132  typedef typename BasicTurbulenceModel::transportModel transportModel;
133 
134 
135  //- Runtime type information
136  TypeName("realizableKE");
137 
138  // Constructors
139 
140  //- Construct from components
142  (
143  const alphaField& alpha,
144  const rhoField& rho,
145  const volVectorField& U,
146  const surfaceScalarField& alphaRhoPhi,
147  const surfaceScalarField& phi,
148  const transportModel& transport,
149  const word& propertiesName = turbulenceModel::propertiesName,
150  const word& type = typeName
151  );
152 
153 
154  //- Destructor
155  virtual ~realizableKE() = default;
156 
157 
158  // Member Functions
159 
160  //- Re-read model coefficients if they have changed
161  virtual bool read();
162 
163  //- Return the effective diffusivity for k
164  tmp<volScalarField> DkEff() const
165  {
166  return tmp<volScalarField>
167  (
168  new volScalarField
169  (
170  "DkEff",
171  (this->nut_/sigmak_ + this->nu())
172  )
173  );
174  }
175 
176  //- Return the effective diffusivity for epsilon
178  {
179  return tmp<volScalarField>
180  (
181  new volScalarField
182  (
183  "DepsilonEff",
184  (this->nut_/sigmaEps_ + this->nu())
185  )
186  );
187  }
188 
189  //- Return the turbulence kinetic energy
190  virtual tmp<volScalarField> k() const
191  {
192  return k_;
193  }
194 
195  //- Return the turbulence kinetic energy dissipation rate
196  virtual tmp<volScalarField> epsilon() const
197  {
198  return epsilon_;
199  }
200 
201  //- Return the (estimated) specific dissipation rate
202  virtual tmp<volScalarField> omega() const
203  {
205  (
206  IOobject
207  (
208  IOobject::groupName("omega", this->alphaRhoPhi_.group()),
209  this->runTime_.timeName(),
210  this->mesh_
211  ),
212  epsilon_/(0.09*k_)
213  );
214  }
215 
216  //- Solve the turbulence equations and correct the turbulence viscosity
217  virtual void correct();
218 };
219 
220 
221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222 
223 } // End namespace RASModels
224 } // End namespace Foam
225 
226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
227 
228 #ifdef NoRepository
229  #include "realizableKE.C"
230 #endif
231 
232 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
233 
234 #endif
235 
236 // ************************************************************************* //
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:104
Foam::RASModels::realizableKE::epsilonSource
virtual tmp< fvScalarMatrix > epsilonSource() const
Definition: realizableKE.C:117
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::RASModels::realizableKE::rhoField
BasicTurbulenceModel::rhoField rhoField
Definition: realizableKE.H:130
realizableKE.C
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:212
Foam::RASModels::realizableKE::read
virtual bool read()
Re-read model coefficients if they have changed.
Definition: realizableKE.C:232
Foam::turbulenceModel::propertiesName
static const word propertiesName
Default name of the turbulence properties dictionary.
Definition: turbulenceModel.H:100
Foam::RASModels::realizableKE::k_
volScalarField k_
Definition: realizableKE.H:102
rho
rho
Definition: readInitialConditions.H:88
Foam::RASModels::realizableKE::rCmu
tmp< volScalarField > rCmu(const volTensorField &gradU, const volScalarField &S2, const volScalarField &magS)
Definition: realizableKE.C:44
Foam::RASModels::realizableKE::sigmaEps_
dimensionedScalar sigmaEps_
Definition: realizableKE.H:97
Foam::RASModels::realizableKE::epsilon
virtual tmp< volScalarField > epsilon() const
Return the turbulence kinetic energy dissipation rate.
Definition: realizableKE.H:195
nu
volScalarField & nu
Definition: readMechanicalProperties.H:176
eddyViscosity.H
Foam::RASModels::realizableKE::TypeName
TypeName("realizableKE")
Runtime type information.
Foam::RASModels::realizableKE::epsilon_
volScalarField epsilon_
Definition: realizableKE.H:103
Foam::RASModels::realizableKE::kSource
virtual tmp< fvScalarMatrix > kSource() const
Definition: realizableKE.C:102
Foam::RASModels::realizableKE
Realizable k-epsilon turbulence model for incompressible and compressible flows.
Definition: realizableKE.H:83
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::RASModels::realizableKE::DkEff
tmp< volScalarField > DkEff() const
Return the effective diffusivity for k.
Definition: realizableKE.H:163
Foam::RASModels::realizableKE::omega
virtual tmp< volScalarField > omega() const
Return the (estimated) specific dissipation rate.
Definition: realizableKE.H:201
Foam::RASModel::rhoField
BasicTurbulenceModel::rhoField rhoField
Definition: RASModel.H:97
RASModel.H
Foam::dimensioned< scalar >
Foam::RASModels::realizableKE::~realizableKE
virtual ~realizableKE()=default
Destructor.
Foam::RASModels::realizableKE::alphaField
BasicTurbulenceModel::alphaField alphaField
Definition: realizableKE.H:129
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::RASModels::realizableKE::correctNut
virtual void correctNut()
Definition: realizableKE.C:92
Foam::RASModel::alphaField
BasicTurbulenceModel::alphaField alphaField
Definition: RASModel.H:96
Foam::RASModel::transportModel
BasicTurbulenceModel::transportModel transportModel
Definition: RASModel.H:98
U
U
Definition: pEqn.H:72
Foam::RASModels::realizableKE::realizableKE
realizableKE(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transport, const word &propertiesName=turbulenceModel::propertiesName, const word &type=typeName)
Construct from components.
Definition: realizableKE.C:135
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:590
Foam::RASModels::realizableKE::A0_
dimensionedScalar A0_
Definition: realizableKE.H:94
Foam::tmp::New
static tmp< T > New(Args &&... args)
Construct tmp of T with forwarding arguments.
Foam::RASModels::realizableKE::transportModel
BasicTurbulenceModel::transportModel transportModel
Definition: realizableKE.H:131
Foam::eddyViscosity
Eddy viscosity turbulence model base class.
Definition: eddyViscosity.H:55
Foam::RASModels::realizableKE::k
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy.
Definition: realizableKE.H:189
Foam::eddyViscosity< RASModel< BasicTurbulenceModel > >::nut_
volScalarField nut_
Definition: eddyViscosity.H:66
Foam::IOobject::groupName
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
Foam::RASModels::realizableKE::DepsilonEff
tmp< volScalarField > DepsilonEff() const
Return the effective diffusivity for epsilon.
Definition: realizableKE.H:176
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::RASModels::realizableKE::correct
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
Definition: realizableKE.C:249
Foam::RASModels::realizableKE::C2_
dimensionedScalar C2_
Definition: realizableKE.H:95
Foam::RASModels::realizableKE::sigmak_
dimensionedScalar sigmak_
Definition: realizableKE.H:96