DeardorffDiffStress.C
Go to the documentation of this file.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 "DeardorffDiffStress.H"
00028 #include "addToRunTimeSelectionTable.H"
00029
00030
00031
00032 namespace Foam
00033 {
00034 namespace compressible
00035 {
00036 namespace LESModels
00037 {
00038
00039
00040
00041 defineTypeNameAndDebug(DeardorffDiffStress, 0);
00042 addToRunTimeSelectionTable(LESModel, DeardorffDiffStress, dictionary);
00043
00044
00045
00046
00047 void DeardorffDiffStress::updateSubGridScaleFields(const volScalarField& K)
00048 {
00049 muSgs_ = ck_*rho()*sqrt(K)*delta();
00050 muSgs_.correctBoundaryConditions();
00051
00052 alphaSgs_ = muSgs_/Prt_;
00053 alphaSgs_.correctBoundaryConditions();
00054 }
00055
00056
00057
00058
00059 DeardorffDiffStress::DeardorffDiffStress
00060 (
00061 const volScalarField& rho,
00062 const volVectorField& U,
00063 const surfaceScalarField& phi,
00064 const basicThermo& thermoPhysicalModel
00065 )
00066 :
00067 LESModel(typeName, rho, U, phi, thermoPhysicalModel),
00068 GenSGSStress(rho, U, phi, thermoPhysicalModel),
00069
00070 ck_
00071 (
00072 dimensioned<scalar>::lookupOrAddToDict
00073 (
00074 "ck",
00075 coeffDict_,
00076 0.094
00077 )
00078 ),
00079 cm_
00080 (
00081 dimensioned<scalar>::lookupOrAddToDict
00082 (
00083 "cm",
00084 coeffDict_,
00085 4.13
00086 )
00087 )
00088 {
00089 updateSubGridScaleFields(0.5*tr(B_));
00090
00091 printCoeffs();
00092 }
00093
00094
00095
00096
00097 void DeardorffDiffStress::correct(const tmp<volTensorField>& tgradU)
00098 {
00099 const volTensorField& gradU = tgradU();
00100
00101 GenSGSStress::correct(gradU);
00102
00103 volSymmTensorField D = symm(gradU);
00104
00105 volSymmTensorField P = -rho()*twoSymm(B_ & gradU);
00106
00107 volScalarField K = 0.5*tr(B_);
00108
00109 solve
00110 (
00111 fvm::ddt(rho(), B_)
00112 + fvm::div(phi(), B_)
00113 - fvm::laplacian(DBEff(), B_)
00114 + fvm::Sp(cm_*rho()*sqrt(K)/delta(), B_)
00115 ==
00116 P
00117 + 0.8*rho()*K*D
00118 - (2*ce_ - 0.667*cm_)*I*rho()*epsilon()
00119 );
00120
00121
00122
00123
00124 forAll(B_, celli)
00125 {
00126 B_[celli].component(symmTensor::XX) =
00127 max(B_[celli].component(symmTensor::XX), 1.0e-10);
00128 B_[celli].component(symmTensor::YY) =
00129 max(B_[celli].component(symmTensor::YY), 1.0e-10);
00130 B_[celli].component(symmTensor::ZZ) =
00131 max(B_[celli].component(symmTensor::ZZ), 1.0e-10);
00132 }
00133
00134 K = 0.5*tr(B_);
00135 bound(K, k0());
00136
00137 updateSubGridScaleFields(K);
00138 }
00139
00140
00141 bool DeardorffDiffStress::read()
00142 {
00143 if (GenSGSStress::read())
00144 {
00145 ck_.readIfPresent(coeffDict());
00146 cm_.readIfPresent(coeffDict());
00147
00148 return true;
00149 }
00150 else
00151 {
00152 return false;
00153 }
00154 }
00155
00156
00157
00158
00159 }
00160 }
00161 }
00162
00163
Copyright © 2000-2009 OpenCFD Ltd