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 | 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 Class
25  Foam::RASModels::LaunderSharmaKE
26 
27 Group
28  grpRASTurbulence
29 
30 Description
31  Launder and Sharma low-Reynolds k-epsilon turbulence model for
32  incompressible and compressible and combusting flows including
33  rapid distortion theory (RDT) based compression term.
34 
35  References:
36  \verbatim
37  Launder, B. E., & Sharma, B. I. (1974).
38  Application of the energy-dissipation model of turbulence to the
39  calculation of flow near a spinning disc.
40  Letters in heat and mass transfer, 1(2), 131-137.
41 
42  For the RDT-based compression term:
43  El Tahry, S. H. (1983).
44  k-epsilon equation for compressible reciprocating engine flows.
45  Journal of Energy, 7(4), 345-353.
46  \endverbatim
47 
48  The default model coefficients are
49  \verbatim
50  LaunderSharmaKECoeffs
51  {
52  Cmu 0.09;
53  C1 1.44;
54  C2 1.92;
55  C3 -0.33;
56  alphah 1.0; // only for compressible
57  alphahk 1.0; // only for compressible
58  alphaEps 0.76923;
59  }
60  \endverbatim
61 
62 SourceFiles
63  LaunderSharmaKE.C
64 
65 \*---------------------------------------------------------------------------*/
66 
67 #ifndef LaunderSharmaKE_H
68 #define LaunderSharmaKE_H
69 
70 #include "RASModel.H"
71 #include "eddyViscosity.H"
72 
73 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
74 
75 namespace Foam
76 {
77 namespace RASModels
78 {
79 
80 /*---------------------------------------------------------------------------*\
81  Class LaunderSharmaKE Declaration
82 \*---------------------------------------------------------------------------*/
83 
84 template<class BasicTurbulenceModel>
85 class LaunderSharmaKE
86 :
87  public eddyViscosity<RASModel<BasicTurbulenceModel> >
88 {
89  // Private Member Functions
90 
91  // Disallow default bitwise copy construct and assignment
94 
95 
96 protected:
97 
98  // Protected data
99 
100  // Model coefficients
101 
108 
109 
110  // Fields
111 
114 
115 
116  // Private Member Functions
117 
118  tmp<volScalarField> fMu() const;
119  tmp<volScalarField> f2() const;
120 
121  virtual void correctNut();
122  virtual tmp<fvScalarMatrix> kSource() const;
123  virtual tmp<fvScalarMatrix> epsilonSource() const;
124 
125 
126 public:
127 
128  typedef typename BasicTurbulenceModel::alphaField alphaField;
129  typedef typename BasicTurbulenceModel::rhoField rhoField;
130  typedef typename BasicTurbulenceModel::transportModel transportModel;
131 
132 
133  //- Runtime type information
134  TypeName("LaunderSharmaKE");
135 
136 
137  // Constructors
138 
139  //- Construct from components
141  (
142  const alphaField& alpha,
143  const rhoField& rho,
144  const volVectorField& U,
145  const surfaceScalarField& alphaRhoPhi,
146  const surfaceScalarField& phi,
147  const transportModel& transport,
148  const word& propertiesName = turbulenceModel::propertiesName,
149  const word& type = typeName
150  );
151 
152 
153  //- Destructor
154  virtual ~LaunderSharmaKE()
155  {}
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  //- Solve the turbulence equations and correct the turbulence viscosity
202  virtual void correct();
203 };
204 
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 } // End namespace RASModels
209 } // End namespace Foam
210 
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 
213 #ifdef NoRepository
214 # include "LaunderSharmaKE.C"
215 #endif
216 
217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218 
219 #endif
220 
221 // ************************************************************************* //
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::RASModels::LaunderSharmaKE::operator=
LaunderSharmaKE & operator=(const LaunderSharmaKE &)
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:216
Foam::RASModels::LaunderSharmaKE::C3_
dimensionedScalar C3_
Definition: LaunderSharmaKE.H:104
Foam::turbulenceModel::propertiesName
static const word propertiesName
Default name of the turbulence properties dictionary.
Definition: turbulenceModel.H:97
Foam::RASModels::LaunderSharmaKE::correct
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
Definition: LaunderSharmaKE.C:236
Foam::RASModels::LaunderSharmaKE::epsilon_
volScalarField epsilon_
Definition: LaunderSharmaKE.H:112
Foam::RASModels::LaunderSharmaKE::epsilon
virtual tmp< volScalarField > epsilon() const
Return the turbulence kinetic energy dissipation rate.
Definition: LaunderSharmaKE.H:195
Foam::RASModels::LaunderSharmaKE::DkEff
tmp< volScalarField > DkEff() const
Return the effective diffusivity for k.
Definition: LaunderSharmaKE.H:163
Foam::RASModels::LaunderSharmaKE::fMu
tmp< volScalarField > fMu() const
Definition: LaunderSharmaKE.C:39
U
U
Definition: pEqn.H:46
Foam::RASModels::LaunderSharmaKE::k
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy.
Definition: LaunderSharmaKE.H:189
nu
volScalarField & nu
Definition: readMechanicalProperties.H:179
eddyViscosity.H
Foam::RASModels::LaunderSharmaKE::epsilonSource
virtual tmp< fvScalarMatrix > epsilonSource() const
Definition: LaunderSharmaKE.C:80
Foam::RASModels::LaunderSharmaKE::alphaField
BasicTurbulenceModel::alphaField alphaField
Definition: LaunderSharmaKE.H:127
Foam::RASModels::LaunderSharmaKE::read
virtual bool read()
Re-read model coefficients if they have changed.
Definition: LaunderSharmaKE.C:215
Foam::RASModels::LaunderSharmaKE::sigmak_
dimensionedScalar sigmak_
Definition: LaunderSharmaKE.H:105
Foam::RASModels::LaunderSharmaKE::DepsilonEff
tmp< volScalarField > DepsilonEff() const
Return the effective diffusivity for epsilon.
Definition: LaunderSharmaKE.H:176
Foam::RASModels::LaunderSharmaKE::TypeName
TypeName("LaunderSharmaKE")
Runtime type information.
Foam::RASModels::LaunderSharmaKE::f2
tmp< volScalarField > f2() const
Definition: LaunderSharmaKE.C:46
Foam::RASModels::LaunderSharmaKE::rhoField
BasicTurbulenceModel::rhoField rhoField
Definition: LaunderSharmaKE.H:128
RASModel.H
Foam::dimensioned
Generic dimensioned Type class.
Definition: dimensionedScalarFwd.H:41
Foam::RASModels::LaunderSharmaKE::k_
volScalarField k_
Definition: LaunderSharmaKE.H:111
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
rho
rho
Definition: pEqn.H:3
Foam::RASModels::LaunderSharmaKE::Cmu_
dimensionedScalar Cmu_
Definition: LaunderSharmaKE.H:101
Foam::RASModels::LaunderSharmaKE::C2_
dimensionedScalar C2_
Definition: LaunderSharmaKE.H:103
Foam::RASModels::LaunderSharmaKE::kSource
virtual tmp< fvScalarMatrix > kSource() const
Definition: LaunderSharmaKE.C:65
Foam::RASModels::LaunderSharmaKE::C1_
dimensionedScalar C1_
Definition: LaunderSharmaKE.H:102
Foam::RASModels::LaunderSharmaKE::LaunderSharmaKE
LaunderSharmaKE(const LaunderSharmaKE &)
Foam::RASModels::LaunderSharmaKE::sigmaEps_
dimensionedScalar sigmaEps_
Definition: LaunderSharmaKE.H:106
LaunderSharmaKE.C
Foam::eddyViscosity
Eddy viscosity turbulence model base class.
Definition: eddyViscosity.H:52
Foam::RASModels::LaunderSharmaKE::~LaunderSharmaKE
virtual ~LaunderSharmaKE()
Destructor.
Definition: LaunderSharmaKE.H:153
Foam::eddyViscosity< RASModel< BasicTurbulenceModel > >::nut_
volScalarField nut_
Definition: eddyViscosity.H:63
Foam::RASModels::LaunderSharmaKE::correctNut
virtual void correctNut()
Definition: LaunderSharmaKE.C:55
Foam::type
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:588
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::RASModels::LaunderSharmaKE::transportModel
BasicTurbulenceModel::transportModel transportModel
Definition: LaunderSharmaKE.H:129
Foam::RASModels::LaunderSharmaKE
Launder and Sharma low-Reynolds k-epsilon turbulence model for incompressible and compressible and co...
Definition: LaunderSharmaKE.H:84