Commit 9544280e authored by mattijs's avatar mattijs
Browse files

ENH: Register turbulenceModel with optional name (default is 'turbulenceModel')

Now instead of looking up RASModel we can lookup turbulenceModel instead.
parent 4c3021ba
......@@ -50,10 +50,11 @@ PDRkEpsilon::PDRkEpsilon
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel,
const word& turbulenceModelName
)
:
RASModel(typeName, rho, U, phi, thermophysicalModel),
RASModel(typeName, rho, U, phi, thermophysicalModel, turbulenceModelName),
Cmu_
(
......
......@@ -112,7 +112,8 @@ public:
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel,
const word& turbulenceModelName = turbulenceModel::typeName
);
......
......@@ -60,10 +60,11 @@ DeardorffDiffStress::DeardorffDiffStress
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
const basicThermo& thermoPhysicalModel,
const word& turbulenceModelName
)
:
LESModel(typeName, rho, U, phi, thermoPhysicalModel),
LESModel(typeName, rho, U, phi, thermoPhysicalModel, turbulenceModelName),
GenSGSStress(rho, U, phi, thermoPhysicalModel),
ck_
......
......@@ -101,7 +101,8 @@ public:
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
const basicThermo& thermoPhysicalModel,
const word& turbulenceModelName = turbulenceModel::typeName
);
......
......@@ -41,12 +41,18 @@ GenEddyVisc::GenEddyVisc
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
const basicThermo& thermoPhysicalModel,
const word& turbulenceModelName
)
:
LESModel
(
word("GenEddyVisc"), rho, U, phi, thermoPhysicalModel
word("GenEddyVisc"),
rho,
U,
phi,
thermoPhysicalModel,
turbulenceModelName
),
ce_
......
......@@ -90,7 +90,8 @@ public:
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
const basicThermo& thermoPhysicalModel,
const word& turbulenceModelName = turbulenceModel::typeName
);
......
......@@ -41,7 +41,8 @@ GenSGSStress::GenSGSStress
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
const basicThermo& thermoPhysicalModel,
const word& turbulenceModelName
)
:
LESModel
......@@ -50,7 +51,8 @@ GenSGSStress::GenSGSStress
rho,
U,
phi,
thermoPhysicalModel
thermoPhysicalModel,
turbulenceModelName
),
ce_
......
......@@ -90,7 +90,8 @@ public:
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
const basicThermo& thermoPhysicalModel,
const word& turbulenceModelName = turbulenceModel::typeName
);
......
......@@ -58,10 +58,11 @@ LESModel::LESModel
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
const basicThermo& thermoPhysicalModel,
const word& turbulenceModelName
)
:
turbulenceModel(rho, U, phi, thermoPhysicalModel),
turbulenceModel(rho, U, phi, thermoPhysicalModel, turbulenceModelName),
IOdictionary
(
......@@ -97,7 +98,8 @@ autoPtr<LESModel> LESModel::New
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
const basicThermo& thermoPhysicalModel,
const word& turbulenceModelName
)
{
// get model name, but do not register the dictionary
......@@ -129,9 +131,11 @@ autoPtr<LESModel> LESModel::New
(
"LESModel::New"
"("
"const volScalarField&, "
"const volVectorField&, "
"const surfaceScalarField&, "
"const basicThermo&"
"const basicThermo&, "
"const word&"
")"
) << "Unknown LESModel type "
<< modelType << nl << nl
......@@ -140,7 +144,10 @@ autoPtr<LESModel> LESModel::New
<< exit(FatalError);
}
return autoPtr<LESModel>(cstrIter()(rho, U, phi, thermoPhysicalModel));
return autoPtr<LESModel>
(
cstrIter()(rho, U, phi, thermoPhysicalModel, turbulenceModelName)
);
}
......@@ -160,7 +167,20 @@ void LESModel::correct()
bool LESModel::read()
{
if (regIOobject::read())
// Bit of trickery : we are both IOdictionary ('RASProperties') and
// an regIOobject (from the turbulenceModel). Problem is to distinguish
// between the two - we only want to reread the IOdictionary.
bool ok = IOdictionary::readData
(
IOdictionary::readStream
(
IOdictionary::type()
)
);
IOdictionary::close();
if (ok)
{
if (const dictionary* dictPtr = subDictPtr(type() + "Coeffs"))
{
......
......@@ -121,9 +121,10 @@ public:
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
const basicThermo& thermoPhysicalModel,
const word& turbulenceModelName
),
(rho, U, phi, thermoPhysicalModel)
(rho, U, phi, thermoPhysicalModel, turbulenceModelName)
);
......@@ -136,7 +137,8 @@ public:
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
const basicThermo& thermoPhysicalModel,
const word& turbulenceModelName = turbulenceModel::typeName
);
......@@ -148,7 +150,8 @@ public:
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
const basicThermo& thermoPhysicalModel,
const word& turbulenceModelName = turbulenceModel::typeName
);
......
......@@ -68,10 +68,11 @@ Smagorinsky::Smagorinsky
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
const basicThermo& thermoPhysicalModel,
const word& turbulenceModelName
)
:
LESModel(typeName, rho, U, phi, thermoPhysicalModel),
LESModel(typeName, rho, U, phi, thermoPhysicalModel, turbulenceModelName),
GenEddyVisc(rho, U, phi, thermoPhysicalModel),
ck_
......
......@@ -96,7 +96,8 @@ public:
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
const basicThermo& thermoPhysicalModel,
const word& turbulenceModelName = turbulenceModel::typeName
);
......
......@@ -106,10 +106,11 @@ SpalartAllmaras::SpalartAllmaras
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
const basicThermo& thermoPhysicalModel,
const word& turbulenceModelName
)
:
LESModel(typeName, rho, U, phi, thermoPhysicalModel),
LESModel(typeName, rho, U, phi, thermoPhysicalModel, turbulenceModelName),
sigmaNut_
(
......
......@@ -111,7 +111,8 @@ public:
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
const basicThermo& thermoPhysicalModel,
const word& turbulenceModelName = turbulenceModel::typeName
);
......
......@@ -90,10 +90,11 @@ dynOneEqEddy::dynOneEqEddy
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
const basicThermo& thermoPhysicalModel,
const word& turbulenceModelName
)
:
LESModel(typeName, rho, U, phi, thermoPhysicalModel),
LESModel(typeName, rho, U, phi, thermoPhysicalModel, turbulenceModelName),
GenEddyVisc(rho, U, phi, thermoPhysicalModel),
filterPtr_(LESfilter::New(U.mesh(), coeffDict())),
......
......@@ -107,7 +107,8 @@ public:
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
const basicThermo& thermoPhysicalModel,
const word& turbulenceModelName = turbulenceModel::typeName
);
......
......@@ -63,10 +63,11 @@ lowReOneEqEddy::lowReOneEqEddy
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
const basicThermo& thermoPhysicalModel,
const word& turbulenceModelName
)
:
LESModel(typeName, rho, U, phi, thermoPhysicalModel),
LESModel(typeName, rho, U, phi, thermoPhysicalModel, turbulenceModelName),
GenEddyVisc(rho, U, phi, thermoPhysicalModel),
ck_
......
......@@ -98,7 +98,8 @@ public:
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
const basicThermo& thermoPhysicalModel,
const word& turbulenceModelName = turbulenceModel::typeName
);
......
......@@ -59,10 +59,11 @@ oneEqEddy::oneEqEddy
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
const basicThermo& thermoPhysicalModel,
const word& turbulenceModelName
)
:
LESModel(typeName, rho, U, phi, thermoPhysicalModel),
LESModel(typeName, rho, U, phi, thermoPhysicalModel, turbulenceModelName),
GenEddyVisc(rho, U, phi, thermoPhysicalModel),
ck_
......
......@@ -101,7 +101,8 @@ public:
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
const basicThermo& thermoPhysicalModel,
const word& turbulenceModelName = turbulenceModel::typeName
);
......
......@@ -50,10 +50,11 @@ LRR::LRR
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel,
const word& turbulenceModelName
)
:
RASModel(typeName, rho, U, phi, thermophysicalModel),
RASModel(typeName, rho, U, phi, thermophysicalModel, turbulenceModelName),
Cmu_
(
......
......@@ -116,7 +116,8 @@ public:
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel,
const word& turbulenceModelName = turbulenceModel::typeName
);
......
......@@ -50,10 +50,11 @@ LaunderGibsonRSTM::LaunderGibsonRSTM
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel,
const word& turbulenceModelName
)
:
RASModel(typeName, rho, U, phi, thermophysicalModel),
RASModel(typeName, rho, U, phi, thermophysicalModel, turbulenceModelName),
Cmu_
(
......
......@@ -125,7 +125,8 @@ public:
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel,
const word& turbulenceModelName = turbulenceModel::typeName
);
......
......@@ -65,10 +65,11 @@ LaunderSharmaKE::LaunderSharmaKE
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel,
const word& turbulenceModelName
)
:
RASModel(typeName, rho, U, phi, thermophysicalModel),
RASModel(typeName, rho, U, phi, thermophysicalModel, turbulenceModelName),
Cmu_
(
......
......@@ -109,7 +109,8 @@ public:
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel,
const word& turbulenceModelName = turbulenceModel::typeName
);
......
......@@ -35,12 +35,8 @@ kqRWallFunctions = $(wallFunctions)/kqRWallFunctions
$(kqRWallFunctions)/kqRWallFunction/kqRWallFunctionFvPatchFields.C
/* Patch fields */
derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C
derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
derivedFvPatchFields/turbulentTemperatureCoupledBaffle/turbulentTemperatureCoupledBaffleFvPatchScalarField.C
derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C
derivedFvPatchFields/turbulentTemperatureCoupledBaffle/regionProperties.C
backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C
LIB = $(FOAM_LIBBIN)/libcompressibleRASModels
EXE_INC = \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
......
......@@ -59,10 +59,11 @@ RASModel::RASModel
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel,
const word& turbulenceModelName
)
:
turbulenceModel(rho, U, phi, thermophysicalModel),
turbulenceModel(rho, U, phi, thermophysicalModel, turbulenceModelName),
IOdictionary
(
......@@ -103,7 +104,8 @@ autoPtr<RASModel> RASModel::New
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel,
const word& turbulenceModelName
)
{
// get model name, but do not register the dictionary
......@@ -138,7 +140,8 @@ autoPtr<RASModel> RASModel::New
"const volScalarField&, "
"const volVectorField&, "
"const surfaceScalarField&, "
"basicThermo&"
"basicThermo&, "
"const word&"
")"
) << "Unknown RASModel type "
<< modelType << nl << nl
......@@ -149,7 +152,7 @@ autoPtr<RASModel> RASModel::New
return autoPtr<RASModel>
(
cstrIter()(rho, U, phi, thermophysicalModel)
cstrIter()(rho, U, phi, thermophysicalModel, turbulenceModelName)
);
}
......@@ -212,7 +215,22 @@ void RASModel::correct()
bool RASModel::read()
{
if (regIOobject::read())
//if (regIOobject::read())
// Bit of trickery : we are both IOdictionary ('RASProperties') and
// an regIOobject from the turbulenceModel level. Problem is to distinguish
// between the two - we only want to reread the IOdictionary.
bool ok = IOdictionary::readData
(
IOdictionary::readStream
(
IOdictionary::type()
)
);
IOdictionary::close();
if (ok)
{
lookup("turbulence") >> turbulence_;
......
......@@ -134,9 +134,10 @@ public:
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
const basicThermo& thermoPhysicalModel,
const word& turbulenceModelName
),
(rho, U, phi, thermoPhysicalModel)
(rho, U, phi, thermoPhysicalModel, turbulenceModelName)
);
......@@ -149,7 +150,8 @@ public:
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
const basicThermo& thermoPhysicalModel,
const word& turbulenceModelName = turbulenceModel::typeName
);
......@@ -161,7 +163,8 @@ public:
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermoPhysicalModel
const basicThermo& thermoPhysicalModel,
const word& turbulenceModelName = turbulenceModel::typeName
);
......
......@@ -49,10 +49,11 @@ RNGkEpsilon::RNGkEpsilon
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel,
const word& turbulenceModelName
)
:
RASModel(typeName, rho, U, phi, thermophysicalModel),
RASModel(typeName, rho, U, phi, thermophysicalModel, turbulenceModelName),
Cmu_
(
......
......@@ -105,7 +105,8 @@ public:
const volScalarField& rho,
const volVectorField& U,