OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

SpalartAllmaras.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::compressible::RASModels::SpalartAllmaras
00027 
00028 Description
00029     Spalart-Allmaras one-eqn mixing-length model for compressible
00030     external flows.
00031 
00032     Reference:
00033     @verbatim
00034         "A One-Equation Turbulence Model for Aerodynamic Flows"
00035         P.R. Spalart,
00036         S.R. Allmaras,
00037         La Recherche A´rospatiale, No. 1, 1994, pp. 5–21.
00038 
00039         Extended according to:
00040 
00041         "An Unstructured Grid Generation and Adaptive Solution Technique
00042         for High Reynolds Number Compressible Flows"
00043         G.A. Ashford,
00044         Ph.D. thesis, University of Michigan, 1996.
00045     @endverbatim
00046 
00047     The default model coefficients correspond to the following:
00048     @verbatim
00049         SpalartAllmarasCoeffs
00050         {
00051             Cb1         0.1355;
00052             Cb2         0.622;
00053             Cw2         0.3;
00054             Cw3         2.0;
00055             Cv1         7.1;
00056             Cv2         5.0;
00057             sigmaNut    0.66666;
00058             Prt         1.0;    // only for compressible
00059             kappa       0.41;
00060         }
00061     @endverbatim
00062 
00063 SourceFiles
00064     SpalartAllmaras.C
00065     SpalartAllmarasCorrect.C
00066 
00067 \*---------------------------------------------------------------------------*/
00068 
00069 #ifndef compressibleSpalartAllmaras_H
00070 #define combressibleSpalartAllmaras_H
00071 
00072 #include "RASModel.H"
00073 #include "wallDist.H"
00074 
00075 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00076 
00077 namespace Foam
00078 {
00079 namespace compressible
00080 {
00081 namespace RASModels
00082 {
00083 
00084 /*---------------------------------------------------------------------------*\
00085                       Class SpalartAllmaras Declaration
00086 \*---------------------------------------------------------------------------*/
00087 
00088 class SpalartAllmaras
00089 :
00090     public RASModel
00091 {
00092     // Private data
00093 
00094         // Model coefficients
00095 
00096             dimensionedScalar sigmaNut_;
00097             dimensionedScalar kappa_;
00098             dimensionedScalar Prt_;
00099 
00100             dimensionedScalar Cb1_;
00101             dimensionedScalar Cb2_;
00102             dimensionedScalar Cw1_;
00103             dimensionedScalar Cw2_;
00104             dimensionedScalar Cw3_;
00105             dimensionedScalar Cv1_;
00106             dimensionedScalar Cv2_;
00107 
00108 
00109         // Fields
00110 
00111             volScalarField nuTilda_;
00112             volScalarField mut_;
00113             volScalarField alphat_;
00114 
00115 
00116         //- Wall distance
00117         wallDist d_;
00118 
00119 
00120     // Private member functions
00121 
00122         tmp<volScalarField> chi() const;
00123         tmp<volScalarField> fv1(const volScalarField& chi) const;
00124         tmp<volScalarField> fv2
00125         (
00126             const volScalarField& chi,
00127             const volScalarField& fv1
00128         ) const;
00129         tmp<volScalarField> fv3
00130         (
00131             const volScalarField& chi,
00132             const volScalarField& fv1
00133         ) const;
00134         tmp<volScalarField> fw(const volScalarField& Stilda) const;
00135 
00136 
00137 public:
00138 
00139     //- Runtime type information
00140     TypeName("SpalartAllmaras");
00141 
00142 
00143     // Constructors
00144 
00145         //- Construct from components
00146         SpalartAllmaras
00147         (
00148             const volScalarField& rho,
00149             const volVectorField& U,
00150             const surfaceScalarField& phi,
00151             const basicThermo& thermophysicalModel
00152         );
00153 
00154 
00155     //- Destructor
00156     virtual ~SpalartAllmaras()
00157     {}
00158 
00159 
00160     // Member Functions
00161 
00162         //- Return the effective diffusivity for nuTilda
00163         tmp<volScalarField> DnuTildaEff() const
00164         {
00165             return tmp<volScalarField>
00166             (
00167                 new volScalarField
00168                 (
00169                     "DnuTildaEff",
00170                     rho_*nuTilda_/sigmaNut_ + mu()
00171                 )
00172             );
00173         }
00174 
00175         //- Return the turbulence viscosity
00176         virtual tmp<volScalarField> mut() const
00177         {
00178             return mut_;
00179         }
00180 
00181         //- Return the effective turbulent thermal diffusivity
00182         virtual tmp<volScalarField> alphaEff() const
00183         {
00184             return tmp<volScalarField>
00185             (
00186                 new volScalarField("alphaEff", alphat_ + alpha())
00187             );
00188         }
00189 
00190         //- Return the turbulence kinetic energy
00191         virtual tmp<volScalarField> k() const
00192         {
00193             return tmp<volScalarField>
00194             (
00195                 new volScalarField
00196                 (
00197                     IOobject
00198                     (
00199                         "k",
00200                         runTime_.timeName(),
00201                         mesh_
00202                     ),
00203                     mesh_,
00204                     dimensionedScalar("0", dimensionSet(0, 2, -2, 0, 0), 0)
00205                 )
00206             );
00207         }
00208 
00209         //- Return the turbulence kinetic energy dissipation rate
00210         virtual tmp<volScalarField> epsilon() const
00211         {
00212             return tmp<volScalarField>
00213             (
00214                 new volScalarField
00215                 (
00216                     IOobject
00217                     (
00218                         "epslion",
00219                         runTime_.timeName(),
00220                         mesh_
00221                     ),
00222                     mesh_,
00223                     dimensionedScalar("0", dimensionSet(0, 2, -3, 0, 0), 0)
00224                 )
00225             );
00226         }
00227 
00228         //- Return the Reynolds stress tensor
00229         virtual tmp<volSymmTensorField> R() const;
00230 
00231         //- Return the effective stress tensor including the laminar stress
00232         virtual tmp<volSymmTensorField> devRhoReff() const;
00233 
00234         //- Return the source term for the momentum equation
00235         virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
00236 
00237         //- Solve the turbulence equations and correct the turbulence viscosity
00238         virtual void correct();
00239 
00240         //- Read RASProperties dictionary
00241         virtual bool read();
00242 };
00243 
00244 
00245 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00246 
00247 } // End namespace RASModels
00248 } // End namespace compressible
00249 } // End namespace Foam
00250 
00251 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00252 
00253 #endif
00254 
00255 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd