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:
107 
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 // ************************************************************************* //
Foam::LESModels::kEqn::~kEqn
virtual ~kEqn()
Destructor.
Definition: kEqn.H:133
Foam::LESModels::kEqn::k
virtual tmp< volScalarField > k() const
Return SGS kinetic energy.
Definition: kEqn.H:143
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
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:216
LESeddyViscosity.H
Foam::turbulenceModel::propertiesName
static const word propertiesName
Default name of the turbulence properties dictionary.
Definition: turbulenceModel.H:97
Foam::LESModels::kEqn::correctNut
virtual void correctNut()
Definition: kEqn.C:38
Foam::LESModels::kEqn::epsilon
virtual tmp< volScalarField > epsilon() const
Return sub-grid disipation rate.
Definition: kEqn.C:140
Foam::LESModels::kEqn::correct
virtual void correct()
Correct eddy-Viscosity and related properties.
Definition: kEqn.C:161
Foam::LESModels::kEqn::TypeName
TypeName("kEqn")
Runtime type information.
Foam::LESModels::kEqn::rhoField
BasicTurbulenceModel::rhoField rhoField
Definition: kEqn.H:108
U
U
Definition: pEqn.H:46
Foam::LESModels::kEqn
One equation eddy-viscosity model.
Definition: kEqn.H:74
nu
volScalarField & nu
Definition: readMechanicalProperties.H:179
kEqn.C
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
Foam::LESModels::kEqn::transportModel
BasicTurbulenceModel::transportModel transportModel
Definition: kEqn.H:109
Foam::LESModels::LESeddyViscosity
Eddy viscosity LES SGS model base class.
Definition: LESeddyViscosity.H:55
Foam::dimensioned
Generic dimensioned Type class.
Definition: dimensionedScalarFwd.H:41
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::LESModels::kEqn::kSource
virtual tmp< fvScalarMatrix > kSource() const
Definition: kEqn.C:48
Foam::LESModels::kEqn::DkEff
tmp< volScalarField > DkEff() const
Return the effective diffusivity for k.
Definition: kEqn.H:152
rho
rho
Definition: pEqn.H:3
Foam::LESModels::kEqn::alphaField
BasicTurbulenceModel::alphaField alphaField
Definition: kEqn.H:107
Foam::LESModels::kEqn::k_
volScalarField k_
Definition: kEqn.H:91
Foam::LESModels::kEqn::kEqn
kEqn(const kEqn &)
Foam::eddyViscosity< LESModel< BasicTurbulenceModel > >::nut_
volScalarField nut_
Definition: eddyViscosity.H:63
Foam::LESModels::kEqn::read
virtual bool read()
Read model coefficients if they have changed.
Definition: kEqn.C:124
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::LESModels::kEqn::Ck_
dimensionedScalar Ck_
Definition: kEqn.H:96
Foam::LESModels::kEqn::operator=
kEqn & operator=(const kEqn &)