00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
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
00040
00041 defineTypeNameAndDebug(SpalartAllmarasIDDES, 0);
00042 addToRunTimeSelectionTable(LESModel, SpalartAllmarasIDDES, dictionary);
00043
00044
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
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
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
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 }
00203 }
00204 }
00205
00206