OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen 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-2007 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     SpalartAllmaras
00027 
00028 Description
00029     Spalart-Allmaras 1-eqn mixing-length model for external flows.
00030 
00031     "A One-Equation Turbulence Model for Aerodynamic Flows"
00032     P.R. Spalart,
00033     S.R. Allmaras
00034     Boeing Commercial Airplane Group
00035     P.O. Box 3707, MS 7H-96
00036     Seattle, WA 98124-2207
00037     USA.
00038 
00039 SourceFiles
00040     SpalartAllmaras.C
00041     SpalartAllmarasCorrect.C
00042 
00043 \*---------------------------------------------------------------------------*/
00044 
00045 #ifndef compressibleSpalartAllmaras_H
00046 #define combressibleSpalartAllmaras_H
00047 
00048 #include "turbulenceModel.H"
00049 #include "wallDist.H"
00050 
00051 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00052 
00053 namespace Foam
00054 {
00055 namespace compressible
00056 {
00057 namespace turbulenceModels
00058 {
00059 
00060 /*---------------------------------------------------------------------------*\
00061                            Class SpalartAllmaras Declaration
00062 \*---------------------------------------------------------------------------*/
00063 
00064 class SpalartAllmaras
00065 :
00066     public turbulenceModel
00067 {
00068     // Private data
00069 
00070         dimensionedScalar alphaNut;
00071         dimensionedScalar alphah;
00072 
00073         dimensionedScalar Cb1;
00074         dimensionedScalar Cb2;
00075         dimensionedScalar Cw1;
00076         dimensionedScalar Cw2;
00077         dimensionedScalar Cw3;
00078         dimensionedScalar Cv1;
00079         dimensionedScalar Cv2;
00080 
00081         volScalarField nuTilda_;
00082         volScalarField mut_;
00083 
00084         wallDist d_;
00085 
00086 
00087     // Private member functions
00088 
00089         tmp<volScalarField> chi() const;
00090         tmp<volScalarField> fv1(const volScalarField& chi) const;
00091         tmp<volScalarField> fv2
00092         (
00093             const volScalarField& chi,
00094             const volScalarField& fv1
00095         ) const;
00096         tmp<volScalarField> fv3
00097         (
00098             const volScalarField& chi,
00099             const volScalarField& fv1
00100         ) const;
00101         tmp<volScalarField> fw(const volScalarField& Stilda) const;
00102 
00103 
00104 public:
00105 
00106     //- Runtime type information
00107     TypeName("SpalartAllmaras");
00108 
00109 
00110     // Constructors
00111 
00112         //- from components
00113         SpalartAllmaras
00114         (
00115             const volScalarField& rho,
00116             const volVectorField& U,
00117             const surfaceScalarField& phi,
00118             basicThermo& thermophysicalModel
00119         );
00120 
00121 
00122     // Destructor
00123 
00124         ~SpalartAllmaras()
00125         {}
00126 
00127 
00128     // Member Functions
00129 
00130         tmp<volScalarField> mut() const
00131         {
00132             return mut_;
00133         }
00134 
00135         //- Return the effective diffusivity for nuTilda
00136         tmp<volScalarField> DnuTildaEff() const
00137         {
00138             return tmp<volScalarField> 
00139             (
00140                 new volScalarField("DnuTildaEff", alphaNut*rho_*nuTilda_ + mu())
00141             );
00142         }
00143           //- Return the effective turbulent thermal diffusivity
00144         tmp<volScalarField> alphaEff() const
00145         {
00146             return tmp<volScalarField>
00147             (
00148                 new volScalarField("alphaEff", alphah*mut_ + alpha())
00149             );
00150         }
00151 
00152         tmp<volScalarField> k() const
00153         {
00154             return tmp<volScalarField> 
00155             (
00156                 new volScalarField
00157                 (
00158                     IOobject
00159                     (
00160                         "k",
00161                         runTime_.timeName(),
00162                         mesh_
00163                     ),
00164                     mesh_,
00165                     dimensionedScalar("0", dimensionSet(0, 2, -2, 0, 0), 0)
00166                 )
00167             );
00168         }
00169 
00170         tmp<volScalarField> epsilon() const
00171         {
00172             return tmp<volScalarField> 
00173             (
00174                 new volScalarField
00175                 (
00176                     IOobject
00177                     (
00178                         "epslion",
00179                         runTime_.timeName(),
00180                         mesh_
00181                     ),
00182                     mesh_,
00183                     dimensionedScalar("0", dimensionSet(0, 2, -3, 0, 0), 0)
00184                 )
00185             );
00186         }
00187 
00188         tmp<volSymmTensorField> R() const;
00189 
00190         tmp<fvVectorMatrix> divRhoR(volVectorField& U) const;
00191 
00192         void correct();
00193 
00194         //- Read turbulenceProperties dictionary
00195         bool read();
00196 
00197           //- Ensures the turbulent viscosities are not written.
00198           void enforceNoWrite();
00199 };
00200 
00201 
00202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00203 
00204 } // End namespace turbulenceModels
00205 } // End namespace compressible
00206 } // End namespace Foam
00207 
00208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00209 
00210 #endif
00211 
00212 // ************************************************************************* //
Copyright © 2000-2007 OpenCFD Ltd