turbulenceModel.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 "turbulenceModel.H"
00028 #include "volFields.H"
00029 #include "surfaceFields.H"
00030
00031
00032
00033 namespace Foam
00034 {
00035 namespace incompressible
00036 {
00037
00038
00039
00040 defineTypeNameAndDebug(turbulenceModel, 0);
00041 defineRunTimeSelectionTable(turbulenceModel, turbulenceModel);
00042
00043
00044
00045 turbulenceModel::turbulenceModel
00046 (
00047 const volVectorField& U,
00048 const surfaceScalarField& phi,
00049 transportModel& lamTransportModel
00050 )
00051 :
00052 runTime_(U.time()),
00053 mesh_(U.mesh()),
00054
00055 U_(U),
00056 phi_(phi),
00057 transportModel_(lamTransportModel)
00058 {}
00059
00060
00061
00062
00063 autoPtr<turbulenceModel> turbulenceModel::New
00064 (
00065 const volVectorField& U,
00066 const surfaceScalarField& phi,
00067 transportModel& transport
00068 )
00069 {
00070 word modelName;
00071
00072
00073
00074
00075 {
00076 IOdictionary dict
00077 (
00078 IOobject
00079 (
00080 "turbulenceProperties",
00081 U.time().constant(),
00082 U.db(),
00083 IOobject::MUST_READ,
00084 IOobject::NO_WRITE
00085 )
00086 );
00087
00088 dict.lookup("simulationType") >> modelName;
00089 }
00090
00091 Info<< "Selecting turbulence model type " << modelName << endl;
00092
00093 turbulenceModelConstructorTable::iterator cstrIter =
00094 turbulenceModelConstructorTablePtr_->find(modelName);
00095
00096 if (cstrIter == turbulenceModelConstructorTablePtr_->end())
00097 {
00098 FatalErrorIn
00099 (
00100 "turbulenceModel::New(const volVectorField&, "
00101 "const surfaceScalarField&, transportModel&)"
00102 ) << "Unknown turbulenceModel type " << modelName
00103 << endl << endl
00104 << "Valid turbulenceModel types are :" << endl
00105 << turbulenceModelConstructorTablePtr_->toc()
00106 << exit(FatalError);
00107 }
00108
00109 return autoPtr<turbulenceModel>(cstrIter()(U, phi, transport));
00110 }
00111
00112
00113
00114
00115 void turbulenceModel::correct()
00116 {
00117 transportModel_.correct();
00118 }
00119
00120
00121
00122
00123 }
00124 }
00125
00126
Copyright © 2000-2009 OpenCFD Ltd