LaunderSharmaKE.H
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) 2011-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 Class
25  Foam::RASModels::LaunderSharmaKE
26 
27 Description
28  Launder and Sharma low-Reynolds k-epsilon turbulence model for
29  incompressible and compressible and combusting flows including
30  rapid distortion theory (RDT) based compression term.
31 
32  References:
33  \verbatim
34  Launder, B. E., & Sharma, B. I. (1974).
35  Application of the energy-dissipation model of turbulence to the
36  calculation of flow near a spinning disc.
37  Letters in heat and mass transfer, 1(2), 131-137.
38 
39  For the RDT-based compression term:
40  El Tahry, S. H. (1983).
41  k-epsilon equation for compressible reciprocating engine flows.
42  Journal of Energy, 7(4), 345-353.
43  \endverbatim
44 
45  The default model coefficients are
46  \verbatim
47  LaunderSharmaKECoeffs
48  {
49  Cmu 0.09;
50  C1 1.44;
51  C2 1.92;
52  C3 0;
53  alphah 1.0; // only for compressible
54  alphahk 1.0; // only for compressible
55  alphaEps 0.76923;
56  }
57  \endverbatim
58 
59 SourceFiles
60  LaunderSharmaKE.C
61 
62 \*---------------------------------------------------------------------------*/
63 
64 #ifndef LaunderSharmaKE_H
65 #define LaunderSharmaKE_H
66 
67 #include "RASModel.H"
68 #include "eddyViscosity.H"
69 
70 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
71 
72 namespace Foam
73 {
74 namespace RASModels
75 {
76 
77 /*---------------------------------------------------------------------------*\
78  Class LaunderSharmaKE Declaration
79 \*---------------------------------------------------------------------------*/
80 
81 template<class BasicMomentumTransportModel>
82 class LaunderSharmaKE
83 :
84  public eddyViscosity<RASModel<BasicMomentumTransportModel>>
85 {
86 protected:
87 
88  // Protected data
89 
90  // Model coefficients
91 
98 
99 
100  // Fields
101 
104 
105 
106  // Private Member Functions
107 
108  tmp<volScalarField> fMu() const;
109  tmp<volScalarField> f2() const;
110 
111  //- Bound epsilon
112  void boundEpsilon();
113 
114  //- Correct the eddy-viscosity nut
115  virtual void correctNut();
116 
117  //- Source term for the k equation
118  virtual tmp<fvScalarMatrix> kSource() const;
119 
120  //- Source term for the epsilon equation
121  virtual tmp<fvScalarMatrix> epsilonSource() const;
122 
123 
124 public:
125 
126  typedef typename BasicMomentumTransportModel::alphaField alphaField;
127  typedef typename BasicMomentumTransportModel::rhoField rhoField;
128 
129 
130  //- Runtime type information
131  TypeName("LaunderSharmaKE");
132 
133 
134  // Constructors
135 
136  //- Construct from components
138  (
139  const alphaField& alpha,
140  const rhoField& rho,
141  const volVectorField& U,
142  const surfaceScalarField& alphaRhoPhi,
143  const surfaceScalarField& phi,
144  const viscosity& viscosity,
145  const word& type = typeName
146  );
147 
148  //- Disallow default bitwise copy construction
149  LaunderSharmaKE(const LaunderSharmaKE&) = delete;
150 
151 
152  //- Destructor
153  virtual ~LaunderSharmaKE()
154  {}
155 
156 
157  // Member Functions
158 
159  //- Re-read model coefficients if they have changed
160  virtual bool read();
161 
162  //- Return the effective diffusivity for k
163  tmp<volScalarField> DkEff() const
164  {
165  return volScalarField::New
166  (
167  "DkEff",
168  (this->nut_/sigmak_ + this->nu())
169  );
170  }
171 
172  //- Return the effective diffusivity for epsilon
174  {
175  return volScalarField::New
176  (
177  "DepsilonEff",
178  (this->nut_/sigmaEps_ + this->nu())
179  );
180  }
181 
182  //- Return the turbulence kinetic energy
183  virtual tmp<volScalarField> k() const
184  {
185  return k_;
186  }
187 
188  //- Return the turbulence kinetic energy dissipation rate
189  virtual tmp<volScalarField> epsilon() const
190  {
191  return epsilon_;
192  }
193 
194  //- Return the turbulence specific dissipation rate
195  virtual tmp<volScalarField> omega() const
196  {
197  return volScalarField::New
198  (
199  "omega",
200  epsilon_/(Cmu_*k_)
201  );
202  }
203 
204  //- Solve the turbulence equations and correct the turbulence viscosity
205  virtual void correct();
206 
207 
208  // Member Operators
209 
210  //- Disallow default bitwise assignment
211  void operator=(const LaunderSharmaKE&) = delete;
212 };
213 
214 
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 
217 } // End namespace RASModels
218 } // End namespace Foam
219 
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221 
222 #ifdef NoRepository
223  #include "LaunderSharmaKE.C"
224 #endif
225 
226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
227 
228 #endif
229 
230 // ************************************************************************* //
Generic GeometricField class.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Internal &, const PtrList< PatchField< Type >> &, const HashPtrTable< Source > &=HashPtrTable< Source >())
Return a temporary field constructed from name,.
Launder and Sharma low-Reynolds k-epsilon turbulence model for incompressible and compressible and co...
BasicMomentumTransportModel::alphaField alphaField
virtual tmp< fvScalarMatrix > epsilonSource() const
Source term for the epsilon equation.
tmp< volScalarField > f2() const
tmp< volScalarField > DkEff() const
Return the effective diffusivity for k.
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy.
virtual tmp< volScalarField > omega() const
Return the turbulence specific dissipation rate.
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
LaunderSharmaKE(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const viscosity &viscosity, const word &type=typeName)
Construct from components.
TypeName("LaunderSharmaKE")
Runtime type information.
void boundEpsilon()
Bound epsilon.
tmp< volScalarField > DepsilonEff() const
Return the effective diffusivity for epsilon.
virtual void correctNut()
Correct the eddy-viscosity nut.
virtual tmp< fvScalarMatrix > kSource() const
Source term for the k equation.
void operator=(const LaunderSharmaKE &)=delete
Disallow default bitwise assignment.
virtual tmp< volScalarField > epsilon() const
Return the turbulence kinetic energy dissipation rate.
virtual ~LaunderSharmaKE()
Destructor.
tmp< volScalarField > fMu() const
virtual bool read()
Re-read model coefficients if they have changed.
BasicMomentumTransportModel::rhoField rhoField
Eddy viscosity turbulence model base class.
Definition: eddyViscosity.H:52
BasicMomentumTransportModel::alphaField alphaField
BasicMomentumTransportModel::rhoField rhoField
A class for managing temporary objects.
Definition: tmp.H:55
Abstract base class for all fluid physical properties.
Definition: viscosity.H:50
A class for handling words, derived from string.
Definition: word.H:62
U
Definition: pEqn.H:72
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
Namespace for OpenFOAM.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488