FreeFOAM The Cross-Platform CFD Toolkit
SpalartAllmaras.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) 1991-2010 OpenCFD Ltd.
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::compressible::RASModels::SpalartAllmaras
26 
27 Description
28  Spalart-Allmaras one-eqn mixing-length model for compressible
29  external flows.
30 
31  Reference:
32  @verbatim
33  "A One-Equation Turbulence Model for Aerodynamic Flows"
34  P.R. Spalart,
35  S.R. Allmaras,
36  La Recherche Aerospatiale, No. 1, 1994, pp. 5--21.
37 
38  Extended according to:
39 
40  "An Unstructured Grid Generation and Adaptive Solution Technique
41  for High Reynolds Number Compressible Flows"
42  G.A. Ashford,
43  Ph.D. thesis, University of Michigan, 1996.
44  @endverbatim
45 
46  The default model coefficients correspond to the following:
47  @verbatim
48  SpalartAllmarasCoeffs
49  {
50  Cb1 0.1355;
51  Cb2 0.622;
52  Cw2 0.3;
53  Cw3 2.0;
54  Cv1 7.1;
55  Cv2 5.0;
56  sigmaNut 0.66666;
57  Prt 1.0; // only for compressible
58  kappa 0.41;
59  }
60  @endverbatim
61 
62 SourceFiles
63  SpalartAllmaras.C
64  SpalartAllmarasCorrect.C
65 
66 \*---------------------------------------------------------------------------*/
67 
68 #ifndef compressibleSpalartAllmaras_H
69 #define combressibleSpalartAllmaras_H
70 
72 #include <finiteVolume/wallDist.H>
73 
74 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
75 
76 namespace Foam
77 {
78 namespace compressible
79 {
80 namespace RASModels
81 {
82 
83 /*---------------------------------------------------------------------------*\
84  Class SpalartAllmaras Declaration
85 \*---------------------------------------------------------------------------*/
86 
88 :
89  public RASModel
90 {
91  // Private data
92 
93  // Model coefficients
94 
95  dimensionedScalar sigmaNut_;
96  dimensionedScalar kappa_;
97  dimensionedScalar Prt_;
98 
99  dimensionedScalar Cb1_;
100  dimensionedScalar Cb2_;
101  dimensionedScalar Cw1_;
102  dimensionedScalar Cw2_;
103  dimensionedScalar Cw3_;
104  dimensionedScalar Cv1_;
105  dimensionedScalar Cv2_;
106 
107 
108  // Fields
109 
110  volScalarField nuTilda_;
111  volScalarField mut_;
112  volScalarField alphat_;
113 
114 
115  //- Wall distance
116  wallDist d_;
117 
118 
119  // Private member functions
120 
121  tmp<volScalarField> chi() const;
122  tmp<volScalarField> fv1(const volScalarField& chi) const;
124  (
125  const volScalarField& chi,
126  const volScalarField& fv1
127  ) const;
129  (
130  const volScalarField& chi,
131  const volScalarField& fv1
132  ) const;
133  tmp<volScalarField> fw(const volScalarField& Stilda) const;
134 
135 
136 public:
137 
138  //- Runtime type information
139  TypeName("SpalartAllmaras");
140 
141 
142  // Constructors
143 
144  //- Construct from components
146  (
147  const volScalarField& rho,
148  const volVectorField& U,
149  const surfaceScalarField& phi,
150  const basicThermo& thermophysicalModel
151  );
152 
153 
154  //- Destructor
155  virtual ~SpalartAllmaras()
156  {}
157 
158 
159  // Member Functions
160 
161  //- Return the effective diffusivity for nuTilda
163  {
164  return tmp<volScalarField>
165  (
166  new volScalarField
167  (
168  "DnuTildaEff",
169  rho_*nuTilda_/sigmaNut_ + mu()
170  )
171  );
172  }
173 
174  //- Return the turbulence viscosity
175  virtual tmp<volScalarField> mut() const
176  {
177  return mut_;
178  }
179 
180  //- Return the effective turbulent thermal diffusivity
182  {
183  return tmp<volScalarField>
184  (
185  new volScalarField("alphaEff", alphat_ + alpha())
186  );
187  }
188 
189  //- Return the turbulence kinetic energy
190  virtual tmp<volScalarField> k() const
191  {
192  return tmp<volScalarField>
193  (
194  new volScalarField
195  (
196  IOobject
197  (
198  "k",
199  runTime_.timeName(),
200  mesh_
201  ),
202  mesh_,
203  dimensionedScalar("0", dimensionSet(0, 2, -2, 0, 0), 0)
204  )
205  );
206  }
207 
208  //- Return the turbulence kinetic energy dissipation rate
209  virtual tmp<volScalarField> epsilon() const
210  {
211  return tmp<volScalarField>
212  (
213  new volScalarField
214  (
215  IOobject
216  (
217  "epslion",
218  runTime_.timeName(),
219  mesh_
220  ),
221  mesh_,
222  dimensionedScalar("0", dimensionSet(0, 2, -3, 0, 0), 0)
223  )
224  );
225  }
226 
227  //- Return the Reynolds stress tensor
228  virtual tmp<volSymmTensorField> R() const;
229 
230  //- Return the effective stress tensor including the laminar stress
231  virtual tmp<volSymmTensorField> devRhoReff() const;
232 
233  //- Return the source term for the momentum equation
234  virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
235 
236  //- Solve the turbulence equations and correct the turbulence viscosity
237  virtual void correct();
238 
239  //- Read RASProperties dictionary
240  virtual bool read();
241 };
242 
243 
244 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
245 
246 } // End namespace RASModels
247 } // End namespace compressible
248 } // End namespace Foam
249 
250 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
251 
252 #endif
253 
254 // ************************ vim: set sw=4 sts=4 et: ************************ //