From c6d61b01799bd5672227eb28b2cea39d8d302b04 Mon Sep 17 00:00:00 2001 From: andy <andy> Date: Mon, 13 May 2013 12:10:27 +0100 Subject: [PATCH] ENH: Forces function object - refactored divRhoEff function --- .../functionObjects/forces/forces/forces.C | 49 +++++++------------ 1 file changed, 17 insertions(+), 32 deletions(-) diff --git a/src/postProcessing/functionObjects/forces/forces/forces.C b/src/postProcessing/functionObjects/forces/forces/forces.C index c159b652e83..dd164d99a42 100644 --- a/src/postProcessing/functionObjects/forces/forces/forces.C +++ b/src/postProcessing/functionObjects/forces/forces/forces.C @@ -28,16 +28,12 @@ License #include "dictionary.H" #include "Time.H" #include "wordReList.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 "fvcGrad.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 * * * * * * * * * * * * * // @@ -70,38 +66,27 @@ void Foam::forces::writeFileHeader(const label i) Foam::tmp<Foam::volSymmTensorField> Foam::forces::devRhoReff() const { - if (obr_.foundObject<compressible::RASModel>("RASProperties")) - { - const compressible::RASModel& ras - = obr_.lookupObject<compressible::RASModel>("RASProperties"); - - return ras.devRhoReff(); - } - else if (obr_.foundObject<incompressible::RASModel>("RASProperties")) - { - const incompressible::RASModel& ras - = obr_.lookupObject<incompressible::RASModel>("RASProperties"); + typedef compressible::turbulenceModel cmpTurbModel; + typedef incompressible::turbulenceModel icoTurbModel; - return rho()*ras.devReff(); - } - else if (obr_.foundObject<compressible::LESModel>("LESProperties")) + if (obr_.foundObject<cmpTurbModel>(cmpTurbModel::typeName)) { - const compressible::LESModel& les = - obr_.lookupObject<compressible::LESModel>("LESProperties"); + const cmpTurbModel& turb = + obr_.lookupObject<cmpTurbModel>(cmpTurbModel::typeName); - return les.devRhoReff(); + return turb.devRhoReff(); } - else if (obr_.foundObject<incompressible::LESModel>("LESProperties")) + else if (obr_.foundObject<icoTurbModel>(icoTurbModel::typeName)) { - const incompressible::LESModel& les - = obr_.lookupObject<incompressible::LESModel>("LESProperties"); + const incompressible::turbulenceModel& turb = + obr_.lookupObject<icoTurbModel>(icoTurbModel::typeName); - return rho()*les.devReff(); + return rho()*turb.devReff(); } - else if (obr_.foundObject<fluidThermo>("thermophysicalProperties")) + else if (obr_.foundObject<fluidThermo>(fluidThermo::typeName)) { const fluidThermo& thermo = - obr_.lookupObject<fluidThermo>("thermophysicalProperties"); + obr_.lookupObject<fluidThermo>(fluidThermo::typeName); const volVectorField& U = obr_.lookupObject<volVectorField>(UName_); -- GitLab