kOmegaSSTDES.C
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) 2015 OpenFOAM Foundation
9  Copyright (C) 2016-2020 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 \*---------------------------------------------------------------------------*/
28 
29 #include "kOmegaSSTDES.H"
30 
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35 namespace LESModels
36 {
37 
38 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
39 
40 template<class BasicTurbulenceModel>
42 {
43  // Correct the turbulence viscosity
45 
46  // Correct the turbulence thermal diffusivity
47  BasicTurbulenceModel::correctNut();
48 }
49 
50 
51 template<class BasicTurbulenceModel>
53 {
54  correctNut(2*magSqr(symm(fvc::grad(this->U_))));
55 }
56 
57 
58 template<class BasicTurbulenceModel>
60 (
61  const volScalarField& magGradU,
62  const volScalarField& CDES
63 ) const
64 {
65  const volScalarField& k = this->k_;
66  const volScalarField& omega = this->omega_;
67 
68  return min(CDES*this->delta(), sqrt(k)/(this->betaStar_*omega));
69 }
70 
71 
72 template<class BasicTurbulenceModel>
74 (
75  const volScalarField& F1,
76  const volTensorField& gradU
77 ) const
78 {
79  volScalarField CDES(this->CDES(F1));
80  return sqrt(this->k_())/dTilda(mag(gradU), CDES)()();
81 }
82 
83 
84 template<class BasicTurbulenceModel>
86 (
87  const volScalarField::Internal& GbyNu0,
89  const volScalarField::Internal& S2
90 ) const
91 {
92  return GbyNu0; // Unlimited
93 }
94 
95 
96 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
97 
98 template<class BasicTurbulenceModel>
100 (
101  const alphaField& alpha,
102  const rhoField& rho,
103  const volVectorField& U,
104  const surfaceScalarField& alphaRhoPhi,
105  const surfaceScalarField& phi,
106  const transportModel& transport,
107  const word& propertiesName,
108  const word& type
109 )
110 :
112  (
113  type,
114  alpha,
115  rho,
116  U,
117  alphaRhoPhi,
118  phi,
119  transport,
120  propertiesName
121  ),
122 
123  kappa_
124  (
126  (
127  "kappa",
128  this->coeffDict_,
129  0.41
130  )
131  ),
132  CDESkom_
133  (
135  (
136  "CDESkom",
137  this->coeffDict_,
138  0.82
139  )
140  ),
141  CDESkeps_
142  (
144  (
145  "CDESkeps",
146  this->coeffDict_,
147  0.60
148  )
149  )
150 {
151  correctNut();
152 
153  if (type == typeName)
154  {
155  this->printCoeffs(type);
156  }
157 }
158 
159 
160 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
161 
162 template<class BasicTurbulenceModel>
164 {
166  {
167  kappa_.readIfPresent(this->coeffDict());
168  CDESkom_.readIfPresent(this->coeffDict());
169  CDESkeps_.readIfPresent(this->coeffDict());
170 
171  return true;
172  }
173 
174  return false;
175 }
176 
177 
178 template<class BasicTurbulenceModel>
180 {
181  const volScalarField& k = this->k_;
182  const volScalarField& omega = this->omega_;
183  const volVectorField& U = this->U_;
184 
185  const volScalarField CDkOmega
186  (
187  (2*this->alphaOmega2_)*(fvc::grad(k) & fvc::grad(omega))/omega
188  );
189 
190  const volScalarField F1(this->F1(CDkOmega));
191 
192  tmp<volScalarField> tLESRegion
193  (
194  new volScalarField
195  (
196  IOobject
197  (
198  "DES::LESRegion",
199  this->mesh_.time().timeName(),
200  this->mesh_,
203  ),
204  neg
205  (
206  dTilda
207  (
208  mag(fvc::grad(U)),
209  F1*CDESkom_ + (1 - F1)*CDESkeps_
210  )
211  - sqrt(k)/(this->betaStar_*omega)
212  )
213  )
214  );
215 
216  return tLESRegion;
217 }
218 
219 
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221 
222 } // End namespace LESModels
223 } // End namespace Foam
224 
225 // ************************************************************************* //
Foam::IOobject::NO_WRITE
Definition: IOobject.H:195
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
F1
#define F1(B, C, D)
Definition: SHA1.C:150
Foam::symm
dimensionedSymmTensor symm(const dimensionedSymmTensor &dt)
Definition: dimensionedSymmTensor.C:84
Foam::fvc::grad
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcGrad.C:54
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::LESModels::kOmegaSSTDES
k-omega-SST DES turbulence model for incompressible and compressible flows
Definition: kOmegaSSTDES.H:71
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
Foam::read
bool read(const char *buf, int32_t &val)
Same as readInt32.
Definition: int32.H:108
Foam::LESModels::kOmegaSSTDES::read
virtual bool read()
Re-read model coefficients if they have changed.
Definition: kOmegaSSTDES.C:163
rho
rho
Definition: readInitialConditions.H:88
Foam::min
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:33
Foam::magSqr
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
Foam::GeometricField< scalar, fvPatchField, volMesh >::Internal
DimensionedField< scalar, volMesh > Internal
Type of the internal field from which this GeometricField is derived.
Definition: GeometricField.H:107
delta
scalar delta
Definition: LISASMDCalcMethod2.H:8
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::LESModels::kOmegaSSTDES::dTilda
virtual tmp< volScalarField > dTilda(const volScalarField &magGradU, const volScalarField &CDES) const
Length scale.
Definition: kOmegaSSTDES.C:60
Foam::dimensioned
Generic dimensioned Type class.
Definition: dimensionedScalarFwd.H:42
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::LESModels::kOmegaSSTDES::epsilonByk
virtual tmp< volScalarField::Internal > epsilonByk(const volScalarField &F1, const volTensorField &gradU) const
Return epsilon/k.
Definition: kOmegaSSTDES.C:74
Foam::LESModels::kOmegaSSTDES::transportModel
BasicTurbulenceModel::transportModel transportModel
Definition: kOmegaSSTDES.H:133
U
U
Definition: pEqn.H:72
Foam::LESModels::kOmegaSSTDES::alphaField
BasicTurbulenceModel::alphaField alphaField
Definition: kOmegaSSTDES.H:131
Foam::LESModels::kOmegaSSTDES::correctNut
virtual void correctNut()
Definition: kOmegaSSTDES.C:52
Foam::LESModels::kOmegaSSTDES::GbyNu
virtual tmp< volScalarField::Internal > GbyNu(const volScalarField::Internal &GbyNu0, const volScalarField::Internal &F2, const volScalarField::Internal &S2) const
Return G/nu.
Definition: kOmegaSSTDES.C:86
Foam::sqrt
dimensionedScalar sqrt(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:144
Foam::mag
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
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
k
label k
Boltzmann constant.
Definition: LISASMDCalcMethod2.H:41
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::IOobject::NO_READ
Definition: IOobject.H:188
Foam::LESModels::kOmegaSSTDES::LESRegion
virtual tmp< volScalarField > LESRegion() const
Return the LES field indicator.
Definition: kOmegaSSTDES.C:179
Foam::LESModels::kOmegaSSTDES::rhoField
BasicTurbulenceModel::rhoField rhoField
Definition: kOmegaSSTDES.H:132
Foam::neg
dimensionedScalar neg(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:199
F2
#define F2(B, C, D)
Definition: SHA1.C:151
Foam::kOmegaSSTBase
Base class implementation of the k-omega-SST turbulence model for incompressible and compressible flo...
Definition: kOmegaSSTBase.H:128
Foam::LESModels::DESModel
Templated abstract base class for DES models.
Definition: DESModel.H:54
kOmegaSSTDES.H