FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::compressible::RASModels::SpalartAllmaras
00026 
00027 Description
00028     Spalart-Allmaras one-eqn mixing-length model for compressible
00029     external flows.
00030 
00031     Reference:
00032     @verbatim
00033         "A One-Equation Turbulence Model for Aerodynamic Flows"
00034         P.R. Spalart,
00035         S.R. Allmaras,
00036         La Recherche Aerospatiale, No. 1, 1994, pp. 5--21.
00037 
00038         Extended according to:
00039 
00040         "An Unstructured Grid Generation and Adaptive Solution Technique
00041         for High Reynolds Number Compressible Flows"
00042         G.A. Ashford,
00043         Ph.D. thesis, University of Michigan, 1996.
00044     @endverbatim
00045 
00046     The default model coefficients correspond to the following:
00047     @verbatim
00048         SpalartAllmarasCoeffs
00049         {
00050             Cb1         0.1355;
00051             Cb2         0.622;
00052             Cw2         0.3;
00053             Cw3         2.0;
00054             Cv1         7.1;
00055             Cv2         5.0;
00056             sigmaNut    0.66666;
00057             Prt         1.0;    // only for compressible
00058             kappa       0.41;
00059         }
00060     @endverbatim
00061 
00062 SourceFiles
00063     SpalartAllmaras.C
00064     SpalartAllmarasCorrect.C
00065 
00066 \*---------------------------------------------------------------------------*/
00067 
00068 #ifndef compressibleSpalartAllmaras_H
00069 #define combressibleSpalartAllmaras_H
00070 
00071 #include <compressibleRASModels/RASModel.H>
00072 #include <finiteVolume/wallDist.H>
00073 
00074 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00075 
00076 namespace Foam
00077 {
00078 namespace compressible
00079 {
00080 namespace RASModels
00081 {
00082 
00083 /*---------------------------------------------------------------------------*\
00084                       Class SpalartAllmaras Declaration
00085 \*---------------------------------------------------------------------------*/
00086 
00087 class SpalartAllmaras
00088 :
00089     public RASModel
00090 {
00091     // Private data
00092 
00093         // Model coefficients
00094 
00095             dimensionedScalar sigmaNut_;
00096             dimensionedScalar kappa_;
00097             dimensionedScalar Prt_;
00098 
00099             dimensionedScalar Cb1_;
00100             dimensionedScalar Cb2_;
00101             dimensionedScalar Cw1_;
00102             dimensionedScalar Cw2_;
00103             dimensionedScalar Cw3_;
00104             dimensionedScalar Cv1_;
00105             dimensionedScalar Cv2_;
00106 
00107 
00108         // Fields
00109 
00110             volScalarField nuTilda_;
00111             volScalarField mut_;
00112             volScalarField alphat_;
00113 
00114 
00115         //- Wall distance
00116         wallDist d_;
00117 
00118 
00119     // Private member functions
00120 
00121         tmp<volScalarField> chi() const;
00122         tmp<volScalarField> fv1(const volScalarField& chi) const;
00123         tmp<volScalarField> fv2
00124         (
00125             const volScalarField& chi,
00126             const volScalarField& fv1
00127         ) const;
00128         tmp<volScalarField> fv3
00129         (
00130             const volScalarField& chi,
00131             const volScalarField& fv1
00132         ) const;
00133         tmp<volScalarField> fw(const volScalarField& Stilda) const;
00134 
00135 
00136 public:
00137 
00138     //- Runtime type information
00139     TypeName("SpalartAllmaras");
00140 
00141 
00142     // Constructors
00143 
00144         //- Construct from components
00145         SpalartAllmaras
00146         (
00147             const volScalarField& rho,
00148             const volVectorField& U,
00149             const surfaceScalarField& phi,
00150             const basicThermo& thermophysicalModel
00151         );
00152 
00153 
00154     //- Destructor
00155     virtual ~SpalartAllmaras()
00156     {}
00157 
00158 
00159     // Member Functions
00160 
00161         //- Return the effective diffusivity for nuTilda
00162         tmp<volScalarField> DnuTildaEff() const
00163         {
00164             return tmp<volScalarField>
00165             (
00166                 new volScalarField
00167                 (
00168                     "DnuTildaEff",
00169                     rho_*nuTilda_/sigmaNut_ + mu()
00170                 )
00171             );
00172         }
00173 
00174         //- Return the turbulence viscosity
00175         virtual tmp<volScalarField> mut() const
00176         {
00177             return mut_;
00178         }
00179 
00180         //- Return the effective turbulent thermal diffusivity
00181         virtual tmp<volScalarField> alphaEff() const
00182         {
00183             return tmp<volScalarField>
00184             (
00185                 new volScalarField("alphaEff", alphat_ + alpha())
00186             );
00187         }
00188 
00189         //- Return the turbulence kinetic energy
00190         virtual tmp<volScalarField> k() const
00191         {
00192             return tmp<volScalarField>
00193             (
00194                 new volScalarField
00195                 (
00196                     IOobject
00197                     (
00198                         "k",
00199                         runTime_.timeName(),
00200                         mesh_
00201                     ),
00202                     mesh_,
00203                     dimensionedScalar("0", dimensionSet(0, 2, -2, 0, 0), 0)
00204                 )
00205             );
00206         }
00207 
00208         //- Return the turbulence kinetic energy dissipation rate
00209         virtual tmp<volScalarField> epsilon() const
00210         {
00211             return tmp<volScalarField>
00212             (
00213                 new volScalarField
00214                 (
00215                     IOobject
00216                     (
00217                         "epslion",
00218                         runTime_.timeName(),
00219                         mesh_
00220                     ),
00221                     mesh_,
00222                     dimensionedScalar("0", dimensionSet(0, 2, -3, 0, 0), 0)
00223                 )
00224             );
00225         }
00226 
00227         //- Return the Reynolds stress tensor
00228         virtual tmp<volSymmTensorField> R() const;
00229 
00230         //- Return the effective stress tensor including the laminar stress
00231         virtual tmp<volSymmTensorField> devRhoReff() const;
00232 
00233         //- Return the source term for the momentum equation
00234         virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
00235 
00236         //- Solve the turbulence equations and correct the turbulence viscosity
00237         virtual void correct();
00238 
00239         //- Read RASProperties dictionary
00240         virtual bool read();
00241 };
00242 
00243 
00244 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00245 
00246 } // End namespace RASModels
00247 } // End namespace compressible
00248 } // End namespace Foam
00249 
00250 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00251 
00252 #endif
00253 
00254 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines