GenSGSStress.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 "GenSGSStress.H"
00028
00029
00030
00031 namespace Foam
00032 {
00033 namespace incompressible
00034 {
00035 namespace LESModels
00036 {
00037
00038
00039
00040 GenSGSStress::GenSGSStress
00041 (
00042 const volVectorField& U,
00043 const surfaceScalarField& phi,
00044 transportModel& transport
00045 )
00046 :
00047 LESModel(word("GenSGSStress"), U, phi, transport),
00048
00049 ce_
00050 (
00051 dimensioned<scalar>::lookupOrAddToDict
00052 (
00053 "ce",
00054 coeffDict_,
00055 1.048
00056 )
00057 ),
00058
00059 couplingFactor_
00060 (
00061 dimensioned<scalar>::lookupOrAddToDict
00062 (
00063 "couplingFactor",
00064 coeffDict_,
00065 0.0
00066 )
00067 ),
00068
00069 B_
00070 (
00071 IOobject
00072 (
00073 "B",
00074 runTime_.timeName(),
00075 mesh_,
00076 IOobject::MUST_READ,
00077 IOobject::AUTO_WRITE
00078 ),
00079 mesh_
00080 ),
00081
00082 nuSgs_
00083 (
00084 IOobject
00085 (
00086 "nuSgs",
00087 runTime_.timeName(),
00088 mesh_,
00089 IOobject::NO_READ,
00090 IOobject::NO_WRITE
00091 ),
00092 nu(),
00093 B_.boundaryField().types()
00094 )
00095 {
00096 if (couplingFactor_.value() < 0.0 || couplingFactor_.value() > 1.0)
00097 {
00098 FatalErrorIn
00099 (
00100 "GenSGSStress::GenSGSStress"
00101 "(const volVectorField& U, const surfaceScalarField& phi,"
00102 "transportModel& lamTransportModel)"
00103 ) << "couplingFactor = " << couplingFactor_
00104 << " is not in range 0 - 1" << nl
00105 << exit(FatalError);
00106 }
00107 }
00108
00109
00110
00111
00112 tmp<volSymmTensorField> GenSGSStress::devBeff() const
00113 {
00114 return tmp<volSymmTensorField>
00115 (
00116 new volSymmTensorField
00117 (
00118 IOobject
00119 (
00120 "devRhoReff",
00121 runTime_.timeName(),
00122 mesh_,
00123 IOobject::NO_READ,
00124 IOobject::NO_WRITE
00125 ),
00126 B_ - nu()*dev(twoSymm(fvc::grad(U())))
00127 )
00128 );
00129 }
00130
00131
00132 tmp<fvVectorMatrix> GenSGSStress::divDevBeff
00133 (
00134 volVectorField& U
00135 ) const
00136 {
00137 if (couplingFactor_.value() > 0.0)
00138 {
00139 return
00140 (
00141 fvc::div(B_ + couplingFactor_*nuSgs_*fvc::grad(U))
00142 + fvc::laplacian
00143 (
00144 (1.0 - couplingFactor_)*nuSgs_, U, "laplacian(nuEff,U)"
00145 )
00146 - fvm::laplacian(nuEff(), U)
00147 );
00148 }
00149 else
00150 {
00151 return
00152 (
00153 fvc::div(B_)
00154 + fvc::laplacian(nuSgs_, U, "laplacian(nuEff,U)")
00155 - fvm::laplacian(nuEff(), U)
00156 );
00157 }
00158 }
00159
00160
00161 bool GenSGSStress::read()
00162 {
00163 if (LESModel::read())
00164 {
00165 ce_.readIfPresent(coeffDict());
00166
00167 couplingFactor_.readIfPresent(coeffDict());
00168
00169 if (couplingFactor_.value() < 0.0 || couplingFactor_.value() > 1.0)
00170 {
00171 FatalErrorIn("GenSGSStress::read()")
00172 << "couplingFactor = " << couplingFactor_
00173 << " is not in range 0 - 1"
00174 << exit(FatalError);
00175 }
00176
00177 return true;
00178 }
00179 else
00180 {
00181 return false;
00182 }
00183 }
00184
00185
00186
00187
00188 }
00189 }
00190 }
00191
00192
Copyright © 2000-2009 OpenCFD Ltd