dynamicKEqn.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::dynamicKEqn
29 
30 Group
31  grpLESTurbulence
32 
33 Description
34  Dynamic one equation eddy-viscosity model
35 
36  Eddy viscosity SGS model using a modeled balance equation to simulate
37  the behaviour of k in which a dynamic procedure is applied to evaluate the
38  coefficients.
39 
40  Reference:
41  \verbatim
42  Kim, W and Menon, S. (1995).
43  A new dynamic one-equation subgrid-scale model for
44  large eddy simulation.
45  In 33rd Aerospace Sciences Meeting and Exhibit, Reno, NV, 1995.
46  \endverbatim
47 
48  There are no default model coefficients but the filter used for KK must be
49  supplied, e.g.
50  \verbatim
51  dynamicKEqnCoeffs
52  {
53  filter simple;
54  }
55  \endverbatim
56 
57 SourceFiles
58  dynamicKEqn.C
59 
60 \*---------------------------------------------------------------------------*/
61 
62 #ifndef dynamicKEqn_H
63 #define dynamicKEqn_H
64 
65 #include "LESeddyViscosity.H"
66 #include "simpleFilter.H"
67 
68 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
69 
70 namespace Foam
71 {
72 namespace LESModels
73 {
74 
75 /*---------------------------------------------------------------------------*\
76  Class dynamicKEqn Declaration
77 \*---------------------------------------------------------------------------*/
78 
79 template<class BasicTurbulenceModel>
80 class dynamicKEqn
81 :
82  public LESeddyViscosity<BasicTurbulenceModel>
83 {
84  // Private Member Functions
85 
86  //- No copy construct
87  dynamicKEqn(const dynamicKEqn&) = delete;
88 
89  //- No copy assignment
90  void operator=(const dynamicKEqn&) = delete;
91 
92 
93 protected:
94 
95  // Protected data
96 
97  // Fields
98 
100 
101 
102  // Filters
103 
107 
108 
109  // Protected Member Functions
110 
111  //- Calculate Ck by filtering the velocity field U
113  (
114  const volSymmTensorField& D,
115  const volScalarField& KK
116  ) const;
117 
118  //- Calculate Ce by filtering the velocity field U
120  (
121  const volSymmTensorField& D,
122  const volScalarField& KK
123  ) const;
124 
125  volScalarField Ce() const;
126 
127  //- Update sub-grid eddy-viscosity
128  void correctNut
129  (
130  const volSymmTensorField& D,
131  const volScalarField& KK
132  );
133 
134  virtual void correctNut();
135 
136  virtual tmp<fvScalarMatrix> kSource() const;
137 
138 
139 public:
140 
141  typedef typename BasicTurbulenceModel::alphaField alphaField;
142  typedef typename BasicTurbulenceModel::rhoField rhoField;
143  typedef typename BasicTurbulenceModel::transportModel transportModel;
144 
145 
146  //- Runtime type information
147  TypeName("dynamicKEqn");
148 
149 
150  // Constructors
151 
152  //- Construct from components
154  (
155  const alphaField& alpha,
156  const rhoField& rho,
157  const volVectorField& U,
158  const surfaceScalarField& alphaRhoPhi,
159  const surfaceScalarField& phi,
160  const transportModel& transport,
161  const word& propertiesName = turbulenceModel::propertiesName,
162  const word& type = typeName
163  );
164 
165 
166  //- Destructor
167  virtual ~dynamicKEqn() = default;
168 
169 
170  // Member Functions
171 
172  //- Read model coefficients if they have changed
173  virtual bool read();
174 
175  //- Return SGS kinetic energy
176  virtual tmp<volScalarField> k() const
177  {
178  return k_;
179  }
180 
181  //- Return the effective diffusivity for k
182  tmp<volScalarField> DkEff() const
183  {
184  return tmp<volScalarField>
185  (
186  new volScalarField("DkEff", this->nut_ + this->nu())
187  );
188  }
189 
190  //- Correct Eddy-Viscosity and related properties
191  virtual void correct();
192 };
193 
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 } // End namespace LESModels
198 } // End namespace Foam
199 
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 
202 #ifdef NoRepository
203  #include "dynamicKEqn.C"
204 #endif
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 #endif
209 
210 // ************************************************************************* //
Foam::LESModels::dynamicKEqn::filterPtr_
autoPtr< LESfilter > filterPtr_
Definition: dynamicKEqn.H:104
Foam::LESModels::dynamicKEqn::alphaField
BasicTurbulenceModel::alphaField alphaField
Definition: dynamicKEqn.H:140
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::LESModels::dynamicKEqn::simpleFilter_
simpleFilter simpleFilter_
Definition: dynamicKEqn.H:103
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::LESModels::dynamicKEqn::transportModel
BasicTurbulenceModel::transportModel transportModel
Definition: dynamicKEqn.H:142
Foam::turbulenceModel::propertiesName
static const word propertiesName
Default name of the turbulence properties dictionary.
Definition: turbulenceModel.H:100
dynamicKEqn.C
Foam::LESModels::dynamicKEqn::TypeName
TypeName("dynamicKEqn")
Runtime type information.
rho
rho
Definition: readInitialConditions.H:88
Foam::LESModels::dynamicKEqn::correctNut
virtual void correctNut()
Definition: dynamicKEqn.C:127
Foam::LESModels::dynamicKEqn::read
virtual bool read()
Read model coefficients if they have changed.
Definition: dynamicKEqn.C:209
Foam::LESModels::dynamicKEqn
Dynamic one equation eddy-viscosity model.
Definition: dynamicKEqn.H:79
nu
volScalarField & nu
Definition: readMechanicalProperties.H:176
Foam::LESModels::dynamicKEqn::rhoField
BasicTurbulenceModel::rhoField rhoField
Definition: dynamicKEqn.H:141
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
Foam::LESModels::LESeddyViscosity
Eddy viscosity LES SGS model base class.
Definition: LESeddyViscosity.H:58
Foam::LESModels::dynamicKEqn::k
virtual tmp< volScalarField > k() const
Return SGS kinetic energy.
Definition: dynamicKEqn.H:175
Foam::LESfilter
Abstract class for LES filters.
Definition: LESfilter.H:57
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::LESModels::dynamicKEqn::correct
virtual void correct()
Correct Eddy-Viscosity and related properties.
Definition: dynamicKEqn.C:223
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
U
U
Definition: pEqn.H:72
Foam::LESModels::dynamicKEqn::Ce
volScalarField Ce() const
Definition: dynamicKEqn.C:97
Foam::LESModels::dynamicKEqn::Ck
volScalarField Ck(const volSymmTensorField &D, const volScalarField &KK) const
Calculate Ck by filtering the velocity field U.
Definition: dynamicKEqn.C:43
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
D
const dimensionedScalar & D
Definition: solveBulkSurfactant.H:4
Foam::LESModels::dynamicKEqn::filter_
LESfilter & filter_
Definition: dynamicKEqn.H:105
Foam::LESModels::dynamicKEqn::~dynamicKEqn
virtual ~dynamicKEqn()=default
Destructor.
simpleFilter.H
Foam::LESModels::dynamicKEqn::k_
volScalarField k_
Definition: dynamicKEqn.H:98
Foam::eddyViscosity< LESModel< BasicTurbulenceModel > >::nut_
volScalarField nut_
Definition: eddyViscosity.H:66
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::simpleFilter
Simple top-hat filter used in dynamic LES models.
Definition: simpleFilter.H:52
Foam::LESModels::dynamicKEqn::kSource
virtual tmp< fvScalarMatrix > kSource() const
Definition: dynamicKEqn.C:139
Foam::LESModels::dynamicKEqn::DkEff
tmp< volScalarField > DkEff() const
Return the effective diffusivity for k.
Definition: dynamicKEqn.H:181