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
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef turbulenceModel_H
00038 #define turbulenceModel_H
00039
00040 #include "volFields.H"
00041 #include "surfaceFields.H"
00042 #include "nearWallDist.H"
00043 #include "fvm.H"
00044 #include "fvc.H"
00045 #include "fvMatrices.H"
00046 #include "incompressible/transportModel/transportModel.H"
00047 #include "IOdictionary.H"
00048 #include "Switch.H"
00049 #include "bound.H"
00050 #include "autoPtr.H"
00051 #include "runTimeSelectionTables.H"
00052
00053
00054
00055 namespace Foam
00056 {
00057
00058
00059
00060
00061
00062 class turbulenceModel
00063 :
00064 public IOdictionary
00065 {
00066
00067 protected:
00068
00069
00070
00071 const Time& runTime_;
00072 const fvMesh& mesh_;
00073
00074 const volVectorField& U_;
00075 const surfaceScalarField& phi_;
00076
00077 transportModel& transportModel_;
00078
00079 Switch turbulence_;
00080 dictionary turbulenceModelCoeffs_;
00081
00082 scalar kappa_;
00083 scalar E_;
00084
00085 scalar yPlusLam(const scalar kappa, const scalar E);
00086 scalar yPlusLam_;
00087
00088 dimensionedScalar k0_;
00089 dimensionedScalar epsilon0_;
00090 dimensionedScalar epsilonSmall_;
00091
00092 nearWallDist y_;
00093
00094
00095 private:
00096
00097
00098
00099
00100 turbulenceModel(const turbulenceModel&);
00101
00102
00103 void operator=(const turbulenceModel&);
00104
00105
00106 public:
00107
00108
00109 TypeName("turbulenceModel");
00110
00111
00112
00113
00114 declareRunTimeSelectionTable
00115 (
00116 autoPtr,
00117 turbulenceModel,
00118 dictionary,
00119 (
00120 const volVectorField& U,
00121 const surfaceScalarField& phi,
00122 transportModel& transport
00123 ),
00124 (U, phi, transport)
00125 );
00126
00127
00128
00129
00130
00131 turbulenceModel
00132 (
00133 const word& type,
00134 const volVectorField& U,
00135 const surfaceScalarField& phi,
00136 transportModel& transport
00137 );
00138
00139
00140
00141
00142
00143 static autoPtr<turbulenceModel> New
00144 (
00145 const volVectorField& U,
00146 const surfaceScalarField& phi,
00147 transportModel& transport
00148 );
00149
00150
00151
00152
00153 virtual ~turbulenceModel();
00154
00155
00156
00157
00158
00159
00160
00161 const dimensionedScalar& k0() const
00162 {
00163 return k0_;
00164 }
00165
00166
00167
00168 const dimensionedScalar& epsilon0() const
00169 {
00170 return epsilon0_;
00171 }
00172
00173
00174
00175 const dimensionedScalar& epsilonSmall() const
00176 {
00177 return epsilonSmall_;
00178 }
00179
00180
00181
00182 dimensionedScalar& k0()
00183 {
00184 return k0_;
00185 }
00186
00187
00188 dimensionedScalar& epsilon0()
00189 {
00190 return epsilon0_;
00191 }
00192
00193
00194 dimensionedScalar& epsilonSmall()
00195 {
00196 return epsilonSmall_;
00197 }
00198
00199
00200
00201 scalar kappa() const
00202 {
00203 return kappa_;
00204 }
00205
00206
00207 scalar E() const
00208 {
00209 return E_;
00210 }
00211
00212
00213
00214 scalar yPlusLam() const
00215 {
00216 return yPlusLam_;
00217 }
00218
00219
00220
00221 const volScalarField& nu() const
00222 {
00223 return transportModel_.nu();
00224 }
00225
00226
00227 virtual tmp<volScalarField> nut() const = 0;
00228
00229
00230 virtual tmp<volScalarField> nuEff() const
00231 {
00232 return tmp<volScalarField>
00233 (
00234 new volScalarField("nuEff", nut() + nu())
00235 );
00236 }
00237
00238
00239 virtual tmp<volScalarField> k() const = 0;
00240
00241
00242 virtual tmp<volScalarField> epsilon() const = 0;
00243
00244
00245 virtual tmp<volTensorField> R() const = 0;
00246
00247
00248 virtual tmp<fvVectorMatrix> divR(volVectorField& U) const = 0;
00249
00250
00251 virtual tmp<scalarField> yPlus(const label patchI) const;
00252
00253
00254 virtual void correct() = 0;
00255
00256
00257 virtual bool read() = 0;
00258 };
00259
00260
00261
00262
00263 }
00264
00265
00266
00267 #endif
00268
00269