kEqn.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::LESModels::kEqn
26 
27 Group
28  grpLESTurbulence
29 
30 Description
31  One equation eddy-viscosity model
32 
33  Eddy viscosity SGS model using a modeled balance equation to simulate the
34  behaviour of k.
35 
36  Reference:
37  \verbatim
38  Yoshizawa, A. (1986).
39  Statistical theory for compressible turbulent shear flows,
40  with the application to subgrid modeling.
41  Physics of Fluids (1958-1988), 29(7), 2152-2164.
42  \endverbatim
43 
44  The default model coefficients are
45  \verbatim
46  kEqnCoeffs
47  {
48  Ck 0.094;
49  Ce 1.048;
50  }
51  \endverbatim
52 
53 SourceFiles
54  kEqn.C
55 
56 \*---------------------------------------------------------------------------*/
57 
58 #ifndef kEqn_H
59 #define kEqn_H
60 
61 #include "LESeddyViscosity.H"
62 
63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 
65 namespace Foam
66 {
67 namespace LESModels
68 {
69 
70 /*---------------------------------------------------------------------------*\
71  Class kEqn Declaration
72 \*---------------------------------------------------------------------------*/
73 
74 template<class BasicTurbulenceModel>
75 class kEqn
76 :
77  public LESeddyViscosity<BasicTurbulenceModel>
78 {
79  // Private Member Functions
80 
81  // Disallow default bitwise copy construct and assignment
82  kEqn(const kEqn&);
83  kEqn& operator=(const kEqn&);
84 
85 
86 protected:
87 
88  // Protected data
89 
90  // Fields
91 
93 
94 
95  // Model constants
96 
98 
99 
100  // Protected Member Functions
101 
102  virtual void correctNut();
103  virtual tmp<fvScalarMatrix> kSource() const;
104 
105 
106 public:
108  typedef typename BasicTurbulenceModel::alphaField alphaField;
109  typedef typename BasicTurbulenceModel::rhoField rhoField;
110  typedef typename BasicTurbulenceModel::transportModel transportModel;
111 
112 
113  //- Runtime type information
114  TypeName("kEqn");
115 
116 
117  // Constructors
118 
119  //- Constructor from components
120  kEqn
121  (
122  const alphaField& alpha,
123  const rhoField& rho,
124  const volVectorField& U,
125  const surfaceScalarField& alphaRhoPhi,
126  const surfaceScalarField& phi,
127  const transportModel& transport,
128  const word& propertiesName = turbulenceModel::propertiesName,
129  const word& type = typeName
130  );
131 
132 
133  //- Destructor
134  virtual ~kEqn()
135  {}
136 
137 
138  // Member Functions
139 
140  //- Read model coefficients if they have changed
141  virtual bool read();
142 
143  //- Return SGS kinetic energy
144  virtual tmp<volScalarField> k() const
145  {
146  return k_;
147  }
148 
149  //- Return sub-grid disipation rate
150  virtual tmp<volScalarField> epsilon() const;
151 
152  //- Return the effective diffusivity for k
153  tmp<volScalarField> DkEff() const
154  {
155  return tmp<volScalarField>
156  (
157  new volScalarField("DkEff", this->nut_ + this->nu())
158  );
159  }
160 
161  //- Correct eddy-Viscosity and related properties
162  virtual void correct();
163 };
164 
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 } // End namespace LESModels
169 } // End namespace Foam
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 #ifdef NoRepository
174 # include "kEqn.C"
175 #endif
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 
179 #endif
180 
181 // ************************************************************************* //
One equation eddy-viscosity model.
Definition: kEqn.H:74
tmp< volScalarField > DkEff() const
Return the effective diffusivity for k.
Definition: kEqn.H:152
virtual tmp< fvScalarMatrix > kSource() const
Definition: kEqn.C:48
A class for handling words, derived from string.
Definition: word.H:59
virtual void correct()
Correct eddy-Viscosity and related properties.
Definition: kEqn.C:162
Namespace for OpenFOAM.
BasicTurbulenceModel::transportModel transportModel
Definition: kEqn.H:109
virtual tmp< volScalarField > k() const
Return SGS kinetic energy.
Definition: kEqn.H:143
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
virtual bool read()
Read model coefficients if they have changed.
Definition: kEqn.C:125
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:589
surfaceScalarField & phi
volScalarField k_
Definition: kEqn.H:91
TypeName("kEqn")
Runtime type information.
static const word propertiesName
Default name of the turbulence properties dictionary.
volScalarField & nu
virtual ~kEqn()
Destructor.
Definition: kEqn.H:133
virtual void correctNut()
Definition: kEqn.C:38
Eddy viscosity LES SGS model base class.
virtual tmp< volScalarField > epsilon() const
Return sub-grid disipation rate.
Definition: kEqn.C:141
BasicTurbulenceModel::rhoField rhoField
Definition: kEqn.H:108
BasicTurbulenceModel::alphaField alphaField
Definition: kEqn.H:107
A class for managing temporary objects.
Definition: PtrList.H:118
U
Definition: pEqn.H:82
dimensionedScalar Ck_
Definition: kEqn.H:96