vanDriestDelta.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 "vanDriestDelta.H"
00028 #include "LESModel.H"
00029 #include "wallFvPatch.H"
00030 #include "wallDistData.H"
00031 #include "wallPointYPlus.H"
00032 #include "addToRunTimeSelectionTable.H"
00033
00034
00035
00036 namespace Foam
00037 {
00038 namespace compressible
00039 {
00040 namespace LESModels
00041 {
00042
00043
00044
00045 defineTypeNameAndDebug(vanDriestDelta, 0);
00046 addToRunTimeSelectionTable(LESdelta, vanDriestDelta, dictionary);
00047
00048
00049
00050 void vanDriestDelta::calcDelta()
00051 {
00052 const LESModel& lesModel = mesh_.lookupObject<LESModel>("LESProperties");
00053
00054 const volVectorField& U = lesModel.U();
00055 const volScalarField& rho = lesModel.rho();
00056 const volScalarField& mu = lesModel.mu();
00057 tmp<volScalarField> muSgs = lesModel.muSgs();
00058
00059 volScalarField ystar
00060 (
00061 IOobject
00062 (
00063 "ystar",
00064 mesh_.time().constant(),
00065 mesh_
00066 ),
00067 mesh_,
00068 dimensionedScalar("ystar", dimLength, GREAT)
00069 );
00070
00071 const fvPatchList& patches = mesh_.boundary();
00072 forAll(patches, patchi)
00073 {
00074 if (isType<wallFvPatch>(patches[patchi]))
00075 {
00076 const fvPatchVectorField& Uw = U.boundaryField()[patchi];
00077 const scalarField& rhow = rho.boundaryField()[patchi];
00078 const scalarField& muw = mu.boundaryField()[patchi];
00079 const scalarField& muSgsw = muSgs().boundaryField()[patchi];
00080
00081 ystar.boundaryField()[patchi] =
00082 muw/(rhow*sqrt((muw + muSgsw)*mag(Uw.snGrad())/rhow + VSMALL));
00083 }
00084 }
00085
00086 wallPointYPlus::yPlusCutOff = 500;
00087 wallDistData<wallPointYPlus> y(mesh_, ystar);
00088
00089 delta_ = min
00090 (
00091 static_cast<const volScalarField&>(geometricDelta_()),
00092 (kappa_/Cdelta_)*((scalar(1) + SMALL) - exp(-y/ystar/Aplus_))*y
00093 );
00094 }
00095
00096
00097
00098
00099 vanDriestDelta::vanDriestDelta
00100 (
00101 const word& name,
00102 const fvMesh& mesh,
00103 const dictionary& dd
00104 )
00105 :
00106 LESdelta(name, mesh),
00107 geometricDelta_
00108 (
00109 LESdelta::New("geometricDelta", mesh, dd.subDict(type() + "Coeffs"))
00110 ),
00111 kappa_(dd.lookupOrDefault<scalar>("kappa", 0.41)),
00112 Aplus_
00113 (
00114 dd.subDict(type() + "Coeffs").lookupOrDefault<scalar>("Aplus", 26.0)
00115 ),
00116 Cdelta_
00117 (
00118 dd.subDict(type() + "Coeffs").lookupOrDefault<scalar>("Cdelta", 0.158)
00119 ),
00120 calcInterval_
00121 (
00122 dd.subDict(type() + "Coeffs").lookupOrDefault<label>("calcInterval", 1)
00123 )
00124 {
00125 delta_ = geometricDelta_();
00126 }
00127
00128
00129
00130
00131 void vanDriestDelta::read(const dictionary& d)
00132 {
00133 const dictionary& dd(d.subDict(type() + "Coeffs"));
00134
00135 geometricDelta_().read(dd);
00136 d.readIfPresent<scalar>("kappa", kappa_);
00137 dd.readIfPresent<scalar>("Aplus", Aplus_);
00138 dd.readIfPresent<scalar>("Cdelta", Cdelta_);
00139 dd.readIfPresent<label>("calcInterval", calcInterval_);
00140 calcDelta();
00141 }
00142
00143
00144 void vanDriestDelta::correct()
00145 {
00146 if (mesh().time().timeIndex() % calcInterval_ == 0)
00147 {
00148 geometricDelta_().correct();
00149 calcDelta();
00150 }
00151 }
00152
00153
00154
00155
00156 }
00157 }
00158 }
00159
00160
Copyright © 2000-2009 OpenCFD Ltd