LaunderSharmaKE.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-2016 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::LaunderSharmaKE
29 
30 Group
31  grpRASTurbulence
32 
33 Description
34  Launder and Sharma low-Reynolds k-epsilon turbulence model for
35  incompressible and compressible and combusting flows including
36  rapid distortion theory (RDT) based compression term.
37 
38  References:
39  \verbatim
40  Launder, B. E., & Sharma, B. I. (1974).
41  Application of the energy-dissipation model of turbulence to the
42  calculation of flow near a spinning disc.
43  Letters in heat and mass transfer, 1(2), 131-137.
44 
45  For the RDT-based compression term:
46  El Tahry, S. H. (1983).
47  k-epsilon equation for compressible reciprocating engine flows.
48  Journal of Energy, 7(4), 345-353.
49  \endverbatim
50 
51  The default model coefficients are
52  \verbatim
53  LaunderSharmaKECoeffs
54  {
55  Cmu 0.09;
56  C1 1.44;
57  C2 1.92;
58  C3 -0.33;
59  alphah 1.0; // only for compressible
60  alphahk 1.0; // only for compressible
61  alphaEps 0.76923;
62  }
63  \endverbatim
64 
65 SourceFiles
66  LaunderSharmaKE.C
67 
68 \*---------------------------------------------------------------------------*/
69 
70 #ifndef LaunderSharmaKE_H
71 #define LaunderSharmaKE_H
72 
73 #include "RASModel.H"
74 #include "eddyViscosity.H"
75 
76 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
77 
78 namespace Foam
79 {
80 namespace RASModels
81 {
82 
83 /*---------------------------------------------------------------------------*\
84  Class LaunderSharmaKE Declaration
85 \*---------------------------------------------------------------------------*/
86 
87 template<class BasicTurbulenceModel>
88 class LaunderSharmaKE
89 :
90  public eddyViscosity<RASModel<BasicTurbulenceModel>>
91 {
92  // Private Member Functions
93 
94  //- No copy construct
95  LaunderSharmaKE(const LaunderSharmaKE&) = delete;
96 
97  //- No copy assignment
98  void operator=(const LaunderSharmaKE&) = delete;
99 
100 
101 protected:
102 
103  // Protected data
104 
105  // Model coefficients
106 
113 
114 
115  // Fields
116 
119 
120 
121  // Private Member Functions
122 
123  tmp<volScalarField> fMu() const;
124  tmp<volScalarField> f2() const;
125 
126  virtual void correctNut();
127  virtual tmp<fvScalarMatrix> kSource() const;
128  virtual tmp<fvScalarMatrix> epsilonSource() const;
129 
130 
131 public:
132 
133  typedef typename BasicTurbulenceModel::alphaField alphaField;
134  typedef typename BasicTurbulenceModel::rhoField rhoField;
135  typedef typename BasicTurbulenceModel::transportModel transportModel;
136 
137 
138  //- Runtime type information
139  TypeName("LaunderSharmaKE");
140 
141 
142  // Constructors
143 
144  //- Construct from components
146  (
147  const alphaField& alpha,
148  const rhoField& rho,
149  const volVectorField& U,
150  const surfaceScalarField& alphaRhoPhi,
151  const surfaceScalarField& phi,
152  const transportModel& transport,
153  const word& propertiesName = turbulenceModel::propertiesName,
154  const word& type = typeName
155  );
156 
157 
158  //- Destructor
159  virtual ~LaunderSharmaKE() = default;
160 
161 
162  // Member Functions
163 
164  //- Re-read model coefficients if they have changed
165  virtual bool read();
166 
167  //- Return the effective diffusivity for k
168  tmp<volScalarField> DkEff() const
169  {
170  return tmp<volScalarField>
171  (
172  new volScalarField
173  (
174  "DkEff",
175  (this->nut_/sigmak_ + this->nu())
176  )
177  );
178  }
179 
180  //- Return the effective diffusivity for epsilon
182  {
183  return tmp<volScalarField>
184  (
185  new volScalarField
186  (
187  "DepsilonEff",
188  (this->nut_/sigmaEps_ + this->nu())
189  )
190  );
191  }
192 
193  //- Return the turbulence kinetic energy
194  virtual tmp<volScalarField> k() const
195  {
196  return k_;
197  }
198 
199  //- Return the turbulence kinetic energy dissipation rate
200  virtual tmp<volScalarField> epsilon() const
201  {
202  return epsilon_;
203  }
204 
205  //- Return the (estimated) specific dissipation rate
206  virtual tmp<volScalarField> omega() const
207  {
209  (
210  IOobject
211  (
212  IOobject::groupName("omega", this->alphaRhoPhi_.group()),
213  this->runTime_.timeName(),
214  this->mesh_
215  ),
216  epsilon_/(Cmu_*k_)
217  );
218  }
219 
220  //- Solve the turbulence equations and correct the turbulence viscosity
221  virtual void correct();
222 };
223 
224 
225 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
226 
227 } // End namespace RASModels
228 } // End namespace Foam
229 
230 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
231 
232 #ifdef NoRepository
233  #include "LaunderSharmaKE.C"
234 #endif
235 
236 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
237 
238 #endif
239 
240 // ************************************************************************* //
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:104
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
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::LaunderSharmaKE::C3_
dimensionedScalar C3_
Definition: LaunderSharmaKE.H:109
Foam::turbulenceModel::propertiesName
static const word propertiesName
Default name of the turbulence properties dictionary.
Definition: turbulenceModel.H:100
Foam::RASModels::LaunderSharmaKE::correct
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
Definition: LaunderSharmaKE.C:239
Foam::RASModels::LaunderSharmaKE::epsilon_
volScalarField epsilon_
Definition: LaunderSharmaKE.H:117
Foam::RASModels::LaunderSharmaKE::epsilon
virtual tmp< volScalarField > epsilon() const
Return the turbulence kinetic energy dissipation rate.
Definition: LaunderSharmaKE.H:199
Foam::RASModels::LaunderSharmaKE::DkEff
tmp< volScalarField > DkEff() const
Return the effective diffusivity for k.
Definition: LaunderSharmaKE.H:167
Foam::RASModels::LaunderSharmaKE::fMu
tmp< volScalarField > fMu() const
Definition: LaunderSharmaKE.C:43
rho
rho
Definition: readInitialConditions.H:88
Foam::RASModels::LaunderSharmaKE::k
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy.
Definition: LaunderSharmaKE.H:193
nu
volScalarField & nu
Definition: readMechanicalProperties.H:176
Foam::RASModels::LaunderSharmaKE::~LaunderSharmaKE
virtual ~LaunderSharmaKE()=default
Destructor.
eddyViscosity.H
Foam::RASModels::LaunderSharmaKE::epsilonSource
virtual tmp< fvScalarMatrix > epsilonSource() const
Definition: LaunderSharmaKE.C:85
Foam::RASModels::LaunderSharmaKE::alphaField
BasicTurbulenceModel::alphaField alphaField
Definition: LaunderSharmaKE.H:132
Foam::RASModels::LaunderSharmaKE::read
virtual bool read()
Re-read model coefficients if they have changed.
Definition: LaunderSharmaKE.C:220
Foam::RASModels::LaunderSharmaKE::sigmak_
dimensionedScalar sigmak_
Definition: LaunderSharmaKE.H:110
Foam::RASModels::LaunderSharmaKE::DepsilonEff
tmp< volScalarField > DepsilonEff() const
Return the effective diffusivity for epsilon.
Definition: LaunderSharmaKE.H:180
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::RASModels::LaunderSharmaKE::TypeName
TypeName("LaunderSharmaKE")
Runtime type information.
Foam::RASModels::LaunderSharmaKE::f2
tmp< volScalarField > f2() const
Definition: LaunderSharmaKE.C:50
Foam::RASModels::LaunderSharmaKE::rhoField
BasicTurbulenceModel::rhoField rhoField
Definition: LaunderSharmaKE.H:133
RASModel.H
Foam::dimensioned< scalar >
Foam::RASModels::LaunderSharmaKE::k_
volScalarField k_
Definition: LaunderSharmaKE.H:116
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::RASModels::LaunderSharmaKE::Cmu_
dimensionedScalar Cmu_
Definition: LaunderSharmaKE.H:106
Foam::RASModels::LaunderSharmaKE::C2_
dimensionedScalar C2_
Definition: LaunderSharmaKE.H:108
U
U
Definition: pEqn.H:72
Foam::RASModels::LaunderSharmaKE::kSource
virtual tmp< fvScalarMatrix > kSource() const
Definition: LaunderSharmaKE.C:70
Foam::RASModels::LaunderSharmaKE::C1_
dimensionedScalar C1_
Definition: LaunderSharmaKE.H:107
Foam::RASModels::LaunderSharmaKE::sigmaEps_
dimensionedScalar sigmaEps_
Definition: LaunderSharmaKE.H:111
Foam::RASModels::LaunderSharmaKE::omega
virtual tmp< volScalarField > omega() const
Return the (estimated) specific dissipation rate.
Definition: LaunderSharmaKE.H:205
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::tmp::New
static tmp< T > New(Args &&... args)
Construct tmp of T with forwarding arguments.
Foam::eddyViscosity
Eddy viscosity turbulence model base class.
Definition: eddyViscosity.H:55
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::LaunderSharmaKE::correctNut
virtual void correctNut()
Definition: LaunderSharmaKE.C:59
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::RASModels::LaunderSharmaKE::transportModel
BasicTurbulenceModel::transportModel transportModel
Definition: LaunderSharmaKE.H:134
Foam::RASModels::LaunderSharmaKE
Launder and Sharma low-Reynolds k-epsilon turbulence model for incompressible and compressible and co...
Definition: LaunderSharmaKE.H:87