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 incompressible
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& nu = lesModel.nu();
00056 tmp<volScalarField> nuSgs = lesModel.nuSgs();
00057
00058 volScalarField ystar
00059 (
00060 IOobject
00061 (
00062 "ystar",
00063 mesh_.time().constant(),
00064 mesh_
00065 ),
00066 mesh_,
00067 dimensionedScalar("ystar", dimLength, GREAT)
00068 );
00069
00070 const fvPatchList& patches = mesh_.boundary();
00071 forAll(patches, patchi)
00072 {
00073 if (isType<wallFvPatch>(patches[patchi]))
00074 {
00075 const fvPatchVectorField& Uw = U.boundaryField()[patchi];
00076 const scalarField& nuw = nu.boundaryField()[patchi];
00077 const scalarField& nuSgsw = nuSgs().boundaryField()[patchi];
00078
00079 ystar.boundaryField()[patchi] =
00080 nuw/sqrt((nuw + nuSgsw)*mag(Uw.snGrad()) + VSMALL);
00081 }
00082 }
00083
00084 wallPointYPlus::yPlusCutOff = 500;
00085 wallDistData<wallPointYPlus> y(mesh_, ystar);
00086
00087 delta_ = min
00088 (
00089 static_cast<const volScalarField&>(geometricDelta_()),
00090 (kappa_/Cdelta_)*((scalar(1) + SMALL) - exp(-y/ystar/Aplus_))*y
00091 );
00092 }
00093
00094
00095
00096
00097 vanDriestDelta::vanDriestDelta
00098 (
00099 const word& name,
00100 const fvMesh& mesh,
00101 const dictionary& dd
00102 )
00103 :
00104 LESdelta(name, mesh),
00105 geometricDelta_
00106 (
00107 LESdelta::New("geometricDelta", mesh, dd.subDict(type() + "Coeffs"))
00108 ),
00109 kappa_(dd.lookupOrDefault<scalar>("kappa", 0.41)),
00110 Aplus_
00111 (
00112 dd.subDict(type() + "Coeffs").lookupOrDefault<scalar>("Aplus", 26.0)
00113 ),
00114 Cdelta_
00115 (
00116 dd.subDict(type() + "Coeffs").lookupOrDefault<scalar>("Cdelta", 0.158)
00117 ),
00118 calcInterval_
00119 (
00120 dd.subDict(type() + "Coeffs").lookupOrDefault<label>("calcInterval", 1)
00121 )
00122 {
00123 delta_ = geometricDelta_();
00124 }
00125
00126
00127
00128
00129 void vanDriestDelta::read(const dictionary& d)
00130 {
00131 const dictionary& dd(d.subDict(type() + "Coeffs"));
00132
00133 geometricDelta_().read(dd);
00134 d.readIfPresent<scalar>("kappa", kappa_);
00135 dd.readIfPresent<scalar>("Aplus", Aplus_);
00136 dd.readIfPresent<scalar>("Cdelta", Cdelta_);
00137 dd.readIfPresent<label>("calcInterval", calcInterval_);
00138 calcDelta();
00139 }
00140
00141
00142 void vanDriestDelta::correct()
00143 {
00144 if (mesh().time().timeIndex() % calcInterval_ == 0)
00145 {
00146 geometricDelta_().correct();
00147 calcDelta();
00148 }
00149 }
00150
00151
00152
00153
00154 }
00155 }
00156 }
00157
00158
Copyright © 2000-2009 OpenCFD Ltd