From 25b34809c788e30243bb52a33e92a149889055d0 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Fri, 10 Apr 2020 18:18:51 +0100 Subject: [PATCH] ThermophysicalTransportModels: New library to handle the transport of energy and species The simplistic energy transport support in compressibleTurbulenceModels has been abstracted and separated into the new ThermophysicalTransportModels library in order to provide a more general interface to support complex energy and specie transport models, in particular multi-component diffusion. Currently only the Fourier for laminar and eddyDiffusivity for RAS and LES turbulent flows are provided but the interface is general and the set of models will be expanded in the near future. The ThermalDiffusivity and EddyDiffusivity modelling layers remain in compressibleTurbulenceModels but will be removed shortly and the alphat boundary conditions will be moved to ThermophysicalTransportModels. --- .../solvers/combustion/PDRFoam/Make/options | 6 +- .../solvers/combustion/PDRFoam/PDRFoam.C | 4 +- .../solvers/combustion/PDRFoam/createFields.H | 9 + .../solvers/combustion/XiFoam/EaEqn.H | 2 +- .../solvers/combustion/XiFoam/EauEqn.H | 2 +- .../solvers/combustion/XiFoam/Make/options | 2 + .../XiFoam/XiEngineFoam/Make/options | 2 + .../XiFoam/XiEngineFoam/XiEngineFoam.C | 4 +- .../solvers/combustion/XiFoam/XiFoam.C | 4 +- applications/solvers/combustion/XiFoam/bEqn.H | 7 +- .../solvers/combustion/XiFoam/createFields.H | 6 + .../solvers/combustion/XiFoam/ftEqn.H | 2 +- .../combustion/coldEngineFoam/Make/options | 6 +- .../coldEngineFoam/coldEngineFoam.C | 4 +- .../combustion/coldEngineFoam/createFields.H | 6 + .../solvers/combustion/fireFoam/Make/options | 2 + .../solvers/combustion/fireFoam/YEEqn.H | 4 +- .../combustion/fireFoam/createFields.H | 6 + .../solvers/combustion/fireFoam/fireFoam.C | 4 +- .../solvers/combustion/reactingFoam/EEqn.H | 2 +- .../combustion/reactingFoam/Make/options | 2 + .../solvers/combustion/reactingFoam/YEqn.H | 2 +- .../combustion/reactingFoam/createFields.H | 6 + .../combustion/reactingFoam/reactingFoam.C | 2 + .../rhoReactingBuoyantFoam/Make/options | 2 + .../rhoReactingBuoyantFoam/createFields.H | 6 + .../rhoReactingBuoyantFoam.C | 2 + .../reactingFoam/rhoReactingFoam/Make/options | 2 + .../rhoReactingFoam/createFields.H | 6 + .../rhoReactingFoam/rhoReactingFoam.C | 2 + .../compressible/rhoCentralFoam/Make/options | 2 + .../rhoCentralFoam/createFields.H | 6 + .../rhoCentralFoam/rhoCentralFoam.C | 6 +- .../solvers/compressible/rhoPimpleFoam/EEqn.H | 2 +- .../compressible/rhoPimpleFoam/Make/options | 2 + .../compressible/rhoPimpleFoam/createFields.H | 6 + .../rhoPimpleFoam/rhoPimpleFoam.C | 2 + .../solvers/compressible/rhoSimpleFoam/EEqn.H | 2 +- .../compressible/rhoSimpleFoam/Make/options | 2 + .../compressible/rhoSimpleFoam/createFields.H | 6 + .../rhoPorousSimpleFoam/Make/options | 2 + .../rhoPorousSimpleFoam/rhoPorousSimpleFoam.C | 4 +- .../rhoSimpleFoam/rhoSimpleFoam.C | 2 + .../heatTransfer/buoyantPimpleFoam/EEqn.H | 2 +- .../buoyantPimpleFoam/Make/options | 2 + .../buoyantPimpleFoam/buoyantPimpleFoam.C | 2 + .../buoyantPimpleFoam/createFields.H | 6 + .../heatTransfer/buoyantSimpleFoam/EEqn.H | 2 +- .../buoyantSimpleFoam/Make/options | 4 +- .../buoyantSimpleFoam/buoyantSimpleFoam.C | 2 + .../buoyantSimpleFoam/createFields.H | 6 + .../chtMultiRegionFoam/Make/options | 2 + .../chtMultiRegionFoam/chtMultiRegionFoam.C | 3 +- .../chtMultiRegionFoam/fluid/EEqn.H | 2 +- .../chtMultiRegionFoam/fluid/YEqn.H | 2 +- .../fluid/createFluidFields.H | 12 + .../fluid/setRegionFluidFields.H | 3 + .../chtMultiRegionFoam/fluid/solveFluid.H | 1 + .../solvers/heatTransfer/thermoFoam/EEqn.H | 2 +- .../heatTransfer/thermoFoam/Make/options | 6 +- .../heatTransfer/thermoFoam/createFields.H | 18 +- .../heatTransfer/thermoFoam/setAlphaEff.H | 47 ---- .../heatTransfer/thermoFoam/thermoFoam.C | 5 +- .../lagrangian/coalChemistryFoam/EEqn.H | 2 +- .../lagrangian/coalChemistryFoam/Make/options | 2 + .../lagrangian/coalChemistryFoam/YEqn.H | 2 +- .../coalChemistryFoam/coalChemistryFoam.C | 4 +- .../coalChemistryFoam/createFields.H | 6 + .../lagrangian/reactingParcelFoam/EEqn.H | 2 +- .../reactingParcelFoam/Make/options | 2 + .../lagrangian/reactingParcelFoam/YEqn.H | 2 +- .../reactingParcelFoam/createFields.H | 6 + .../reactingParcelFoam/reactingParcelFoam.C | 2 + .../simpleReactingParcelFoam/EEqn.H | 2 +- .../simpleReactingParcelFoam/Make/options | 2 + .../simpleReactingParcelFoam/YEqn.H | 2 +- .../simpleReactingParcelFoam/createFields.H | 6 + .../simpleReactingParcelFoam.C | 4 +- .../solvers/lagrangian/sprayFoam/EEqn.H | 2 +- .../solvers/lagrangian/sprayFoam/Make/options | 2 + .../solvers/lagrangian/sprayFoam/YEqn.H | 2 +- .../lagrangian/sprayFoam/createFields.H | 6 + .../sprayFoam/engineFoam/Make/options | 2 + .../sprayFoam/engineFoam/engineFoam.C | 4 +- .../solvers/lagrangian/sprayFoam/sprayFoam.C | 4 +- .../compressibleInterPhaseTransportModel.C | 27 +- .../compressibleInterPhaseTransportModel.H | 4 +- .../multiphase/reactingEulerFoam/Allwclean | 1 + .../multiphase/reactingEulerFoam/Allwmake | 1 + .../turbulentDispersionModel.C | 4 +- ...sonJacksonParticleSlipFvPatchVectorField.C | 2 +- ...onJacksonParticleThetaFvPatchScalarField.C | 2 +- ...ayatillekeWallFunctionFvPatchScalarField.C | 17 +- ...allBoilingWallFunctionFvPatchScalarField.C | 4 +- .../phaseSystems/Make/options | 1 + .../MovingPhaseModel/MovingPhaseModel.C | 14 +- .../MovingPhaseModel/MovingPhaseModel.H | 4 + .../phaseThermophysicalTransportModel.H | 52 ++++ .../phaseModel/phaseModel/phaseModel.H | 6 + .../wallBoiling/wallBoiling.C | 4 +- .../populationBalanceModel.C | 2 +- .../Make/files | 3 + .../Make/options | 19 ++ .../phaseThermophysicalTransportModels.C | 104 ++++++++ .../reactingMultiphaseEulerFoam/Make/options | 2 + .../reactingTwoPhaseEulerFoam/Make/options | 2 + .../IATEsources/wallBoiling/wallBoiling.C | 4 +- .../multiphase/twoPhaseEulerFoam/Allwclean | 1 + .../multiphase/twoPhaseEulerFoam/Allwmake | 1 + .../multiphase/twoPhaseEulerFoam/Make/options | 6 +- .../Make/options | 2 +- ...sonJacksonParticleSlipFvPatchVectorField.C | 4 +- ...onJacksonParticleThetaFvPatchScalarField.C | 4 +- .../Make/files | 3 + .../Make/options | 18 ++ .../phaseThermophysicalTransportModels.C | 104 ++++++++ .../twoPhaseSystem/phaseModel/phaseModel.H | 8 +- src/Allwmake | 1 + .../LESThermophysicalTransportModel.C | 176 +++++++++++++ .../LESThermophysicalTransportModel.H | 234 ++++++++++++++++++ .../LESeddyDiffusivity/LESeddyDiffusivity.C | 158 ++++++++++++ .../LESeddyDiffusivity/LESeddyDiffusivity.H | 180 ++++++++++++++ src/ThermophysicalTransportModels/Make/files | 19 ++ .../Make/options | 19 ++ .../PhaseThermophysicalTransportModel.C | 63 +++++ .../PhaseThermophysicalTransportModel.H | 102 ++++++++ .../RASThermophysicalTransportModel.C | 172 +++++++++++++ .../RASThermophysicalTransportModel.H | 234 ++++++++++++++++++ .../RASeddyDiffusivity/RASeddyDiffusivity.C | 158 ++++++++++++ .../RASeddyDiffusivity/RASeddyDiffusivity.H | 180 ++++++++++++++ .../ThermophysicalTransportModel.C | 83 +++++++ .../ThermophysicalTransportModel.H | 152 ++++++++++++ .../fluidThermo/fluidThermoTransportModel.H | 80 ++++++ .../laminar/Fourier/Fourier.C | 107 ++++++++ .../laminar/Fourier/Fourier.H | 121 +++++++++ .../laminarThermophysicalTransportModel.C | 174 +++++++++++++ .../laminarThermophysicalTransportModel.H | 234 ++++++++++++++++++ .../thermophysicalTransportModel.C | 76 ++++++ .../thermophysicalTransportModel.H | 141 +++++++++++ .../makeThermophysicalTransportModel.H | 159 ++++++++++++ .../thermophysicalTransportModels.C | 61 +++++ .../thermophysicalTransportModels.H | 71 ++++++ .../cavity/constant/thermophysicalTransport | 25 ++ 143 files changed, 3833 insertions(+), 134 deletions(-) delete mode 100644 applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H create mode 100644 applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/phaseThermophysicalTransportModel.H create mode 100644 applications/solvers/multiphase/reactingEulerFoam/phaseThermophysicalTransportModels/Make/files create mode 100644 applications/solvers/multiphase/reactingEulerFoam/phaseThermophysicalTransportModels/Make/options create mode 100644 applications/solvers/multiphase/reactingEulerFoam/phaseThermophysicalTransportModels/phaseThermophysicalTransportModels.C create mode 100644 applications/solvers/multiphase/twoPhaseEulerFoam/phaseThermophysicalTransportModels/Make/files create mode 100644 applications/solvers/multiphase/twoPhaseEulerFoam/phaseThermophysicalTransportModels/Make/options create mode 100644 applications/solvers/multiphase/twoPhaseEulerFoam/phaseThermophysicalTransportModels/phaseThermophysicalTransportModels.C create mode 100644 src/ThermophysicalTransportModels/LES/LESThermophysicalTransportModel/LESThermophysicalTransportModel.C create mode 100644 src/ThermophysicalTransportModels/LES/LESThermophysicalTransportModel/LESThermophysicalTransportModel.H create mode 100644 src/ThermophysicalTransportModels/LES/LESeddyDiffusivity/LESeddyDiffusivity.C create mode 100644 src/ThermophysicalTransportModels/LES/LESeddyDiffusivity/LESeddyDiffusivity.H create mode 100644 src/ThermophysicalTransportModels/Make/files create mode 100644 src/ThermophysicalTransportModels/Make/options create mode 100644 src/ThermophysicalTransportModels/PhaseThermophysicalTransportModel/PhaseThermophysicalTransportModel.C create mode 100644 src/ThermophysicalTransportModels/PhaseThermophysicalTransportModel/PhaseThermophysicalTransportModel.H create mode 100644 src/ThermophysicalTransportModels/RAS/RASThermophysicalTransportModel/RASThermophysicalTransportModel.C create mode 100644 src/ThermophysicalTransportModels/RAS/RASThermophysicalTransportModel/RASThermophysicalTransportModel.H create mode 100644 src/ThermophysicalTransportModels/RAS/RASeddyDiffusivity/RASeddyDiffusivity.C create mode 100644 src/ThermophysicalTransportModels/RAS/RASeddyDiffusivity/RASeddyDiffusivity.H create mode 100644 src/ThermophysicalTransportModels/ThermophysicalTransportModel/ThermophysicalTransportModel.C create mode 100644 src/ThermophysicalTransportModels/ThermophysicalTransportModel/ThermophysicalTransportModel.H create mode 100644 src/ThermophysicalTransportModels/fluidThermo/fluidThermoTransportModel.H create mode 100644 src/ThermophysicalTransportModels/laminar/Fourier/Fourier.C create mode 100644 src/ThermophysicalTransportModels/laminar/Fourier/Fourier.H create mode 100644 src/ThermophysicalTransportModels/laminar/laminarThermophysicalTransportModel/laminarThermophysicalTransportModel.C create mode 100644 src/ThermophysicalTransportModels/laminar/laminarThermophysicalTransportModel/laminarThermophysicalTransportModel.H create mode 100644 src/ThermophysicalTransportModels/thermophysicalTransportModel/thermophysicalTransportModel.C create mode 100644 src/ThermophysicalTransportModels/thermophysicalTransportModel/thermophysicalTransportModel.H create mode 100644 src/ThermophysicalTransportModels/thermophysicalTransportModels/makeThermophysicalTransportModel.H create mode 100644 src/ThermophysicalTransportModels/thermophysicalTransportModels/thermophysicalTransportModels.C create mode 100644 src/ThermophysicalTransportModels/thermophysicalTransportModels/thermophysicalTransportModels.H create mode 100644 tutorials/compressible/rhoPimpleFoam/RAS/cavity/constant/thermophysicalTransport diff --git a/applications/solvers/combustion/PDRFoam/Make/options b/applications/solvers/combustion/PDRFoam/Make/options index a7c8e12f62..f2c0ad276d 100644 --- a/applications/solvers/combustion/PDRFoam/Make/options +++ b/applications/solvers/combustion/PDRFoam/Make/options @@ -26,6 +26,7 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ @@ -36,12 +37,13 @@ EXE_INC = \ EXE_LIBS = \ -lengine \ -lmeshTools \ - -lturbulenceModels \ - -lcompressibleTurbulenceModels \ -lcompressibleTransportModels \ -lfluidThermophysicalModels \ -lreactionThermophysicalModels \ -lspecie \ + -lturbulenceModels \ + -lcompressibleTurbulenceModels \ + -lthermophysicalTransportModels \ -llaminarFlameSpeedModels \ -lfiniteVolume \ -ldynamicFvMesh \ diff --git a/applications/solvers/combustion/PDRFoam/PDRFoam.C b/applications/solvers/combustion/PDRFoam/PDRFoam.C index b60179d48a..81c9d82eb6 100644 --- a/applications/solvers/combustion/PDRFoam/PDRFoam.C +++ b/applications/solvers/combustion/PDRFoam/PDRFoam.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-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -70,6 +70,7 @@ Description #include "fvCFD.H" #include "psiuReactionThermo.H" #include "turbulentFluidThermoModel.H" +#include "fluidThermoTransportModel.H" #include "laminarFlameSpeed.H" #include "XiModel.H" #include "PDRDragModel.H" @@ -140,6 +141,7 @@ int main(int argc, char *argv[]) if (pimple.turbCorr()) { turbulence->correct(); + thermophysicalTransport->correct(); } } diff --git a/applications/solvers/combustion/PDRFoam/createFields.H b/applications/solvers/combustion/PDRFoam/createFields.H index 6134f45c5c..18733c360e 100644 --- a/applications/solvers/combustion/PDRFoam/createFields.H +++ b/applications/solvers/combustion/PDRFoam/createFields.H @@ -57,6 +57,15 @@ autoPtr turbulence ) ); +Info<< "Creating thermophysical transport model\n" << endl; +autoPtr +thermophysicalTransport +( + compressible::RASThermophysicalTransportModel::New + ( + turbulence() + ) +); Info<< "Creating field dpdt\n" << endl; volScalarField dpdt diff --git a/applications/solvers/combustion/XiFoam/EaEqn.H b/applications/solvers/combustion/XiFoam/EaEqn.H index c6cc5efc51..172ef00fce 100644 --- a/applications/solvers/combustion/XiFoam/EaEqn.H +++ b/applications/solvers/combustion/XiFoam/EaEqn.H @@ -15,7 +15,7 @@ ) : -dpdt ) - - fvm::laplacian(turbulence->alphaEff(), hea) + - fvm::laplacian(thermophysicalTransport->alphaEff(), hea) + fvOptions(rho, hea) ); diff --git a/applications/solvers/combustion/XiFoam/EauEqn.H b/applications/solvers/combustion/XiFoam/EauEqn.H index dd4c455518..dcbb20c8b2 100644 --- a/applications/solvers/combustion/XiFoam/EauEqn.H +++ b/applications/solvers/combustion/XiFoam/EauEqn.H @@ -16,7 +16,7 @@ if (ign.ignited()) )*rho/thermo.rhou() : -dpdt*rho/thermo.rhou() ) - - fvm::laplacian(turbulence->alphaEff(), heau) + - fvm::laplacian(thermophysicalTransport->alphaEff(), heau) // These terms cannot be used in partially-premixed combustion due to // the resultant inconsistency between ft and heau transport. diff --git a/applications/solvers/combustion/XiFoam/Make/options b/applications/solvers/combustion/XiFoam/Make/options index f659b4dcbe..b5f2862825 100644 --- a/applications/solvers/combustion/XiFoam/Make/options +++ b/applications/solvers/combustion/XiFoam/Make/options @@ -6,6 +6,7 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \ @@ -15,6 +16,7 @@ EXE_LIBS = \ -lengine \ -lturbulenceModels \ -lcompressibleTurbulenceModels \ + -lthermophysicalTransportModels \ -lcompressibleTransportModels \ -lfluidThermophysicalModels \ -lreactionThermophysicalModels \ diff --git a/applications/solvers/combustion/XiFoam/XiEngineFoam/Make/options b/applications/solvers/combustion/XiFoam/XiEngineFoam/Make/options index 957735be5e..5342f80a5d 100644 --- a/applications/solvers/combustion/XiFoam/XiEngineFoam/Make/options +++ b/applications/solvers/combustion/XiFoam/XiEngineFoam/Make/options @@ -10,6 +10,7 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude EXE_LIBS = \ @@ -20,6 +21,7 @@ EXE_LIBS = \ -lengine \ -lturbulenceModels \ -lcompressibleTurbulenceModels \ + -lthermophysicalTransportModels \ -lcompressibleTransportModels \ -lfluidThermophysicalModels \ -lreactionThermophysicalModels \ diff --git a/applications/solvers/combustion/XiFoam/XiEngineFoam/XiEngineFoam.C b/applications/solvers/combustion/XiFoam/XiEngineFoam/XiEngineFoam.C index 1569122c89..a2413c8424 100644 --- a/applications/solvers/combustion/XiFoam/XiEngineFoam/XiEngineFoam.C +++ b/applications/solvers/combustion/XiFoam/XiEngineFoam/XiEngineFoam.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-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -53,6 +53,7 @@ Description #include "engineMesh.H" #include "psiuReactionThermo.H" #include "turbulentFluidThermoModel.H" +#include "fluidThermoTransportModel.H" #include "laminarFlameSpeed.H" #include "ignition.H" #include "Switch.H" @@ -127,6 +128,7 @@ int main(int argc, char *argv[]) if (pimple.turbCorr()) { turbulence->correct(); + thermophysicalTransport->correct(); } } diff --git a/applications/solvers/combustion/XiFoam/XiFoam.C b/applications/solvers/combustion/XiFoam/XiFoam.C index ae4be9c804..151e365be6 100644 --- a/applications/solvers/combustion/XiFoam/XiFoam.C +++ b/applications/solvers/combustion/XiFoam/XiFoam.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-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -52,6 +52,7 @@ Description #include "fvCFD.H" #include "psiuReactionThermo.H" #include "turbulentFluidThermoModel.H" +#include "fluidThermoTransportModel.H" #include "laminarFlameSpeed.H" #include "ignition.H" #include "Switch.H" @@ -117,6 +118,7 @@ int main(int argc, char *argv[]) if (pimple.turbCorr()) { turbulence->correct(); + thermophysicalTransport->correct(); } } diff --git a/applications/solvers/combustion/XiFoam/bEqn.H b/applications/solvers/combustion/XiFoam/bEqn.H index 2d8c0b7a9a..54d53b5893 100644 --- a/applications/solvers/combustion/XiFoam/bEqn.H +++ b/applications/solvers/combustion/XiFoam/bEqn.H @@ -52,7 +52,7 @@ if (ign.ignited()) + mvConvection->fvmDiv(phi, b) + fvm::div(phiSt, b) - fvm::Sp(fvc::div(phiSt), b) - - fvm::laplacian(turbulence->alphaEff(), b) + - fvm::laplacian(thermophysicalTransport->alphaEff(), b) == fvOptions(rho, b) ); @@ -103,7 +103,10 @@ if (ign.ignited()) surfaceScalarField phiXi ( phiSt - - fvc::interpolate(fvc::laplacian(turbulence->alphaEff(), b)/mgb)*nf + - fvc::interpolate + ( + fvc::laplacian(thermophysicalTransport->alphaEff(), b)/mgb + )*nf + fvc::interpolate(rho)*fvc::interpolate(Su*(1.0/Xi - Xi))*nf ); diff --git a/applications/solvers/combustion/XiFoam/createFields.H b/applications/solvers/combustion/XiFoam/createFields.H index d83ea841ff..2d33788db9 100644 --- a/applications/solvers/combustion/XiFoam/createFields.H +++ b/applications/solvers/combustion/XiFoam/createFields.H @@ -58,6 +58,12 @@ autoPtr turbulence ) ); +Info<< "Creating thermophysical transport model\n" << endl; +autoPtr thermophysicalTransport +( + compressible::thermophysicalTransportModel::New(turbulence()) +); + Info<< "Creating field dpdt\n" << endl; volScalarField dpdt ( diff --git a/applications/solvers/combustion/XiFoam/ftEqn.H b/applications/solvers/combustion/XiFoam/ftEqn.H index c0f7dcad9c..d3092eb78f 100644 --- a/applications/solvers/combustion/XiFoam/ftEqn.H +++ b/applications/solvers/combustion/XiFoam/ftEqn.H @@ -17,7 +17,7 @@ if (composition.contains("ft")) ( fvm::ddt(rho, ft) + mvConvection->fvmDiv(phi, ft) - - fvm::laplacian(turbulence->alphaEff(), ft) + - fvm::laplacian(thermophysicalTransport->alphaEff(), ft) == fvOptions(rho, ft) ); diff --git a/applications/solvers/combustion/coldEngineFoam/Make/options b/applications/solvers/combustion/coldEngineFoam/Make/options index 1e267e19ed..65841b342c 100644 --- a/applications/solvers/combustion/coldEngineFoam/Make/options +++ b/applications/solvers/combustion/coldEngineFoam/Make/options @@ -10,16 +10,18 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ EXE_LIBS = \ -lengine \ - -lturbulenceModels \ - -lcompressibleTurbulenceModels \ -lcompressibleTransportModels \ -lfluidThermophysicalModels \ + -lturbulenceModels \ + -lcompressibleTurbulenceModels \ + -lthermophysicalTransportModels \ -lspecie \ -lfiniteVolume \ -lmeshTools \ diff --git a/applications/solvers/combustion/coldEngineFoam/coldEngineFoam.C b/applications/solvers/combustion/coldEngineFoam/coldEngineFoam.C index a97113eaa1..55a4f2084c 100644 --- a/applications/solvers/combustion/coldEngineFoam/coldEngineFoam.C +++ b/applications/solvers/combustion/coldEngineFoam/coldEngineFoam.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-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -34,6 +34,7 @@ Description #include "engineMesh.H" #include "psiThermo.H" #include "turbulentFluidThermoModel.H" +#include "fluidThermoTransportModel.H" #include "OFstream.H" #include "fvOptions.H" #include "pimpleControl.H" @@ -95,6 +96,7 @@ int main(int argc, char *argv[]) if (pimple.turbCorr()) { turbulence->correct(); + thermophysicalTransport->correct(); } } diff --git a/applications/solvers/combustion/coldEngineFoam/createFields.H b/applications/solvers/combustion/coldEngineFoam/createFields.H index 9e6f937709..1e363eb350 100644 --- a/applications/solvers/combustion/coldEngineFoam/createFields.H +++ b/applications/solvers/combustion/coldEngineFoam/createFields.H @@ -51,6 +51,12 @@ autoPtr turbulence ) ); +Info<< "Creating thermophysical transport model\n" << endl; +autoPtr thermophysicalTransport +( + compressible::thermophysicalTransportModel::New(turbulence()) +); + Info<< "Creating field dpdt\n" << endl; volScalarField dpdt ( diff --git a/applications/solvers/combustion/fireFoam/Make/options b/applications/solvers/combustion/fireFoam/Make/options index 58da65f273..2613ac02db 100644 --- a/applications/solvers/combustion/fireFoam/Make/options +++ b/applications/solvers/combustion/fireFoam/Make/options @@ -4,6 +4,7 @@ EXE_INC = \ -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude \ -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \ @@ -27,6 +28,7 @@ EXE_LIBS = \ -lsampling \ -lturbulenceModels \ -lcompressibleTurbulenceModels \ + -lthermophysicalTransportModels \ -lspecie \ -lcompressibleTransportModels \ -lfluidThermophysicalModels \ diff --git a/applications/solvers/combustion/fireFoam/YEEqn.H b/applications/solvers/combustion/fireFoam/YEEqn.H index e4a86200ee..479ae4c2eb 100644 --- a/applications/solvers/combustion/fireFoam/YEEqn.H +++ b/applications/solvers/combustion/fireFoam/YEEqn.H @@ -23,7 +23,7 @@ tmp> mvConvection ( fvm::ddt(rho, Yi) + mvConvection->fvmDiv(phi, Yi) - - fvm::laplacian(turbulence->alphaEff(), Yi) + - fvm::laplacian(thermophysicalTransport->alphaEff(), Yi) == parcels.SYi(i, Yi) + surfaceFilm.Srho(i) @@ -63,7 +63,7 @@ tmp> mvConvection ) : -dpdt ) - - fvm::laplacian(turbulence->alphaEff(), he) + - fvm::laplacian(thermophysicalTransport->alphaEff(), he) == combustion->Qdot() + radiation->Sh(thermo, he) diff --git a/applications/solvers/combustion/fireFoam/createFields.H b/applications/solvers/combustion/fireFoam/createFields.H index 90e6b90e11..b7388084e5 100644 --- a/applications/solvers/combustion/fireFoam/createFields.H +++ b/applications/solvers/combustion/fireFoam/createFields.H @@ -64,6 +64,12 @@ autoPtr turbulence ) ); +Info<< "Creating thermophysical transport model\n" << endl; +autoPtr thermophysicalTransport +( + compressible::thermophysicalTransportModel::New(turbulence()) +); + Info<< "Creating combustion model\n" << endl; autoPtr> combustion ( diff --git a/applications/solvers/combustion/fireFoam/fireFoam.C b/applications/solvers/combustion/fireFoam/fireFoam.C index 2eae4d1d05..20fa4f4620 100644 --- a/applications/solvers/combustion/fireFoam/fireFoam.C +++ b/applications/solvers/combustion/fireFoam/fireFoam.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-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -32,6 +32,7 @@ Description #include "fvCFD.H" #include "turbulentFluidThermoModel.H" +#include "fluidThermoTransportModel.H" #include "basicReactingCloud.H" #include "surfaceFilmModel.H" #include "radiationModel.H" @@ -98,6 +99,7 @@ int main(int argc, char *argv[]) if (pimple.turbCorr()) { turbulence->correct(); + thermophysicalTransport->correct(); } } diff --git a/applications/solvers/combustion/reactingFoam/EEqn.H b/applications/solvers/combustion/reactingFoam/EEqn.H index c5e01eb4e8..043ed846ea 100644 --- a/applications/solvers/combustion/reactingFoam/EEqn.H +++ b/applications/solvers/combustion/reactingFoam/EEqn.H @@ -15,7 +15,7 @@ ) : -dpdt ) - - fvm::laplacian(turbulence->alphaEff(), he) + + thermophysicalTransport->divq(he) == reaction->Qdot() + fvOptions(rho, he) diff --git a/applications/solvers/combustion/reactingFoam/Make/options b/applications/solvers/combustion/reactingFoam/Make/options index 6363f6d80d..dff0ef8489 100644 --- a/applications/solvers/combustion/reactingFoam/Make/options +++ b/applications/solvers/combustion/reactingFoam/Make/options @@ -4,6 +4,7 @@ EXE_INC = \ -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \ @@ -19,6 +20,7 @@ EXE_LIBS = \ -lsampling \ -lturbulenceModels \ -lcompressibleTurbulenceModels \ + -lthermophysicalTransportModels \ -lreactionThermophysicalModels \ -lspecie \ -lcompressibleTransportModels \ diff --git a/applications/solvers/combustion/reactingFoam/YEqn.H b/applications/solvers/combustion/reactingFoam/YEqn.H index 58f3ba5e2a..9346dd3f97 100644 --- a/applications/solvers/combustion/reactingFoam/YEqn.H +++ b/applications/solvers/combustion/reactingFoam/YEqn.H @@ -23,7 +23,7 @@ tmp> mvConvection ( fvm::ddt(rho, Yi) + mvConvection->fvmDiv(phi, Yi) - - fvm::laplacian(turbulence->alphaEff(), Yi) + - fvm::laplacian(thermophysicalTransport->alphaEff(), Yi) == reaction->R(Yi) + fvOptions(rho, Yi) diff --git a/applications/solvers/combustion/reactingFoam/createFields.H b/applications/solvers/combustion/reactingFoam/createFields.H index 82bed57147..f4c814cf0a 100644 --- a/applications/solvers/combustion/reactingFoam/createFields.H +++ b/applications/solvers/combustion/reactingFoam/createFields.H @@ -61,6 +61,12 @@ autoPtr turbulence ) ); +Info<< "Creating thermophysical transport model\n" << endl; +autoPtr thermophysicalTransport +( + compressible::thermophysicalTransportModel::New(turbulence()) +); + Info<< "Creating reaction model\n" << endl; autoPtr> reaction ( diff --git a/applications/solvers/combustion/reactingFoam/reactingFoam.C b/applications/solvers/combustion/reactingFoam/reactingFoam.C index 95c0bec4a1..c566be7f9a 100644 --- a/applications/solvers/combustion/reactingFoam/reactingFoam.C +++ b/applications/solvers/combustion/reactingFoam/reactingFoam.C @@ -31,6 +31,7 @@ Description #include "fvCFD.H" #include "turbulentFluidThermoModel.H" +#include "fluidThermoTransportModel.H" #include "psiReactionThermo.H" #include "CombustionModel.H" #include "multivariateScheme.H" @@ -102,6 +103,7 @@ int main(int argc, char *argv[]) if (pimple.turbCorr()) { turbulence->correct(); + thermophysicalTransport->correct(); } } diff --git a/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/Make/options b/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/Make/options index 57f5c58466..2bb23a9d78 100644 --- a/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/Make/options +++ b/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/Make/options @@ -7,6 +7,7 @@ EXE_INC = \ -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \ @@ -23,6 +24,7 @@ EXE_LIBS = \ -lsampling \ -lturbulenceModels \ -lcompressibleTurbulenceModels \ + -lthermophysicalTransportModels \ -lreactionThermophysicalModels \ -lspecie \ -lcompressibleTransportModels \ diff --git a/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/createFields.H b/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/createFields.H index 7274bf121d..7b314c29cd 100644 --- a/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/createFields.H +++ b/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/createFields.H @@ -62,6 +62,12 @@ autoPtr turbulence ) ); +Info<< "Creating thermophysical transport model\n" << endl; +autoPtr thermophysicalTransport +( + compressible::thermophysicalTransportModel::New(turbulence()) +); + Info<< "Creating reaction model\n" << endl; autoPtr> reaction ( diff --git a/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/rhoReactingBuoyantFoam.C b/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/rhoReactingBuoyantFoam.C index ec9b3cc559..0da388e640 100644 --- a/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/rhoReactingBuoyantFoam.C +++ b/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/rhoReactingBuoyantFoam.C @@ -34,6 +34,7 @@ Description #include "rhoReactionThermo.H" #include "CombustionModel.H" #include "turbulentFluidThermoModel.H" +#include "fluidThermoTransportModel.H" #include "multivariateScheme.H" #include "pimpleControl.H" #include "pressureControl.H" @@ -104,6 +105,7 @@ int main(int argc, char *argv[]) if (pimple.turbCorr()) { turbulence->correct(); + thermophysicalTransport->correct(); } } diff --git a/applications/solvers/combustion/reactingFoam/rhoReactingFoam/Make/options b/applications/solvers/combustion/reactingFoam/rhoReactingFoam/Make/options index 45c9d929fa..7ee0625fd5 100644 --- a/applications/solvers/combustion/reactingFoam/rhoReactingFoam/Make/options +++ b/applications/solvers/combustion/reactingFoam/rhoReactingFoam/Make/options @@ -3,6 +3,7 @@ EXE_INC = \ -I$(FOAM_SOLVERS)/combustion/reactingFoam \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \ @@ -26,6 +27,7 @@ EXE_LIBS = \ -lreactionThermophysicalModels \ -lturbulenceModels \ -lcompressibleTurbulenceModels \ + -lthermophysicalTransportModels \ -lfiniteVolume \ -ldynamicFvMesh \ -ltopoChangerFvMesh \ diff --git a/applications/solvers/combustion/reactingFoam/rhoReactingFoam/createFields.H b/applications/solvers/combustion/reactingFoam/rhoReactingFoam/createFields.H index 2fb40ac1b6..7c30133652 100644 --- a/applications/solvers/combustion/reactingFoam/rhoReactingFoam/createFields.H +++ b/applications/solvers/combustion/reactingFoam/rhoReactingFoam/createFields.H @@ -64,6 +64,12 @@ autoPtr turbulence ) ); +Info<< "Creating thermophysical transport model\n" << endl; +autoPtr thermophysicalTransport +( + compressible::thermophysicalTransportModel::New(turbulence()) +); + Info<< "Creating reaction model\n" << endl; autoPtr> reaction ( diff --git a/applications/solvers/combustion/reactingFoam/rhoReactingFoam/rhoReactingFoam.C b/applications/solvers/combustion/reactingFoam/rhoReactingFoam/rhoReactingFoam.C index 806112b075..47337cd19a 100644 --- a/applications/solvers/combustion/reactingFoam/rhoReactingFoam/rhoReactingFoam.C +++ b/applications/solvers/combustion/reactingFoam/rhoReactingFoam/rhoReactingFoam.C @@ -35,6 +35,7 @@ Description #include "rhoReactionThermo.H" #include "CombustionModel.H" #include "turbulentFluidThermoModel.H" +#include "fluidThermoTransportModel.H" #include "multivariateScheme.H" #include "pimpleControl.H" #include "pressureControl.H" @@ -157,6 +158,7 @@ int main(int argc, char *argv[]) if (pimple.turbCorr()) { turbulence->correct(); + thermophysicalTransport->correct(); } } diff --git a/applications/solvers/compressible/rhoCentralFoam/Make/options b/applications/solvers/compressible/rhoCentralFoam/Make/options index 3b71f3ea95..46c7be115f 100644 --- a/applications/solvers/compressible/rhoCentralFoam/Make/options +++ b/applications/solvers/compressible/rhoCentralFoam/Make/options @@ -6,6 +6,7 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude \ -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude @@ -18,6 +19,7 @@ EXE_LIBS = \ -lrhoCentralFoam \ -lturbulenceModels \ -lcompressibleTurbulenceModels \ + -lthermophysicalTransportModels \ -ldynamicFvMesh \ -ltopoChangerFvMesh \ -lmeshTools diff --git a/applications/solvers/compressible/rhoCentralFoam/createFields.H b/applications/solvers/compressible/rhoCentralFoam/createFields.H index 4f8be91d64..24f0baf463 100644 --- a/applications/solvers/compressible/rhoCentralFoam/createFields.H +++ b/applications/solvers/compressible/rhoCentralFoam/createFields.H @@ -100,3 +100,9 @@ autoPtr turbulence thermo ) ); + +Info<< "Creating thermophysical transport model\n" << endl; +autoPtr thermophysicalTransport +( + compressible::thermophysicalTransportModel::New(turbulence()) +); diff --git a/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C b/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C index f74fa9f1a0..9736977ad0 100644 --- a/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C +++ b/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -34,6 +34,7 @@ Description #include "dynamicFvMesh.H" #include "psiThermo.H" #include "turbulentFluidThermoModel.H" +#include "fluidThermoTransportModel.H" #include "fixedRhoFvPatchScalarField.H" #include "directionInterpolate.H" #include "localEulerDdtScheme.H" @@ -248,7 +249,7 @@ int main(int argc, char *argv[]) solve ( fvm::ddt(rho, e) - fvc::ddt(rho, e) - - fvm::laplacian(turbulence->alphaEff(), e) + + thermophysicalTransport->divq(e) ); thermo.correct(); rhoE = rho*(e + 0.5*magSqr(U)); @@ -261,6 +262,7 @@ int main(int argc, char *argv[]) rho.boundaryFieldRef() == psi.boundaryField()*p.boundaryField(); turbulence->correct(); + thermophysicalTransport->correct(); runTime.write(); diff --git a/applications/solvers/compressible/rhoPimpleFoam/EEqn.H b/applications/solvers/compressible/rhoPimpleFoam/EEqn.H index ee2a95f208..7408a2833a 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/EEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/EEqn.H @@ -15,7 +15,7 @@ ) : -dpdt ) - - fvm::laplacian(turbulence->alphaEff(), he) + + thermophysicalTransport->divq(he) == fvOptions(rho, he) ); diff --git a/applications/solvers/compressible/rhoPimpleFoam/Make/options b/applications/solvers/compressible/rhoPimpleFoam/Make/options index 94658ff20f..c7edbe2842 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/Make/options +++ b/applications/solvers/compressible/rhoPimpleFoam/Make/options @@ -3,6 +3,7 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude \ -I$(LIB_SRC)/finiteVolume/cfdTools \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ @@ -15,6 +16,7 @@ EXE_LIBS = \ -lspecie \ -lturbulenceModels \ -lcompressibleTurbulenceModels \ + -lthermophysicalTransportModels \ -lfiniteVolume \ -ldynamicFvMesh \ -ltopoChangerFvMesh \ diff --git a/applications/solvers/compressible/rhoPimpleFoam/createFields.H b/applications/solvers/compressible/rhoPimpleFoam/createFields.H index 90392ed475..f3ea79a0e2 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/createFields.H +++ b/applications/solvers/compressible/rhoPimpleFoam/createFields.H @@ -62,6 +62,12 @@ autoPtr turbulence ) ); +Info<< "Creating thermophysical transport model\n" << endl; +autoPtr thermophysicalTransport +( + compressible::thermophysicalTransportModel::New(turbulence()) +); + Info<< "Creating field dpdt\n" << endl; volScalarField dpdt ( diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C index d00ed96121..c893c4b6c9 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C @@ -37,6 +37,7 @@ Description #include "dynamicFvMesh.H" #include "fluidThermo.H" #include "turbulentFluidThermoModel.H" +#include "fluidThermoTransportModel.H" #include "pimpleControl.H" #include "pressureControl.H" #include "CorrectPhi.H" @@ -162,6 +163,7 @@ int main(int argc, char *argv[]) if (pimple.turbCorr()) { turbulence->correct(); + thermophysicalTransport->correct(); } } diff --git a/applications/solvers/compressible/rhoSimpleFoam/EEqn.H b/applications/solvers/compressible/rhoSimpleFoam/EEqn.H index 56e78ff630..8fb20d1ac1 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/EEqn.H +++ b/applications/solvers/compressible/rhoSimpleFoam/EEqn.H @@ -9,7 +9,7 @@ ? fvc::div(phi, volScalarField("Ekp", 0.5*magSqr(U) + p/rho)) : fvc::div(phi, volScalarField("K", 0.5*magSqr(U))) ) - - fvm::laplacian(turbulence->alphaEff(), he) + + thermophysicalTransport->divq(he) == fvOptions(rho, he) ); diff --git a/applications/solvers/compressible/rhoSimpleFoam/Make/options b/applications/solvers/compressible/rhoSimpleFoam/Make/options index aecfa919e7..004a38ed50 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/Make/options +++ b/applications/solvers/compressible/rhoSimpleFoam/Make/options @@ -3,6 +3,7 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude \ -I$(LIB_SRC)/finiteVolume/cfdTools \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \ @@ -14,6 +15,7 @@ EXE_LIBS = \ -lspecie \ -lturbulenceModels \ -lcompressibleTurbulenceModels \ + -lthermophysicalTransportModels \ -lfiniteVolume \ -lsampling \ -lmeshTools \ diff --git a/applications/solvers/compressible/rhoSimpleFoam/createFields.H b/applications/solvers/compressible/rhoSimpleFoam/createFields.H index 1d525d7d76..e3472bb586 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/createFields.H +++ b/applications/solvers/compressible/rhoSimpleFoam/createFields.H @@ -60,6 +60,12 @@ autoPtr turbulence ) ); +Info<< "Creating thermophysical transport model\n" << endl; +autoPtr thermophysicalTransport +( + compressible::thermophysicalTransportModel::New(turbulence()) +); + dimensionedScalar initialMass = fvc::domainIntegrate(rho); #include "createMRF.H" diff --git a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/Make/options b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/Make/options index 02ddee5132..e32cb2c002 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/Make/options +++ b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/Make/options @@ -5,6 +5,7 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude \ -I$(LIB_SRC)/finiteVolume/cfdTools \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \ @@ -16,6 +17,7 @@ EXE_LIBS = \ -lspecie \ -lturbulenceModels \ -lcompressibleTurbulenceModels \ + -lthermophysicalTransportModels \ -lfiniteVolume \ -lsampling \ -lmeshTools \ diff --git a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/rhoPorousSimpleFoam.C b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/rhoPorousSimpleFoam.C index 4aa4fa98f8..4fd16544f5 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/rhoPorousSimpleFoam.C +++ b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/rhoPorousSimpleFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,6 +33,7 @@ Description #include "fvCFD.H" #include "fluidThermo.H" #include "turbulentFluidThermoModel.H" +#include "fluidThermoTransportModel.H" #include "simpleControl.H" #include "pressureControl.H" #include "fvOptions.H" @@ -70,6 +71,7 @@ int main(int argc, char *argv[]) } turbulence->correct(); + thermophysicalTransport->correct(); runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" diff --git a/applications/solvers/compressible/rhoSimpleFoam/rhoSimpleFoam.C b/applications/solvers/compressible/rhoSimpleFoam/rhoSimpleFoam.C index 7440d229b7..9de062c334 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/rhoSimpleFoam.C +++ b/applications/solvers/compressible/rhoSimpleFoam/rhoSimpleFoam.C @@ -32,6 +32,7 @@ Description #include "fvCFD.H" #include "fluidThermo.H" #include "turbulentFluidThermoModel.H" +#include "fluidThermoTransportModel.H" #include "simpleControl.H" #include "pressureControl.H" #include "fvOptions.H" @@ -66,6 +67,7 @@ int main(int argc, char *argv[]) #include "pEqn.H" turbulence->correct(); + thermophysicalTransport->correct(); runTime.write(); diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/EEqn.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/EEqn.H index f0a7e3ad36..0514425f68 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/EEqn.H +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/EEqn.H @@ -15,7 +15,7 @@ ) : -dpdt ) - - fvm::laplacian(turbulence->alphaEff(), he) + + thermophysicalTransport->divq(he) == rho*(U&g) + radiation->Sh(thermo, he) diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/Make/options b/applications/solvers/heatTransfer/buoyantPimpleFoam/Make/options index c8894d021f..a2b47826d5 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/Make/options +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/Make/options @@ -6,6 +6,7 @@ EXE_INC = \ -I$(LIB_SRC)/radiationModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude \ -I$(LIB_SRC)/finiteVolume/cfdTools \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ @@ -19,6 +20,7 @@ EXE_LIBS = \ -lspecie \ -lturbulenceModels \ -lcompressibleTurbulenceModels \ + -lthermophysicalTransportModels \ -lfiniteVolume \ -ldynamicFvMesh \ -ltopoChangerFvMesh \ diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C b/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C index 25343ee2a8..16e4ece23c 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C @@ -38,6 +38,7 @@ Description #include "dynamicFvMesh.H" #include "fluidThermo.H" #include "turbulentFluidThermoModel.H" +#include "fluidThermoTransportModel.H" #include "radiationModel.H" #include "pimpleControl.H" #include "pressureControl.H" @@ -162,6 +163,7 @@ int main(int argc, char *argv[]) if (pimple.turbCorr()) { turbulence->correct(); + thermophysicalTransport->correct(); } } diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/createFields.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/createFields.H index 58d825f881..1fe7a15ef4 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/createFields.H +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/createFields.H @@ -52,6 +52,12 @@ autoPtr turbulence ) ); +Info<< "Creating thermophysical transport model\n" << endl; +autoPtr thermophysicalTransport +( + compressible::thermophysicalTransportModel::New(turbulence()) +); + #include "readGravitationalAcceleration.H" #include "readhRef.H" diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/EEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/EEqn.H index e932d2fdef..20dec3dff0 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/EEqn.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/EEqn.H @@ -9,7 +9,7 @@ ? fvc::div(phi, volScalarField("Ekp", 0.5*magSqr(U) + p/rho)) : fvc::div(phi, volScalarField("K", 0.5*magSqr(U))) ) - - fvm::laplacian(turbulence->alphaEff(), he) + + thermophysicalTransport->divq(he) == rho*(U&g) + radiation->Sh(thermo, he) diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/Make/options b/applications/solvers/heatTransfer/buoyantSimpleFoam/Make/options index 2d14ae533c..7ef5940fdf 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/Make/options +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/Make/options @@ -7,7 +7,8 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/radiationModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude + -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude EXE_LIBS = \ -lfiniteVolume \ @@ -15,6 +16,7 @@ EXE_LIBS = \ -lsampling \ -lmeshTools \ -lcompressibleTransportModels \ + -lthermophysicalTransportModels \ -lfluidThermophysicalModels \ -lspecie \ -lradiationModels \ diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C index 62f5b071c4..d3044206bf 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C @@ -33,6 +33,7 @@ Description #include "fvCFD.H" #include "rhoThermo.H" #include "turbulentFluidThermoModel.H" +#include "fluidThermoTransportModel.H" #include "radiationModel.H" #include "simpleControl.H" #include "pressureControl.H" @@ -70,6 +71,7 @@ int main(int argc, char *argv[]) } turbulence->correct(); + thermophysicalTransport->correct(); runTime.write(); diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H index 02b0811887..18f9006e3c 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H @@ -47,6 +47,12 @@ autoPtr turbulence ) ); +Info<< "Creating thermophysical transport model\n" << endl; +autoPtr thermophysicalTransport +( + compressible::thermophysicalTransportModel::New(turbulence()) +); + #include "readGravitationalAcceleration.H" #include "readhRef.H" diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options b/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options index 96f1f137d2..16a5ccd245 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options @@ -19,6 +19,7 @@ EXE_INC = \ -I$(LIB_SRC)/combustionModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude \ -I$(LIB_SRC)/radiationModels/lnInclude \ -I$(LIB_SRC)/regionModels/regionModel/lnInclude @@ -34,6 +35,7 @@ EXE_LIBS = \ -lcombustionModels \ -lturbulenceModels \ -lcompressibleTurbulenceModels \ + -lthermophysicalTransportModels \ -lmeshTools \ -lfiniteVolume \ -lradiationModels \ diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C index e086325074..2ff553a0a2 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,6 +33,7 @@ Description #include "fvCFD.H" #include "turbulentFluidThermoModel.H" +#include "fluidThermoTransportModel.H" #include "rhoReactionThermo.H" #include "CombustionModel.H" #include "fixedGradientFvPatchFields.H" diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/EEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/EEqn.H index 7accb05971..5224a088e1 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/EEqn.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/EEqn.H @@ -15,7 +15,7 @@ ) : -dpdt ) - - fvm::laplacian(turbulence.alphaEff(), he) + + thermophysicalTransport.divq(he) == rho*(U&g) + rad.Sh(thermo, he) diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/YEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/YEqn.H index 4693dd7031..7d886e7fa5 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/YEqn.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/YEqn.H @@ -42,7 +42,7 @@ if (Y.size()) ( fvm::ddt(rho, Yi) + mvConvection->fvmDiv(phi, Yi) - - fvm::laplacian(turbulence.alphaEff(), Yi) + - fvm::laplacian(thermophysicalTransport.alphaEff(), Yi) == reaction.R(Yi) + fvOptions(rho, Yi) diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/createFluidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/createFluidFields.H index 66028b7d28..455693a9df 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/createFluidFields.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/createFluidFields.H @@ -8,6 +8,8 @@ PtrList hRefFluid(fluidRegions.size()); PtrList ghFluid(fluidRegions.size()); PtrList ghfFluid(fluidRegions.size()); PtrList turbulenceFluid(fluidRegions.size()); +PtrList + thermophysicalTransportFluid(fluidRegions.size()); PtrList> reactionFluid(fluidRegions.size()); PtrList p_rghFluid(fluidRegions.size()); PtrList radiation(fluidRegions.size()); @@ -157,6 +159,16 @@ forAll(fluidRegions, i) ).ptr() ); + Info<< " Adding to thermophysicalTransport\n" << endl; + thermophysicalTransportFluid.set + ( + i, + compressible::thermophysicalTransportModel::New + ( + turbulenceFluid[i] + ).ptr() + ); + Info<< " Adding to reactionFluid\n" << endl; reactionFluid.set ( diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/setRegionFluidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/setRegionFluidFields.H index f0fdc7c2f9..aace459f6f 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/setRegionFluidFields.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/setRegionFluidFields.H @@ -28,6 +28,9 @@ surfaceScalarField& phi = phiFluid[i]; compressible::turbulenceModel& turbulence = turbulenceFluid[i]; + compressible::thermophysicalTransportModel& thermophysicalTransport = + thermophysicalTransportFluid[i]; + volScalarField& K = KFluid[i]; volScalarField& dpdt = dpdtFluid[i]; diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveFluid.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveFluid.H index 137c18d230..71ed939465 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveFluid.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveFluid.H @@ -22,6 +22,7 @@ else if (pimples.pimpleTurbCorr(i)) { turbulence.correct(); + thermophysicalTransport.correct(); } if (!mesh.steady() && pimples.finalPimpleIter()) diff --git a/applications/solvers/heatTransfer/thermoFoam/EEqn.H b/applications/solvers/heatTransfer/thermoFoam/EEqn.H index 98a248ac35..88028f7782 100644 --- a/applications/solvers/heatTransfer/thermoFoam/EEqn.H +++ b/applications/solvers/heatTransfer/thermoFoam/EEqn.H @@ -15,7 +15,7 @@ ) : -dpdt ) - - fvm::laplacian(alphaEff, he) + + thermophysicalTransport->divq(he) == radiation->Sh(thermo, he) + fvOptions(rho, he) diff --git a/applications/solvers/heatTransfer/thermoFoam/Make/options b/applications/solvers/heatTransfer/thermoFoam/Make/options index 5488b6d63f..5bd67fa2fb 100644 --- a/applications/solvers/heatTransfer/thermoFoam/Make/options +++ b/applications/solvers/heatTransfer/thermoFoam/Make/options @@ -6,7 +6,8 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/radiationModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude + -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude EXE_LIBS = \ -lfiniteVolume \ @@ -18,4 +19,5 @@ EXE_LIBS = \ -lradiationModels \ -lspecie \ -lturbulenceModels \ - -lcompressibleTurbulenceModels + -lcompressibleTurbulenceModels \ + -lthermophysicalTransportModels diff --git a/applications/solvers/heatTransfer/thermoFoam/createFields.H b/applications/solvers/heatTransfer/thermoFoam/createFields.H index 59687c1d0e..a0bd5bce42 100644 --- a/applications/solvers/heatTransfer/thermoFoam/createFields.H +++ b/applications/solvers/heatTransfer/thermoFoam/createFields.H @@ -35,7 +35,23 @@ volVectorField U #include "compressibleCreatePhi.H" -#include "setAlphaEff.H" +Info<< "Creating turbulence model\n" << endl; +autoPtr turbulence +( + compressible::turbulenceModel::New + ( + rho, + U, + phi, + thermo + ) +); + +Info<< "Creating thermophysical transport model\n" << endl; +autoPtr thermophysicalTransport +( + compressible::thermophysicalTransportModel::New(turbulence()) +); Info<< "Creating field dpdt\n" << endl; volScalarField dpdt diff --git a/applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H b/applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H deleted file mode 100644 index 56a44c2ecd..0000000000 --- a/applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H +++ /dev/null @@ -1,47 +0,0 @@ -Info<< "Creating turbulence model\n" << endl; -tmp talphaEff; - -IOobject turbulencePropertiesHeader -( - "turbulenceProperties", - runTime.constant(), - mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE, - false -); - -if (turbulencePropertiesHeader.typeHeaderOk(true)) -{ - autoPtr turbulence - ( - compressible::turbulenceModel::New - ( - rho, - U, - phi, - thermo - ) - ); - - talphaEff = turbulence->alphaEff(); -} -else -{ - talphaEff = tmp - ( - new volScalarField - ( - IOobject - ( - "alphaEff", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh, - dimensionedScalar(dimMass/dimLength/dimTime, 0) - ) - ); -} diff --git a/applications/solvers/heatTransfer/thermoFoam/thermoFoam.C b/applications/solvers/heatTransfer/thermoFoam/thermoFoam.C index 4efa72e1b3..9fd9ed2256 100644 --- a/applications/solvers/heatTransfer/thermoFoam/thermoFoam.C +++ b/applications/solvers/heatTransfer/thermoFoam/thermoFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -32,6 +32,7 @@ Description #include "fvCFD.H" #include "rhoThermo.H" #include "turbulentFluidThermoModel.H" +#include "fluidThermoTransportModel.H" #include "LESModel.H" #include "radiationModel.H" #include "fvOptions.H" @@ -50,8 +51,6 @@ int main(int argc, char *argv[]) #include "createMesh.H" #include "createFields.H" - const volScalarField& alphaEff = talphaEff(); - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nEvolving thermodynamics\n" << endl; diff --git a/applications/solvers/lagrangian/coalChemistryFoam/EEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/EEqn.H index 31da75ccab..26308cb160 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/EEqn.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/EEqn.H @@ -15,7 +15,7 @@ ) : -dpdt ) - - fvm::laplacian(turbulence->alphaEff(), he) + + thermophysicalTransport->divq(he) == rho*(U&g) + combustion->Qdot() diff --git a/applications/solvers/lagrangian/coalChemistryFoam/Make/options b/applications/solvers/lagrangian/coalChemistryFoam/Make/options index e55832d24a..f42e3b53c9 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/Make/options +++ b/applications/solvers/lagrangian/coalChemistryFoam/Make/options @@ -3,6 +3,7 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ -I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \ @@ -27,6 +28,7 @@ EXE_LIBS = \ -lmeshTools \ -lturbulenceModels \ -lcompressibleTurbulenceModels \ + -lthermophysicalTransportModels \ -llagrangian \ -llagrangianIntermediate \ -llagrangianTurbulence \ diff --git a/applications/solvers/lagrangian/coalChemistryFoam/YEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/YEqn.H index 1b0ef80713..3824190673 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/YEqn.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/YEqn.H @@ -24,7 +24,7 @@ tmp> mvConvection ( fvm::ddt(rho, Yi) + mvConvection->fvmDiv(phi, Yi) - - fvm::laplacian(turbulence->alphaEff(), Yi) + - fvm::laplacian(thermophysicalTransport->alphaEff(), Yi) == coalParcels.SYi(i, Yi) + combustion->R(Yi) diff --git a/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C b/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C index 58be1b619b..97499758f2 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C +++ b/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.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-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -32,6 +32,7 @@ Description #include "fvCFD.H" #include "turbulentFluidThermoModel.H" +#include "fluidThermoTransportModel.H" #include "basicThermoCloud.H" #include "coalCloud.H" #include "psiReactionThermo.H" @@ -114,6 +115,7 @@ int main(int argc, char *argv[]) if (pimple.turbCorr()) { turbulence->correct(); + thermophysicalTransport->correct(); } } diff --git a/applications/solvers/lagrangian/coalChemistryFoam/createFields.H b/applications/solvers/lagrangian/coalChemistryFoam/createFields.H index 40c0dc8279..3888266043 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/createFields.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/createFields.H @@ -107,6 +107,12 @@ autoPtr turbulence ) ); +Info<< "Creating thermophysical transport model\n" << endl; +autoPtr thermophysicalTransport +( + compressible::thermophysicalTransportModel::New(turbulence()) +); + Info<< "Creating combustion model\n" << endl; autoPtr> combustion ( diff --git a/applications/solvers/lagrangian/reactingParcelFoam/EEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/EEqn.H index 537d75e2ff..5de37eb37a 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/EEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/EEqn.H @@ -15,7 +15,7 @@ ) : -dpdt ) - - fvm::laplacian(turbulence->alphaEff(), he) + + thermophysicalTransport->divq(he) == rho*(U&g) + parcels.Sh(he) diff --git a/applications/solvers/lagrangian/reactingParcelFoam/Make/options b/applications/solvers/lagrangian/reactingParcelFoam/Make/options index f533371a97..1d6b4f1fe5 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/Make/options +++ b/applications/solvers/lagrangian/reactingParcelFoam/Make/options @@ -6,6 +6,7 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude \ -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \ @@ -30,6 +31,7 @@ EXE_LIBS = \ -lmeshTools \ -lturbulenceModels \ -lcompressibleTurbulenceModels \ + -lthermophysicalTransportModels \ -lspecie \ -lcompressibleTransportModels \ -lfluidThermophysicalModels \ diff --git a/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H index 684aa9517f..c2aa62d37e 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H @@ -24,7 +24,7 @@ tmp> mvConvection ( fvm::ddt(rho, Yi) + mvConvection->fvmDiv(phi, Yi) - - fvm::laplacian(turbulence->alphaEff(), Yi) + - fvm::laplacian(thermophysicalTransport->alphaEff(), Yi) == parcels.SYi(i, Yi) + fvOptions(rho, Yi) diff --git a/applications/solvers/lagrangian/reactingParcelFoam/createFields.H b/applications/solvers/lagrangian/reactingParcelFoam/createFields.H index 2c099e1d02..a02694bf29 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/createFields.H @@ -61,6 +61,12 @@ autoPtr turbulence ) ); +Info<< "Creating thermophysical transport model\n" << endl; +autoPtr thermophysicalTransport +( + compressible::thermophysicalTransportModel::New(turbulence()) +); + Info<< "Creating combustion model\n" << endl; autoPtr> combustion ( diff --git a/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C b/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C index c94f1c7044..e6ab7c931c 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C +++ b/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C @@ -32,6 +32,7 @@ Description #include "fvCFD.H" #include "turbulentFluidThermoModel.H" +#include "fluidThermoTransportModel.H" #include "basicReactingMultiphaseCloud.H" #include "surfaceFilmModel.H" #include "rhoReactionThermo.H" @@ -115,6 +116,7 @@ int main(int argc, char *argv[]) if (pimple.turbCorr()) { turbulence->correct(); + thermophysicalTransport->correct(); } } } diff --git a/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/EEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/EEqn.H index f2f9ddc0b3..4507b5817c 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/EEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/EEqn.H @@ -9,7 +9,7 @@ ? fvc::div(phi, volScalarField("Ekp", 0.5*magSqr(U) + p/rho)) : fvc::div(phi, volScalarField("K", 0.5*magSqr(U))) ) - - fvm::laplacian(turbulence->alphaEff(), he) + + thermophysicalTransport->divq(he) == rho*(U&g) + parcels.Sh(he) diff --git a/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/Make/options b/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/Make/options index 4718912632..799e8fa0ab 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/Make/options +++ b/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/Make/options @@ -4,6 +4,7 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ -I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \ @@ -29,6 +30,7 @@ EXE_LIBS = \ -lmeshTools \ -lturbulenceModels \ -lcompressibleTurbulenceModels \ + -lthermophysicalTransportModels \ -llagrangian \ -llagrangianIntermediate \ -llagrangianTurbulence \ diff --git a/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/YEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/YEqn.H index d78f01e610..c8e6cabc00 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/YEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/YEqn.H @@ -22,7 +22,7 @@ tmp> mvConvection fvScalarMatrix YEqn ( mvConvection->fvmDiv(phi, Yi) - - fvm::laplacian(turbulence->alphaEff(), Yi) + - fvm::laplacian(thermophysicalTransport->alphaEff(), Yi) == parcels.SYi(i, Yi) + combustion->R(Yi) diff --git a/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/createFields.H b/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/createFields.H index 284ff09250..d152b60440 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/createFields.H @@ -84,6 +84,12 @@ autoPtr turbulence ) ); +Info<< "Creating thermophysical transport model\n" << endl; +autoPtr thermophysicalTransport +( + compressible::thermophysicalTransportModel::New(turbulence()) +); + Info<< "Creating combustion model\n" << endl; autoPtr> combustion ( diff --git a/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/simpleReactingParcelFoam.C b/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/simpleReactingParcelFoam.C index d4ec050bb1..ce110dd6e1 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/simpleReactingParcelFoam.C +++ b/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/simpleReactingParcelFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -32,6 +32,7 @@ Description #include "fvCFD.H" #include "turbulentFluidThermoModel.H" +#include "fluidThermoTransportModel.H" #include "basicReactingMultiphaseCloud.H" #include "rhoReactionThermo.H" #include "CombustionModel.H" @@ -76,6 +77,7 @@ int main(int argc, char *argv[]) } turbulence->correct(); + thermophysicalTransport->correct(); runTime.write(); diff --git a/applications/solvers/lagrangian/sprayFoam/EEqn.H b/applications/solvers/lagrangian/sprayFoam/EEqn.H index d67d2e09ae..7baab51647 100644 --- a/applications/solvers/lagrangian/sprayFoam/EEqn.H +++ b/applications/solvers/lagrangian/sprayFoam/EEqn.H @@ -15,7 +15,7 @@ ) : -dpdt ) - - fvm::laplacian(turbulence->alphaEff(), he) + + thermophysicalTransport->divq(he) == rho*(U&g) + parcels.Sh(he) diff --git a/applications/solvers/lagrangian/sprayFoam/Make/options b/applications/solvers/lagrangian/sprayFoam/Make/options index 30bd2b7b72..1806b4d5a3 100644 --- a/applications/solvers/lagrangian/sprayFoam/Make/options +++ b/applications/solvers/lagrangian/sprayFoam/Make/options @@ -7,6 +7,7 @@ EXE_INC = \ -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ -I$(LIB_SRC)/lagrangian/spray/lnInclude \ @@ -29,6 +30,7 @@ EXE_INC = \ EXE_LIBS = \ -lturbulenceModels \ -lcompressibleTurbulenceModels \ + -lthermophysicalTransportModels \ -llagrangian \ -llagrangianIntermediate \ -llagrangianTurbulence \ diff --git a/applications/solvers/lagrangian/sprayFoam/YEqn.H b/applications/solvers/lagrangian/sprayFoam/YEqn.H index 546b12a85f..1ee3dd74b9 100644 --- a/applications/solvers/lagrangian/sprayFoam/YEqn.H +++ b/applications/solvers/lagrangian/sprayFoam/YEqn.H @@ -23,7 +23,7 @@ tmp> mvConvection ( fvm::ddt(rho, Yi) + mvConvection->fvmDiv(phi, Yi) - - fvm::laplacian(turbulence->alphaEff(), Yi) + - fvm::laplacian(thermophysicalTransport->alphaEff(), Yi) == parcels.SYi(i, Yi) + combustion->R(Yi) diff --git a/applications/solvers/lagrangian/sprayFoam/createFields.H b/applications/solvers/lagrangian/sprayFoam/createFields.H index 8a6daba768..957cf9198f 100644 --- a/applications/solvers/lagrangian/sprayFoam/createFields.H +++ b/applications/solvers/lagrangian/sprayFoam/createFields.H @@ -86,6 +86,12 @@ autoPtr turbulence ) ); +Info<< "Creating thermophysical transport model\n" << endl; +autoPtr thermophysicalTransport +( + compressible::thermophysicalTransportModel::New(turbulence()) +); + Info<< "Creating combustion model\n" << endl; autoPtr> combustion ( diff --git a/applications/solvers/lagrangian/sprayFoam/engineFoam/Make/options b/applications/solvers/lagrangian/sprayFoam/engineFoam/Make/options index afd395867e..c9e089f53c 100644 --- a/applications/solvers/lagrangian/sprayFoam/engineFoam/Make/options +++ b/applications/solvers/lagrangian/sprayFoam/engineFoam/Make/options @@ -7,6 +7,7 @@ EXE_INC = \ -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ -I$(LIB_SRC)/lagrangian/spray/lnInclude \ @@ -32,6 +33,7 @@ EXE_LIBS = \ -lsampling \ -lturbulenceModels \ -lcompressibleTurbulenceModels \ + -lthermophysicalTransportModels \ -llagrangian \ -llagrangianIntermediate \ -llagrangianTurbulence \ diff --git a/applications/solvers/lagrangian/sprayFoam/engineFoam/engineFoam.C b/applications/solvers/lagrangian/sprayFoam/engineFoam/engineFoam.C index 3027de0a47..21809e93b8 100644 --- a/applications/solvers/lagrangian/sprayFoam/engineFoam/engineFoam.C +++ b/applications/solvers/lagrangian/sprayFoam/engineFoam/engineFoam.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-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -34,6 +34,7 @@ Description #include "engineTime.H" #include "engineMesh.H" #include "turbulentFluidThermoModel.H" +#include "fluidThermoTransportModel.H" #include "basicSprayCloud.H" #include "psiReactionThermo.H" #include "CombustionModel.H" @@ -101,6 +102,7 @@ int main(int argc, char *argv[]) if (pimple.turbCorr()) { turbulence->correct(); + thermophysicalTransport->correct(); } } diff --git a/applications/solvers/lagrangian/sprayFoam/sprayFoam.C b/applications/solvers/lagrangian/sprayFoam/sprayFoam.C index 2c21acc3e5..d4fa59cc8d 100644 --- a/applications/solvers/lagrangian/sprayFoam/sprayFoam.C +++ b/applications/solvers/lagrangian/sprayFoam/sprayFoam.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-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,6 +33,7 @@ Description #include "fvCFD.H" #include "dynamicFvMesh.H" #include "turbulenceModel.H" +#include "fluidThermoTransportModel.H" #include "basicSprayCloud.H" #include "psiReactionThermo.H" #include "CombustionModel.H" @@ -143,6 +144,7 @@ int main(int argc, char *argv[]) if (pimple.turbCorr()) { turbulence->correct(); + thermophysicalTransport->correct(); } } diff --git a/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/compressibleInterPhaseTransportModel.C b/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/compressibleInterPhaseTransportModel.C index 3e3ef7b3bc..d069c78a4e 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/compressibleInterPhaseTransportModel.C +++ b/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/compressibleInterPhaseTransportModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,11 +43,11 @@ Foam::compressibleInterPhaseTransportModel::compressibleInterPhaseTransportModel alphaPhi10_(alphaPhi10) { { - IOdictionary turbulenceProperties + IOdictionary momentumTransport ( IOobject ( - turbulenceModel::propertiesName, + turbulenceModel::typeName, U.time().constant(), U.db(), IOobject::MUST_READ, @@ -57,7 +57,7 @@ Foam::compressibleInterPhaseTransportModel::compressibleInterPhaseTransportModel word simulationType ( - turbulenceProperties.lookup("simulationType") + momentumTransport.lookup("simulationType") ); if (simulationType == "twoPhaseTransport") @@ -140,6 +140,7 @@ Foam::compressibleInterPhaseTransportModel::compressibleInterPhaseTransportModel Foam::tmp Foam::compressibleInterPhaseTransportModel::alphaEff() const { + /* ***HGW if (twoPhaseTransport_) { return @@ -156,6 +157,24 @@ Foam::compressibleInterPhaseTransportModel::alphaEff() const { return mixture_.alphaEff(turbulence_->alphat()); } + */ + + if (twoPhaseTransport_) + { + return + mixture_.alpha1()*mixture_.thermo1().alphaEff + ( + turbulence1_->mut() + ) + + mixture_.alpha2()*mixture_.thermo2().alphaEff + ( + turbulence2_->mut() + ); + } + else + { + return mixture_.alphaEff(turbulence_->mut()); + } } diff --git a/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/compressibleInterPhaseTransportModel.H b/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/compressibleInterPhaseTransportModel.H index cf724d5cb4..44768c5cf3 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/compressibleInterPhaseTransportModel.H +++ b/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/compressibleInterPhaseTransportModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,7 +31,7 @@ Description By default the standard mixture transport modelling approach is used in which a single momentum stress model (laminar, non-Newtonian, LES or RAS) is constructed for the mixture. However if the \c simulationType in - constant/turbulenceProperties is set to \c twoPhaseTransport the alternative + constant/momentumTransport is set to \c twoPhaseTransport the alternative Euler-Euler two-phase transport modelling approach is used in which separate stress models (laminar, non-Newtonian, LES or RAS) are instantiated for each of the two phases allowing for different modeling for the phases. diff --git a/applications/solvers/multiphase/reactingEulerFoam/Allwclean b/applications/solvers/multiphase/reactingEulerFoam/Allwclean index 680ac8689c..fa2a3c55f0 100755 --- a/applications/solvers/multiphase/reactingEulerFoam/Allwclean +++ b/applications/solvers/multiphase/reactingEulerFoam/Allwclean @@ -5,6 +5,7 @@ wclean libso phaseSystems wclean libso interfacialModels wclean libso interfacialCompositionModels wclean libso phaseCompressibleTurbulenceModels +wclean libso phaseThermophysicalTransportModels reactingTwoPhaseEulerFoam/Allwclean reactingMultiphaseEulerFoam/Allwclean wclean libso functionObjects diff --git a/applications/solvers/multiphase/reactingEulerFoam/Allwmake b/applications/solvers/multiphase/reactingEulerFoam/Allwmake index 08aa7c3218..311a218f63 100755 --- a/applications/solvers/multiphase/reactingEulerFoam/Allwmake +++ b/applications/solvers/multiphase/reactingEulerFoam/Allwmake @@ -8,6 +8,7 @@ wmake $targetType phaseSystems wmake $targetType interfacialModels wmake $targetType interfacialCompositionModels wmake $targetType phaseCompressibleTurbulenceModels +wmake $targetType phaseThermophysicalTransportModels reactingTwoPhaseEulerFoam/Allwmake $targetType $* reactingMultiphaseEulerFoam/Allwmake $targetType $* wmake $targetType functionObjects diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.C index 24f4df95ba..fece349e01 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -72,7 +72,7 @@ Foam::turbulentDispersionModel::continuousTurbulence() const ( IOobject::groupName ( - turbulenceModel::propertiesName, + turbulenceModel::typeName, pair_.continuous().name() ) ); diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleTurbulenceModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C b/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleTurbulenceModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C index 361801c397..0368f6f504 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleTurbulenceModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleTurbulenceModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C @@ -211,7 +211,7 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::updateCoeffs() db() .lookupObject ( - IOobject::groupName("turbulenceProperties", phase.name()) + IOobject::groupName("momentumTransport", phase.name()) ) .subDict("RAS") .subDict("kineticTheoryCoeffs") diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleTurbulenceModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C b/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleTurbulenceModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C index 64caa1f001..a396ac2696 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleTurbulenceModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleTurbulenceModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C @@ -225,7 +225,7 @@ void Foam::JohnsonJacksonParticleThetaFvPatchScalarField::updateCoeffs() db() .lookupObject ( - IOobject::groupName("turbulenceProperties", phase.name()) + IOobject::groupName("momentumTransport", phase.name()) ) .subDict("RAS") .subDict("kineticTheoryCoeffs") diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatPhaseJayatillekeWallFunction/alphatPhaseJayatillekeWallFunctionFvPatchScalarField.C b/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatPhaseJayatillekeWallFunction/alphatPhaseJayatillekeWallFunctionFvPatchScalarField.C index 77ae92d1b0..ee040664fb 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatPhaseJayatillekeWallFunction/alphatPhaseJayatillekeWallFunctionFvPatchScalarField.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatPhaseJayatillekeWallFunction/alphatPhaseJayatillekeWallFunctionFvPatchScalarField.C @@ -169,7 +169,6 @@ alphatPhaseJayatillekeWallFunctionFvPatchScalarField::calcAlphat const scalarField& prevAlphat ) const { - // Lookup the fluid model const phaseSystem& fluid = db().lookupObject("phaseProperties"); @@ -185,7 +184,7 @@ alphatPhaseJayatillekeWallFunctionFvPatchScalarField::calcAlphat const phaseCompressibleTurbulenceModel& turbModel = db().lookupObject ( - IOobject::groupName(turbulenceModel::propertiesName, phase.name()) + IOobject::groupName(turbulenceModel::typeName, phase.name()) ); const nutWallFunctionFvPatchScalarField& nutw = @@ -216,7 +215,7 @@ alphatPhaseJayatillekeWallFunctionFvPatchScalarField::calcAlphat const fvPatchScalarField& Tw = phase.thermo().T().boundaryField()[patchi]; - scalarField Tp(Tw.patchInternalField()); + const scalarField Tp(Tw.patchInternalField()); // Heat flux [W/m^2] - lagging alphatw const scalarField qDot @@ -224,19 +223,19 @@ alphatPhaseJayatillekeWallFunctionFvPatchScalarField::calcAlphat (prevAlphat + alphaw)*hew.snGrad() ); - scalarField uTau(Cmu25*sqrt(kw)); + const scalarField uTau(Cmu25*sqrt(kw)); - scalarField yPlus(uTau*y/(muw/rhow)); + const scalarField yPlus(uTau*y/(muw/rhow)); - scalarField Pr(muw/alphaw); + const scalarField Pr(muw/alphaw); // Molecular-to-turbulent Prandtl number ratio - scalarField Prat(Pr/Prt_); + const scalarField Prat(Pr/Prt_); // Thermal sublayer thickness - scalarField P(this->Psmooth(Prat)); + const scalarField P(this->Psmooth(Prat)); - scalarField yPlusTherm(this->yPlusTherm(nutw, P, Prat)); + const scalarField yPlusTherm(this->yPlusTherm(nutw, P, Prat)); tmp talphatConv(new scalarField(this->size())); scalarField& alphatConv = talphatConv.ref(); diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C b/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C index 76b66e5885..df9973c066 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C @@ -361,7 +361,7 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() ( IOobject::groupName ( - turbulenceModel::propertiesName, + turbulenceModel::typeName, liquid.name() ) ); @@ -370,7 +370,7 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() ( IOobject::groupName ( - turbulenceModel::propertiesName, + turbulenceModel::typeName, vapor.name() ) ); diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/Make/options b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/Make/options index 5f4202e8ad..dd3cc03747 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/Make/options +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/Make/options @@ -9,6 +9,7 @@ EXE_INC = \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude \ -I$(LIB_SRC)/combustionModels/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C index 7bb6c95fa5..4341cba256 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C @@ -26,6 +26,7 @@ License #include "MovingPhaseModel.H" #include "phaseSystem.H" #include "phaseCompressibleTurbulenceModel.H" +#include "phaseThermophysicalTransportModel.H" #include "fixedValueFvPatchFields.H" #include "slipFvPatchFields.H" #include "partialSlipFvPatchFields.H" @@ -174,6 +175,10 @@ Foam::MovingPhaseModel::MovingPhaseModel *this ) ), + thermophysicalTransport_ + ( + phaseThermophysicalTransportModel::New(turbulence_) + ), continuityError_ ( IOobject @@ -262,6 +267,7 @@ void Foam::MovingPhaseModel::correctEnergyTransport() BasePhaseModel::correctEnergyTransport(); turbulence_->correctEnergyTransport(); + thermophysicalTransport_->correct(); } @@ -475,7 +481,7 @@ template Foam::tmp Foam::MovingPhaseModel::kappaEff() const { - return turbulence_->kappaEff(); + return thermophysicalTransport_->kappaEff(); } @@ -483,7 +489,7 @@ template Foam::tmp Foam::MovingPhaseModel::kappaEff(const label patchi) const { - return turbulence_->kappaEff(patchi); + return thermophysicalTransport_->kappaEff(patchi); } @@ -491,7 +497,7 @@ template Foam::tmp Foam::MovingPhaseModel::alphaEff() const { - return turbulence_->alphaEff(); + return thermophysicalTransport_->alphaEff(); } @@ -499,7 +505,7 @@ template Foam::tmp Foam::MovingPhaseModel::alphaEff(const label patchi) const { - return turbulence_->alphaEff(patchi); + return thermophysicalTransport_->alphaEff(patchi); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.H index b5ec8f9a6b..b370de1ba6 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.H @@ -46,6 +46,7 @@ SourceFiles #include "phaseModel.H" #include "phaseCompressibleTurbulenceModel.H" +#include "phaseThermophysicalTransportModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -89,6 +90,9 @@ protected: //- Turbulence model autoPtr turbulence_; + //- Thermophysical transport model + autoPtr thermophysicalTransport_; + //- Continuity error volScalarField continuityError_; diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/phaseThermophysicalTransportModel.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/phaseThermophysicalTransportModel.H new file mode 100644 index 0000000000..3410668ddd --- /dev/null +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/phaseThermophysicalTransportModel.H @@ -0,0 +1,52 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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 . + +Typedef + Foam::phaseThermophysicalTransportModel + +Description + Typedef for phaseThermophysicalTransportModel + +\*---------------------------------------------------------------------------*/ + +#ifndef phaseThermophysicalTransportModel_H +#define phaseThermophysicalTransportModel_H + +#include "PhaseThermophysicalTransportModel.H" +#include "phaseCompressibleTurbulenceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef PhaseThermophysicalTransportModel + < + phaseCompressibleTurbulenceModel + > phaseThermophysicalTransportModel; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.H index 2fd4611e39..bd85748ad1 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.H @@ -234,6 +234,12 @@ public: //- Return the thermophysical model virtual const rhoThermo& thermo() const = 0; + //- Cast to the thermophysical model + operator const rhoThermo&() const + { + return thermo(); + } + //- Access the thermophysical model virtual rhoThermo& thermoRef() = 0; diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/populationBalanceModel/nucleationModels/wallBoiling/wallBoiling.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/populationBalanceModel/nucleationModels/wallBoiling/wallBoiling.C index e0ee89e8d4..c7f1870872 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/populationBalanceModel/nucleationModels/wallBoiling/wallBoiling.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/populationBalanceModel/nucleationModels/wallBoiling/wallBoiling.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2018-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2018-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -78,7 +78,7 @@ wallBoiling ( IOobject::groupName ( - turbulenceModel::propertiesName, + turbulenceModel::typeName, popBal_.continuousPhase().name() ) ) diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/populationBalanceModel/populationBalanceModel/populationBalanceModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/populationBalanceModel/populationBalanceModel/populationBalanceModel.C index c64d72eb54..9ca04bae9b 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/populationBalanceModel/populationBalanceModel/populationBalanceModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/populationBalanceModel/populationBalanceModel/populationBalanceModel.C @@ -1245,7 +1245,7 @@ Foam::diameterModels::populationBalanceModel::continuousTurbulence() const ( IOobject::groupName ( - turbulenceModel::propertiesName, + turbulenceModel::typeName, continuousPhase_.name() ) ); diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseThermophysicalTransportModels/Make/files b/applications/solvers/multiphase/reactingEulerFoam/phaseThermophysicalTransportModels/Make/files new file mode 100644 index 0000000000..f9623dcab6 --- /dev/null +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseThermophysicalTransportModels/Make/files @@ -0,0 +1,3 @@ +phaseThermophysicalTransportModels.C + +LIB = $(FOAM_LIBBIN)/libphaseReactingTherophysicalTransportModels diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseThermophysicalTransportModels/Make/options b/applications/solvers/multiphase/reactingEulerFoam/phaseThermophysicalTransportModels/Make/options new file mode 100644 index 0000000000..f99d16456f --- /dev/null +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseThermophysicalTransportModels/Make/options @@ -0,0 +1,19 @@ +EXE_INC = \ + -I../phaseSystems/lnInclude \ + -I../interfacialModels/lnInclude\ + -I../interfacialCompositionModels/lnInclude \ + -I$(LIB_SRC)/transportModels/compressible/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ + -I$(LIB_SRC)/transportModels/incompressible/transportModel \ + -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude + +LIB_LIBS = \ + -lphaseReactingTurbulenceModels \ + -lthermophysicalTransportModels diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseThermophysicalTransportModels/phaseThermophysicalTransportModels.C b/applications/solvers/multiphase/reactingEulerFoam/phaseThermophysicalTransportModels/phaseThermophysicalTransportModels.C new file mode 100644 index 0000000000..9109db897b --- /dev/null +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseThermophysicalTransportModels/phaseThermophysicalTransportModels.C @@ -0,0 +1,104 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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 "PhaseThermophysicalTransportModel.H" + +#include "phaseCompressibleTurbulenceModel.H" +#include "addToRunTimeSelectionTable.H" +#include "makeThermophysicalTransportModel.H" + +#include "laminarThermophysicalTransportModel.H" +#include "RASThermophysicalTransportModel.H" +#include "LESThermophysicalTransportModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makeThermophysicalTransportModelTypes +( + PhaseThermophysicalTransportModel, + phaseCompressibleTurbulenceModel +); + + +makeThermophysicalTransportModel +( + PhaseThermophysicalTransportModel, + phaseCompressibleTurbulenceModel +); + + +#define makeThermophysicalTransportLaminarModel(Type) \ + makeTemplatedThermophysicalTransportModel \ + ( \ + PhaseThermophysicalTransportModel, \ + phaseCompressibleTurbulenceModel, \ + laminar, \ + Type \ + ) + +#define makeThermophysicalTransportRASModel(Type) \ + makeTemplatedThermophysicalTransportModel \ + ( \ + PhaseThermophysicalTransportModel, \ + phaseCompressibleTurbulenceModel, \ + RAS, \ + Type \ + ) + +#define makeThermophysicalTransportLESModel(Type) \ + makeTemplatedThermophysicalTransportModel \ + ( \ + PhaseThermophysicalTransportModel, \ + phaseCompressibleTurbulenceModel, \ + LES, \ + Type \ + ) + + +// -------------------------------------------------------------------------- // +// Laminar models +// -------------------------------------------------------------------------- // + +#include "Fourier.H" +makeThermophysicalTransportLaminarModel(Fourier); + + +// -------------------------------------------------------------------------- // +// RAS models +// -------------------------------------------------------------------------- // + +#include "RASeddyDiffusivity.H" +makeThermophysicalTransportRASModel(eddyDiffusivity); + + +// -------------------------------------------------------------------------- // +// LES models +// -------------------------------------------------------------------------- // + +#include "LESeddyDiffusivity.H" +makeThermophysicalTransportLESModel(eddyDiffusivity); + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Make/options b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Make/options index 394bb5b830..8acb5d61c0 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Make/options +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Make/options @@ -19,6 +19,8 @@ EXE_LIBS = \ -lreactingEulerianInterfacialModels \ -lreactingEulerianInterfacialCompositionModels \ -lphaseReactingTurbulenceModels \ + -lphaseReactingTherophysicalTransportModels \ + -lthermophysicalTransportModels \ -lfiniteVolume \ -lfvOptions \ -lmeshTools \ diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Make/options b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Make/options index cd85b2120d..dbf0a2c702 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Make/options +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Make/options @@ -19,7 +19,9 @@ EXE_LIBS = \ -lreactingEulerianInterfacialModels \ -lreactingEulerianInterfacialCompositionModels \ -lphaseReactingTurbulenceModels \ + -lphaseReactingTherophysicalTransportModels \ -ltwoPhaseReactingTurbulenceModels \ + -lthermophysicalTransportModels \ -lfiniteVolume \ -lfvOptions \ -lmeshTools \ diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/wallBoiling/wallBoiling.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/wallBoiling/wallBoiling.C index fb79d14264..ba9fd91822 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/wallBoiling/wallBoiling.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATEsources/wallBoiling/wallBoiling.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -94,7 +94,7 @@ Foam::diameterModels::IATEsources::wallBoiling::R ( IOobject::groupName ( - turbulenceModel::propertiesName, + turbulenceModel::typeName, otherPhase().name() ) ); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/Allwclean b/applications/solvers/multiphase/twoPhaseEulerFoam/Allwclean index 056bc90a3d..bf154ca7ce 100755 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/Allwclean +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/Allwclean @@ -4,6 +4,7 @@ cd ${0%/*} || exit 1 # Run from this directory wclean libso twoPhaseSystem wclean libso interfacialModels wclean libso phaseCompressibleTurbulenceModels +wclean libso phaseThermophysicalTransportModels wclean #------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake b/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake index 33db79cd4d..3414cc4d5b 100755 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake @@ -7,6 +7,7 @@ cd ${0%/*} || exit 1 # Run from this directory wmake $targetType twoPhaseSystem wmake $targetType interfacialModels wmake $targetType phaseCompressibleTurbulenceModels +wmake $targetType phaseThermophysicalTransportModels wmake $targetType #------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/Make/options b/applications/solvers/multiphase/twoPhaseEulerFoam/Make/options index f5255ec17b..c443d63f15 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/Make/options +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/Make/options @@ -17,12 +17,12 @@ EXE_LIBS = \ -lfluidThermophysicalModels \ -lspecie \ -lturbulenceModels \ - -lcompressibleTurbulenceModels \ -lphaseCompressibleTurbulenceModels \ + -lcompressibleTurbulenceModels \ + -lthermophysicalTransportModels \ -lincompressibleTransportModels \ -lcompressibleTwoPhaseSystem \ -lcompressibleEulerianInterfacialModels \ -lfiniteVolume \ -lfvOptions \ - -lmeshTools \ - -lsampling + -lmeshTools diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/Make/options b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/Make/options index e18f6a8fdc..c4176c1eea 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/Make/options +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/Make/options @@ -1,6 +1,6 @@ EXE_INC = \ -I../twoPhaseSystem/lnInclude \ - -I../interfacialModels/lnInclude\ + -I../interfacialModels/lnInclude \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/transportModels/incompressible/transportModel \ diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C index 68d5e2a1b9..5df9d623d0 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -215,7 +215,7 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::updateCoeffs() db() .lookupObject ( - IOobject::groupName("turbulenceProperties", phased.name()) + IOobject::groupName("momentumTransport", phased.name()) ) .subDict("RAS") .subDict("kineticTheoryCoeffs") diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C index 3b555764e2..4d1d2bc15f 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -229,7 +229,7 @@ void Foam::JohnsonJacksonParticleThetaFvPatchScalarField::updateCoeffs() db() .lookupObject ( - IOobject::groupName("turbulenceProperties", phased.name()) + IOobject::groupName("momentumTransport", phased.name()) ) .subDict("RAS") .subDict("kineticTheoryCoeffs") diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseThermophysicalTransportModels/Make/files b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseThermophysicalTransportModels/Make/files new file mode 100644 index 0000000000..f9623dcab6 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseThermophysicalTransportModels/Make/files @@ -0,0 +1,3 @@ +phaseThermophysicalTransportModels.C + +LIB = $(FOAM_LIBBIN)/libphaseReactingTherophysicalTransportModels diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseThermophysicalTransportModels/Make/options b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseThermophysicalTransportModels/Make/options new file mode 100644 index 0000000000..1854016a6a --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseThermophysicalTransportModels/Make/options @@ -0,0 +1,18 @@ +EXE_INC = \ + -I../twoPhaseSystem/lnInclude \ + -I../interfacialModels/lnInclude \ + -I../phaseCompressibleTurbulenceModels/lnInclude \ + -I$(LIB_SRC)/transportModels/compressible/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/transportModels/incompressible/transportModel \ + -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude + +LIB_LIBS = \ + -lphaseCompressibleTurbulenceModels \ + -lthermophysicalTransportModels \ + -lfiniteVolume diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseThermophysicalTransportModels/phaseThermophysicalTransportModels.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseThermophysicalTransportModels/phaseThermophysicalTransportModels.C new file mode 100644 index 0000000000..9109db897b --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseThermophysicalTransportModels/phaseThermophysicalTransportModels.C @@ -0,0 +1,104 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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 "PhaseThermophysicalTransportModel.H" + +#include "phaseCompressibleTurbulenceModel.H" +#include "addToRunTimeSelectionTable.H" +#include "makeThermophysicalTransportModel.H" + +#include "laminarThermophysicalTransportModel.H" +#include "RASThermophysicalTransportModel.H" +#include "LESThermophysicalTransportModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makeThermophysicalTransportModelTypes +( + PhaseThermophysicalTransportModel, + phaseCompressibleTurbulenceModel +); + + +makeThermophysicalTransportModel +( + PhaseThermophysicalTransportModel, + phaseCompressibleTurbulenceModel +); + + +#define makeThermophysicalTransportLaminarModel(Type) \ + makeTemplatedThermophysicalTransportModel \ + ( \ + PhaseThermophysicalTransportModel, \ + phaseCompressibleTurbulenceModel, \ + laminar, \ + Type \ + ) + +#define makeThermophysicalTransportRASModel(Type) \ + makeTemplatedThermophysicalTransportModel \ + ( \ + PhaseThermophysicalTransportModel, \ + phaseCompressibleTurbulenceModel, \ + RAS, \ + Type \ + ) + +#define makeThermophysicalTransportLESModel(Type) \ + makeTemplatedThermophysicalTransportModel \ + ( \ + PhaseThermophysicalTransportModel, \ + phaseCompressibleTurbulenceModel, \ + LES, \ + Type \ + ) + + +// -------------------------------------------------------------------------- // +// Laminar models +// -------------------------------------------------------------------------- // + +#include "Fourier.H" +makeThermophysicalTransportLaminarModel(Fourier); + + +// -------------------------------------------------------------------------- // +// RAS models +// -------------------------------------------------------------------------- // + +#include "RASeddyDiffusivity.H" +makeThermophysicalTransportRASModel(eddyDiffusivity); + + +// -------------------------------------------------------------------------- // +// LES models +// -------------------------------------------------------------------------- // + +#include "LESeddyDiffusivity.H" +makeThermophysicalTransportLESModel(eddyDiffusivity); + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H index ea6b606c5f..b993b6b8b2 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H @@ -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-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -165,6 +165,12 @@ public: return thermo_(); } + //- Cast to the thermophysical model + operator const rhoThermo&() const + { + return thermo(); + } + //- Return non-const access to the thermophysical model // for correction rhoThermo& thermo() diff --git a/src/Allwmake b/src/Allwmake index 63c3eb2f31..69d637be3a 100755 --- a/src/Allwmake +++ b/src/Allwmake @@ -56,6 +56,7 @@ wmake $targetType randomProcesses transportModels/Allwmake $targetType $* thermophysicalModels/Allwmake $targetType $* TurbulenceModels/Allwmake $targetType $* +wmake $targetType ThermophysicalTransportModels wmake $targetType radiationModels wmake $targetType combustionModels regionModels/Allwmake $targetType $* diff --git a/src/ThermophysicalTransportModels/LES/LESThermophysicalTransportModel/LESThermophysicalTransportModel.C b/src/ThermophysicalTransportModels/LES/LESThermophysicalTransportModel/LESThermophysicalTransportModel.C new file mode 100644 index 0000000000..d13d9f665e --- /dev/null +++ b/src/ThermophysicalTransportModels/LES/LESThermophysicalTransportModel/LESThermophysicalTransportModel.C @@ -0,0 +1,176 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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 "LESThermophysicalTransportModel.H" +#include "LESeddyDiffusivity.H" + +// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // + +template +void Foam::LESThermophysicalTransportModel +< + BasicThermophysicalTransportModel +>::printCoeffs +( + const word& type) +{ + if (printCoeffs_) + { + Info<< coeffDict_.dictName() << coeffDict_ << endl; + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::LESThermophysicalTransportModel +< + BasicThermophysicalTransportModel +>::LESThermophysicalTransportModel +( + const word& type, + const momentumTransportModel& momentumTransport +) +: + BasicThermophysicalTransportModel + ( + momentumTransport + ), + + LESDict_(this->subOrEmptyDict("LES")), + printCoeffs_(LESDict_.lookupOrDefault("printCoeffs", false)), + coeffDict_(LESDict_.optionalSubDict(type + "Coeffs")) +{} + + +// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // + +template +Foam::autoPtr +< + Foam::LESThermophysicalTransportModel + < + BasicThermophysicalTransportModel + > +> +Foam::LESThermophysicalTransportModel +< + BasicThermophysicalTransportModel +>::New +( + const momentumTransportModel& momentumTransport +) +{ + IOobject header + ( + IOobject::groupName + ( + thermophysicalTransportModel::typeName, + momentumTransport.alphaRhoPhi().group() + ), + momentumTransport.time().constant(), + momentumTransport.mesh(), + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ); + + if (header.typeHeaderOk(true)) + { + IOdictionary modelDict(header); + + const word modelType(modelDict.subDict("LES").lookup( "model")); + + Info<< "Selecting LES thermophysical transport model " + << modelType << endl; + + typename dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(modelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorInFunction + << "Unknown LES thermophysical transport model " + << modelType << nl << nl + << "Available models:" << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return autoPtr + ( + cstrIter()(momentumTransport) + ); + } + else + { + Info<< "Selecting default LES thermophysical transport model " + << LESThermophysicalTransportModels::eddyDiffusivity + ::typeName << endl; + + return autoPtr + ( + new LESThermophysicalTransportModels::eddyDiffusivity + < + BasicThermophysicalTransportModel + >(momentumTransport) + ); + } +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +bool Foam::LESThermophysicalTransportModel +< + BasicThermophysicalTransportModel +>::read() +{ + if (BasicThermophysicalTransportModel::read()) + { + LESDict_ <<= this->subDict("LES"); + + coeffDict_ <<= LESDict_.optionalSubDict(type() + "Coeffs"); + + return true; + } + else + { + return false; + } +} + + +template +void Foam::LESThermophysicalTransportModel:: +correct() +{ + BasicThermophysicalTransportModel::correct(); +} + + +// ************************************************************************* // diff --git a/src/ThermophysicalTransportModels/LES/LESThermophysicalTransportModel/LESThermophysicalTransportModel.H b/src/ThermophysicalTransportModels/LES/LESThermophysicalTransportModel/LESThermophysicalTransportModel.H new file mode 100644 index 0000000000..2ad4fcf982 --- /dev/null +++ b/src/ThermophysicalTransportModels/LES/LESThermophysicalTransportModel/LESThermophysicalTransportModel.H @@ -0,0 +1,234 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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::LESThermophysicalTransportModel + +Description + Templated abstract base class for LES thermophysical transport models + +SourceFiles + LESThermophysicalTransportModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef LESThermophysicalTransportModel_H +#define LESThermophysicalTransportModel_H + +#include "ThermophysicalTransportModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class LESThermophysicalTransportModel Declaration +\*---------------------------------------------------------------------------*/ + +template +class LESThermophysicalTransportModel +: + public BasicThermophysicalTransportModel +{ + +protected: + + // Protected data + + //- LES coefficients dictionary + dictionary LESDict_; + + //- Flag to print the model coeffs at run-time + Switch printCoeffs_; + + //- Model coefficients dictionary + dictionary coeffDict_; + + + // Protected Member Functions + + //- Print model coefficients + virtual void printCoeffs(const word& type); + + +public: + + typedef typename BasicThermophysicalTransportModel::alphaField + alphaField; + + typedef typename BasicThermophysicalTransportModel::momentumTransportModel + momentumTransportModel; + + + //- Runtime type information + TypeName("LES"); + + + // Declare run-time constructor selection table + + declareRunTimeSelectionTable + ( + autoPtr, + LESThermophysicalTransportModel, + dictionary, + ( + const momentumTransportModel& momentumTransport + ), + (momentumTransport) + ); + + + // Constructors + + //- Construct from components + LESThermophysicalTransportModel + ( + const word& type, + const momentumTransportModel& momentumTransport + ); + + //- Disallow default bitwise copy construction + LESThermophysicalTransportModel + ( + const LESThermophysicalTransportModel& + ) = delete; + + + // Selectors + + //- Return a reference to the selected LES model + static autoPtr New + ( + const momentumTransportModel& momentumTransport + ); + + + //- Destructor + virtual ~LESThermophysicalTransportModel() + {} + + + // Member Functions + + //- Read model coefficients if they have changed + virtual bool read(); + + //- Const access to the coefficients dictionary + virtual const dictionary& coeffDict() const + { + return coeffDict_; + } + + //- Thermal diffusivity for enthalpy of mixture [kg/m/s] + virtual tmp alpha() const + { + return this->thermo().alpha(); + } + + //- Thermal diffusivity for enthalpy of mixture for patch [kg/m/s] + virtual tmp alpha(const label patchi) const + { + return this->thermo().alpha(patchi); + } + + //- Thermal diffusivity for temperature of mixture [W/m/K] + virtual tmp kappa() const + { + return this->thermo().kappa(); + } + + //- Thermal diffusivity for temperature of mixture + // for patch [W/m/K] + virtual tmp kappa(const label patchi) const + { + return this->thermo().kappa(patchi); + } + + //- Effective thermal turbulent diffusivity for temperature + // of mixture [W/m/K] + virtual tmp kappaEff() const + { + return volScalarField::New + ( + "kappaEff", + this->thermo().kappa() + ); + } + + //- Effective thermal turbulent diffusivity for temperature + // of mixture for patch [W/m/K] + virtual tmp kappaEff(const label patchi) const + { + return kappa(patchi); + } + + //- Effective thermal turbulent diffusivity of mixture [kg/m/s] + virtual tmp alphaEff() const + { + return volScalarField::New + ( + "alphaEff", + this->thermo().alphahe() + ); + } + + //- Effective thermal turbulent diffusivity of mixture + // for patch [kg/m/s] + virtual tmp alphaEff(const label patchi) const + { + return this->thermo().alphahe(patchi); + } + + //- Return the heat flux + virtual tmp q() const = 0; + + //- Return the source term for the energy equation + virtual tmp divq(volScalarField& he) const = 0; + + //- Correct the LES transport + virtual void correct(); + + + // Member Operators + + //- Disallow default bitwise assignment + void operator=(const LESThermophysicalTransportModel&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "LESThermophysicalTransportModel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/ThermophysicalTransportModels/LES/LESeddyDiffusivity/LESeddyDiffusivity.C b/src/ThermophysicalTransportModels/LES/LESeddyDiffusivity/LESeddyDiffusivity.C new file mode 100644 index 0000000000..5d69333fed --- /dev/null +++ b/src/ThermophysicalTransportModels/LES/LESeddyDiffusivity/LESeddyDiffusivity.C @@ -0,0 +1,158 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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 "LESeddyDiffusivity.H" +#include "fvmLaplacian.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace LESThermophysicalTransportModels +{ + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +template +void eddyDiffusivity::correctAlphat() +{ + alphat_ = + this->momentumTransport().rho() + *this->momentumTransport().nut()/Prt_; + alphat_.correctBoundaryConditions(); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +eddyDiffusivity::eddyDiffusivity +( + const momentumTransportModel& momentumTransport +) +: + LESThermophysicalTransportModel + ( + typeName, + momentumTransport + ), + + Prt_ + ( + dimensioned::lookupOrAddToDict + ( + "Prt", + this->coeffDict_, + 1 + ) + ), + + alphat_ + ( + IOobject + ( + IOobject::groupName + ( + "alphat", + this->momentumTransport().alphaRhoPhi().group() + ), + momentumTransport.time().timeName(), + momentumTransport.mesh(), + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + momentumTransport.mesh() + ) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +bool eddyDiffusivity::read() +{ + if + ( + LESThermophysicalTransportModel + < + BasicThermophysicalTransportModel + >::read() + ) + { + Prt_.readIfPresent(this->coeffDict()); + + return true; + } + else + { + return false; + } +} + + +template +tmpeddyDiffusivity::q() const +{ + return volVectorField::New + ( + IOobject::groupName + ( + "q", + this->momentumTransport().alphaRhoPhi().group() + ), + -this->alphaEff() + *fvc::grad(this->thermo().he()) + ); +} + + +template +tmp +eddyDiffusivity::divq +( + volScalarField& he +) const +{ + return -fvm::laplacian(this->alphaEff(), he); +} + + +template +void eddyDiffusivity::correct() +{ + LESThermophysicalTransportModel + < + BasicThermophysicalTransportModel + >::correct(); + correctAlphat(); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESThermophysicalTransportModels +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/ThermophysicalTransportModels/LES/LESeddyDiffusivity/LESeddyDiffusivity.H b/src/ThermophysicalTransportModels/LES/LESeddyDiffusivity/LESeddyDiffusivity.H new file mode 100644 index 0000000000..035cd66a09 --- /dev/null +++ b/src/ThermophysicalTransportModels/LES/LESeddyDiffusivity/LESeddyDiffusivity.H @@ -0,0 +1,180 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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::LESThermophysicalTransportModels::eddyDiffusivity + +Description + Eddy-diffusivity based gradient heat flux model for LES flow. + +SourceFiles + LESeddyDiffusivity.C + +\*---------------------------------------------------------------------------*/ + +#ifndef LESeddyDiffusivity_H +#define LESeddyDiffusivity_H + +#include "LESThermophysicalTransportModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace LESThermophysicalTransportModels +{ + +/*---------------------------------------------------------------------------* \ + Class eddyDiffusivity Declaration +\*---------------------------------------------------------------------------*/ + +template +class eddyDiffusivity +: + public LESThermophysicalTransportModel + < + BasicThermophysicalTransportModel + > +{ + +protected: + + // Protected data + + // Model coefficients + + dimensionedScalar Prt_; + + // Fields + + volScalarField alphat_; + + + // Protected Member Functions + + virtual void correctAlphat(); + + +public: + + typedef typename BasicThermophysicalTransportModel::alphaField + alphaField; + + typedef typename BasicThermophysicalTransportModel::momentumTransportModel + momentumTransportModel; + + + //- Runtime type information + TypeName("eddyDiffusivity"); + + + // Constructors + + //- Construct from components + eddyDiffusivity(const momentumTransportModel& momentumTransport); + + + //- Destructor + virtual ~eddyDiffusivity() + {} + + + // Member Functions + + //- Read thermophysicalTransport dictionary + virtual bool read(); + + //- Turbulent thermal diffusivity for enthalpy [kg/m/s] + virtual tmp alphat() const + { + return alphat_; + } + + //- Turbulent thermal diffusivity for enthalpy for a patch [kg/m/s] + virtual tmp alphat(const label patchi) const + { + return alphat()().boundaryField()[patchi]; + } + + //- Effective thermal turbulent diffusivity for temperature + // of mixture [W/m/K] + virtual tmp kappaEff() const + { + return this->thermo().kappaEff(alphat()); + } + + //- Effective thermal turbulent diffusivity for temperature + // of mixture for patch [W/m/K] + virtual tmp kappaEff(const label patchi) const + { + return this->thermo().kappaEff + ( + alphat(patchi), + patchi + ); + } + + //- Effective thermal turbulent diffusivity of mixture [kg/m/s] + virtual tmp alphaEff() const + { + return this->thermo().alphaEff(alphat()); + } + + //- Effective thermal turbulent diffusivity of mixture + // for patch [kg/m/s] + virtual tmp alphaEff(const label patchi) const + { + return this->thermo().alphaEff + ( + alphat(patchi), + patchi + ); + } + + //- Return the heat flux + virtual tmp q() const; + + //- Return the source term for the energy equation + virtual tmp divq(volScalarField& he) const; + + //- Correct the eddyDiffusivity viscosity + virtual void correct(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESThermophysicalTransportModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "LESeddyDiffusivity.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/ThermophysicalTransportModels/Make/files b/src/ThermophysicalTransportModels/Make/files new file mode 100644 index 0000000000..0a514b90f2 --- /dev/null +++ b/src/ThermophysicalTransportModels/Make/files @@ -0,0 +1,19 @@ +thermophysicalTransportModel/thermophysicalTransportModel.C +thermophysicalTransportModels/thermophysicalTransportModels.C + +/* +BCs = turbulentFluidThermoModels/derivedFvPatchFields +$(BCs)/temperatureCoupledBase/temperatureCoupledBase.C +$(BCs)/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C +$(BCs)/thermalBaffle1D/thermalBaffle1DFvPatchScalarFields.C +$(BCs)/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C +$(BCs)/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C +$(BCs)/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C +$(BCs)/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.C +$(BCs)/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C + +turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C +turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C +*/ + +LIB = $(FOAM_LIBBIN)/libthermophysicalTransportModels diff --git a/src/ThermophysicalTransportModels/Make/options b/src/ThermophysicalTransportModels/Make/options new file mode 100644 index 0000000000..4873b3bfdd --- /dev/null +++ b/src/ThermophysicalTransportModels/Make/options @@ -0,0 +1,19 @@ +EXE_INC = \ + -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/transportModels/compressible/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/solidSpecie/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + +LIB_LIBS = \ + -lcompressibleTransportModels \ + -lfluidThermophysicalModels \ + -lsolidThermo \ + -lturbulenceModels \ + -lspecie \ + -lfiniteVolume \ + -lmeshTools diff --git a/src/ThermophysicalTransportModels/PhaseThermophysicalTransportModel/PhaseThermophysicalTransportModel.C b/src/ThermophysicalTransportModels/PhaseThermophysicalTransportModel/PhaseThermophysicalTransportModel.C new file mode 100644 index 0000000000..440c36d041 --- /dev/null +++ b/src/ThermophysicalTransportModels/PhaseThermophysicalTransportModel/PhaseThermophysicalTransportModel.C @@ -0,0 +1,63 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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 "PhaseThermophysicalTransportModel.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::PhaseThermophysicalTransportModel:: +PhaseThermophysicalTransportModel +( + const momentumTransportModel& momentumTransport +) +: + ThermophysicalTransportModel(momentumTransport) +{} + + +// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * // + +template +Foam::autoPtr> +Foam::PhaseThermophysicalTransportModel::New +( + const momentumTransportModel& momentumTransport +) +{ + return autoPtr + ( + static_cast + ( + ThermophysicalTransportModel::New + ( + momentumTransport + ).ptr() + ) + ); +} + + +// ************************************************************************* // diff --git a/src/ThermophysicalTransportModels/PhaseThermophysicalTransportModel/PhaseThermophysicalTransportModel.H b/src/ThermophysicalTransportModels/PhaseThermophysicalTransportModel/PhaseThermophysicalTransportModel.H new file mode 100644 index 0000000000..ae243005fa --- /dev/null +++ b/src/ThermophysicalTransportModels/PhaseThermophysicalTransportModel/PhaseThermophysicalTransportModel.H @@ -0,0 +1,102 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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::PhaseThermophysicalTransportModel + +Description + Templated base class for multiphase thermophysical transport models. + +SourceFiles + PhaseThermophysicalTransportModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef PhaseThermophysicalTransportModel_H +#define PhaseThermophysicalTransportModel_H + +#include "ThermophysicalTransportModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class PhaseThermophysicalTransportModel Declaration +\*---------------------------------------------------------------------------*/ + +template +class PhaseThermophysicalTransportModel +: + public ThermophysicalTransportModel +{ + +public: + + typedef volScalarField alphaField; + typedef MomentumTransportModel momentumTransportModel; + + + // Constructors + + //- Construct + PhaseThermophysicalTransportModel + ( + const momentumTransportModel& momentumTransport + ); + + + // Selectors + + //- Return a reference to the selected turbulence model + static autoPtr New + ( + const momentumTransportModel& momentumTransport + ); + + + //- Destructor + virtual ~PhaseThermophysicalTransportModel() + {} + + + // Member Functions +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "PhaseThermophysicalTransportModel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/ThermophysicalTransportModels/RAS/RASThermophysicalTransportModel/RASThermophysicalTransportModel.C b/src/ThermophysicalTransportModels/RAS/RASThermophysicalTransportModel/RASThermophysicalTransportModel.C new file mode 100644 index 0000000000..5b55aadeb3 --- /dev/null +++ b/src/ThermophysicalTransportModels/RAS/RASThermophysicalTransportModel/RASThermophysicalTransportModel.C @@ -0,0 +1,172 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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 "RASThermophysicalTransportModel.H" +#include "RASeddyDiffusivity.H" + +// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // + +template +void Foam::RASThermophysicalTransportModel +< + BasicThermophysicalTransportModel +>::printCoeffs +( + const word& type) +{ + if (printCoeffs_) + { + Info<< coeffDict_.dictName() << coeffDict_ << endl; + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::RASThermophysicalTransportModel +< + BasicThermophysicalTransportModel +>::RASThermophysicalTransportModel +( + const word& type, + const momentumTransportModel& momentumTransport +) +: + BasicThermophysicalTransportModel(momentumTransport), + RASDict_(this->subOrEmptyDict("RAS")), + printCoeffs_(RASDict_.lookupOrDefault("printCoeffs", false)), + coeffDict_(RASDict_.optionalSubDict(type + "Coeffs")) +{} + + +// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // + +template +Foam::autoPtr +< + Foam::RASThermophysicalTransportModel + < + BasicThermophysicalTransportModel + > +> +Foam::RASThermophysicalTransportModel +< + BasicThermophysicalTransportModel +>::New +( + const momentumTransportModel& momentumTransport +) +{ + IOobject header + ( + IOobject::groupName + ( + thermophysicalTransportModel::typeName, + momentumTransport.alphaRhoPhi().group() + ), + momentumTransport.time().constant(), + momentumTransport.mesh(), + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ); + + if (header.typeHeaderOk(true)) + { + IOdictionary modelDict(header); + + const word modelType(modelDict.subDict("RAS").lookup( "model")); + + Info<< "Selecting RAS thermophysical transport model " + << modelType << endl; + + typename dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(modelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorInFunction + << "Unknown RAS thermophysical transport model " + << modelType << nl << nl + << "Available models:" << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return autoPtr + ( + cstrIter()(momentumTransport) + ); + } + else + { + Info<< "Selecting default RAS thermophysical transport model " + << RASThermophysicalTransportModels::eddyDiffusivity + ::typeName << endl; + + return autoPtr + ( + new RASThermophysicalTransportModels::eddyDiffusivity + < + BasicThermophysicalTransportModel + >(momentumTransport) + ); + } +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +bool Foam::RASThermophysicalTransportModel +< + BasicThermophysicalTransportModel +>::read() +{ + if (BasicThermophysicalTransportModel::read()) + { + RASDict_ <<= this->subDict("RAS"); + + coeffDict_ <<= RASDict_.optionalSubDict(type() + "Coeffs"); + + return true; + } + else + { + return false; + } +} + + +template +void Foam::RASThermophysicalTransportModel:: +correct() +{ + BasicThermophysicalTransportModel::correct(); +} + + +// ************************************************************************* // diff --git a/src/ThermophysicalTransportModels/RAS/RASThermophysicalTransportModel/RASThermophysicalTransportModel.H b/src/ThermophysicalTransportModels/RAS/RASThermophysicalTransportModel/RASThermophysicalTransportModel.H new file mode 100644 index 0000000000..27a6b557dc --- /dev/null +++ b/src/ThermophysicalTransportModels/RAS/RASThermophysicalTransportModel/RASThermophysicalTransportModel.H @@ -0,0 +1,234 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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::RASThermophysicalTransportModel + +Description + Templated abstract base class for RAS thermophysical transport models + +SourceFiles + RASThermophysicalTransportModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef RASThermophysicalTransportModel_H +#define RASThermophysicalTransportModel_H + +#include "ThermophysicalTransportModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class RASThermophysicalTransportModel Declaration +\*---------------------------------------------------------------------------*/ + +template +class RASThermophysicalTransportModel +: + public BasicThermophysicalTransportModel +{ + +protected: + + // Protected data + + //- RAS coefficients dictionary + dictionary RASDict_; + + //- Flag to print the model coeffs at run-time + Switch printCoeffs_; + + //- Model coefficients dictionary + dictionary coeffDict_; + + + // Protected Member Functions + + //- Print model coefficients + virtual void printCoeffs(const word& type); + + +public: + + typedef typename BasicThermophysicalTransportModel::alphaField + alphaField; + + typedef typename BasicThermophysicalTransportModel::momentumTransportModel + momentumTransportModel; + + + //- Runtime type information + TypeName("RAS"); + + + // Declare run-time constructor selection table + + declareRunTimeSelectionTable + ( + autoPtr, + RASThermophysicalTransportModel, + dictionary, + ( + const momentumTransportModel& momentumTransport + ), + (momentumTransport) + ); + + + // Constructors + + //- Construct from components + RASThermophysicalTransportModel + ( + const word& type, + const momentumTransportModel& momentumTransport + ); + + //- Disallow default bitwise copy construction + RASThermophysicalTransportModel + ( + const RASThermophysicalTransportModel& + ) = delete; + + + // Selectors + + //- Return a reference to the selected RAS model + static autoPtr New + ( + const momentumTransportModel& momentumTransport + ); + + + //- Destructor + virtual ~RASThermophysicalTransportModel() + {} + + + // Member Functions + + //- Read model coefficients if they have changed + virtual bool read(); + + //- Const access to the coefficients dictionary + virtual const dictionary& coeffDict() const + { + return coeffDict_; + } + + //- Thermal diffusivity for enthalpy of mixture [kg/m/s] + virtual tmp alpha() const + { + return this->thermo().alpha(); + } + + //- Thermal diffusivity for enthalpy of mixture for patch [kg/m/s] + virtual tmp alpha(const label patchi) const + { + return this->thermo().alpha(patchi); + } + + //- Thermal diffusivity for temperature of mixture [W/m/K] + virtual tmp kappa() const + { + return this->thermo().kappa(); + } + + //- Thermal diffusivity for temperature of mixture + // for patch [W/m/K] + virtual tmp kappa(const label patchi) const + { + return this->thermo().kappa(patchi); + } + + //- Effective thermal turbulent diffusivity for temperature + // of mixture [W/m/K] + virtual tmp kappaEff() const + { + return volScalarField::New + ( + "kappaEff", + this->thermo().kappa() + ); + } + + //- Effective thermal turbulent diffusivity for temperature + // of mixture for patch [W/m/K] + virtual tmp kappaEff(const label patchi) const + { + return kappa(patchi); + } + + //- Effective thermal turbulent diffusivity of mixture [kg/m/s] + virtual tmp alphaEff() const + { + return volScalarField::New + ( + "alphaEff", + this->thermo().alphahe() + ); + } + + //- Effective thermal turbulent diffusivity of mixture + // for patch [kg/m/s] + virtual tmp alphaEff(const label patchi) const + { + return this->thermo().alphahe(patchi); + } + + //- Return the heat flux + virtual tmp q() const = 0; + + //- Return the source term for the energy equation + virtual tmp divq(volScalarField& he) const = 0; + + //- Correct the RAS transport + virtual void correct(); + + + // Member Operators + + //- Disallow default bitwise assignment + void operator=(const RASThermophysicalTransportModel&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "RASThermophysicalTransportModel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/ThermophysicalTransportModels/RAS/RASeddyDiffusivity/RASeddyDiffusivity.C b/src/ThermophysicalTransportModels/RAS/RASeddyDiffusivity/RASeddyDiffusivity.C new file mode 100644 index 0000000000..ae850e91b3 --- /dev/null +++ b/src/ThermophysicalTransportModels/RAS/RASeddyDiffusivity/RASeddyDiffusivity.C @@ -0,0 +1,158 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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 "RASeddyDiffusivity.H" +#include "fvmLaplacian.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace RASThermophysicalTransportModels +{ + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +template +void eddyDiffusivity::correctAlphat() +{ + alphat_ = + this->momentumTransport().rho() + *this->momentumTransport().nut()/Prt_; + alphat_.correctBoundaryConditions(); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +eddyDiffusivity::eddyDiffusivity +( + const momentumTransportModel& momentumTransport +) +: + RASThermophysicalTransportModel + ( + typeName, + momentumTransport + ), + + Prt_ + ( + dimensioned::lookupOrAddToDict + ( + "Prt", + this->coeffDict_, + 1 + ) + ), + + alphat_ + ( + IOobject + ( + IOobject::groupName + ( + "alphat", + this->momentumTransport().alphaRhoPhi().group() + ), + momentumTransport.time().timeName(), + momentumTransport.mesh(), + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + momentumTransport.mesh() + ) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +bool eddyDiffusivity::read() +{ + if + ( + RASThermophysicalTransportModel + < + BasicThermophysicalTransportModel + >::read() + ) + { + Prt_.readIfPresent(this->coeffDict()); + + return true; + } + else + { + return false; + } +} + + +template +tmpeddyDiffusivity::q() const +{ + return volVectorField::New + ( + IOobject::groupName + ( + "q", + this->momentumTransport().alphaRhoPhi().group() + ), + -this->alphaEff() + *fvc::grad(this->thermo().he()) + ); +} + + +template +tmp +eddyDiffusivity::divq +( + volScalarField& he +) const +{ + return -fvm::laplacian(this->alphaEff(), he); +} + + +template +void eddyDiffusivity::correct() +{ + RASThermophysicalTransportModel + < + BasicThermophysicalTransportModel + >::correct(); + correctAlphat(); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASThermophysicalTransportModels +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/ThermophysicalTransportModels/RAS/RASeddyDiffusivity/RASeddyDiffusivity.H b/src/ThermophysicalTransportModels/RAS/RASeddyDiffusivity/RASeddyDiffusivity.H new file mode 100644 index 0000000000..f4995f46da --- /dev/null +++ b/src/ThermophysicalTransportModels/RAS/RASeddyDiffusivity/RASeddyDiffusivity.H @@ -0,0 +1,180 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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::RASThermophysicalTransportModels::eddyDiffusivity + +Description + Eddy-diffusivity based gradient heat flux model for RAS flow. + +SourceFiles + RASeddyDiffusivity.C + +\*---------------------------------------------------------------------------*/ + +#ifndef RASeddyDiffusivity_H +#define RASeddyDiffusivity_H + +#include "RASThermophysicalTransportModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace RASThermophysicalTransportModels +{ + +/*---------------------------------------------------------------------------* \ + Class eddyDiffusivity Declaration +\*---------------------------------------------------------------------------*/ + +template +class eddyDiffusivity +: + public RASThermophysicalTransportModel + < + BasicThermophysicalTransportModel + > +{ + +protected: + + // Protected data + + // Model coefficients + + dimensionedScalar Prt_; + + // Fields + + volScalarField alphat_; + + + // Protected Member Functions + + virtual void correctAlphat(); + + +public: + + typedef typename BasicThermophysicalTransportModel::alphaField + alphaField; + + typedef typename BasicThermophysicalTransportModel::momentumTransportModel + momentumTransportModel; + + + //- Runtime type information + TypeName("eddyDiffusivity"); + + + // Constructors + + //- Construct from components + eddyDiffusivity(const momentumTransportModel& momentumTransport); + + + //- Destructor + virtual ~eddyDiffusivity() + {} + + + // Member Functions + + //- Read thermophysicalTransport dictionary + virtual bool read(); + + //- Turbulent thermal diffusivity for enthalpy [kg/m/s] + virtual tmp alphat() const + { + return alphat_; + } + + //- Turbulent thermal diffusivity for enthalpy for a patch [kg/m/s] + virtual tmp alphat(const label patchi) const + { + return alphat()().boundaryField()[patchi]; + } + + //- Effective thermal turbulent diffusivity for temperature + // of mixture [W/m/K] + virtual tmp kappaEff() const + { + return this->thermo().kappaEff(alphat()); + } + + //- Effective thermal turbulent diffusivity for temperature + // of mixture for patch [W/m/K] + virtual tmp kappaEff(const label patchi) const + { + return this->thermo().kappaEff + ( + alphat(patchi), + patchi + ); + } + + //- Effective thermal turbulent diffusivity of mixture [kg/m/s] + virtual tmp alphaEff() const + { + return this->thermo().alphaEff(alphat()); + } + + //- Effective thermal turbulent diffusivity of mixture + // for patch [kg/m/s] + virtual tmp alphaEff(const label patchi) const + { + return this->thermo().alphaEff + ( + alphat(patchi), + patchi + ); + } + + //- Return the heat flux + virtual tmp q() const; + + //- Return the source term for the energy equation + virtual tmp divq(volScalarField& he) const; + + //- Correct the eddyDiffusivity viscosity + virtual void correct(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASThermophysicalTransportModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "RASeddyDiffusivity.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/ThermophysicalTransportModels/ThermophysicalTransportModel/ThermophysicalTransportModel.C b/src/ThermophysicalTransportModels/ThermophysicalTransportModel/ThermophysicalTransportModel.C new file mode 100644 index 0000000000..e89073be32 --- /dev/null +++ b/src/ThermophysicalTransportModels/ThermophysicalTransportModel/ThermophysicalTransportModel.C @@ -0,0 +1,83 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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 "ThermophysicalTransportModel.H" +#include "volFields.H" +#include "surfaceFields.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::ThermophysicalTransportModel:: +ThermophysicalTransportModel +( + const momentumTransportModel& momentumTransport +) +: + thermophysicalTransportModel(momentumTransport), + momentumTransport_(momentumTransport) +{} + + +// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * // + +template +Foam::autoPtr +< + Foam::ThermophysicalTransportModel +> +Foam::ThermophysicalTransportModel::New +( + const momentumTransportModel& momentumTransport +) +{ + const word modelType + ( + momentumTransport.lookup("simulationType") + ); + + Info<< "Selecting thermophysical transport type " << modelType << endl; + + typename dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(modelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorInFunction + << "Unknown thermophysical transport type " + << modelType << nl << nl + << "Available types:" << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return autoPtr + ( + cstrIter()(momentumTransport) + ); +} + + +// ************************************************************************* // diff --git a/src/ThermophysicalTransportModels/ThermophysicalTransportModel/ThermophysicalTransportModel.H b/src/ThermophysicalTransportModels/ThermophysicalTransportModel/ThermophysicalTransportModel.H new file mode 100644 index 0000000000..7f87d5ffc4 --- /dev/null +++ b/src/ThermophysicalTransportModels/ThermophysicalTransportModel/ThermophysicalTransportModel.H @@ -0,0 +1,152 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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::ThermophysicalTransportModel + +Description + Templated abstract base class for thermophysical transport models + +SourceFiles + ThermophysicalTransportModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef ThermophysicalTransportModel_H +#define ThermophysicalTransportModel_H + +#include "thermophysicalTransportModel.H" +#include "autoPtr.H" +#include "fluidThermo.H" +#include "runTimeSelectionTables.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class ThermophysicalTransportModel Declaration +\*---------------------------------------------------------------------------*/ + +template +class ThermophysicalTransportModel +: + public thermophysicalTransportModel +{ + +public: + + typedef typename MomentumTransportModel::alphaField alphaField; + typedef MomentumTransportModel momentumTransportModel; + + +protected: + + // Protected data + + const momentumTransportModel& momentumTransport_; + + +public: + + // Declare run-time constructor selection table + + declareRunTimeNewSelectionTable + ( + autoPtr, + ThermophysicalTransportModel, + dictionary, + ( + const momentumTransportModel& momentumTransport + ), + (momentumTransport) + ); + + + // Constructors + + //- Construct + ThermophysicalTransportModel + ( + const momentumTransportModel& momentumTransport + ); + + //- Disallow default bitwise copy construction + ThermophysicalTransportModel + ( + const ThermophysicalTransportModel& + ) = delete; + + + // Selectors + + //- Return a reference to the selected thermophysical transport model + static autoPtr New + ( + const momentumTransportModel& transport + ); + + + //- Destructor + virtual ~ThermophysicalTransportModel() + {} + + + // Member Functions + + //- Access function to incompressible transport model + const momentumTransportModel& momentumTransport() const + { + return momentumTransport_; + } + + //- Access function to incompressible transport model + const fluidThermo& thermo() const + { + return momentumTransport_.transport(); + } + + + // Member Operators + + //- Disallow default bitwise assignment + void operator=(const ThermophysicalTransportModel&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "ThermophysicalTransportModel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/ThermophysicalTransportModels/fluidThermo/fluidThermoTransportModel.H b/src/ThermophysicalTransportModels/fluidThermo/fluidThermoTransportModel.H new file mode 100644 index 0000000000..07a2f52369 --- /dev/null +++ b/src/ThermophysicalTransportModels/fluidThermo/fluidThermoTransportModel.H @@ -0,0 +1,80 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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 . + +Typedef + Foam::compressible::thermophysicalTransportModel + +Typedef + Foam::compressible::laminarThermophysicalTransportModel + +Typedef + Foam::compressible::RASThermophysicalTransportModel + +Typedef + Foam::compressible::LESThermophysicalTransportModel + +Description + Typedefs for laminar, RAS and LES thermophysical transport models + for fluidThermo flow. + +\*---------------------------------------------------------------------------*/ + +#ifndef fluidThermoTransportModel_H +#define fluidThermoTransportModel_H + +#include "laminarThermophysicalTransportModel.H" +#include "RASThermophysicalTransportModel.H" +#include "LESThermophysicalTransportModel.H" +#include "turbulentFluidThermoModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + namespace compressible + { + typedef ThermophysicalTransportModel + thermophysicalTransportModel; + + typedef laminarThermophysicalTransportModel + < + thermophysicalTransportModel + > laminarThermophysicalTransportModel; + + typedef RASThermophysicalTransportModel + < + thermophysicalTransportModel + > RASThermophysicalTransportModel; + + typedef LESThermophysicalTransportModel + < + thermophysicalTransportModel + > LESThermophysicalTransportModel; + } +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/ThermophysicalTransportModels/laminar/Fourier/Fourier.C b/src/ThermophysicalTransportModels/laminar/Fourier/Fourier.C new file mode 100644 index 0000000000..db6a59dafd --- /dev/null +++ b/src/ThermophysicalTransportModels/laminar/Fourier/Fourier.C @@ -0,0 +1,107 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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 "Fourier.H" +#include "fvmLaplacian.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace laminarThermophysicalTransportModels +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Fourier::Fourier +( + const momentumTransportModel& momentumTransport +) +: + laminarThermophysicalTransportModel + ( + typeName, + momentumTransport + ) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +const dictionary& +Fourier::coeffDict() const +{ + return dictionary::null; +} + + +template +bool Fourier::read() +{ + return true; +} + + +template +tmpFourier::q() const +{ + return volVectorField::New + ( + IOobject::groupName + ( + "q", + this->momentumTransport().alphaRhoPhi().group() + ), + -this->alpha()*fvc::grad(this->thermo().he()) + ); +} + + +template +tmp +Fourier::divq(volScalarField& he) const +{ + return -fvm::laplacian(this->alpha(), he); +} + + +template +void Fourier::correct() +{ + laminarThermophysicalTransportModel + < + BasicThermophysicalTransportModel + >::correct(); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace laminarThermophysicalTransportModels +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/ThermophysicalTransportModels/laminar/Fourier/Fourier.H b/src/ThermophysicalTransportModels/laminar/Fourier/Fourier.H new file mode 100644 index 0000000000..6dfbd9697b --- /dev/null +++ b/src/ThermophysicalTransportModels/laminar/Fourier/Fourier.H @@ -0,0 +1,121 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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::laminarThermophysicalTransportModels::Fourier + +Description + Fourier's gradient heat flux model for laminar flow. + +SourceFiles + Fourier.C + +\*---------------------------------------------------------------------------*/ + +#ifndef Fourier_H +#define Fourier_H + +#include "laminarThermophysicalTransportModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace laminarThermophysicalTransportModels +{ + +/*---------------------------------------------------------------------------* \ + Class Fourier Declaration +\*---------------------------------------------------------------------------*/ + +template +class Fourier +: + public laminarThermophysicalTransportModel + < + BasicThermophysicalTransportModel + > +{ + +public: + + typedef typename BasicThermophysicalTransportModel::alphaField + alphaField; + + typedef typename BasicThermophysicalTransportModel::momentumTransportModel + momentumTransportModel; + + + //- Runtime type information + TypeName("Fourier"); + + + // Constructors + + //- Construct from components + Fourier + ( + const momentumTransportModel& momentumTransport + ); + + + //- Destructor + virtual ~Fourier() + {} + + + // Member Functions + + //- Const access to the coefficients dictionary + virtual const dictionary& coeffDict() const; + + //- Read thermophysicalTransport dictionary + virtual bool read(); + + //- Return the heat flux + virtual tmp q() const; + + //- Return the source term for the energy equation + virtual tmp divq(volScalarField& he) const; + + //- Correct the Fourier viscosity + virtual void correct(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace laminarThermophysicalTransportModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "Fourier.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/ThermophysicalTransportModels/laminar/laminarThermophysicalTransportModel/laminarThermophysicalTransportModel.C b/src/ThermophysicalTransportModels/laminar/laminarThermophysicalTransportModel/laminarThermophysicalTransportModel.C new file mode 100644 index 0000000000..f656eb7622 --- /dev/null +++ b/src/ThermophysicalTransportModels/laminar/laminarThermophysicalTransportModel/laminarThermophysicalTransportModel.C @@ -0,0 +1,174 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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 "laminarThermophysicalTransportModel.H" +#include "Fourier.H" + +// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // + +template +void Foam::laminarThermophysicalTransportModel +< + BasicThermophysicalTransportModel +>::printCoeffs +( + const word& type) +{ + if (printCoeffs_) + { + Info<< coeffDict_.dictName() << coeffDict_ << endl; + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::laminarThermophysicalTransportModel +< + BasicThermophysicalTransportModel +>::laminarThermophysicalTransportModel +( + const word& type, + const momentumTransportModel& momentumTransport +) +: + BasicThermophysicalTransportModel(momentumTransport), + laminarDict_(this->subOrEmptyDict("laminar")), + printCoeffs_(laminarDict_.lookupOrDefault("printCoeffs", false)), + coeffDict_(laminarDict_.optionalSubDict(type + "Coeffs")) +{} + + +// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // + +template +Foam::autoPtr +< + Foam::laminarThermophysicalTransportModel + < + BasicThermophysicalTransportModel + > +> +Foam::laminarThermophysicalTransportModel +< + BasicThermophysicalTransportModel +>::New +( + const momentumTransportModel& momentumTransport +) +{ + IOobject header + ( + IOobject::groupName + ( + thermophysicalTransportModel::typeName, + momentumTransport.alphaRhoPhi().group() + ), + momentumTransport.time().constant(), + momentumTransport.mesh(), + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ); + + if (header.typeHeaderOk(true)) + { + IOdictionary modelDict(header); + + const word modelType(modelDict.subDict("laminar").lookup( "model")); + + Info<< "Selecting laminar thermophysical transport model " + << modelType << endl; + + typename dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(modelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorInFunction + << "Unknown laminar thermophysical transport model " + << modelType << nl << nl + << "Available models:" << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return autoPtr + ( + cstrIter()(momentumTransport) + ); + } + else + { + Info<< "Selecting default laminar thermophysical transport model " + << laminarThermophysicalTransportModels::Fourier< + BasicThermophysicalTransportModel>::typeName << endl; + + return autoPtr + ( + new laminarThermophysicalTransportModels::Fourier + < + BasicThermophysicalTransportModel + >(momentumTransport) + ); + } +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +bool Foam::laminarThermophysicalTransportModel +< + BasicThermophysicalTransportModel +>::read() +{ + if (BasicThermophysicalTransportModel::read()) + { + laminarDict_ <<= this->subDict("laminar"); + + coeffDict_ <<= laminarDict_.optionalSubDict(type() + "Coeffs"); + + return true; + } + else + { + return false; + } +} + + +template +void Foam::laminarThermophysicalTransportModel +< + BasicThermophysicalTransportModel +>::correct() +{ + BasicThermophysicalTransportModel::correct(); +} + + +// ************************************************************************* // diff --git a/src/ThermophysicalTransportModels/laminar/laminarThermophysicalTransportModel/laminarThermophysicalTransportModel.H b/src/ThermophysicalTransportModels/laminar/laminarThermophysicalTransportModel/laminarThermophysicalTransportModel.H new file mode 100644 index 0000000000..6b907bce48 --- /dev/null +++ b/src/ThermophysicalTransportModels/laminar/laminarThermophysicalTransportModel/laminarThermophysicalTransportModel.H @@ -0,0 +1,234 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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::laminarThermophysicalTransportModel + +Description + Templated abstract base class for laminar thermophysical transport models + +SourceFiles + laminarThermophysicalTransportModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef laminarThermophysicalTransportModel_H +#define laminarThermophysicalTransportModel_H + +#include "ThermophysicalTransportModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class laminarThermophysicalTransportModel Declaration +\*---------------------------------------------------------------------------*/ + +template +class laminarThermophysicalTransportModel +: + public BasicThermophysicalTransportModel +{ + +protected: + + // Protected data + + //- laminar coefficients dictionary + dictionary laminarDict_; + + //- Flag to print the model coeffs at run-time + Switch printCoeffs_; + + //- Model coefficients dictionary + dictionary coeffDict_; + + + // Protected Member Functions + + //- Print model coefficients + virtual void printCoeffs(const word& type); + + +public: + + typedef typename BasicThermophysicalTransportModel::alphaField + alphaField; + + typedef typename BasicThermophysicalTransportModel::momentumTransportModel + momentumTransportModel; + + + //- Runtime type information + TypeName("laminar"); + + + // Declare run-time constructor selection table + + declareRunTimeSelectionTable + ( + autoPtr, + laminarThermophysicalTransportModel, + dictionary, + ( + const momentumTransportModel& momentumTransport + ), + (momentumTransport) + ); + + + // Constructors + + //- Construct from components + laminarThermophysicalTransportModel + ( + const word& type, + const momentumTransportModel& momentumTransport + ); + + //- Disallow default bitwise copy construction + laminarThermophysicalTransportModel + ( + const laminarThermophysicalTransportModel& + ) = delete; + + + // Selectors + + //- Return a reference to the selected laminar model + static autoPtr New + ( + const momentumTransportModel& momentumTransport + ); + + + //- Destructor + virtual ~laminarThermophysicalTransportModel() + {} + + + // Member Functions + + //- Read model coefficients if they have changed + virtual bool read(); + + //- Const access to the coefficients dictionary + virtual const dictionary& coeffDict() const + { + return coeffDict_; + } + + //- Thermal diffusivity for enthalpy of mixture [kg/m/s] + virtual tmp alpha() const + { + return this->thermo().alpha(); + } + + //- Thermal diffusivity for enthalpy of mixture for patch [kg/m/s] + virtual tmp alpha(const label patchi) const + { + return this->thermo().alpha(patchi); + } + + //- Thermal diffusivity for temperature of mixture [W/m/K] + virtual tmp kappa() const + { + return this->thermo().kappa(); + } + + //- Thermal diffusivity for temperature of mixture + // for patch [W/m/K] + virtual tmp kappa(const label patchi) const + { + return this->thermo().kappa(patchi); + } + + //- Effective thermal turbulent diffusivity for temperature + // of mixture [W/m/K] + virtual tmp kappaEff() const + { + return volScalarField::New + ( + "kappaEff", + this->thermo().kappa() + ); + } + + //- Effective thermal turbulent diffusivity for temperature + // of mixture for patch [W/m/K] + virtual tmp kappaEff(const label patchi) const + { + return kappa(patchi); + } + + //- Effective thermal turbulent diffusivity of mixture [kg/m/s] + virtual tmp alphaEff() const + { + return volScalarField::New + ( + "alphaEff", + this->thermo().alphahe() + ); + } + + //- Effective thermal turbulent diffusivity of mixture + // for patch [kg/m/s] + virtual tmp alphaEff(const label patchi) const + { + return this->thermo().alphahe(patchi); + } + + //- Return the heat flux + virtual tmp q() const = 0; + + //- Return the source term for the energy equation + virtual tmp divq(volScalarField& he) const = 0; + + //- Correct the laminar transport + virtual void correct(); + + + // Member Operators + + //- Disallow default bitwise assignment + void operator=(const laminarThermophysicalTransportModel&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "laminarThermophysicalTransportModel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/ThermophysicalTransportModels/thermophysicalTransportModel/thermophysicalTransportModel.C b/src/ThermophysicalTransportModels/thermophysicalTransportModel/thermophysicalTransportModel.C new file mode 100644 index 0000000000..db0c462857 --- /dev/null +++ b/src/ThermophysicalTransportModels/thermophysicalTransportModel/thermophysicalTransportModel.C @@ -0,0 +1,76 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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 "thermophysicalTransportModel.H" +#include "surfaceFields.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(thermophysicalTransportModel, 0); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::thermophysicalTransportModel::thermophysicalTransportModel +( + const compressibleTurbulenceModel& momentumTransport +) +: + IOdictionary + ( + IOobject + ( + IOobject::groupName + ( + typeName, momentumTransport.alphaRhoPhi().group() + ), + momentumTransport.time().constant(), + momentumTransport.mesh(), + //***HGW IOobject::MUST_READ_IF_MODIFIED, + IOobject::READ_IF_PRESENT, + IOobject::NO_WRITE + ) + ), + + momentumTransportModel_(momentumTransport) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +bool Foam::thermophysicalTransportModel::read() +{ + return regIOobject::read(); +} + + +void Foam::thermophysicalTransportModel::correct() +{} + + +// ************************************************************************* // diff --git a/src/ThermophysicalTransportModels/thermophysicalTransportModel/thermophysicalTransportModel.H b/src/ThermophysicalTransportModels/thermophysicalTransportModel/thermophysicalTransportModel.H new file mode 100644 index 0000000000..a77b5ac6e6 --- /dev/null +++ b/src/ThermophysicalTransportModels/thermophysicalTransportModel/thermophysicalTransportModel.H @@ -0,0 +1,141 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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::thermophysicalTransportModel + +Description + Abstract base class for thermophysical transport models + (RAS, LES and laminar). + +SourceFiles + thermophysicalTransportModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef thermophysicalTransportModel_H +#define thermophysicalTransportModel_H + +#include "compressibleTurbulenceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class thermophysicalTransportModel Declaration +\*---------------------------------------------------------------------------*/ + +class thermophysicalTransportModel +: + public IOdictionary +{ +protected: + + // Protected data + + const compressibleTurbulenceModel& momentumTransportModel_; + + +public: + + //- Runtime type information + TypeName("thermophysicalTransport"); + + + // Constructors + + //- Construct from compressibleTurbulenceModel + thermophysicalTransportModel + ( + const compressibleTurbulenceModel& momentumTransport + ); + + //- Disallow default bitwise copy construction + thermophysicalTransportModel + ( + const thermophysicalTransportModel& + ) = delete; + + + //- Destructor + virtual ~thermophysicalTransportModel() + {} + + + // Member Functions + + //- Read model coefficients if they have changed + virtual bool read() = 0; + + const compressibleTurbulenceModel& momentumTransport() const + { + return momentumTransportModel_; + } + + //- Const access to the coefficients dictionary + virtual const dictionary& coeffDict() const = 0; + + //- Effective thermal turbulent diffusivity for temperature + // of mixture [W/m/K] + virtual tmp kappaEff() const = 0; + + //- Effective thermal turbulent diffusivity for temperature + // 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; + + //- Return the heat flux + virtual tmp q() const = 0; + + //- Return the source term for the energy equation + virtual tmp divq(volScalarField& he) const = 0; + + //- Solve the thermophysical transport model equations + // and correct the transport coefficients + virtual void correct() = 0; + + + // Member Operators + + //- Disallow default bitwise assignment + void operator=(const thermophysicalTransportModel&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/ThermophysicalTransportModels/thermophysicalTransportModels/makeThermophysicalTransportModel.H b/src/ThermophysicalTransportModels/thermophysicalTransportModels/makeThermophysicalTransportModel.H new file mode 100644 index 0000000000..9fcb48a522 --- /dev/null +++ b/src/ThermophysicalTransportModels/thermophysicalTransportModels/makeThermophysicalTransportModel.H @@ -0,0 +1,159 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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 . + +\*---------------------------------------------------------------------------*/ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeThermophysicalTransportModelTypes( \ + BaseModel, MomentumTransportModel) \ + \ + namespace Foam \ + { \ + typedef BaseModel \ + BaseModel##MomentumTransportModel; \ + \ + typedef laminarThermophysicalTransportModel \ + < \ + BaseModel##MomentumTransportModel \ + > laminar##BaseModel##MomentumTransportModel; \ + \ + typedef RASThermophysicalTransportModel \ + < \ + BaseModel##MomentumTransportModel \ + > RAS##BaseModel##MomentumTransportModel; \ + \ + typedef LESThermophysicalTransportModel \ + < \ + BaseModel##MomentumTransportModel \ + > LES##BaseModel##MomentumTransportModel; \ + } + + +#define makeThermophysicalTransportModel(BaseModel, MomentumTransportModel) \ + \ + namespace Foam \ + { \ + typedef ThermophysicalTransportModel \ + < \ + MomentumTransportModel \ + > ThermophysicalTransportModel##MomentumTransportModel; \ + \ + defineTemplateRunTimeSelectionTable \ + ( \ + ThermophysicalTransportModel##MomentumTransportModel, \ + dictionary \ + ); \ + \ + \ + defineNamedTemplateTypeNameAndDebug \ + ( \ + laminar##BaseModel##MomentumTransportModel, \ + 0 \ + ); \ + \ + defineTemplateRunTimeSelectionTable \ + ( \ + laminar##BaseModel##MomentumTransportModel, \ + dictionary \ + ); \ + \ + addToRunTimeSelectionTable \ + ( \ + ThermophysicalTransportModel##MomentumTransportModel, \ + laminar##BaseModel##MomentumTransportModel, \ + dictionary \ + ); \ + \ + \ + defineNamedTemplateTypeNameAndDebug \ + ( \ + RAS##BaseModel##MomentumTransportModel, \ + 0 \ + ); \ + \ + defineTemplateRunTimeSelectionTable \ + ( \ + RAS##BaseModel##MomentumTransportModel, \ + dictionary \ + ); \ + \ + addToRunTimeSelectionTable \ + ( \ + ThermophysicalTransportModel##MomentumTransportModel, \ + RAS##BaseModel##MomentumTransportModel, \ + dictionary \ + ); \ + \ + \ + defineNamedTemplateTypeNameAndDebug \ + ( \ + LES##BaseModel##MomentumTransportModel,\ + 0 \ + ); \ + \ + defineTemplateRunTimeSelectionTable \ + ( \ + LES##BaseModel##MomentumTransportModel,\ + dictionary \ + ); \ + \ + addToRunTimeSelectionTable \ + ( \ + ThermophysicalTransportModel##MomentumTransportModel, \ + LES##BaseModel##MomentumTransportModel,\ + dictionary \ + ); \ + } + + +#define makeTemplatedThermophysicalTransportModel( \ + BaseModel, MomentumTransportModel, SType, Type) \ + \ + defineNamedTemplateTypeNameAndDebug \ + ( \ + Foam::SType##ThermophysicalTransportModels::Type \ + < \ + Foam::BaseModel \ + >, \ + 0 \ + ); \ + \ + namespace Foam \ + { \ + namespace SType##ThermophysicalTransportModels \ + { \ + typedef Type> \ + Type##SType##BaseModel##MomentumTransportModel; \ + \ + addToRunTimeSelectionTable \ + ( \ + SType##BaseModel##MomentumTransportModel, \ + Type##SType##BaseModel##MomentumTransportModel, \ + dictionary \ + ); \ + } \ + } + + +// ************************************************************************* // diff --git a/src/ThermophysicalTransportModels/thermophysicalTransportModels/thermophysicalTransportModels.C b/src/ThermophysicalTransportModels/thermophysicalTransportModels/thermophysicalTransportModels.C new file mode 100644 index 0000000000..ff213096c2 --- /dev/null +++ b/src/ThermophysicalTransportModels/thermophysicalTransportModels/thermophysicalTransportModels.C @@ -0,0 +1,61 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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 "thermophysicalTransportModels.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makeThermophysicalTransportModel +( + ThermophysicalTransportModel, + fluidThermoCompressibleTurbulenceModel +); + + +// -------------------------------------------------------------------------- // +// Laminar models +// -------------------------------------------------------------------------- // + +#include "Fourier.H" +makeThermophysicalTransportLaminarModel(Fourier); + + +// -------------------------------------------------------------------------- // +// RAS models +// -------------------------------------------------------------------------- // + +#include "RASeddyDiffusivity.H" +makeThermophysicalTransportRASModel(eddyDiffusivity); + + +// -------------------------------------------------------------------------- // +// LES models +// -------------------------------------------------------------------------- // + +#include "LESeddyDiffusivity.H" +makeThermophysicalTransportLESModel(eddyDiffusivity); + + +// ************************************************************************* // diff --git a/src/ThermophysicalTransportModels/thermophysicalTransportModels/thermophysicalTransportModels.H b/src/ThermophysicalTransportModels/thermophysicalTransportModels/thermophysicalTransportModels.H new file mode 100644 index 0000000000..ca6bc93947 --- /dev/null +++ b/src/ThermophysicalTransportModels/thermophysicalTransportModels/thermophysicalTransportModels.H @@ -0,0 +1,71 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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 "turbulentFluidThermoModels.H" +#include "addToRunTimeSelectionTable.H" +#include "makeThermophysicalTransportModel.H" + +#include "laminarThermophysicalTransportModel.H" +#include "RASThermophysicalTransportModel.H" +#include "LESThermophysicalTransportModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makeThermophysicalTransportModelTypes +( + ThermophysicalTransportModel, + fluidThermoCompressibleTurbulenceModel +); + + +#define makeThermophysicalTransportLaminarModel(Type) \ + makeTemplatedThermophysicalTransportModel \ + ( \ + ThermophysicalTransportModel, \ + fluidThermoCompressibleTurbulenceModel, \ + laminar, \ + Type \ + ) + +#define makeThermophysicalTransportRASModel(Type) \ + makeTemplatedThermophysicalTransportModel \ + ( \ + ThermophysicalTransportModel, \ + fluidThermoCompressibleTurbulenceModel, \ + RAS, \ + Type \ + ) + +#define makeThermophysicalTransportLESModel(Type) \ + makeTemplatedThermophysicalTransportModel \ + ( \ + ThermophysicalTransportModel, \ + fluidThermoCompressibleTurbulenceModel, \ + LES, \ + Type \ + ) + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/cavity/constant/thermophysicalTransport b/tutorials/compressible/rhoPimpleFoam/RAS/cavity/constant/thermophysicalTransport new file mode 100644 index 0000000000..4110f6eca1 --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/RAS/cavity/constant/thermophysicalTransport @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalTransport; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +RAS +{ + model eddyDiffusivity; + + Prt 0.85; +} + +// ************************************************************************* //