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