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::LESModels::SpalartAllmaras
00027 
00028 Description
00029     SpalartAllmaras for compressible flows
00030 
00031 SourceFiles
00032     SpalartAllmaras.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef compressibleSpalartAllmaras_H
00037 #define compressibleSpalartAllmaras_H
00038 
00039 #include "LESModel.H"
00040 #include "volFields.H"
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 namespace compressible
00047 {
00048 namespace LESModels
00049 {
00050 
00051 /*---------------------------------------------------------------------------*\
00052                        Class SpalartAllmaras Declaration
00053 \*---------------------------------------------------------------------------*/
00054 
00055 class SpalartAllmaras
00056 :
00057     public LESModel
00058 {
00059     // Private data
00060 
00061         // Model coefficients
00062 
00063             dimensionedScalar sigmaNut_;
00064             dimensionedScalar Prt_;
00065 
00066             dimensionedScalar Cb1_;
00067             dimensionedScalar Cb2_;
00068             dimensionedScalar Cv1_;
00069             dimensionedScalar Cv2_;
00070             dimensionedScalar CDES_;
00071             dimensionedScalar ck_;
00072             dimensionedScalar kappa_;
00073             dimensionedScalar Cw1_;
00074             dimensionedScalar Cw2_;
00075             dimensionedScalar Cw3_;
00076 
00077 
00078     // Fields
00079 
00080         volScalarField nuTilda_;
00081         volScalarField dTilda_;
00082         volScalarField muSgs_;
00083         volScalarField alphaSgs_;
00084 
00085 
00086     // Private member functions
00087 
00088         //- Update sub-grid scale fields
00089         void updateSubGridScaleFields();
00090 
00091         tmp<volScalarField> fv1() const;
00092         tmp<volScalarField> fv2() const;
00093         tmp<volScalarField> fv3() const;
00094         tmp<volScalarField> fw(const volScalarField& Stilda) const;
00095 
00096         // Disallow default bitwise copy construct and assignment
00097         SpalartAllmaras(const SpalartAllmaras&);
00098         SpalartAllmaras& operator=(const SpalartAllmaras&);
00099 
00100 
00101 public:
00102 
00103     //- Runtime type information
00104     TypeName("SpalartAllmaras");
00105 
00106 
00107     // Constructors
00108 
00109         //- Constructor from components
00110         SpalartAllmaras
00111         (
00112             const volScalarField& rho,
00113             const volVectorField& U,
00114             const surfaceScalarField& phi,
00115             const basicThermo& thermoPhysicalModel
00116         );
00117 
00118 
00119     //- Destructor
00120     virtual ~SpalartAllmaras()
00121     {}
00122 
00123 
00124     // Member Functions
00125 
00126         tmp<volScalarField> nuTilda() const
00127         {
00128             return nuTilda_;
00129         }
00130 
00131         //- Return SGS kinetic energy
00132         virtual tmp<volScalarField> k() const
00133         {
00134             return sqr(muSgs()/rho()/ck_/dTilda_);
00135         }
00136 
00137         //- Return sub-grid disipation rate
00138         virtual tmp<volScalarField> epsilon() const;
00139 
00140         //- Return SGS viscosity
00141         virtual tmp<volScalarField> muSgs() const
00142         {
00143             return muSgs_;
00144         }
00145 
00146         //- Return SGS thermal diffusivity
00147         virtual tmp<volScalarField> alphaSgs() const
00148         {
00149             return alphaSgs_;
00150         }
00151 
00152         //- Return thermal conductivity
00153         virtual tmp<volScalarField> alphaEff() const
00154         {
00155             return tmp<volScalarField>
00156             (
00157                 new volScalarField("alphaEff", alphaSgs_ + alpha())
00158             );
00159         }
00160 
00161         //- Return the sub-grid stress tensor.
00162         virtual tmp<volSymmTensorField> B() const;
00163 
00164         //- Return the deviatoric part of the effective sub-grid
00165         //  turbulence stress tensor including the laminar stress
00166         virtual tmp<volSymmTensorField> devRhoBeff() const;
00167 
00168         //- Returns div(rho*dev(B)).
00169         // This is the additional term due to the filtering of the NSE.
00170         virtual tmp<fvVectorMatrix> divDevRhoBeff(volVectorField& U) const;
00171 
00172         //- Correct nuTilda and related properties
00173         virtual void correct(const tmp<volTensorField>& gradU);
00174 
00175         //- Read LESProperties dictionary
00176         virtual bool read();
00177 };
00178 
00179 
00180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00181 
00182 } // End namespace LESModels
00183 } // End namespace compressible
00184 } // End namespace Foam
00185 
00186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00187 
00188 #endif
00189 
00190 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd