diff --git a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFTurbulenceDamping/VoFTurbulenceDamping.C b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFTurbulenceDamping/VoFTurbulenceDamping.C index 831e3eae9c..c42485cbb0 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFTurbulenceDamping/VoFTurbulenceDamping.C +++ b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFTurbulenceDamping/VoFTurbulenceDamping.C @@ -74,8 +74,7 @@ Foam::fv::compressible::VoFTurbulenceDamping::VoFTurbulenceDamping interface_(mixture_), turbulence_ ( - mesh.lookupObject - (IOobject::groupName(momentumTransportModel::typeName, phaseName_)) + mesh.lookupType(phaseName_) ), C2_("C2", dimless, 0), betaStar_("betaStar", dimless, 0), diff --git a/applications/solvers/modules/solid/solid/Make/options b/applications/solvers/modules/solid/solid/Make/options index c8f10595e2..cc845ca8a7 100644 --- a/applications/solvers/modules/solid/solid/Make/options +++ b/applications/solvers/modules/solid/solid/Make/options @@ -2,6 +2,7 @@ EXE_INC = \ -I$(LIB_SRC)/physicalProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/thermophysicalTransportModel/lnInclude \ -I$(LIB_SRC)/ThermophysicalTransportModels/solid/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ @@ -10,6 +11,7 @@ EXE_INC = \ LIB_LIBS = \ -lsolidThermo \ -lsolidThermophysicalTransportModels \ + -lcoupledThermophysicalTransportModels \ -lspecie \ -lfiniteVolume \ -lmeshTools \ diff --git a/applications/solvers/multiphase/interFoam/fvModels/VoFTurbulenceDamping/VoFTurbulenceDamping.C b/applications/solvers/multiphase/interFoam/fvModels/VoFTurbulenceDamping/VoFTurbulenceDamping.C index 3b875ff799..d6fab8c88e 100644 --- a/applications/solvers/multiphase/interFoam/fvModels/VoFTurbulenceDamping/VoFTurbulenceDamping.C +++ b/applications/solvers/multiphase/interFoam/fvModels/VoFTurbulenceDamping/VoFTurbulenceDamping.C @@ -71,8 +71,7 @@ Foam::fv::VoFTurbulenceDamping::VoFTurbulenceDamping interface_(mixture_), turbulence_ ( - mesh.lookupObject - (IOobject::groupName(momentumTransportModel::typeName, phaseName_)) + mesh.lookupType(phaseName_) ), C2_("C2", dimless, 0), betaStar_("betaStar", dimless, 0), diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/fvModels/interfaceTurbulenceDamping/interfaceTurbulenceDamping.C b/applications/solvers/multiphase/multiphaseEulerFoam/fvModels/interfaceTurbulenceDamping/interfaceTurbulenceDamping.C index 366d4307bb..fd33527ddc 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/fvModels/interfaceTurbulenceDamping/interfaceTurbulenceDamping.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/fvModels/interfaceTurbulenceDamping/interfaceTurbulenceDamping.C @@ -192,14 +192,7 @@ Foam::fv::interfaceTurbulenceDamping::interfaceTurbulenceDamping ), turbulence_ ( - mesh.lookupObject - ( - IOobject::groupName - ( - momentumTransportModel::typeName, - phaseName_ - ) - ) + mesh.lookupType(phaseName_) ), C2_("C2", dimless, 0), betaStar_("betaStar", dimless, 0), diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/fvModels/phaseTurbulenceStabilisation/phaseTurbulenceStabilisation.C b/applications/solvers/multiphase/multiphaseEulerFoam/fvModels/phaseTurbulenceStabilisation/phaseTurbulenceStabilisation.C index aedf57a0fc..91eb6fe04d 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/fvModels/phaseTurbulenceStabilisation/phaseTurbulenceStabilisation.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/fvModels/phaseTurbulenceStabilisation/phaseTurbulenceStabilisation.C @@ -93,13 +93,9 @@ void Foam::fv::phaseTurbulenceStabilisation::addSup if (movingPhases[phasei] != phase_) { const phaseCompressible::momentumTransportModel& turbulence = - mesh.lookupObject + mesh.lookupType ( - IOobject::groupName - ( - momentumTransportModel::typeName, - phaseName_ - ) + phaseName_ ); if (notNull(turbulence)) @@ -149,13 +145,9 @@ Foam::fv::phaseTurbulenceStabilisation::phaseTurbulenceStabilisation ), turbulence_ ( - mesh.lookupObject + mesh.lookupType ( - IOobject::groupName - ( - momentumTransportModel::typeName, - phaseName_ - ) + phaseName_ ) ) { diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/alphatPhaseJayatillekeWallFunction/alphatPhaseJayatillekeWallFunctionFvPatchScalarField.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/alphatPhaseJayatillekeWallFunction/alphatPhaseJayatillekeWallFunctionFvPatchScalarField.C index be47607992..9fbd85b2dc 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/alphatPhaseJayatillekeWallFunction/alphatPhaseJayatillekeWallFunctionFvPatchScalarField.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/alphatPhaseJayatillekeWallFunction/alphatPhaseJayatillekeWallFunctionFvPatchScalarField.C @@ -170,9 +170,9 @@ alphatPhaseJayatillekeWallFunctionFvPatchScalarField::calcAlphat // Retrieve turbulence properties from model const phaseCompressible::momentumTransportModel& turbModel = - db().lookupObject + db().lookupType ( - IOobject::groupName(momentumTransportModel::typeName, phase.name()) + phase.name() ); const nutWallFunctionFvPatchScalarField& nutw = diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C index a322f66efb..dafe292c5e 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C @@ -337,22 +337,14 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() { // Retrieve turbulence properties from models const phaseCompressible::momentumTransportModel& turbModel - = db().lookupObject + = db().lookupType ( - IOobject::groupName - ( - momentumTransportModel::typeName, - liquid.name() - ) + liquid.name() ); const phaseCompressible::momentumTransportModel& vaporTurbModel - = db().lookupObject + = db().lookupType ( - IOobject::groupName - ( - momentumTransportModel::typeName, - vapor.name() - ) + vapor.name() ); const nutWallFunctionFvPatchScalarField& nutw = diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/populationBalanceModel/populationBalanceModel/populationBalanceModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/populationBalanceModel/populationBalanceModel/populationBalanceModel.C index d44ecfab32..f176060dd9 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/populationBalanceModel/populationBalanceModel/populationBalanceModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/populationBalanceModel/populationBalanceModel/populationBalanceModel.C @@ -1121,13 +1121,9 @@ const Foam::phaseCompressible::momentumTransportModel& Foam::diameterModels::populationBalanceModel::continuousTurbulence() const { return - mesh_.lookupObject + mesh_.lookupType ( - IOobject::groupName - ( - momentumTransportModel::typeName, - continuousPhase_.name() - ) + continuousPhase_.name() ); } diff --git a/applications/solvers/stressAnalysis/solidDisplacementFoam/Make/options b/applications/solvers/stressAnalysis/solidDisplacementFoam/Make/options index 32b7e969b3..b713fac972 100644 --- a/applications/solvers/stressAnalysis/solidDisplacementFoam/Make/options +++ b/applications/solvers/stressAnalysis/solidDisplacementFoam/Make/options @@ -6,6 +6,7 @@ EXE_INC = \ -I$(LIB_SRC)/physicalProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/thermophysicalTransportModel/lnInclude \ -I$(LIB_SRC)/ThermophysicalTransportModels/solid/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude diff --git a/applications/solvers/stressAnalysis/solidDisplacementFoam/solidEquilibriumDisplacementFoam/Make/options b/applications/solvers/stressAnalysis/solidDisplacementFoam/solidEquilibriumDisplacementFoam/Make/options index 9a0daaef41..fff0cd3ffc 100644 --- a/applications/solvers/stressAnalysis/solidDisplacementFoam/solidEquilibriumDisplacementFoam/Make/options +++ b/applications/solvers/stressAnalysis/solidDisplacementFoam/solidEquilibriumDisplacementFoam/Make/options @@ -5,6 +5,7 @@ EXE_INC = \ -ItractionDisplacementCorrection \ -I$(LIB_SRC)/physicalProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/thermophysicalTransportModel/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \ -I$(LIB_SRC)/ThermophysicalTransportModels/solid/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ diff --git a/src/MomentumTransportModels/compressible/compressibleMomentumTransportModel.C b/src/MomentumTransportModels/compressible/compressibleMomentumTransportModel.C index 729a42c684..919aa4c45e 100644 --- a/src/MomentumTransportModels/compressible/compressibleMomentumTransportModel.C +++ b/src/MomentumTransportModels/compressible/compressibleMomentumTransportModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,14 +26,6 @@ License #include "compressibleMomentumTransportModel.H" #include "surfaceInterpolate.H" -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -// namespace Foam -// { -// defineTypeNameAndDebug(compressibleMomentumTransportModel, 0); -// } - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::compressibleMomentumTransportModel::compressibleMomentumTransportModel diff --git a/src/MomentumTransportModels/compressible/compressibleMomentumTransportModel.H b/src/MomentumTransportModels/compressible/compressibleMomentumTransportModel.H index 34d1d3a6a9..e51069bf66 100644 --- a/src/MomentumTransportModels/compressible/compressibleMomentumTransportModel.H +++ b/src/MomentumTransportModels/compressible/compressibleMomentumTransportModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -67,10 +67,6 @@ protected: public: - //- Runtime type information - // TypeName("compressibleMomentumTransportModel"); - - // Declare run-time constructor selection table declareRunTimeNewSelectionTable diff --git a/src/MomentumTransportModels/incompressible/incompressibleMomentumTransportModel.C b/src/MomentumTransportModels/incompressible/incompressibleMomentumTransportModel.C index 26c110ad09..6c59e09129 100644 --- a/src/MomentumTransportModels/incompressible/incompressibleMomentumTransportModel.C +++ b/src/MomentumTransportModels/incompressible/incompressibleMomentumTransportModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,14 +26,6 @@ License #include "incompressibleMomentumTransportModel.H" #include "fvMatrix.H" -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -// namespace Foam -// { -// defineTypeNameAndDebug(incompressibleMomentumTransportModel, 0); -// } - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::incompressibleMomentumTransportModel::incompressibleMomentumTransportModel diff --git a/src/MomentumTransportModels/incompressible/incompressibleMomentumTransportModel.H b/src/MomentumTransportModels/incompressible/incompressibleMomentumTransportModel.H index bcc9b145b1..ab43560bfa 100644 --- a/src/MomentumTransportModels/incompressible/incompressibleMomentumTransportModel.H +++ b/src/MomentumTransportModels/incompressible/incompressibleMomentumTransportModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -67,10 +67,6 @@ protected: public: - //- Runtime type information - // TypeName("incompressibleMomentumTransportModel"); - - // Declare run-time constructor selection table declareRunTimeNewSelectionTable diff --git a/src/MomentumTransportModels/momentumTransportModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C b/src/MomentumTransportModels/momentumTransportModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C index 38999e84aa..45f7e1afc2 100644 --- a/src/MomentumTransportModels/momentumTransportModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C +++ b/src/MomentumTransportModels/momentumTransportModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C @@ -114,15 +114,9 @@ void turbulentMixingLengthDissipationRateInletFvPatchScalarField::updateCoeffs() } // Lookup Cmu corresponding to the turbulence model selected + const momentumTransportModel& turbModel = - db().lookupObject - ( - IOobject::groupName - ( - momentumTransportModel::typeName, - internalField().group() - ) - ); + db().lookupType(internalField().group()); const scalar Cmu = turbModel.coeffDict().lookupOrDefault("Cmu", 0.09); diff --git a/src/MomentumTransportModels/momentumTransportModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C b/src/MomentumTransportModels/momentumTransportModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C index 5aadc558e8..8de92aba79 100644 --- a/src/MomentumTransportModels/momentumTransportModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C +++ b/src/MomentumTransportModels/momentumTransportModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C @@ -114,15 +114,9 @@ void turbulentMixingLengthFrequencyInletFvPatchScalarField::updateCoeffs() } // Lookup Cmu corresponding to the turbulence model selected + const momentumTransportModel& turbModel = - db().lookupObject - ( - IOobject::groupName - ( - momentumTransportModel::typeName, - internalField().group() - ) - ); + db().lookupType(internalField().group()); const scalar Cmu = turbModel.coeffDict().lookupOrDefault("Cmu", 0.09); diff --git a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C index fe53c1b577..6c526be65e 100644 --- a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C +++ b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -91,14 +91,7 @@ void Foam::fixedShearStressFvPatchVectorField::updateCoeffs() } const momentumTransportModel& turbModel = - db().lookupObject - ( - IOobject::groupName - ( - momentumTransportModel::typeName, - internalField().group() - ) - ); + db().lookupType(internalField().group()); scalarField nuEff(turbModel.nuEff(patch().index())); diff --git a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C index 2eca7696d6..52a1f0ecfd 100644 --- a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C +++ b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C @@ -131,14 +131,7 @@ void Foam::porousBafflePressureFvPatchField::updateCoeffs() const scalarField magUn(mag(Un)); const momentumTransportModel& turbModel = - db().lookupObject - ( - IOobject::groupName - ( - momentumTransportModel::typeName, - internalField().group() - ) - ); + db().lookupType(internalField().group()); jump_ = -sign(Un) diff --git a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C index f9a8aa5a88..b65d486a02 100644 --- a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C +++ b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -352,14 +352,7 @@ void Foam::epsilonWallFunctionFvPatchScalarField::updateCoeffs() } const momentumTransportModel& turbModel = - db().lookupObject - ( - IOobject::groupName - ( - momentumTransportModel::typeName, - internalField().group() - ) - ); + db().lookupType(internalField().group()); setMaster(); diff --git a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C index f975bb8d97..f144325cd5 100644 --- a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C +++ b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -93,14 +93,8 @@ void fWallFunctionFvPatchScalarField::updateCoeffs() const label patchi = patch().index(); const momentumTransportModel& turbModel = - db().lookupObject - ( - IOobject::groupName - ( - momentumTransportModel::typeName, - internalField().group() - ) - ); + db().lookupType(internalField().group()); + const v2fBase& v2fModel = refCast(turbModel); const nutWallFunctionFvPatchScalarField& nutw = diff --git a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C index e65da2b757..87f24247d8 100644 --- a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C +++ b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -94,14 +94,7 @@ void kLowReWallFunctionFvPatchScalarField::updateCoeffs() const label patchi = patch().index(); const momentumTransportModel& turbModel = - db().lookupObject - ( - IOobject::groupName - ( - momentumTransportModel::typeName, - internalField().group() - ) - ); + db().lookupType(internalField().group()); const nutWallFunctionFvPatchScalarField& nutw = nutWallFunctionFvPatchScalarField::nutw(turbModel, patchi); diff --git a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C index fce85bcbff..640b7983f7 100644 --- a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C +++ b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -92,15 +92,10 @@ nutLowReWallFunctionFvPatchScalarField::nutLowReWallFunctionFvPatchScalarField tmp nutLowReWallFunctionFvPatchScalarField::yPlus() const { const label patchi = patch().index(); + const momentumTransportModel& turbModel = - db().lookupObject - ( - IOobject::groupName - ( - momentumTransportModel::typeName, - internalField().group() - ) - ); + db().lookupType(internalField().group()); + const scalarField& y = turbModel.y()[patchi]; const tmp tnuw = turbModel.nu(patchi); const scalarField& nuw = tnuw(); diff --git a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C index a7178691bf..25a07e411e 100644 --- a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C +++ b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C @@ -41,14 +41,8 @@ tmp nutURoughWallFunctionFvPatchScalarField::nut() const const label patchi = patch().index(); const momentumTransportModel& turbModel = - db().lookupObject - ( - IOobject::groupName - ( - momentumTransportModel::typeName, - internalField().group() - ) - ); + db().lookupType(internalField().group()); + const scalarField& y = turbModel.y()[patchi]; const tmp tnuw = turbModel.nu(patchi); const scalarField& nuw = tnuw(); @@ -88,14 +82,8 @@ tmp nutURoughWallFunctionFvPatchScalarField::yPlus const label patchi = patch().index(); const momentumTransportModel& turbModel = - db().lookupObject - ( - IOobject::groupName - ( - momentumTransportModel::typeName, - internalField().group() - ) - ); + db().lookupType(internalField().group()); + const scalarField& y = turbModel.y()[patchi]; const tmp tnuw = turbModel.nu(patchi); const scalarField& nuw = tnuw(); diff --git a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C index 26673cdd36..53b0e172a3 100644 --- a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C +++ b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,14 +41,8 @@ tmp nutUSpaldingWallFunctionFvPatchScalarField::nut() const const label patchi = patch().index(); const momentumTransportModel& turbModel = - db().lookupObject - ( - IOobject::groupName - ( - momentumTransportModel::typeName, - internalField().group() - ) - ); + db().lookupType(internalField().group()); + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi]; const scalarField magGradU(mag(Uw.snGrad())); const tmp tnuw = turbModel.nu(patchi); @@ -70,14 +64,8 @@ tmp nutUSpaldingWallFunctionFvPatchScalarField::calcUTau const label patchi = patch().index(); const momentumTransportModel& turbModel = - db().lookupObject - ( - IOobject::groupName - ( - momentumTransportModel::typeName, - internalField().group() - ) - ); + db().lookupType(internalField().group()); + const scalarField& y = turbModel.y()[patchi]; const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi]; @@ -185,14 +173,8 @@ tmp nutUSpaldingWallFunctionFvPatchScalarField::yPlus() const const label patchi = patch().index(); const momentumTransportModel& turbModel = - db().lookupObject - ( - IOobject::groupName - ( - momentumTransportModel::typeName, - internalField().group() - ) - ); + db().lookupType(internalField().group()); + const scalarField& y = turbModel.y()[patchi]; const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi]; const tmp tnuw = turbModel.nu(patchi); diff --git a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C index 20e81da13e..f33ceafdbb 100644 --- a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C +++ b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,14 +41,8 @@ tmp nutUWallFunctionFvPatchScalarField::nut() const const label patchi = patch().index(); const momentumTransportModel& turbModel = - db().lookupObject - ( - IOobject::groupName - ( - momentumTransportModel::typeName, - internalField().group() - ) - ); + db().lookupType(internalField().group()); + const tmp tnuw = turbModel.nu(patchi); const scalarField& nuw = tnuw(); @@ -81,14 +75,8 @@ tmp nutUWallFunctionFvPatchScalarField::yPlus const label patchi = patch().index(); const momentumTransportModel& turbModel = - db().lookupObject - ( - IOobject::groupName - ( - momentumTransportModel::typeName, - internalField().group() - ) - ); + db().lookupType(internalField().group()); + const scalarField& y = turbModel.y()[patchi]; const tmp tnuw = turbModel.nu(patchi); const scalarField& nuw = tnuw(); @@ -175,15 +163,11 @@ nutUWallFunctionFvPatchScalarField::nutUWallFunctionFvPatchScalarField tmp nutUWallFunctionFvPatchScalarField::yPlus() const { const label patchi = patch().index(); + + const momentumTransportModel& turbModel = - db().lookupObject - ( - IOobject::groupName - ( - momentumTransportModel::typeName, - internalField().group() - ) - ); + db().lookupType(internalField().group()); + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi]; const scalarField magUp(mag(Uw.patchInternalField() - Uw)); diff --git a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C index bd945b0c31..d2225ab581 100644 --- a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C +++ b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C @@ -71,14 +71,7 @@ tmp nutkRoughWallFunctionFvPatchScalarField::nut() const const label patchi = patch().index(); const momentumTransportModel& turbModel = - db().lookupObject - ( - IOobject::groupName - ( - momentumTransportModel::typeName, - internalField().group() - ) - ); + db().lookupType(internalField().group()); const scalarField& y = turbModel.y()[patchi]; diff --git a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C index f03e842c34..870aabb4f7 100644 --- a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C +++ b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,14 +42,7 @@ tmp nutkWallFunctionFvPatchScalarField::nut() const const label patchi = patch().index(); const momentumTransportModel& turbModel = - db().lookupObject - ( - IOobject::groupName - ( - momentumTransportModel::typeName, - internalField().group() - ) - ); + db().lookupType(internalField().group()); const scalarField& y = turbModel.y()[patchi]; const tmp tk = turbModel.k(); @@ -130,14 +123,7 @@ tmp nutkWallFunctionFvPatchScalarField::yPlus() const const label patchi = patch().index(); const momentumTransportModel& turbModel = - db().lookupObject - ( - IOobject::groupName - ( - momentumTransportModel::typeName, - internalField().group() - ) - ); + db().lookupType(internalField().group()); const scalarField& y = turbModel.y()[patchi]; diff --git a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C index af3e622627..b012854464 100644 --- a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C +++ b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -395,14 +395,7 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs() } const momentumTransportModel& turbModel = - db().lookupObject - ( - IOobject::groupName - ( - momentumTransportModel::typeName, - internalField().group() - ) - ); + db().lookupType(internalField().group()); setMaster(); diff --git a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C index f44c3b852c..0508e157a8 100644 --- a/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C +++ b/src/MomentumTransportModels/momentumTransportModels/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -91,15 +91,9 @@ void v2WallFunctionFvPatchScalarField::updateCoeffs() const label patchi = patch().index(); + const momentumTransportModel& turbModel = - db().lookupObject - ( - IOobject::groupName - ( - momentumTransportModel::typeName, - internalField().group() - ) - ); + db().lookupType(internalField().group()); const nutWallFunctionFvPatchScalarField& nutw = nutWallFunctionFvPatchScalarField::nutw(turbModel, patchi); diff --git a/src/MomentumTransportModels/phaseCompressible/LES/continuousGasKEqn/continuousGasKEqn.C b/src/MomentumTransportModels/phaseCompressible/LES/continuousGasKEqn/continuousGasKEqn.C index 8d4d383f52..26376ebb0d 100644 --- a/src/MomentumTransportModels/phaseCompressible/LES/continuousGasKEqn/continuousGasKEqn.C +++ b/src/MomentumTransportModels/phaseCompressible/LES/continuousGasKEqn/continuousGasKEqn.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -108,14 +108,7 @@ continuousGasKEqn::liquidTurbulence() const const phaseModel& liquid = fluid.otherPhase(gas); liquidTurbulencePtr_ = - &U.db().lookupObject - ( - IOobject::groupName - ( - momentumTransportModel::typeName, - liquid.name() - ) - ); + &U.db().lookupType(liquid.name()); } return *liquidTurbulencePtr_; diff --git a/src/MomentumTransportModels/phaseCompressible/RAS/continuousGasKEpsilon/continuousGasKEpsilon.C b/src/MomentumTransportModels/phaseCompressible/RAS/continuousGasKEpsilon/continuousGasKEpsilon.C index f38320f134..8d643f4e64 100644 --- a/src/MomentumTransportModels/phaseCompressible/RAS/continuousGasKEpsilon/continuousGasKEpsilon.C +++ b/src/MomentumTransportModels/phaseCompressible/RAS/continuousGasKEpsilon/continuousGasKEpsilon.C @@ -162,14 +162,7 @@ continuousGasKEpsilon::liquidTurbulence() const const phaseModel& liquid = fluid.otherPhase(gas); liquidTurbulencePtr_ = - &U.db().lookupObject - ( - IOobject::groupName - ( - momentumTransportModel::typeName, - liquid.name() - ) - ); + &U.db().lookupType(liquid.name()); } return *liquidTurbulencePtr_; diff --git a/src/MomentumTransportModels/phaseCompressible/phaseCompressibleMomentumTransportModel.C b/src/MomentumTransportModels/phaseCompressible/phaseCompressibleMomentumTransportModel.C index f8b4ed11ea..7bc1ba63e6 100644 --- a/src/MomentumTransportModels/phaseCompressible/phaseCompressibleMomentumTransportModel.C +++ b/src/MomentumTransportModels/phaseCompressible/phaseCompressibleMomentumTransportModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,15 +26,6 @@ License #include "phaseCompressibleMomentumTransportModel.H" #include "surfaceInterpolate.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(phaseCompressibleMomentumTransportModel, 0); -} - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::phaseCompressibleMomentumTransportModel:: diff --git a/src/MomentumTransportModels/phaseCompressible/phaseCompressibleMomentumTransportModel.H b/src/MomentumTransportModels/phaseCompressible/phaseCompressibleMomentumTransportModel.H index b2fd15a22b..c331aed6c8 100644 --- a/src/MomentumTransportModels/phaseCompressible/phaseCompressibleMomentumTransportModel.H +++ b/src/MomentumTransportModels/phaseCompressible/phaseCompressibleMomentumTransportModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -67,10 +67,6 @@ protected: public: - //- Runtime type information - TypeName("phaseCompressibleMomentumTransportModel"); - - // Declare run-time constructor selection table declareRunTimeNewSelectionTable diff --git a/src/MomentumTransportModels/phaseIncompressible/phaseIncompressibleMomentumTransportModel.C b/src/MomentumTransportModels/phaseIncompressible/phaseIncompressibleMomentumTransportModel.C index e2278e6cda..16e9f19ab4 100644 --- a/src/MomentumTransportModels/phaseIncompressible/phaseIncompressibleMomentumTransportModel.C +++ b/src/MomentumTransportModels/phaseIncompressible/phaseIncompressibleMomentumTransportModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,14 +26,6 @@ License #include "phaseIncompressibleMomentumTransportModel.H" #include "fvMatrix.H" -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(phaseIncompressibleMomentumTransportModel, 0); -} - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::phaseIncompressibleMomentumTransportModel:: diff --git a/src/MomentumTransportModels/phaseIncompressible/phaseIncompressibleMomentumTransportModel.H b/src/MomentumTransportModels/phaseIncompressible/phaseIncompressibleMomentumTransportModel.H index 104bd7b996..2f6807ae10 100644 --- a/src/MomentumTransportModels/phaseIncompressible/phaseIncompressibleMomentumTransportModel.H +++ b/src/MomentumTransportModels/phaseIncompressible/phaseIncompressibleMomentumTransportModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -67,10 +67,6 @@ protected: public: - //- Runtime type information - TypeName("phaseIncompressibleMomentumTransportModel"); - - // Declare run-time constructor selection table declareRunTimeNewSelectionTable diff --git a/src/OpenFOAM/db/objectRegistry/objectRegistry.H b/src/OpenFOAM/db/objectRegistry/objectRegistry.H index 11abb46833..4f70e6ec77 100644 --- a/src/OpenFOAM/db/objectRegistry/objectRegistry.H +++ b/src/OpenFOAM/db/objectRegistry/objectRegistry.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -197,14 +197,24 @@ public: template HashTable lookupClass(const bool strict = false); - //- Is the named Type found? + //- Is the named Type in registry template bool foundObject(const word& name) const; - //- Lookup and return the object of the given Type + //- Lookup and return the object of the given Type and name template const Type& lookupObject(const word& name) const; + //- Is the Type in registry + // the name is derived from the type name and given group + template + bool foundType(const word& group = word::null) const; + + //- Lookup and return the object of the given Type + // the name is derived from the type name and given group + template + const Type& lookupType(const word& group = word::null) const; + //- Lookup and return the object reference of the given Type template Type& lookupObjectRef(const word& name) const; diff --git a/src/OpenFOAM/db/objectRegistry/objectRegistryTemplates.C b/src/OpenFOAM/db/objectRegistry/objectRegistryTemplates.C index 946a050f32..7dbfbcc544 100644 --- a/src/OpenFOAM/db/objectRegistry/objectRegistryTemplates.C +++ b/src/OpenFOAM/db/objectRegistry/objectRegistryTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -216,6 +216,20 @@ const Type& Foam::objectRegistry::lookupObject(const word& name) const } +template +bool Foam::objectRegistry::foundType(const word& group) const +{ + return foundObject(IOobject::groupName(Type::typeName, group)); +} + + +template +const Type& Foam::objectRegistry::lookupType(const word& group) const +{ + return lookupObject(IOobject::groupName(Type::typeName, group)); +} + + template Type& Foam::objectRegistry::lookupObjectRef(const word& name) const { diff --git a/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/Make/files b/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/Make/files index c1a581775e..94b29da5a9 100644 --- a/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/Make/files +++ b/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/Make/files @@ -1,5 +1,4 @@ externalTemperature/externalTemperatureFvPatchScalarField.C -patchKappa/patchKappa.C coupledTemperature/coupledTemperatureFvPatchScalarField.C LIB = $(FOAM_LIBBIN)/libcoupledThermophysicalTransportModels diff --git a/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/Make/options b/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/Make/options index 65d0a1d4fc..0cef820bd5 100644 --- a/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/Make/options +++ b/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/Make/options @@ -1,21 +1,9 @@ EXE_INC = \ -I$(LIB_SRC)/ThermophysicalTransportModels/thermophysicalTransportModel/lnInclude \ - -I$(LIB_SRC)/ThermophysicalTransportModels/fluid/lnInclude \ - -I$(LIB_SRC)/ThermophysicalTransportModels/solid/lnInclude \ - -I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \ - -I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \ - -I$(LIB_SRC)/physicalProperties/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ LIB_LIBS = \ -lthermophysicalTransportModel \ - -lfluidThermophysicalModels \ - -lsolidThermo \ - -lfluidThermoThermophysicalTransportModels \ - -lmomentumTransportModels \ - -lsolidThermophysicalTransportModels \ -lfiniteVolume \ -lmeshTools diff --git a/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/coupledTemperature/coupledTemperatureFvPatchScalarField.C b/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/coupledTemperature/coupledTemperatureFvPatchScalarField.C index 921f4faca9..92b21a0b20 100644 --- a/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/coupledTemperature/coupledTemperatureFvPatchScalarField.C +++ b/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/coupledTemperature/coupledTemperatureFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "coupledTemperatureFvPatchScalarField.H" -#include "patchKappa.H" +#include "thermophysicalTransportModel.H" #include "volFields.H" #include "fvPatchFieldMapper.H" #include "mappedPatchBase.H" @@ -222,15 +222,23 @@ void Foam::coupledTemperatureFvPatchScalarField::updateCoeffs() : mpp.distribute(coupledTemperatureNbr) ); - const scalarField kappa(patchKappa(patch()).kappa()); + const scalarField kappa + ( + patch().boundaryMesh().mesh() + .lookupType().kappaEff(patch().index()) + ); const scalarField KDelta(kappa*patch().deltaCoeffs()); const scalarField KDeltaNbr ( contactRes_ == 0 - ? mpp.distribute(patchKappa(patchNbr).kappa() - *patchNbr.deltaCoeffs()) + ? mpp.distribute + ( + patchNbr.boundaryMesh().mesh() + .lookupType().kappaEff(patchiNbr) + *patchNbr.deltaCoeffs() + ) : tmp(new scalarField(size(), contactRes_)) ); diff --git a/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/coupledTemperature/coupledTemperatureFvPatchScalarField.H b/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/coupledTemperature/coupledTemperatureFvPatchScalarField.H index 139a45577c..8cc48f892d 100644 --- a/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/coupledTemperature/coupledTemperatureFvPatchScalarField.H +++ b/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/coupledTemperature/coupledTemperatureFvPatchScalarField.H @@ -38,9 +38,6 @@ Description where KDelta is heat-transfer coefficient K*deltaCoeffs and qs is the optional source heat flux. - The thermal conductivity \c kappa can either be retrieved from various - possible sources, as detailed in the class patchKappa. - Usage \table Property | Description | Required | Default value @@ -68,12 +65,13 @@ Usage Needs to be on underlying mapped(Wall)FvPatch. + The patch thermal conductivity \c kappa is obtained from the region + thermophysicalTransportModel so that this boundary condition can be applied + directly to either fluid or solid regions. + Note that in order to provide an optional heat source either qs or Qs should be specified, not both. -See also - Foam::patchKappa - SourceFiles coupledTemperatureFvPatchScalarField.C diff --git a/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/externalTemperature/externalTemperatureFvPatchScalarField.C b/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/externalTemperature/externalTemperatureFvPatchScalarField.C index 5b75c522d9..53f528ea29 100644 --- a/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/externalTemperature/externalTemperatureFvPatchScalarField.C +++ b/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/externalTemperature/externalTemperatureFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "externalTemperatureFvPatchScalarField.H" -#include "patchKappa.H" +#include "thermophysicalTransportModel.H" #include "volFields.H" #include "physicoChemicalConstants.H" #include "addToRunTimeSelectionTable.H" @@ -307,7 +307,11 @@ void Foam::externalTemperatureFvPatchScalarField::updateCoeffs() qTot += q_; } - const scalarField kappa(patchKappa(patch()).kappa()); + const scalarField kappa + ( + patch().boundaryMesh().mesh() + .lookupType().kappaEff(patch().index()) + ); // Evaluate if (!haveh_) diff --git a/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/externalTemperature/externalTemperatureFvPatchScalarField.H b/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/externalTemperature/externalTemperatureFvPatchScalarField.H index d42f7f4e86..fb93497455 100644 --- a/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/externalTemperature/externalTemperatureFvPatchScalarField.H +++ b/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/externalTemperature/externalTemperatureFvPatchScalarField.H @@ -46,8 +46,8 @@ Description resistances can be specified through thicknessLayers and kappaLayers entries. - The patch thermal conductivity \c kappa is obtained from the - Foam::patchKappa base class so that this boundary condition can be applied + The patch thermal conductivity \c kappa is obtained from the region + thermophysicalTransportModel so that this boundary condition can be applied directly to either fluid or solid regions. The ambient temperature Ta is specified as a Foam::Function1 of time but diff --git a/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/patchKappa/patchKappa.C b/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/patchKappa/patchKappa.C deleted file mode 100644 index 2472e7890d..0000000000 --- a/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/patchKappa/patchKappa.C +++ /dev/null @@ -1,89 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2022 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "patchKappa.H" -#include "thermophysicalTransportModel.H" -#include "solidThermophysicalTransportModel.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::patchKappa::patchKappa(const fvPatch& patch) -: - patch_(patch) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -Foam::tmp Foam::patchKappa::kappa() const -{ - const fvMesh& mesh = patch_.boundaryMesh().mesh(); - const label patchi = patch_.index(); - - if - ( - mesh.foundObject - ( - thermophysicalTransportModel::typeName - ) - ) - { - const thermophysicalTransportModel& ttm = - mesh.lookupObject - ( - thermophysicalTransportModel::typeName - ); - - return ttm.kappaEff(patchi); - } - else if - ( - mesh.foundObject - ( - solidThermophysicalTransportModel::typeName - ) - ) - { - const solidThermophysicalTransportModel& sttm = - mesh.lookupObject - ( - solidThermophysicalTransportModel::typeName - ); - - return sttm.kappa(patchi); - } - else - { - FatalErrorInFunction - << "Cannot find a thermophysicalTransportModel " - "or solidThermophysicalTransportModel instance" - << exit(FatalError); - - return scalarField::null(); - } -} - - -// ************************************************************************* // diff --git a/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/patchKappa/patchKappa.H b/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/patchKappa/patchKappa.H deleted file mode 100644 index a789b4d39c..0000000000 --- a/src/ThermophysicalTransportModels/coupledThermophysicalTransportModels/patchKappa/patchKappa.H +++ /dev/null @@ -1,88 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2022 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Class - Foam::patchKappa - -Description - Provides the patch thermal conductivity \c kappa for the fluid or solid - region an appropriate. - - For fluid regions \c kappaEff is obtained from the - Foam::thermophysicalTransportModel and for solid regions - \c kappa is obtained from the Foam::solidThermophysicalTransportModel. - -SourceFiles - patchKappa.C - -\*---------------------------------------------------------------------------*/ - -#ifndef patchKappa_H -#define patchKappa_H - -#include "fvPatch.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class patchKappa Declaration -\*---------------------------------------------------------------------------*/ - -class patchKappa -{ - // Private data - - //- Reference to the region patch - const fvPatch& patch_; - - -public: - - // Constructors - - //- Construct from patch - patchKappa - ( - const fvPatch& patch - ); - - - // Member Functions - - //- Thermal conductivity for patch [W/m/K] - tmp kappa() const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/ThermophysicalTransportModels/fluid/Make/files b/src/ThermophysicalTransportModels/fluid/Make/files index ad431be1ba..b29f26c6c2 100644 --- a/src/ThermophysicalTransportModels/fluid/Make/files +++ b/src/ThermophysicalTransportModels/fluid/Make/files @@ -1,4 +1,4 @@ -#fluidThermophysicalTransportModel/fluidThermophysicalTransportModel.C +fluidThermophysicalTransportModel/fluidThermophysicalTransportModel.C BCs = derivedFvPatchFields $(BCs)/thermalBaffle1D/thermalBaffle1DFvPatchScalarFields.C diff --git a/src/ThermophysicalTransportModels/fluid/ThermophysicalTransportModel/ThermophysicalTransportModel.C b/src/ThermophysicalTransportModels/fluid/ThermophysicalTransportModel/ThermophysicalTransportModel.C index ee912aae45..c10dcbb0ab 100644 --- a/src/ThermophysicalTransportModels/fluid/ThermophysicalTransportModel/ThermophysicalTransportModel.C +++ b/src/ThermophysicalTransportModels/fluid/ThermophysicalTransportModel/ThermophysicalTransportModel.C @@ -37,7 +37,7 @@ ThermophysicalTransportModel const thermoModel& thermo ) : - thermophysicalTransportModel(momentumTransport), + fluidThermophysicalTransportModel(momentumTransport), momentumTransport_(momentumTransport), thermo_(thermo) {} diff --git a/src/ThermophysicalTransportModels/fluid/ThermophysicalTransportModel/ThermophysicalTransportModel.H b/src/ThermophysicalTransportModels/fluid/ThermophysicalTransportModel/ThermophysicalTransportModel.H index 2c8a0b9152..9da2d7d10f 100644 --- a/src/ThermophysicalTransportModels/fluid/ThermophysicalTransportModel/ThermophysicalTransportModel.H +++ b/src/ThermophysicalTransportModels/fluid/ThermophysicalTransportModel/ThermophysicalTransportModel.H @@ -35,7 +35,7 @@ SourceFiles #ifndef ThermophysicalTransportModel_H #define ThermophysicalTransportModel_H -#include "thermophysicalTransportModel.H" +#include "fluidThermophysicalTransportModel.H" #include "runTimeSelectionTables.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -50,7 +50,7 @@ namespace Foam template class ThermophysicalTransportModel : - public thermophysicalTransportModel + public fluidThermophysicalTransportModel { public: diff --git a/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C b/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C index 5da2798650..e33f7747b9 100644 --- a/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C +++ b/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "alphatJayatillekeWallFunctionFvPatchScalarField.H" -#include "thermophysicalTransportModel.H" +#include "fluidThermophysicalTransportModel.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -148,14 +148,10 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs() const label patchi = patch().index(); - const thermophysicalTransportModel& ttm = - db().lookupObject + const fluidThermophysicalTransportModel& ttm = + db().lookupType ( - IOobject::groupName - ( - thermophysicalTransportModel::typeName, - internalField().group() - ) + internalField().group() ); const compressibleMomentumTransportModel& turbModel = diff --git a/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C b/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C index 7bdcb667b2..9b7ddd9c23 100644 --- a/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C +++ b/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "alphatWallFunctionFvPatchScalarField.H" -#include "thermophysicalTransportModel.H" +#include "fluidThermophysicalTransportModel.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -94,14 +94,10 @@ void alphatWallFunctionFvPatchScalarField::updateCoeffs() const label patchi = patch().index(); - const thermophysicalTransportModel& ttm = - db().lookupObject + const fluidThermophysicalTransportModel& ttm = + db().lookupType ( - IOobject::groupName - ( - thermophysicalTransportModel::typeName, - internalField().group() - ) + internalField().group() ); const compressibleMomentumTransportModel& turbModel = diff --git a/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C b/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C index f5f7d5637d..c75a0f0dcb 100644 --- a/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C +++ b/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "convectiveHeatTransferFvPatchScalarField.H" -#include "thermophysicalTransportModel.H" +#include "fluidThermophysicalTransportModel.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -98,14 +98,10 @@ void convectiveHeatTransferFvPatchScalarField::updateCoeffs() const label patchi = patch().index(); - const thermophysicalTransportModel& ttm = - db().lookupObject + const fluidThermophysicalTransportModel& ttm = + db().lookupType ( - IOobject::groupName - ( - thermophysicalTransportModel::typeName, - internalField().group() - ) + internalField().group() ); const compressibleMomentumTransportModel& turbModel = diff --git a/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.C b/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.C index 2697f27811..f97721d2f9 100644 --- a/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.C +++ b/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "externalCoupledTemperatureMixedFvPatchScalarField.H" -#include "thermophysicalTransportModel.H" +#include "fluidThermophysicalTransportModel.H" #include "OFstream.H" #include "addToRunTimeSelectionTable.H" @@ -114,42 +114,17 @@ void Foam::externalCoupledTemperatureMixedFvPatchScalarField::transferData // heat flux [W/m^2] scalarField qDot(this->patch().size(), 0.0); - static word ttmName - ( - IOobject::groupName + const fluidThermophysicalTransportModel& ttm = + db().lookupType ( - thermophysicalTransportModel::typeName, internalField().group() - ) - ); + ); - static word thermoName(physicalProperties::typeName); + const basicThermo& thermo = ttm.thermo(); - if (db().foundObject(ttmName)) - { - const thermophysicalTransportModel& ttm = - db().lookupObject(ttmName); + const fvPatchScalarField& hep = thermo.he().boundaryField()[patchi]; - const basicThermo& thermo = ttm.thermo(); - - const fvPatchScalarField& hep = thermo.he().boundaryField()[patchi]; - - qDot = ttm.alphaEff(patchi)*hep.snGrad(); - } - else if (db().foundObject(thermoName)) - { - const basicThermo& thermo = db().lookupObject(thermoName); - - const fvPatchScalarField& hep = thermo.he().boundaryField()[patchi]; - - qDot = thermo.alphahe(patchi)*hep.snGrad(); - } - else - { - FatalErrorInFunction - << "Condition requires either compressible turbulence and/or " - << "thermo model to be available" << exit(FatalError); - } + qDot = ttm.alphaEff(patchi)*hep.snGrad(); // patch temperature [K] const scalarField Tp(*this); diff --git a/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C b/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C index ba332f6b01..43cadc07c3 100644 --- a/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C +++ b/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C @@ -25,7 +25,7 @@ License #include "totalFlowRateAdvectiveDiffusiveFvPatchScalarField.H" #include "surfaceFields.H" -#include "thermophysicalTransportModel.H" +#include "fluidThermophysicalTransportModel.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -148,14 +148,10 @@ void Foam::totalFlowRateAdvectiveDiffusiveFvPatchScalarField::updateCoeffs() const label patchi = patch().index(); - const thermophysicalTransportModel& ttm = - db().lookupObject + const fluidThermophysicalTransportModel& ttm = + db().lookupType ( - IOobject::groupName - ( - thermophysicalTransportModel::typeName, - internalField().group() - ) + internalField().group() ); const fvsPatchField& phip = diff --git a/src/ThermophysicalTransportModels/fluid/fluidThermophysicalTransportModel/fluidThermophysicalTransportModel.C b/src/ThermophysicalTransportModels/fluid/fluidThermophysicalTransportModel/fluidThermophysicalTransportModel.C new file mode 100644 index 0000000000..6eb584adb9 --- /dev/null +++ b/src/ThermophysicalTransportModels/fluid/fluidThermophysicalTransportModel/fluidThermophysicalTransportModel.C @@ -0,0 +1,44 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2022 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "fluidThermophysicalTransportModel.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::fluidThermophysicalTransportModel::fluidThermophysicalTransportModel +( + const compressibleMomentumTransportModel& momentumTransport +) +: + thermophysicalTransportModel + ( + momentumTransport.mesh(), + momentumTransport.alphaRhoPhi().group() + ), + momentumTransportModel_(momentumTransport) +{} + + +// ************************************************************************* // diff --git a/src/ThermophysicalTransportModels/fluid/fluidThermophysicalTransportModel/fluidThermophysicalTransportModel.H b/src/ThermophysicalTransportModels/fluid/fluidThermophysicalTransportModel/fluidThermophysicalTransportModel.H new file mode 100644 index 0000000000..4ac006b8d8 --- /dev/null +++ b/src/ThermophysicalTransportModels/fluid/fluidThermophysicalTransportModel/fluidThermophysicalTransportModel.H @@ -0,0 +1,125 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2022 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::fluidThermophysicalTransportModel + +Description + Abstract base class for fluid thermophysical transport models + RAS, LES and laminar. + +SourceFiles + fluidThermophysicalTransportModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef fluidThermophysicalTransportModel_H +#define fluidThermophysicalTransportModel_H + +#include "thermophysicalTransportModel.H" +#include "compressibleMomentumTransportModel.H" +#include "fluidThermo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class fluidThermophysicalTransportModel Declaration +\*---------------------------------------------------------------------------*/ + +class fluidThermophysicalTransportModel +: + public thermophysicalTransportModel +{ +protected: + + // Protected data + + const compressibleMomentumTransportModel& momentumTransportModel_; + + +public: + + // Constructors + + //- Construct from compressibleMomentumTransportModel + fluidThermophysicalTransportModel + ( + const compressibleMomentumTransportModel& momentumTransport + ); + + + //- Destructor + virtual ~fluidThermophysicalTransportModel() + {} + + + // Member Functions + + //- Access function to momentum transport model + const compressibleMomentumTransportModel& momentumTransport() const + { + return momentumTransportModel_; + } + + //- Access function to fluid thermophysical properties + virtual const fluidThermo& thermo() const = 0; + + //- Effective thermal turbulent diffusivity of mixture [kg/m/s] + virtual tmp alphaEff() const = 0; + + //- Effective thermal turbulent diffusivity of mixture + // for patch [kg/m/s] + virtual tmp alphaEff(const label patchi) const = 0; + + //- Effective mass diffusion coefficient + // for a given specie mass-fraction [kg/m/s] + virtual tmp DEff(const volScalarField& Yi) const = 0; + + //- Effective mass diffusion coefficient + // for a given specie mass-fraction for patch [kg/m/s] + virtual tmp DEff + ( + const volScalarField& Yi, + const label patchi + ) const = 0; + + //- Return the specie flux for the given specie mass-fraction [kg/m^2/s] + virtual tmp j(const volScalarField& Yi) const = 0; + + //- Return the source term for the given specie mass-fraction equation + virtual tmp divj(volScalarField& Yi) const = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/ThermophysicalTransportModels/thermophysicalTransportModel/makeThermophysicalTransportModel.H b/src/ThermophysicalTransportModels/fluid/makeThermophysicalTransportModel.H similarity index 99% rename from src/ThermophysicalTransportModels/thermophysicalTransportModel/makeThermophysicalTransportModel.H rename to src/ThermophysicalTransportModels/fluid/makeThermophysicalTransportModel.H index 6f4aee0e2b..f1ba6d6a2b 100644 --- a/src/ThermophysicalTransportModels/thermophysicalTransportModel/makeThermophysicalTransportModel.H +++ b/src/ThermophysicalTransportModels/fluid/makeThermophysicalTransportModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/ThermophysicalTransportModels/solid/Make/options b/src/ThermophysicalTransportModels/solid/Make/options index 2282e4d74d..00399dfbd5 100644 --- a/src/ThermophysicalTransportModels/solid/Make/options +++ b/src/ThermophysicalTransportModels/solid/Make/options @@ -8,6 +8,7 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude \ LIB_LIBS = \ + -lthermophysicalTransportModel \ -lsolidThermo \ -lspecie \ -lfiniteVolume \ diff --git a/src/ThermophysicalTransportModels/solid/solidThermophysicalTransportModel/solidThermophysicalTransportModel.C b/src/ThermophysicalTransportModels/solid/solidThermophysicalTransportModel/solidThermophysicalTransportModel.C index 8a284b0394..6d165b1522 100644 --- a/src/ThermophysicalTransportModels/solid/solidThermophysicalTransportModel/solidThermophysicalTransportModel.C +++ b/src/ThermophysicalTransportModels/solid/solidThermophysicalTransportModel/solidThermophysicalTransportModel.C @@ -30,7 +30,6 @@ License namespace Foam { - defineTypeNameAndDebug(solidThermophysicalTransportModel, 0); defineRunTimeSelectionTable(solidThermophysicalTransportModel, dictionary); } @@ -55,27 +54,11 @@ Foam::solidThermophysicalTransportModel::solidThermophysicalTransportModel const solidThermo& thermo ) : - IOdictionary - ( - IOobject - ( - typeName, - thermo.mesh().time().constant(), - thermo.mesh(), - IOobject::READ_IF_PRESENT, - IOobject::NO_WRITE - ) - ), - + thermophysicalTransportModel(thermo.mesh(), word::null), thermo_(thermo), printCoeffs_(lookupOrDefault("printCoeffs", false)), coeffDict_(optionalSubDict(type + "Coeffs")) -{ - // Add run-time re-reading of thermophysicalTransport dictionary - // after construction to avoid problems if the dictionary is not present - readOpt() = IOobject::MUST_READ_IF_MODIFIED; - addWatch(); -} +{} // * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * // diff --git a/src/ThermophysicalTransportModels/solid/solidThermophysicalTransportModel/solidThermophysicalTransportModel.H b/src/ThermophysicalTransportModels/solid/solidThermophysicalTransportModel/solidThermophysicalTransportModel.H index 2396392d66..aa0d8d352b 100644 --- a/src/ThermophysicalTransportModels/solid/solidThermophysicalTransportModel/solidThermophysicalTransportModel.H +++ b/src/ThermophysicalTransportModels/solid/solidThermophysicalTransportModel/solidThermophysicalTransportModel.H @@ -25,8 +25,7 @@ Class Foam::solidThermophysicalTransportModel Description - Abstract base class for thermophysical transport models - (RAS, LES and laminar). + Abstract base class for solid thermophysical transport models SourceFiles solidThermophysicalTransportModel.C @@ -36,6 +35,7 @@ SourceFiles #ifndef solidThermophysicalTransportModel_H #define solidThermophysicalTransportModel_H +#include "thermophysicalTransportModel.H" #include "solidThermo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,12 +44,12 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class solidThermophysicalTransportModel Declaration + Class solidThermophysicalTransportModel Declaration \*---------------------------------------------------------------------------*/ class solidThermophysicalTransportModel : - public IOdictionary + public thermophysicalTransportModel { protected: @@ -73,10 +73,6 @@ protected: public: - //- Runtime type information - TypeName("thermophysicalTransport"); - - // Declare run-time constructor selection table declareRunTimeSelectionTable @@ -100,12 +96,6 @@ public: const solidThermo& thermo ); - //- Disallow default bitwise copy construction - solidThermophysicalTransportModel - ( - const solidThermophysicalTransportModel& - ) = delete; - // Selectors @@ -144,6 +134,20 @@ public: //- Thermal conductivity for patch [W/m/K] virtual tmp kappa(const label patchi) const; + //- Effective thermal conductivity + // of mixture [W/m/K] + virtual tmp kappaEff() const + { + return kappa(); + } + + //- Effective thermal conductivity + // of mixture for patch [W/m/K] + virtual tmp kappaEff(const label patchi) const + { + return kappa(patchi); + } + //- Return the heat flux [W/m^2] virtual tmp q() const = 0; @@ -153,12 +157,6 @@ public: //- Solve the thermophysical transport model equations // and correct the transport coefficients virtual void correct() = 0; - - - // Member Operators - - //- Disallow default bitwise assignment - void operator=(const solidThermophysicalTransportModel&) = delete; }; diff --git a/src/ThermophysicalTransportModels/thermophysicalTransportModel/Make/options b/src/ThermophysicalTransportModels/thermophysicalTransportModel/Make/options index ffbd0da0dd..ea345a9f24 100644 --- a/src/ThermophysicalTransportModels/thermophysicalTransportModel/Make/options +++ b/src/ThermophysicalTransportModels/thermophysicalTransportModel/Make/options @@ -1,16 +1,7 @@ EXE_INC = \ - -I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \ - -I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \ - -I$(LIB_SRC)/physicalProperties/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ LIB_LIBS = \ - -lfluidThermophysicalModels \ - -lmomentumTransportModels \ - -lspecie \ -lfiniteVolume \ -lmeshTools diff --git a/src/ThermophysicalTransportModels/thermophysicalTransportModel/thermophysicalTransportModel.C b/src/ThermophysicalTransportModels/thermophysicalTransportModel/thermophysicalTransportModel.C index 886cc2639d..7763d08517 100644 --- a/src/ThermophysicalTransportModels/thermophysicalTransportModel/thermophysicalTransportModel.C +++ b/src/ThermophysicalTransportModels/thermophysicalTransportModel/thermophysicalTransportModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "thermophysicalTransportModel.H" -#include "surfaceFields.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -38,25 +37,21 @@ namespace Foam Foam::thermophysicalTransportModel::thermophysicalTransportModel ( - const compressibleMomentumTransportModel& momentumTransport + const fvMesh& mesh, + const word& group ) : IOdictionary ( IOobject ( - IOobject::groupName - ( - typeName, momentumTransport.alphaRhoPhi().group() - ), - momentumTransport.time().constant(), - momentumTransport.mesh(), + IOobject::groupName(typeName, group), + mesh.time().constant(), + mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE ) - ), - - momentumTransportModel_(momentumTransport) + ) { // Add run-time re-reading of thermophysicalTransport dictionary // after construction to avoid problems if the dictionary is not present diff --git a/src/ThermophysicalTransportModels/thermophysicalTransportModel/thermophysicalTransportModel.H b/src/ThermophysicalTransportModels/thermophysicalTransportModel/thermophysicalTransportModel.H index 2f92b1bb6c..4d80c452b4 100644 --- a/src/ThermophysicalTransportModels/thermophysicalTransportModel/thermophysicalTransportModel.H +++ b/src/ThermophysicalTransportModels/thermophysicalTransportModel/thermophysicalTransportModel.H @@ -25,8 +25,7 @@ Class Foam::thermophysicalTransportModel Description - Abstract base class for thermophysical transport models - (RAS, LES and laminar). + Abstract base class for all fluid and solid thermophysical transport models SourceFiles thermophysicalTransportModel.C @@ -36,8 +35,8 @@ SourceFiles #ifndef thermophysicalTransportModel_H #define thermophysicalTransportModel_H -#include "compressibleMomentumTransportModel.H" -#include "fluidThermo.H" +#include "IOdictionary.H" +#include "fvMatrix.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -52,12 +51,6 @@ class thermophysicalTransportModel : public IOdictionary { -protected: - - // Protected data - - const compressibleMomentumTransportModel& momentumTransportModel_; - public: @@ -67,10 +60,11 @@ public: // Constructors - //- Construct from compressibleMomentumTransportModel + //- Construct from mesh and group thermophysicalTransportModel ( - const compressibleMomentumTransportModel& momentumTransport + const fvMesh& mesh, + const word& group ); //- Disallow default bitwise copy construction @@ -90,15 +84,6 @@ public: //- Read model coefficients if they have changed virtual bool read() = 0; - //- Access function to momentum transport model - const compressibleMomentumTransportModel& momentumTransport() const - { - return momentumTransportModel_; - } - - //- Access function to fluid thermophysical properties - virtual const fluidThermo& thermo() const = 0; - //- Const access to the coefficients dictionary virtual const dictionary& coeffDict() const = 0; @@ -110,37 +95,12 @@ public: // of mixture for patch [W/m/K] virtual tmp kappaEff(const label patchi) const = 0; - //- Effective thermal turbulent diffusivity of mixture [kg/m/s] - virtual tmp alphaEff() const = 0; - - //- Effective thermal turbulent diffusivity of mixture - // for patch [kg/m/s] - virtual tmp alphaEff(const label patchi) const = 0; - - //- Effective mass diffusion coefficient - // for a given specie mass-fraction [kg/m/s] - virtual tmp DEff(const volScalarField& Yi) const = 0; - - //- Effective mass diffusion coefficient - // for a given specie mass-fraction for patch [kg/m/s] - virtual tmp DEff - ( - const volScalarField& Yi, - const label patchi - ) const = 0; - //- Return the heat flux [W/m^2] virtual tmp q() const = 0; //- Return the source term for the energy equation virtual tmp divq(volScalarField& he) const = 0; - //- Return the specie flux for the given specie mass-fraction [kg/m^2/s] - virtual tmp j(const volScalarField& Yi) const = 0; - - //- Return the source term for the given specie mass-fraction equation - virtual tmp divj(volScalarField& Yi) const = 0; - //- Solve the thermophysical transport model equations // and correct the transport coefficients virtual void correct() = 0; diff --git a/src/atmosphericModels/derivedFvPatchFields/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C b/src/atmosphericModels/derivedFvPatchFields/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C index 7186f8afbb..1f1a7e2bf2 100644 --- a/src/atmosphericModels/derivedFvPatchFields/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C +++ b/src/atmosphericModels/derivedFvPatchFields/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C @@ -41,14 +41,8 @@ tmp nutkAtmRoughWallFunctionFvPatchScalarField::nut() const const label patchi = patch().index(); const momentumTransportModel& turbModel = - db().lookupObject - ( - IOobject::groupName - ( - momentumTransportModel::typeName, - internalField().group() - ) - ); + db().lookupType(internalField().group()); + const scalarField& y = turbModel.y()[patchi]; const tmp tk = turbModel.k(); const volScalarField& k = tk(); diff --git a/src/functionObjects/field/PecletNo/PecletNo.C b/src/functionObjects/field/PecletNo/PecletNo.C index 46a9c2b94b..bf49549af3 100644 --- a/src/functionObjects/field/PecletNo/PecletNo.C +++ b/src/functionObjects/field/PecletNo/PecletNo.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -54,10 +54,7 @@ bool Foam::functionObjects::PecletNo::calc() { tmp nuEff ( - mesh_.lookupObject - ( - momentumTransportModel::typeName - ).nuEff() + mesh_.lookupType().nuEff() ); const surfaceScalarField& phi = diff --git a/src/functionObjects/field/age/age.C b/src/functionObjects/field/age/age.C index 4c2cff5b91..8a1d119747 100644 --- a/src/functionObjects/field/age/age.C +++ b/src/functionObjects/field/age/age.C @@ -186,11 +186,7 @@ bool Foam::functionObjects::age::execute() tmp tnuEff; if (diffusion_) { - tnuEff = - mesh_.lookupObject - ( - momentumTransportModel::typeName - ).nuEff(); + tnuEff = mesh_.lookupType().nuEff(); } for (int i=0; i<=nCorr_; i++) @@ -224,11 +220,7 @@ bool Foam::functionObjects::age::execute() if (diffusion_) { - tnuEff = - mesh_.lookupObject - ( - momentumTransportModel::typeName - ).nuEff(); + tnuEff = mesh_.lookupType().nuEff(); laplacianScheme = "laplacian(" + tnuEff().name() + ',' + schemesField_ + ")"; diff --git a/src/functionObjects/field/turbulenceFields/turbulenceFields.C b/src/functionObjects/field/turbulenceFields/turbulenceFields.C index fc0b3a31c7..53064a351c 100644 --- a/src/functionObjects/field/turbulenceFields/turbulenceFields.C +++ b/src/functionObjects/field/turbulenceFields/turbulenceFields.C @@ -25,7 +25,7 @@ License #include "turbulenceFields.H" #include "incompressibleMomentumTransportModel.H" -#include "thermophysicalTransportModel.H" +#include "fluidThermophysicalTransportModel.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -158,18 +158,10 @@ bool Foam::functionObjects::turbulenceFields::read(const dictionary& dict) bool Foam::functionObjects::turbulenceFields::execute() { - const word modelName - ( - IOobject::groupName(momentumTransportModel::typeName, phaseName_) - ); - - if (obr_.foundObject(modelName)) + if (obr_.foundObject(phaseName_)) { - const thermophysicalTransportModel& ttm = - obr_.lookupObject - ( - thermophysicalTransportModel::typeName - ); + const fluidThermophysicalTransportModel& ttm = + obr_.lookupType(phaseName_); const compressibleMomentumTransportModel& model = ttm.momentumTransport(); @@ -227,10 +219,10 @@ bool Foam::functionObjects::turbulenceFields::execute() } } } - else if (obr_.foundObject(modelName)) + else if (obr_.foundType(phaseName_)) { const compressibleMomentumTransportModel& model = - obr_.lookupObject(modelName); + obr_.lookupType(phaseName_); forAllConstIter(wordHashSet, fieldSet_, iter) { @@ -282,14 +274,11 @@ bool Foam::functionObjects::turbulenceFields::execute() } else if ( - obr_.foundObject(modelName) + obr_.foundType(phaseName_) ) { const incompressible::momentumTransportModel& model = - obr_.lookupObject - ( - modelName - ); + obr_.lookupType(phaseName_); forAllConstIter(wordHashSet, fieldSet_, iter) { diff --git a/src/functionObjects/field/turbulenceIntensity/turbulenceIntensity.C b/src/functionObjects/field/turbulenceIntensity/turbulenceIntensity.C index d7a5796822..ad9df6e606 100644 --- a/src/functionObjects/field/turbulenceIntensity/turbulenceIntensity.C +++ b/src/functionObjects/field/turbulenceIntensity/turbulenceIntensity.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2018-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2018-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -97,19 +97,10 @@ bool Foam::functionObjects::turbulenceIntensity::read(const dictionary& dict) bool Foam::functionObjects::turbulenceIntensity::execute() { - if - ( - mesh_.foundObject - ( - momentumTransportModel::typeName - ) - ) + if (mesh_.foundType()) { const momentumTransportModel& turbModel = - mesh_.lookupObject - ( - momentumTransportModel::typeName - ); + mesh_.lookupType(); volScalarField uPrime(sqrt((2.0/3.0)*turbModel.k())); diff --git a/src/functionObjects/field/wallHeatFlux/wallHeatFlux.C b/src/functionObjects/field/wallHeatFlux/wallHeatFlux.C index 0ca72f5856..35e8d9f336 100644 --- a/src/functionObjects/field/wallHeatFlux/wallHeatFlux.C +++ b/src/functionObjects/field/wallHeatFlux/wallHeatFlux.C @@ -25,8 +25,6 @@ License #include "wallHeatFlux.H" #include "thermophysicalTransportModel.H" -#include "solidThermophysicalTransportModel.H" -#include "solidThermo.H" #include "surfaceInterpolate.H" #include "fvcGrad.H" #include "wallPolyPatch.H" @@ -220,26 +218,10 @@ bool Foam::functionObjects::wallHeatFlux::execute() return store(fieldName, calcWallHeatFlux(ttm.q())); } - else if - ( - foundObject - ( - solidThermophysicalTransportModel::typeName - ) - ) - { - const solidThermophysicalTransportModel& sttm = - lookupObject - ( - solidThermophysicalTransportModel::typeName - ); - - return store(fieldName, calcWallHeatFlux(sttm.q())); - } else { FatalErrorInFunction - << "Unable to find compressible turbulence model in the " + << "Unable to find thermophysicalTransportModel in the " << "database" << exit(FatalError); } diff --git a/src/functionObjects/field/yPlus/yPlus.C b/src/functionObjects/field/yPlus/yPlus.C index ca26a059c4..e94be57008 100644 --- a/src/functionObjects/field/yPlus/yPlus.C +++ b/src/functionObjects/field/yPlus/yPlus.C @@ -169,14 +169,7 @@ bool Foam::functionObjects::yPlus::execute() ) { const momentumTransportModel& model = - mesh_.lookupObject - ( - IOobject::groupName - ( - momentumTransportModel::typeName, - phaseName_ - ) - ); + mesh_.lookupType(phaseName_); word name(IOobject::groupName(type(), phaseName_)); diff --git a/src/functionObjects/solvers/scalarTransport/scalarTransport.C b/src/functionObjects/solvers/scalarTransport/scalarTransport.C index f70a6bde42..ac58f33dfc 100644 --- a/src/functionObjects/solvers/scalarTransport/scalarTransport.C +++ b/src/functionObjects/solvers/scalarTransport/scalarTransport.C @@ -101,10 +101,7 @@ Foam::functionObjects::scalarTransport::D() const else { const momentumTransportModel& turbulence = - mesh_.lookupObject - ( - momentumTransportModel::typeName - ); + mesh_.lookupType(); return alphal_*turbulence.nu() + alphat_*turbulence.nut(); } diff --git a/src/fvModels/derived/heatTransfer/heatTransferModels/variable/variable.C b/src/fvModels/derived/heatTransfer/heatTransferModels/variable/variable.C index 0405835257..9071d26f83 100644 --- a/src/fvModels/derived/heatTransfer/heatTransferModels/variable/variable.C +++ b/src/fvModels/derived/heatTransfer/heatTransferModels/variable/variable.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "variable.H" -#include "thermophysicalTransportModel.H" +#include "fluidThermophysicalTransportModel.H" #include "zeroGradientFvPatchFields.H" #include "addToRunTimeSelectionTable.H" @@ -114,11 +114,9 @@ Foam::fv::heatTransferModels::variable::~variable() void Foam::fv::heatTransferModels::variable::correct() { - const thermophysicalTransportModel& ttm = - mesh().lookupObject - ( - thermophysicalTransportModel::typeName - ); + const fluidThermophysicalTransportModel& ttm = + mesh().lookupType(); + const compressibleMomentumTransportModel& mtm = ttm.momentumTransport(); diff --git a/src/fvModels/derived/volumeFractionSource/volumeFractionSource.C b/src/fvModels/derived/volumeFractionSource/volumeFractionSource.C index 8a2dcd3c9e..ee09ef5709 100644 --- a/src/fvModels/derived/volumeFractionSource/volumeFractionSource.C +++ b/src/fvModels/derived/volumeFractionSource/volumeFractionSource.C @@ -28,7 +28,7 @@ License #include "fvmLaplacian.H" #include "fvcDiv.H" #include "surfaceInterpolate.H" -#include "thermophysicalTransportModel.H" +#include "fluidThermophysicalTransportModel.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -100,20 +100,14 @@ Foam::tmp Foam::fv::volumeFractionSource::D if (phi.dimensions() == dimVolume/dimTime) { const momentumTransportModel& turbulence = - mesh().lookupObject - ( - momentumTransportModel::typeName - ); + mesh().lookupType(); return turbulence.nuEff(); } else if (phi.dimensions() == dimMass/dimTime) { - const thermophysicalTransportModel& ttm = - mesh().lookupObject - ( - thermophysicalTransportModel::typeName - ); + const fluidThermophysicalTransportModel& ttm = + mesh().lookupType(); return fieldName == ttm.thermo().T().name() @@ -127,6 +121,7 @@ Foam::tmp Foam::fv::volumeFractionSource::D FatalErrorInFunction << "Dimensions of " << phi.name() << " not recognised" << exit(FatalError); + return tmp(nullptr); } } diff --git a/src/lagrangian/parcelTurbulence/submodels/Kinematic/DispersionModel/DispersionRASModel/DispersionRASModel.C b/src/lagrangian/parcelTurbulence/submodels/Kinematic/DispersionModel/DispersionRASModel/DispersionRASModel.C index 55194ee489..a0885db313 100644 --- a/src/lagrangian/parcelTurbulence/submodels/Kinematic/DispersionModel/DispersionRASModel/DispersionRASModel.C +++ b/src/lagrangian/parcelTurbulence/submodels/Kinematic/DispersionModel/DispersionRASModel/DispersionRASModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -34,17 +34,12 @@ Foam::tmp Foam::DispersionRASModel::kModel() const { const objectRegistry& obr = this->owner().mesh(); - const word turbName = - IOobject::groupName - ( - momentumTransportModel::typeName, - this->owner().U().group() - ); - if (obr.foundObject(turbName)) + if (obr.foundType(this->owner().U().group())) { const momentumTransportModel& model = - obr.lookupObject(turbName); + obr.lookupType(this->owner().U().group()); + return model.k(); } else @@ -64,17 +59,12 @@ Foam::tmp Foam::DispersionRASModel::epsilonModel() const { const objectRegistry& obr = this->owner().mesh(); - const word turbName = - IOobject::groupName - ( - momentumTransportModel::typeName, - this->owner().U().group() - ); - if (obr.foundObject(turbName)) + if (obr.foundType(this->owner().U().group())) { const momentumTransportModel& model = - obr.lookupObject(turbName); + obr.lookupType(this->owner().U().group()); + return model.epsilon(); } else diff --git a/src/lagrangian/parcelTurbulence/submodels/Thermodynamic/ParticleForces/BrownianMotion/BrownianMotionForce.C b/src/lagrangian/parcelTurbulence/submodels/Thermodynamic/ParticleForces/BrownianMotion/BrownianMotionForce.C index 2de5b19cf6..6254369e99 100644 --- a/src/lagrangian/parcelTurbulence/submodels/Thermodynamic/ParticleForces/BrownianMotion/BrownianMotionForce.C +++ b/src/lagrangian/parcelTurbulence/submodels/Thermodynamic/ParticleForces/BrownianMotion/BrownianMotionForce.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -57,17 +57,12 @@ Foam::tmp Foam::BrownianMotionForce::kModel() const { const objectRegistry& obr = this->owner().mesh(); - const word turbName = - IOobject::groupName - ( - momentumTransportModel::typeName, - this->owner().U().group() - ); - if (obr.foundObject(turbName)) + if (obr.foundType(this->owner().U().group())) { const momentumTransportModel& model = - obr.lookupObject(turbName); + obr.lookupType(this->owner().U().group()); + return model.k(); } else diff --git a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C index 19a3f38213..606b6d6f66 100644 --- a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C +++ b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "alphatFilmWallFunctionFvPatchScalarField.H" -#include "thermophysicalTransportModel.H" +#include "fluidThermophysicalTransportModel.H" #include "surfaceFilm.H" #include "fvPatchFieldMapper.H" #include "volFields.H" @@ -158,14 +158,10 @@ void alphatFilmWallFunctionFvPatchScalarField::updateCoeffs() scalarField mDotFilmp = mDotFilm().boundaryField()[filmPatchi]; filmModel.toPrimary(filmPatchi, mDotFilmp); - const thermophysicalTransportModel& ttm = - db().lookupObject + const fluidThermophysicalTransportModel& ttm = + db().lookupType ( - IOobject::groupName - ( - thermophysicalTransportModel::typeName, - internalField().group() - ) + internalField().group() ); const compressibleMomentumTransportModel& turbModel = diff --git a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/nutkFilmWallFunction/nutkFilmWallFunctionFvPatchScalarField.C b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/nutkFilmWallFunction/nutkFilmWallFunctionFvPatchScalarField.C index c1b61b675d..21742b1072 100644 --- a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/nutkFilmWallFunction/nutkFilmWallFunctionFvPatchScalarField.C +++ b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/nutkFilmWallFunction/nutkFilmWallFunctionFvPatchScalarField.C @@ -74,17 +74,9 @@ tmp nutkFilmWallFunctionFvPatchScalarField::calcUTau scalarField mDotFilmp = mDotFilm().boundaryField()[filmPatchi]; filmModel.toPrimary(filmPatchi, mDotFilmp); - // Retrieve RAS turbulence model const momentumTransportModel& turbModel = - db().lookupObject - ( - IOobject::groupName - ( - momentumTransportModel::typeName, - internalField().group() - ) - ); + db().lookupType(internalField().group()); const scalarField& y = turbModel.y()[patchi]; const tmp tk = turbModel.k(); @@ -129,14 +121,7 @@ tmp nutkFilmWallFunctionFvPatchScalarField::nut() const const label patchi = patch().index(); const momentumTransportModel& turbModel = - db().lookupObject - ( - IOobject::groupName - ( - momentumTransportModel::typeName, - internalField().group() - ) - ); + db().lookupType(internalField().group()); const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi]; const scalarField magGradU(mag(Uw.snGrad())); @@ -222,14 +207,7 @@ tmp nutkFilmWallFunctionFvPatchScalarField::yPlus() const const label patchi = patch().index(); const momentumTransportModel& turbModel = - db().lookupObject - ( - IOobject::groupName - ( - momentumTransportModel::typeName, - internalField().group() - ) - ); + db().lookupType(internalField().group()); const scalarField& y = turbModel.y()[patchi]; const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi]; diff --git a/src/specieTransfer/derivedFvPatchFields/adsorptionMassFraction/adsorptionMassFractionFvPatchScalarField.C b/src/specieTransfer/derivedFvPatchFields/adsorptionMassFraction/adsorptionMassFractionFvPatchScalarField.C index b7d696db26..cf2b8b77ec 100644 --- a/src/specieTransfer/derivedFvPatchFields/adsorptionMassFraction/adsorptionMassFractionFvPatchScalarField.C +++ b/src/specieTransfer/derivedFvPatchFields/adsorptionMassFraction/adsorptionMassFractionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,7 +26,7 @@ License #include "adsorptionMassFractionFvPatchScalarField.H" #include "volFields.H" #include "surfaceFields.H" -#include "thermophysicalTransportModel.H" +#include "fluidThermophysicalTransportModel.H" #include "basicSpecieMixture.H" #include "addToRunTimeSelectionTable.H" @@ -98,11 +98,9 @@ Foam::adsorptionMassFractionFvPatchScalarField::calcPhiYp() const const scalarField Yc(patchInternalField()); // Get the patch delta coefficients multiplied by the diffusivity - const thermophysicalTransportModel& ttm = - db().lookupObject - ( - thermophysicalTransportModel::typeName - ); + const fluidThermophysicalTransportModel& ttm = + db().lookupType(); + const scalarField alphaEffDeltap ( ttm.alphaEff(patch().index())*patch().deltaCoeffs() diff --git a/src/specieTransfer/derivedFvPatchFields/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.C b/src/specieTransfer/derivedFvPatchFields/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.C index 4ec5b360e0..a9021dd0c5 100644 --- a/src/specieTransfer/derivedFvPatchFields/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.C +++ b/src/specieTransfer/derivedFvPatchFields/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.C @@ -27,7 +27,7 @@ License #include "fvPatchFieldMapper.H" #include "volFields.H" #include "surfaceFields.H" -#include "thermophysicalTransportModel.H" +#include "fluidThermophysicalTransportModel.H" #include "basicSpecieMixture.H" #include "mappedPatchBase.H" #include "addToRunTimeSelectionTable.H" @@ -126,15 +126,14 @@ Foam::semiPermeableBaffleMassFractionFvPatchScalarField::calcPhiYp() const ); // Get the patch delta coefficients multiplied by the diffusivity - const thermophysicalTransportModel& ttm = - db().lookupObject - ( - thermophysicalTransportModel::typeName - ); + const fluidThermophysicalTransportModel& ttm = + db().lookupType(); + const scalarField alphaEffDeltap ( ttm.alphaEff(patch().index())*patch().deltaCoeffs() ); + const scalarField nbrAlphaEffDeltap ( mpp.distribute diff --git a/src/specieTransfer/derivedFvPatchFields/specieTransferMassFraction/specieTransferMassFractionFvPatchScalarField.C b/src/specieTransfer/derivedFvPatchFields/specieTransferMassFraction/specieTransferMassFractionFvPatchScalarField.C index 0153386c26..717dbd0b15 100644 --- a/src/specieTransfer/derivedFvPatchFields/specieTransferMassFraction/specieTransferMassFractionFvPatchScalarField.C +++ b/src/specieTransfer/derivedFvPatchFields/specieTransferMassFraction/specieTransferMassFractionFvPatchScalarField.C @@ -27,7 +27,7 @@ License #include "specieTransferVelocityFvPatchVectorField.H" #include "volFields.H" #include "surfaceFields.H" -#include "thermophysicalTransportModel.H" +#include "fluidThermophysicalTransportModel.H" #include "fluidMulticomponentThermo.H" // * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * // @@ -235,10 +235,7 @@ void Foam::specieTransferMassFractionFvPatchScalarField::updateCoeffs() const scalarField AAlphaEffp ( patch().magSf() - *db().lookupObject - ( - thermophysicalTransportModel::typeName - ) + *db().lookupType() .alphaEff(patch().index()) ); diff --git a/src/specieTransfer/derivedFvPatchFields/specieTransferTemperature/specieTransferTemperatureFvPatchScalarField.C b/src/specieTransfer/derivedFvPatchFields/specieTransferTemperature/specieTransferTemperatureFvPatchScalarField.C index e2a6a8f19e..de6f2152c5 100644 --- a/src/specieTransfer/derivedFvPatchFields/specieTransferTemperature/specieTransferTemperatureFvPatchScalarField.C +++ b/src/specieTransfer/derivedFvPatchFields/specieTransferTemperature/specieTransferTemperatureFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,7 +28,7 @@ License #include "specieTransferVelocityFvPatchVectorField.H" #include "volFields.H" #include "surfaceFields.H" -#include "thermophysicalTransportModel.H" +#include "fluidThermophysicalTransportModel.H" #include "basicSpecieMixture.H" #include "addToRunTimeSelectionTable.H" @@ -154,10 +154,8 @@ void Foam::specieTransferTemperatureFvPatchScalarField::updateCoeffs() const scalarField AAlphaEffp ( patch().magSf() - *db().lookupObject - ( - thermophysicalTransportModel::typeName - ).alphaEff(patch().index()) + *db().lookupType() + .alphaEff(patch().index()) ); // Get the current energy to linearise around diff --git a/tutorials/modules/CHT/shellAndTubeHeatExchanger/0/solid/T b/tutorials/modules/CHT/shellAndTubeHeatExchanger/0/solid/T index dabfd0945f..87f1c2ee39 100644 --- a/tutorials/modules/CHT/shellAndTubeHeatExchanger/0/solid/T +++ b/tutorials/modules/CHT/shellAndTubeHeatExchanger/0/solid/T @@ -29,17 +29,11 @@ boundaryField solid_to_shell { type coupledTemperature; - - libs ("libcoupledThermophysicalTransportModels.so"); - value $internalField; } solid_to_tube { type coupledTemperature; - - libs ("libcoupledThermophysicalTransportModels.so"); - value $internalField; } }