ENH: Forces function object - refactored divRhoEff function

This commit is contained in:
andy
2013-05-13 12:10:27 +01:00
parent c08917f196
commit c6d61b0179

View File

@ -28,16 +28,12 @@ License
#include "dictionary.H" #include "dictionary.H"
#include "Time.H" #include "Time.H"
#include "wordReList.H" #include "wordReList.H"
#include "fvcGrad.H"
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
#include "incompressible/RAS/RASModel/RASModel.H"
#include "incompressible/LES/LESModel/LESModel.H"
#include "fluidThermo.H"
#include "compressible/RAS/RASModel/RASModel.H"
#include "compressible/LES/LESModel/LESModel.H"
#include "porosityModel.H" #include "porosityModel.H"
#include "fluidThermo.H"
#include "incompressible/turbulenceModel/turbulenceModel.H"
#include "compressible/turbulenceModel/turbulenceModel.H"
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -70,38 +66,27 @@ void Foam::forces::writeFileHeader(const label i)
Foam::tmp<Foam::volSymmTensorField> Foam::forces::devRhoReff() const Foam::tmp<Foam::volSymmTensorField> Foam::forces::devRhoReff() const
{ {
if (obr_.foundObject<compressible::RASModel>("RASProperties")) typedef compressible::turbulenceModel cmpTurbModel;
{ typedef incompressible::turbulenceModel icoTurbModel;
const compressible::RASModel& ras
= obr_.lookupObject<compressible::RASModel>("RASProperties");
return ras.devRhoReff(); if (obr_.foundObject<cmpTurbModel>(cmpTurbModel::typeName))
}
else if (obr_.foundObject<incompressible::RASModel>("RASProperties"))
{ {
const incompressible::RASModel& ras const cmpTurbModel& turb =
= obr_.lookupObject<incompressible::RASModel>("RASProperties"); obr_.lookupObject<cmpTurbModel>(cmpTurbModel::typeName);
return rho()*ras.devReff(); return turb.devRhoReff();
} }
else if (obr_.foundObject<compressible::LESModel>("LESProperties")) else if (obr_.foundObject<icoTurbModel>(icoTurbModel::typeName))
{ {
const compressible::LESModel& les = const incompressible::turbulenceModel& turb =
obr_.lookupObject<compressible::LESModel>("LESProperties"); obr_.lookupObject<icoTurbModel>(icoTurbModel::typeName);
return les.devRhoReff(); return rho()*turb.devReff();
} }
else if (obr_.foundObject<incompressible::LESModel>("LESProperties")) else if (obr_.foundObject<fluidThermo>(fluidThermo::typeName))
{
const incompressible::LESModel& les
= obr_.lookupObject<incompressible::LESModel>("LESProperties");
return rho()*les.devReff();
}
else if (obr_.foundObject<fluidThermo>("thermophysicalProperties"))
{ {
const fluidThermo& thermo = const fluidThermo& thermo =
obr_.lookupObject<fluidThermo>("thermophysicalProperties"); obr_.lookupObject<fluidThermo>(fluidThermo::typeName);
const volVectorField& U = obr_.lookupObject<volVectorField>(UName_); const volVectorField& U = obr_.lookupObject<volVectorField>(UName_);