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

SpalartAllmarasIDDES.C

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) 2008-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 \*---------------------------------------------------------------------------*/
00026 
00027 #include "SpalartAllmarasIDDES.H"
00028 #include "addToRunTimeSelectionTable.H"
00029 
00030 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00031 
00032 namespace Foam
00033 {
00034 namespace incompressible
00035 {
00036 namespace LESModels
00037 {
00038 
00039 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00040 
00041 defineTypeNameAndDebug(SpalartAllmarasIDDES, 0);
00042 addToRunTimeSelectionTable(LESModel, SpalartAllmarasIDDES, dictionary);
00043 
00044 // * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * * //
00045 
00046 tmp<volScalarField> SpalartAllmarasIDDES::alpha() const
00047 {
00048     return max
00049     (
00050         0.25 - y_/dimensionedScalar("hMax", dimLength, max(cmptMax(delta()))),
00051         scalar(-5)
00052     );
00053 }
00054 
00055 
00056 tmp<volScalarField> SpalartAllmarasIDDES::ft
00057 (
00058     const volScalarField& S
00059 ) const
00060 {
00061     return tanh(pow3(sqr(ct_)*rd(nuSgs_, S)));
00062 }
00063 
00064 
00065 tmp<volScalarField> SpalartAllmarasIDDES::fl
00066 (
00067     const volScalarField& S
00068 ) const
00069 {
00070     return tanh(pow(sqr(cl_)*rd(nu(), S), 10));
00071 }
00072 
00073 
00074 tmp<volScalarField> SpalartAllmarasIDDES::rd
00075 (
00076     const volScalarField& visc,
00077     const volScalarField& S
00078 ) const
00079 {
00080     return min
00081     (
00082         visc
00083        /(
00084            max
00085            (
00086                S,
00087                dimensionedScalar("SMALL", S.dimensions(), SMALL)
00088            )*sqr(kappa_*y_)
00089          + dimensionedScalar
00090            (
00091                "ROOTVSMALL",
00092                dimensionSet(0, 2 , -1, 0, 0),
00093                ROOTVSMALL
00094            )
00095        ),
00096        scalar(10)
00097     );
00098 }
00099 
00100 
00101 // * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
00102 
00103 tmp<volScalarField> SpalartAllmarasIDDES::fd(const volScalarField& S) const
00104 {
00105     return 1 - tanh(pow3(8*rd(nuEff(), S)));
00106 }
00107 
00108 
00109 tmp<volScalarField> SpalartAllmarasIDDES::dTilda(const volScalarField& S) const
00110 {
00111     volScalarField alpha = this->alpha();
00112     volScalarField expTerm = exp(sqr(alpha));
00113 
00114     volScalarField fHill =
00115         2*(pos(alpha)*pow(expTerm, -11.09) + neg(alpha)*pow(expTerm, -9.0));
00116 
00117     volScalarField fStep = min(2*pow(expTerm, -9.0), scalar(1));
00118     volScalarField fHyb = max(1 - fd(S), fStep);
00119     volScalarField fAmp = 1 - max(ft(S), fl(S));
00120     volScalarField fRestore = max(fHill - 1, scalar(0))*fAmp;
00121 
00122     // IGNORING ft2 terms
00123     volScalarField Psi = sqrt
00124     (
00125         min
00126         (
00127             scalar(100),
00128             (1 - Cb1_/(Cw1_*sqr(kappa_)*fwStar_)*fv2())/max(SMALL, fv1())
00129         )
00130     );
00131 
00132     return max
00133     (
00134         dimensionedScalar("SMALL", dimLength, SMALL),
00135         fHyb*(1 + fRestore*Psi)*y_
00136       + (1 - fHyb)*CDES_*Psi*delta()
00137     );
00138 }
00139 
00140 
00141 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00142 
00143 SpalartAllmarasIDDES::SpalartAllmarasIDDES
00144 (
00145     const volVectorField& U,
00146     const surfaceScalarField& phi,
00147     transportModel& transport
00148 )
00149 :
00150     SpalartAllmaras(U, phi, transport, typeName),
00151 
00152     fwStar_
00153     (
00154         dimensioned<scalar>::lookupOrAddToDict
00155         (
00156             "fwStar",
00157             coeffDict_,
00158             0.424
00159         )
00160     ),
00161     cl_
00162     (
00163         dimensioned<scalar>::lookupOrAddToDict
00164         (
00165             "cl",
00166             coeffDict_,
00167             3.55
00168         )
00169     ),
00170     ct_
00171     (
00172         dimensioned<scalar>::lookupOrAddToDict
00173         (
00174             "ct",
00175             coeffDict_,
00176             1.63
00177         )
00178     )
00179 
00180 {}
00181 
00182 
00183 bool SpalartAllmarasIDDES::read()
00184 {
00185     if (SpalartAllmaras::read())
00186     {
00187         fwStar_.readIfPresent(coeffDict());
00188         cl_.readIfPresent(coeffDict());
00189         ct_.readIfPresent(coeffDict());
00190 
00191         return true;
00192     }
00193     else
00194     {
00195         return false;
00196     }
00197 }
00198 
00199 
00200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00201 
00202 } // End namespace LESModels
00203 } // End namespace incompressible
00204 } // End namespace Foam
00205 
00206 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd