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