kOmega.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::kOmega
26 
27 Description
28  Standard high Reynolds-number k-omega turbulence model for
29  incompressible and compressible flows.
30 
31  References:
32  \verbatim
33  Wilcox, D. C. (1998).
34  Turbulence modeling for CFD
35  (Vol. 2, pp. 103-217). La Canada, CA: DCW industries.
36  \endverbatim
37 
38  The default model coefficients are
39  \verbatim
40  kOmegaCoeffs
41  {
42  betaStar 0.09;
43  gamma 0.52;
44  beta 0.072;
45  alphak 0.5;
46  alphaOmega 0.5;
47  }
48  \endverbatim
49 
50 SourceFiles
51  kOmega.C
52 
53 \*---------------------------------------------------------------------------*/
54 
55 #ifndef kOmega_H
56 #define kOmega_H
57 
58 #include "RASModel.H"
59 #include "eddyViscosity.H"
60 
61 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62 
63 namespace Foam
64 {
65 namespace RASModels
66 {
67 
68 /*---------------------------------------------------------------------------*\
69  Class kOmega Declaration
70 \*---------------------------------------------------------------------------*/
71 
72 template<class BasicMomentumTransportModel>
73 class kOmega
74 :
75  public eddyViscosity<RASModel<BasicMomentumTransportModel>>
76 {
77 
78 protected:
79 
80  // Protected data
81 
82  // Model coefficients
83 
89 
90 
91  // Fields
92 
95 
96 
97  // Protected Member Functions
98 
99  //- Bound omega
100  void boundOmega();
101 
102  //- Correct the eddy-viscosity nut
103  virtual void correctNut();
104 
105  //- Source term for the k equation
106  virtual tmp<fvScalarMatrix> kSource() const;
107 
108  //- Source term for the omega equation
109  virtual tmp<fvScalarMatrix> omegaSource() const;
110 
111 
112 public:
113 
114  typedef typename BasicMomentumTransportModel::alphaField alphaField;
115  typedef typename BasicMomentumTransportModel::rhoField rhoField;
116 
117 
118  //- Runtime type information
119  TypeName("kOmega");
120 
121 
122  // Constructors
123 
124  //- Construct from components
125  kOmega
126  (
127  const alphaField& alpha,
128  const rhoField& rho,
129  const volVectorField& U,
130  const surfaceScalarField& alphaRhoPhi,
131  const surfaceScalarField& phi,
132  const viscosity& viscosity,
133  const word& type = typeName
134  );
135 
136 
137  //- Destructor
138  virtual ~kOmega()
139  {}
140 
141 
142  // Member Functions
143 
144  //- Read RASProperties dictionary
145  virtual bool read();
146 
147  //- Return the effective diffusivity for k
148  tmp<volScalarField> DkEff() const
149  {
150  return volScalarField::New
151  (
152  "DkEff",
153  alphaK_*this->nut_ + this->nu()
154  );
155  }
156 
157  //- Return the effective diffusivity for omega
159  {
160  return volScalarField::New
161  (
162  "DomegaEff",
163  alphaOmega_*this->nut_ + this->nu()
164  );
165  }
166 
167  //- Return the turbulence kinetic energy
168  virtual tmp<volScalarField> k() const
169  {
170  return k_;
171  }
172 
173  //- Return the turbulence specific dissipation rate
174  virtual tmp<volScalarField> omega() const
175  {
176  return omega_;
177  }
178 
179  //- Return the turbulence kinetic energy dissipation rate
180  virtual tmp<volScalarField> epsilon() const
181  {
182  return volScalarField::New
183  (
184  "epsilon",
186  );
187  }
188 
189  //- Solve the turbulence equations and correct the turbulence viscosity
190  virtual void correct();
191 };
192 
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 } // End namespace RASModels
197 } // End namespace Foam
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 #ifdef NoRepository
201  #include "kOmega.C"
202 #endif
203 
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205 
206 #endif
207 
208 // ************************************************************************* //
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,.
Standard high Reynolds-number k-omega turbulence model for incompressible and compressible flows.
Definition: kOmega.H:75
BasicMomentumTransportModel::alphaField alphaField
Definition: kOmega.H:113
void boundOmega()
Bound omega.
Definition: kOmega.C:41
tmp< volScalarField > DkEff() const
Return the effective diffusivity for k.
Definition: kOmega.H:147
tmp< volScalarField > DomegaEff() const
Return the effective diffusivity for omega.
Definition: kOmega.H:157
volScalarField k_
Definition: kOmega.H:92
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy.
Definition: kOmega.H:167
TypeName("kOmega")
Runtime type information.
virtual tmp< volScalarField > omega() const
Return the turbulence specific dissipation rate.
Definition: kOmega.H:173
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
Definition: kOmega.C:214
dimensionedScalar alphaOmega_
Definition: kOmega.H:87
kOmega(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.
Definition: kOmega.C:89
dimensionedScalar gamma_
Definition: kOmega.H:85
volScalarField omega_
Definition: kOmega.H:93
virtual tmp< fvScalarMatrix > omegaSource() const
Source term for the omega equation.
Definition: kOmega.C:72
virtual void correctNut()
Correct the eddy-viscosity nut.
Definition: kOmega.C:48
virtual ~kOmega()
Destructor.
Definition: kOmega.H:137
virtual tmp< fvScalarMatrix > kSource() const
Source term for the k equation.
Definition: kOmega.C:57
virtual tmp< volScalarField > epsilon() const
Return the turbulence kinetic energy dissipation rate.
Definition: kOmega.H:179
dimensionedScalar betaStar_
Definition: kOmega.H:83
dimensionedScalar alphaK_
Definition: kOmega.H:86
virtual bool read()
Read RASProperties dictionary.
Definition: kOmega.C:194
dimensionedScalar beta_
Definition: kOmega.H:84
BasicMomentumTransportModel::rhoField rhoField
Definition: kOmega.H:114
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