SpalartAllmarasDES.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) 2015-2019 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::SpalartAllmarasDES
29 
30 Group
31  grpDESTurbulence
32 
33 Description
34  SpalartAllmarasDES DES turbulence model for incompressible and
35  compressible flows
36 
37  Reference:
38  \verbatim
39  Spalart, P. R., Jou, W. H., Strelets, M., & Allmaras, S. R. (1997).
40  Comments on the feasibility of LES for wings, and on a hybrid
41  RANS/LES approach.
42  Advances in DNS/LES, 1, 4-8.
43  \endverbatim
44 
45  Including the low Reynolds number correction documented in
46  \verbatim
47  Spalart, P. R., Deck, S., Shur, M.L., Squires, K.D., Strelets, M.Kh,
48  Travin, A. (2006).
49  A new version of detached-eddy simulation, resistant to ambiguous grid
50  densities.
51  Theor. Comput. Fluid Dyn., 20, 181-195.
52  \endverbatim
53 
54 Note
55  The default value of the DES constant implemented was calibrated for
56  OpenFOAM using decaying isotropic turbulence and agrees with the value
57  suggested in the reference publication.
58 
59 SourceFiles
60  SpalartAllmarasDES.C
61 
62 \*---------------------------------------------------------------------------*/
63 
64 #ifndef SpalartAllmarasDES_H
65 #define SpalartAllmarasDES_H
66 
67 #include "DESModel.H"
68 
69 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
70 
71 namespace Foam
72 {
73 namespace LESModels
74 {
75 
76 /*---------------------------------------------------------------------------*\
77  Class SpalartAllmarasDES Declaration
78 \*---------------------------------------------------------------------------*/
79 
80 template<class BasicTurbulenceModel>
82 :
83  public DESModel<BasicTurbulenceModel>
84 {
85  // Private Member Functions
86 
87  //- No copy construct
88  SpalartAllmarasDES(const SpalartAllmarasDES&) = delete;
89 
90  //- No copy assignment
91  void operator=(const SpalartAllmarasDES&) = delete;
92 
93 
94 protected:
95 
96  // Protected data
97 
98  // Model constants
99 
102 
112 
113 
114  // Low Reynolds number correction
115 
120 
121 
122  // Fields
123 
125 
126  //- Wall distance
127  // Note: different to wall distance in parent RASModel
128  // which is for near-wall cells only
129  const volScalarField& y_;
130 
131 
132  // Protected Member Functions
133 
134  tmp<volScalarField> chi() const;
135 
137 
139  (
140  const volScalarField& chi,
141  const volScalarField& fv1
142  ) const;
143 
145 
146  tmp<volScalarField> Omega(const volTensorField& gradU) const;
147 
149  (
150  const volScalarField& chi,
151  const volScalarField& fv1,
152  const volScalarField& Omega,
153  const volScalarField& dTilda
154  ) const;
155 
157  (
158  const volScalarField& nur,
159  const volScalarField& Omega,
160  const volScalarField& dTilda
161  ) const;
162 
164  (
165  const volScalarField& Omega,
166  const volScalarField& dTilda
167  ) const;
168 
170  (
171  const volScalarField& chi,
172  const volScalarField& fv1
173  ) const;
174 
175  //- Length scale
177  (
178  const volScalarField& chi,
179  const volScalarField& fv1,
180  const volTensorField& gradU
181  ) const;
182 
183  void correctNut(const volScalarField& fv1);
184  virtual void correctNut();
185 
186 
187 public:
188 
189  typedef typename BasicTurbulenceModel::alphaField alphaField;
190  typedef typename BasicTurbulenceModel::rhoField rhoField;
191  typedef typename BasicTurbulenceModel::transportModel transportModel;
192 
193 
194  //- Runtime type information
195  TypeName("SpalartAllmarasDES");
196 
197 
198  // Constructors
199 
200  //- Construct from components
202  (
203  const alphaField& alpha,
204  const rhoField& rho,
205  const volVectorField& U,
206  const surfaceScalarField& alphaRhoPhi,
207  const surfaceScalarField& phi,
208  const transportModel& transport,
209  const word& propertiesName = turbulenceModel::propertiesName,
210  const word& type = typeName
211  );
212 
213 
214  //- Destructor
215  virtual ~SpalartAllmarasDES() = default;
216 
217 
218  // Member Functions
219 
220  //- Re-read model coefficients if they have changed
221  virtual bool read();
222 
223  //- Return the effective diffusivity for nuTilda
225 
226  //- Return SGS kinetic energy
227  virtual tmp<volScalarField> k() const;
228 
230  {
231  return nuTilda_;
232  }
233 
234  //- Return the LES field indicator
235  virtual tmp<volScalarField> LESRegion() const;
236 
237  //- Correct nuTilda and related properties
238  virtual void correct();
239 };
240 
241 
242 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
243 
244 } // End namespace LESModels
245 } // End namespace Foam
246 
247 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
248 
249 #ifdef NoRepository
250  #include "SpalartAllmarasDES.C"
251 #endif
252 
253 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
254 
255 #endif
256 
257 // ************************************************************************* //
Foam::LESModels::SpalartAllmarasDES::Cb2_
dimensionedScalar Cb2_
Definition: SpalartAllmarasDES.H:103
Foam::LESModels::SpalartAllmarasDES::Stilda
tmp< volScalarField > Stilda(const volScalarField &chi, const volScalarField &fv1, const volScalarField &Omega, const volScalarField &dTilda) const
Definition: SpalartAllmarasDES.C:92
Foam::Switch
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:77
Foam::LESModels::SpalartAllmarasDES::Cs_
dimensionedScalar Cs_
Definition: SpalartAllmarasDES.H:108
Foam::LESModels::SpalartAllmarasDES::CDES_
dimensionedScalar CDES_
Definition: SpalartAllmarasDES.H:109
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::LESModels::SpalartAllmarasDES::Cw2_
dimensionedScalar Cw2_
Definition: SpalartAllmarasDES.H:105
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::LESModels::SpalartAllmarasDES::DnuTildaEff
tmp< volScalarField > DnuTildaEff() const
Return the effective diffusivity for nuTilda.
Definition: SpalartAllmarasDES.C:449
Foam::LESModels::SpalartAllmarasDES::Ct4_
dimensionedScalar Ct4_
Definition: SpalartAllmarasDES.H:117
Foam::LESModels::SpalartAllmarasDES::Ct3_
dimensionedScalar Ct3_
Definition: SpalartAllmarasDES.H:116
Foam::LESModels::SpalartAllmarasDES::Cw3_
dimensionedScalar Cw3_
Definition: SpalartAllmarasDES.H:106
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:212
Foam::LESModels::SpalartAllmarasDES::fv2
tmp< volScalarField > fv2(const volScalarField &chi, const volScalarField &fv1) const
Definition: SpalartAllmarasDES.C:61
Foam::LESModels::SpalartAllmarasDES::TypeName
TypeName("SpalartAllmarasDES")
Runtime type information.
Foam::turbulenceModel::propertiesName
static const word propertiesName
Default name of the turbulence properties dictionary.
Definition: turbulenceModel.H:100
Foam::LESModels::SpalartAllmarasDES
SpalartAllmarasDES DES turbulence model for incompressible and compressible flows.
Definition: SpalartAllmarasDES.H:80
Foam::LESModels::SpalartAllmarasDES::r
tmp< volScalarField > r(const volScalarField &nur, const volScalarField &Omega, const volScalarField &dTilda) const
Definition: SpalartAllmarasDES.C:113
Foam::LESModels::DESModel::rhoField
BasicTurbulenceModel::rhoField rhoField
Definition: DESModel.H:74
Foam::LESModels::SpalartAllmarasDES::nuTilda_
volScalarField nuTilda_
Definition: SpalartAllmarasDES.H:123
Foam::LESModels::SpalartAllmarasDES::kappa_
dimensionedScalar kappa_
Definition: SpalartAllmarasDES.H:100
rho
rho
Definition: readInitialConditions.H:88
DESModel.H
Foam::LESModels::SpalartAllmarasDES::lowReCorrection_
Switch lowReCorrection_
Definition: SpalartAllmarasDES.H:115
Foam::LESModels::SpalartAllmarasDES::nuTilda
tmp< volScalarField > nuTilda() const
Definition: SpalartAllmarasDES.H:228
Foam::LESModels::SpalartAllmarasDES::chi
tmp< volScalarField > chi() const
Definition: SpalartAllmarasDES.C:42
Foam::LESModels::SpalartAllmarasDES::transportModel
BasicTurbulenceModel::transportModel transportModel
Definition: SpalartAllmarasDES.H:190
Foam::LESModels::SpalartAllmarasDES::LESRegion
virtual tmp< volScalarField > LESRegion() const
Return the LES field indicator.
Definition: SpalartAllmarasDES.C:490
Foam::LESModels::SpalartAllmarasDES::fwStar_
dimensionedScalar fwStar_
Definition: SpalartAllmarasDES.H:118
Foam::LESModels::SpalartAllmarasDES::k
virtual tmp< volScalarField > k() const
Return SGS kinetic energy.
Definition: SpalartAllmarasDES.C:459
Foam::LESModels::SpalartAllmarasDES::Cv1_
dimensionedScalar Cv1_
Definition: SpalartAllmarasDES.H:107
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::LESModels::SpalartAllmarasDES::read
virtual bool read()
Re-read model coefficients if they have changed.
Definition: SpalartAllmarasDES.C:417
Foam::LESModels::SpalartAllmarasDES::Cw1_
dimensionedScalar Cw1_
Definition: SpalartAllmarasDES.H:104
Foam::LESModels::SpalartAllmarasDES::sigmaNut_
dimensionedScalar sigmaNut_
Definition: SpalartAllmarasDES.H:99
Foam::dimensioned< scalar >
Foam::LESModels::DESModel::transportModel
BasicTurbulenceModel::transportModel transportModel
Definition: DESModel.H:75
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
U
U
Definition: pEqn.H:72
Foam::LESModels::SpalartAllmarasDES::~SpalartAllmarasDES
virtual ~SpalartAllmarasDES()=default
Destructor.
Foam::LESModels::SpalartAllmarasDES::psi
tmp< volScalarField > psi(const volScalarField &chi, const volScalarField &fv1) const
Definition: SpalartAllmarasDES.C:157
Foam::LESModels::SpalartAllmarasDES::alphaField
BasicTurbulenceModel::alphaField alphaField
Definition: SpalartAllmarasDES.H:188
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::LESModels::SpalartAllmarasDES::ft2
tmp< volScalarField > ft2(const volScalarField &chi) const
Definition: SpalartAllmarasDES.C:72
Foam::LESModels::SpalartAllmarasDES::dTilda
virtual tmp< volScalarField > dTilda(const volScalarField &chi, const volScalarField &fv1, const volTensorField &gradU) const
Length scale.
Definition: SpalartAllmarasDES.C:204
Foam::LESModels::DESModel::alphaField
BasicTurbulenceModel::alphaField alphaField
Definition: DESModel.H:73
Foam::LESModels::SpalartAllmarasDES::ck_
dimensionedScalar ck_
Definition: SpalartAllmarasDES.H:110
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::LESModels::SpalartAllmarasDES::correct
virtual void correct()
Correct nuTilda and related properties.
Definition: SpalartAllmarasDES.C:516
Foam::LESModels::SpalartAllmarasDES::fv1
tmp< volScalarField > fv1(const volScalarField &chi) const
Definition: SpalartAllmarasDES.C:50
Foam::LESModels::SpalartAllmarasDES::Cb1_
dimensionedScalar Cb1_
Definition: SpalartAllmarasDES.H:102
Foam::LESModels::SpalartAllmarasDES::fw
tmp< volScalarField > fw(const volScalarField &Omega, const volScalarField &dTilda) const
Definition: SpalartAllmarasDES.C:143
Foam::LESModels::SpalartAllmarasDES::Omega
tmp< volScalarField > Omega(const volTensorField &gradU) const
Definition: SpalartAllmarasDES.C:82
Foam::LESModels::SpalartAllmarasDES::y_
const volScalarField & y_
Wall distance.
Definition: SpalartAllmarasDES.H:128
SpalartAllmarasDES.C
Foam::LESModels::SpalartAllmarasDES::rhoField
BasicTurbulenceModel::rhoField rhoField
Definition: SpalartAllmarasDES.H:189
Foam::LESModels::SpalartAllmarasDES::correctNut
virtual void correctNut()
Definition: SpalartAllmarasDES.C:231
Foam::LESModels::DESModel
Templated abstract base class for DES models.
Definition: DESModel.H:54