From ce42ebc5d7303f4b2b545630bdca78b38636e972 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Thu, 15 Dec 2022 14:59:44 +0000 Subject: [PATCH] thermophysicalTransportModel: added predict() function None of the current thermophysicalTransportModels solve transport equations in order to evaluate the thermophysical transport properties so it makes more sense that the evaluation occurs at the beginning of the time-step rather than at the end where conservative fluxes are available for transport solution. To enable this the correct() functions have been renamed predict() and called in the prePredictor() step of foamRun and foamMultiRun and at the beginning of the time-step in the legacy solvers. A particular advantage of this approach is that complex data cached in the thermophysicalTransportModels can now be deleted following mesh topology changes and recreated in the predict() call which is more efficient than attempting to register and map the data. An empty correct() function is included in addition to the new predict() function in thermophysicalTransportModel to support scalar flux transport closure in the future if needed. Additionally the two transport model corrector function calls in foamRun and foamMultiRun have been combined into a single postCorrector() call to allow greater flexibility in transport property prediction and correction in the modular solvers. --- .../combustion/XiFoam/PDRFoam/PDRFoam.C | 1 + .../XiFoam/PDRFoam/PDRFoamAutoRefine.C | 1 + .../solvers/combustion/XiFoam/XiFoam.C | 1 + .../rhoCentralFoam/rhoCentralFoam.C | 2 ++ .../rhoPorousSimpleFoam/rhoPorousSimpleFoam.C | 2 ++ .../solvers/foamMultiRun/foamMultiRun.C | 3 +-- applications/solvers/foamRun/foamRun.C | 3 +-- ...leInterPhaseThermophysicalTransportModel.C | 4 ++++ ...leInterPhaseThermophysicalTransportModel.H | 4 ++++ .../modules/compressibleVoF/compressibleVoF.C | 8 +++----- .../modules/compressibleVoF/compressibleVoF.H | 8 ++------ applications/solvers/modules/fluid/fluid.C | 11 +++++++++- applications/solvers/modules/fluid/fluid.H | 7 +++++-- .../incompressibleFluid/incompressibleFluid.C | 6 +----- .../incompressibleFluid/incompressibleFluid.H | 8 ++------ .../modules/isothermalFluid/isothermalFluid.C | 6 +----- .../modules/isothermalFluid/isothermalFluid.H | 8 ++------ .../multicomponentFluid/multicomponentFluid.C | 11 +++++++++- .../multicomponentFluid/multicomponentFluid.H | 7 +++++-- .../multiphaseEuler/multiphaseEuler.C | 9 +++------ .../multiphaseEuler/multiphaseEuler.H | 8 ++------ .../multiphaseEuler/thermophysicalPredictor.C | 3 --- .../TwoResistanceHeatTransferPhaseSystem.C | 4 ++-- .../TwoResistanceHeatTransferPhaseSystem.H | 2 +- .../MovingPhaseModel/MovingPhaseModel.C | 10 +++++----- .../MovingPhaseModel/MovingPhaseModel.H | 4 ++-- .../phaseModel/phaseModel/phaseModel.C | 4 ++-- .../phaseModel/phaseModel/phaseModel.H | 4 ++-- .../phaseSystems/phaseSystem/phaseSystem.C | 8 ++++---- .../phaseSystems/phaseSystem/phaseSystem.H | 4 ++-- applications/solvers/modules/solid/solid.C | 17 +++++++++------- applications/solvers/modules/solid/solid.H | 6 +----- .../fluid/laminar/Fickian/Fickian.C | 19 ++++++++++-------- .../fluid/laminar/Fickian/Fickian.H | 2 +- .../laminar/FickianFourier/FickianFourier.C | 2 +- .../fluid/laminar/Fourier/Fourier.C | 4 ++-- .../fluid/laminar/Fourier/Fourier.H | 2 +- .../laminar/MaxwellStefan/MaxwellStefan.C | 4 ++-- .../laminar/MaxwellStefan/MaxwellStefan.H | 2 +- .../MaxwellStefanFourier.C | 2 +- .../laminarThermophysicalTransportModel.C | 10 ++++++++++ .../laminarThermophysicalTransportModel.H | 7 ++++++- .../unityLewisFourier/unityLewisFourier.C | 4 ++-- .../unityLewisFourier/unityLewisFourier.H | 2 +- .../FickianEddyDiffusivity.C | 2 +- .../LESThermophysicalTransportModel.C | 8 ++++++++ .../LESThermophysicalTransportModel.H | 7 ++++++- .../RASThermophysicalTransportModel.C | 8 ++++++++ .../RASThermophysicalTransportModel.H | 7 ++++++- .../eddyDiffusivity/eddyDiffusivity.C | 4 ++-- .../eddyDiffusivity/eddyDiffusivity.H | 2 +- .../unityLewisEddyDiffusivity.C | 4 ++-- .../unityLewisEddyDiffusivity.H | 2 +- .../solid/anisotropic/anisotropic.C | 20 ++++++++++++++----- .../solid/anisotropic/anisotropic.H | 2 +- .../solid/isotropic/isotropic.C | 4 ++-- .../solid/isotropic/isotropic.H | 2 +- .../solidThermophysicalTransportModel.C | 4 ++++ .../solidThermophysicalTransportModel.H | 6 +++++- .../thermophysicalTransportModel.C | 4 ++++ .../thermophysicalTransportModel.H | 6 +++++- src/finiteVolume/solver/solver.H | 7 ++----- 62 files changed, 207 insertions(+), 136 deletions(-) diff --git a/applications/solvers/combustion/XiFoam/PDRFoam/PDRFoam.C b/applications/solvers/combustion/XiFoam/PDRFoam/PDRFoam.C index dbe7ea3bd9..900b9a5c94 100644 --- a/applications/solvers/combustion/XiFoam/PDRFoam/PDRFoam.C +++ b/applications/solvers/combustion/XiFoam/PDRFoam/PDRFoam.C @@ -123,6 +123,7 @@ int main(int argc, char *argv[]) while (pimple.loop()) { fvModels.correct(); + thermophysicalTransport.predict(); #include "UEqn.H" diff --git a/applications/solvers/combustion/XiFoam/PDRFoam/PDRFoamAutoRefine.C b/applications/solvers/combustion/XiFoam/PDRFoam/PDRFoamAutoRefine.C index 1928c15ac1..dfd2a1af9d 100644 --- a/applications/solvers/combustion/XiFoam/PDRFoam/PDRFoamAutoRefine.C +++ b/applications/solvers/combustion/XiFoam/PDRFoam/PDRFoamAutoRefine.C @@ -173,6 +173,7 @@ int main(int argc, char *argv[]) while (pimple.loop()) { fvModels.correct(); + thermophysicalTransport->predict(); #include "UEqn.H" diff --git a/applications/solvers/combustion/XiFoam/XiFoam.C b/applications/solvers/combustion/XiFoam/XiFoam.C index 46e91f8651..dfa12634d4 100644 --- a/applications/solvers/combustion/XiFoam/XiFoam.C +++ b/applications/solvers/combustion/XiFoam/XiFoam.C @@ -157,6 +157,7 @@ int main(int argc, char *argv[]) } fvModels.correct(); + thermophysicalTransport.predict(); #include "UEqn.H" #include "ftEqn.H" diff --git a/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C b/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C index c60ef4d424..391969fa85 100644 --- a/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C +++ b/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C @@ -200,6 +200,8 @@ int main(int argc, char *argv[]) // --- Solve density solve(fvm::ddt(rho) + fvc::div(phi)); + thermophysicalTransport->predict(); + // --- Solve momentum solve(fvm::ddt(rhoU) + fvc::div(phiUp)); diff --git a/applications/solvers/compressible/rhoPorousSimpleFoam/rhoPorousSimpleFoam.C b/applications/solvers/compressible/rhoPorousSimpleFoam/rhoPorousSimpleFoam.C index c760a104bd..e26239c086 100644 --- a/applications/solvers/compressible/rhoPorousSimpleFoam/rhoPorousSimpleFoam.C +++ b/applications/solvers/compressible/rhoPorousSimpleFoam/rhoPorousSimpleFoam.C @@ -64,6 +64,8 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.userTimeName() << nl << endl; + thermophysicalTransport->predict(); + // Pressure-velocity SIMPLE corrector { #include "UEqn.H" diff --git a/applications/solvers/foamMultiRun/foamMultiRun.C b/applications/solvers/foamMultiRun/foamMultiRun.C index 7bb438b3c9..857d668cb7 100644 --- a/applications/solvers/foamMultiRun/foamMultiRun.C +++ b/applications/solvers/foamMultiRun/foamMultiRun.C @@ -183,8 +183,7 @@ int main(int argc, char *argv[]) forAll(solvers, i) { - solvers[i].momentumTransportCorrector(); - solvers[i].thermophysicalTransportCorrector(); + solvers[i].postCorrector(); } } diff --git a/applications/solvers/foamRun/foamRun.C b/applications/solvers/foamRun/foamRun.C index b396c02e2b..fdf5ae5403 100644 --- a/applications/solvers/foamRun/foamRun.C +++ b/applications/solvers/foamRun/foamRun.C @@ -138,8 +138,7 @@ int main(int argc, char *argv[]) solver.momentumPredictor(); solver.thermophysicalPredictor(); solver.pressureCorrector(); - solver.momentumTransportCorrector(); - solver.thermophysicalTransportCorrector(); + solver.postCorrector(); } solver.postSolve(); diff --git a/applications/solvers/modules/compressibleVoF/compressibleInterPhaseThermophysicalTransportModel/compressibleInterPhaseThermophysicalTransportModel.C b/applications/solvers/modules/compressibleVoF/compressibleInterPhaseThermophysicalTransportModel/compressibleInterPhaseThermophysicalTransportModel.C index 1d3b03c757..1edc8f2956 100644 --- a/applications/solvers/modules/compressibleVoF/compressibleInterPhaseThermophysicalTransportModel/compressibleInterPhaseThermophysicalTransportModel.C +++ b/applications/solvers/modules/compressibleVoF/compressibleInterPhaseThermophysicalTransportModel/compressibleInterPhaseThermophysicalTransportModel.C @@ -215,6 +215,10 @@ Foam::compressibleInterPhaseThermophysicalTransportModel::divq } +void Foam::compressibleInterPhaseThermophysicalTransportModel::predict() +{} + + void Foam::compressibleInterPhaseThermophysicalTransportModel::correct() {} diff --git a/applications/solvers/modules/compressibleVoF/compressibleInterPhaseThermophysicalTransportModel/compressibleInterPhaseThermophysicalTransportModel.H b/applications/solvers/modules/compressibleVoF/compressibleInterPhaseThermophysicalTransportModel/compressibleInterPhaseThermophysicalTransportModel.H index 45aa0d4eac..178a819e9f 100644 --- a/applications/solvers/modules/compressibleVoF/compressibleInterPhaseThermophysicalTransportModel/compressibleInterPhaseThermophysicalTransportModel.H +++ b/applications/solvers/modules/compressibleVoF/compressibleInterPhaseThermophysicalTransportModel/compressibleInterPhaseThermophysicalTransportModel.H @@ -108,6 +108,10 @@ public: //- Return the source term for the energy equation virtual tmp divq(volScalarField& he) const; + //- Predict the transport coefficients if possible + // without solving thermophysical transport model equations + virtual void predict(); + //- Solve the thermophysical transport model equations // and correct the transport coefficients virtual void correct(); diff --git a/applications/solvers/modules/compressibleVoF/compressibleVoF.C b/applications/solvers/modules/compressibleVoF/compressibleVoF.C index ef772acdb0..d11cdf5fe2 100644 --- a/applications/solvers/modules/compressibleVoF/compressibleVoF.C +++ b/applications/solvers/modules/compressibleVoF/compressibleVoF.C @@ -331,22 +331,20 @@ void Foam::solvers::compressibleVoF::prePredictor() fvModels().correct(); alphaPredictor(); momentumTransport.correctPhasePhi(); + thermophysicalTransport.predict(); } -void Foam::solvers::compressibleVoF::momentumTransportCorrector() +void Foam::solvers::compressibleVoF::postCorrector() { if (pimple.transportCorr()) { momentumTransport.correct(); + thermophysicalTransport.correct(); } } -void Foam::solvers::compressibleVoF::thermophysicalTransportCorrector() -{} - - void Foam::solvers::compressibleVoF::postSolve() { divU.clear(); diff --git a/applications/solvers/modules/compressibleVoF/compressibleVoF.H b/applications/solvers/modules/compressibleVoF/compressibleVoF.H index e4cfbe1daf..4f340c6e30 100644 --- a/applications/solvers/modules/compressibleVoF/compressibleVoF.H +++ b/applications/solvers/modules/compressibleVoF/compressibleVoF.H @@ -244,12 +244,8 @@ public: //- Construct and solve the pressure equation in the PISO loop virtual void pressureCorrector(); - //- Correct the momentum transport modelling - // Newtonian, non-Newtonian or turbulent - virtual void momentumTransportCorrector(); - - //- Correct the thermophysical transport modelling - virtual void thermophysicalTransportCorrector(); + //- Correct the momentum and thermophysical transport modelling + virtual void postCorrector(); //- Called after the PIMPLE loop at the end of the time-step virtual void postSolve(); diff --git a/applications/solvers/modules/fluid/fluid.C b/applications/solvers/modules/fluid/fluid.C index 32a85a8018..298824a4ad 100644 --- a/applications/solvers/modules/fluid/fluid.C +++ b/applications/solvers/modules/fluid/fluid.C @@ -63,8 +63,17 @@ Foam::solvers::fluid::~fluid() // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -void Foam::solvers::fluid::thermophysicalTransportCorrector() +void Foam::solvers::fluid::prePredictor() { + isothermalFluid::prePredictor(); + thermophysicalTransport->predict(); +} + + +void Foam::solvers::fluid::postCorrector() +{ + isothermalFluid::postCorrector(); + if (pimple.transportCorr()) { thermophysicalTransport->correct(); diff --git a/applications/solvers/modules/fluid/fluid.H b/applications/solvers/modules/fluid/fluid.H index f80bfb69e1..3978559db1 100644 --- a/applications/solvers/modules/fluid/fluid.H +++ b/applications/solvers/modules/fluid/fluid.H @@ -99,13 +99,16 @@ public: // Member Functions + //- Called at the start of the PIMPLE loop + virtual void prePredictor(); + //- Construct and solve the energy equation, // convert to temperature // and update thermophysical and transport properties virtual void thermophysicalPredictor(); - //- Correct the thermophysical transport modelling - virtual void thermophysicalTransportCorrector(); + //- Correct the momentum and thermophysical transport modelling + virtual void postCorrector(); // Member Operators diff --git a/applications/solvers/modules/incompressibleFluid/incompressibleFluid.C b/applications/solvers/modules/incompressibleFluid/incompressibleFluid.C index 39cad573d4..4f939bdf41 100644 --- a/applications/solvers/modules/incompressibleFluid/incompressibleFluid.C +++ b/applications/solvers/modules/incompressibleFluid/incompressibleFluid.C @@ -215,7 +215,7 @@ void Foam::solvers::incompressibleFluid::pressureCorrector() } -void Foam::solvers::incompressibleFluid::momentumTransportCorrector() +void Foam::solvers::incompressibleFluid::postCorrector() { if (pimple.transportCorr()) { @@ -225,10 +225,6 @@ void Foam::solvers::incompressibleFluid::momentumTransportCorrector() } -void Foam::solvers::incompressibleFluid::thermophysicalTransportCorrector() -{} - - void Foam::solvers::incompressibleFluid::postSolve() {} diff --git a/applications/solvers/modules/incompressibleFluid/incompressibleFluid.H b/applications/solvers/modules/incompressibleFluid/incompressibleFluid.H index 0281e5e66d..7cd938886c 100644 --- a/applications/solvers/modules/incompressibleFluid/incompressibleFluid.H +++ b/applications/solvers/modules/incompressibleFluid/incompressibleFluid.H @@ -189,12 +189,8 @@ public: //- Construct and solve the pressure equation in the PISO loop virtual void pressureCorrector(); - //- Correct the momentum transport modelling - // Newtonian, non-Newtonian or turbulent - virtual void momentumTransportCorrector(); - - //- Correct the thermophysical transport modelling - virtual void thermophysicalTransportCorrector(); + //- Correct the momentum and thermophysical transport modelling + virtual void postCorrector(); //- Called after the PIMPLE loop at the end of the time-step virtual void postSolve(); diff --git a/applications/solvers/modules/isothermalFluid/isothermalFluid.C b/applications/solvers/modules/isothermalFluid/isothermalFluid.C index 25268225fa..bd97f3ddfa 100644 --- a/applications/solvers/modules/isothermalFluid/isothermalFluid.C +++ b/applications/solvers/modules/isothermalFluid/isothermalFluid.C @@ -342,7 +342,7 @@ void Foam::solvers::isothermalFluid::pressureCorrector() } -void Foam::solvers::isothermalFluid::momentumTransportCorrector() +void Foam::solvers::isothermalFluid::postCorrector() { if (pimple.transportCorr()) { @@ -351,10 +351,6 @@ void Foam::solvers::isothermalFluid::momentumTransportCorrector() } -void Foam::solvers::isothermalFluid::thermophysicalTransportCorrector() -{} - - void Foam::solvers::isothermalFluid::postSolve() { divrhoU.clear(); diff --git a/applications/solvers/modules/isothermalFluid/isothermalFluid.H b/applications/solvers/modules/isothermalFluid/isothermalFluid.H index 47c165f523..f4b406f96f 100644 --- a/applications/solvers/modules/isothermalFluid/isothermalFluid.H +++ b/applications/solvers/modules/isothermalFluid/isothermalFluid.H @@ -251,12 +251,8 @@ public: //- Construct and solve the pressure equation in the PISO loop virtual void pressureCorrector(); - //- Correct the momentum transport modelling - // Newtonian, non-Newtonian or turbulent - virtual void momentumTransportCorrector(); - - //- Correct the thermophysical transport modelling - virtual void thermophysicalTransportCorrector(); + //- Correct the momentum and thermophysical transport modelling + virtual void postCorrector(); //- Called after the PIMPLE loop at the end of the time-step virtual void postSolve(); diff --git a/applications/solvers/modules/multicomponentFluid/multicomponentFluid.C b/applications/solvers/modules/multicomponentFluid/multicomponentFluid.C index 10b1ee676a..07949cb703 100644 --- a/applications/solvers/modules/multicomponentFluid/multicomponentFluid.C +++ b/applications/solvers/modules/multicomponentFluid/multicomponentFluid.C @@ -82,8 +82,17 @@ Foam::solvers::multicomponentFluid::~multicomponentFluid() // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -void Foam::solvers::multicomponentFluid::thermophysicalTransportCorrector() +void Foam::solvers::multicomponentFluid::prePredictor() { + isothermalFluid::prePredictor(); + thermophysicalTransport->predict(); +} + + +void Foam::solvers::multicomponentFluid::postCorrector() +{ + isothermalFluid::postCorrector(); + if (pimple.transportCorr()) { thermophysicalTransport->correct(); diff --git a/applications/solvers/modules/multicomponentFluid/multicomponentFluid.H b/applications/solvers/modules/multicomponentFluid/multicomponentFluid.H index af8fc1bf22..f8482bcdc1 100644 --- a/applications/solvers/modules/multicomponentFluid/multicomponentFluid.H +++ b/applications/solvers/modules/multicomponentFluid/multicomponentFluid.H @@ -131,13 +131,16 @@ public: // Member Functions + //- Called at the start of the PIMPLE loop + virtual void prePredictor(); + //- Construct and solve the energy equation, // convert to temperature // and update thermophysical and transport properties virtual void thermophysicalPredictor(); - //- Correct the thermophysical transport modelling - virtual void thermophysicalTransportCorrector(); + //- Correct the momentum and thermophysical transport modelling + virtual void postCorrector(); // Member Operators diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseEuler/multiphaseEuler.C b/applications/solvers/modules/multiphaseEuler/multiphaseEuler/multiphaseEuler.C index aa832cf191..259abfa772 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseEuler/multiphaseEuler.C +++ b/applications/solvers/modules/multiphaseEuler/multiphaseEuler/multiphaseEuler.C @@ -248,19 +248,16 @@ void Foam::solvers::multiphaseEuler::prePredictor() } -void Foam::solvers::multiphaseEuler::momentumTransportCorrector() +void Foam::solvers::multiphaseEuler::postCorrector() { if (pimple.flow() && pimple.transportCorr()) { - fluid.correctTurbulence(); + fluid.correctMomentumTransport(); + fluid.correctThermophysicalTransport(); } } -void Foam::solvers::multiphaseEuler::thermophysicalTransportCorrector() -{} - - void Foam::solvers::multiphaseEuler::postSolve() { divU.clear(); diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseEuler/multiphaseEuler.H b/applications/solvers/modules/multiphaseEuler/multiphaseEuler/multiphaseEuler.H index c4504ba887..8bb33e5b28 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseEuler/multiphaseEuler.H +++ b/applications/solvers/modules/multiphaseEuler/multiphaseEuler/multiphaseEuler.H @@ -233,12 +233,8 @@ public: //- Construct and solve the pressure equation in the PISO loop virtual void pressureCorrector(); - //- Correct the momentum transport modelling - // Newtonian, non-Newtonian or turbulent - virtual void momentumTransportCorrector(); - - //- Correct the thermophysical transport modelling - virtual void thermophysicalTransportCorrector(); + //- Correct the momentum and thermophysical transport modelling + virtual void postCorrector(); //- Called after the PIMPLE loop at the end of the time-step virtual void postSolve(); diff --git a/applications/solvers/modules/multiphaseEuler/multiphaseEuler/thermophysicalPredictor.C b/applications/solvers/modules/multiphaseEuler/multiphaseEuler/thermophysicalPredictor.C index 8f122cbacc..427788cecf 100644 --- a/applications/solvers/modules/multiphaseEuler/multiphaseEuler/thermophysicalPredictor.C +++ b/applications/solvers/modules/multiphaseEuler/multiphaseEuler/thermophysicalPredictor.C @@ -76,8 +76,6 @@ void Foam::solvers::multiphaseEuler::energyPredictor() { for (int Ecorr=0; Ecorr heatTransferPtr(fluid.heatTransfer()); @@ -120,7 +118,6 @@ void Foam::solvers::multiphaseEuler::thermophysicalPredictor() { if (pimple.thermophysics()) { - // compositionPredictor(); energyPredictor(); forAll(phases, phasei) diff --git a/applications/solvers/modules/multiphaseEuler/phaseSystems/PhaseSystems/TwoResistanceHeatTransferPhaseSystem/TwoResistanceHeatTransferPhaseSystem.C b/applications/solvers/modules/multiphaseEuler/phaseSystems/PhaseSystems/TwoResistanceHeatTransferPhaseSystem/TwoResistanceHeatTransferPhaseSystem.C index d4ff8e8df9..4fde52a603 100644 --- a/applications/solvers/modules/multiphaseEuler/phaseSystems/PhaseSystems/TwoResistanceHeatTransferPhaseSystem/TwoResistanceHeatTransferPhaseSystem.C +++ b/applications/solvers/modules/multiphaseEuler/phaseSystems/PhaseSystems/TwoResistanceHeatTransferPhaseSystem/TwoResistanceHeatTransferPhaseSystem.C @@ -295,9 +295,9 @@ heatTransfer() const template void Foam::TwoResistanceHeatTransferPhaseSystem:: -correctEnergyTransport() +correctThermophysicalTransport() { - BasePhaseSystem::correctEnergyTransport(); + BasePhaseSystem::correctThermophysicalTransport(); correctInterfaceThermo(); } diff --git a/applications/solvers/modules/multiphaseEuler/phaseSystems/PhaseSystems/TwoResistanceHeatTransferPhaseSystem/TwoResistanceHeatTransferPhaseSystem.H b/applications/solvers/modules/multiphaseEuler/phaseSystems/PhaseSystems/TwoResistanceHeatTransferPhaseSystem/TwoResistanceHeatTransferPhaseSystem.H index dbd83792fb..d0c28d7d05 100644 --- a/applications/solvers/modules/multiphaseEuler/phaseSystems/PhaseSystems/TwoResistanceHeatTransferPhaseSystem/TwoResistanceHeatTransferPhaseSystem.H +++ b/applications/solvers/modules/multiphaseEuler/phaseSystems/PhaseSystems/TwoResistanceHeatTransferPhaseSystem/TwoResistanceHeatTransferPhaseSystem.H @@ -137,7 +137,7 @@ public: virtual autoPtr heatTransfer() const; //- Correct the energy transport e.g. alphat and Tf - virtual void correctEnergyTransport(); + virtual void correctThermophysicalTransport(); //- Correct the interface thermodynamics virtual void correctInterfaceThermo() = 0; diff --git a/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C b/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C index ba1d2623ff..4cbd8a1dca 100644 --- a/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C +++ b/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C @@ -241,6 +241,7 @@ template void Foam::MovingPhaseModel::correct() { BasePhaseModel::correct(); + thermophysicalTransport_->predict(); } @@ -269,18 +270,17 @@ void Foam::MovingPhaseModel::correctKinematics() template -void Foam::MovingPhaseModel::correctTurbulence() +void Foam::MovingPhaseModel::correctMomentumTransport() { - BasePhaseModel::correctTurbulence(); - + BasePhaseModel::correctMomentumTransport(); momentumTransport_->correct(); } template -void Foam::MovingPhaseModel::correctEnergyTransport() +void Foam::MovingPhaseModel::correctThermophysicalTransport() { - BasePhaseModel::correctEnergyTransport(); + BasePhaseModel::correctThermophysicalTransport(); thermophysicalTransport_->correct(); } diff --git a/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.H b/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.H index 241827d322..87c12996ea 100644 --- a/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.H +++ b/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.H @@ -179,10 +179,10 @@ public: virtual void correctKinematics(); //- Correct the momentumTransport - virtual void correctTurbulence(); + virtual void correctMomentumTransport(); //- Correct the energy transport e.g. alphat - virtual void correctEnergyTransport(); + virtual void correctThermophysicalTransport(); //- Correct the face velocity for moving meshes virtual void correctUf(); diff --git a/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseModel/phaseModel/phaseModel.C b/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseModel/phaseModel/phaseModel.C index ea1bda6ede..a7281c3b3a 100644 --- a/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseModel/phaseModel/phaseModel.C +++ b/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseModel/phaseModel/phaseModel.C @@ -180,11 +180,11 @@ void Foam::phaseModel::correctSpecies() {} -void Foam::phaseModel::correctTurbulence() +void Foam::phaseModel::correctMomentumTransport() {} -void Foam::phaseModel::correctEnergyTransport() +void Foam::phaseModel::correctThermophysicalTransport() {} diff --git a/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseModel/phaseModel/phaseModel.H b/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseModel/phaseModel/phaseModel.H index 54d420a3b7..3421273bf8 100644 --- a/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseModel/phaseModel/phaseModel.H +++ b/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseModel/phaseModel/phaseModel.H @@ -216,10 +216,10 @@ public: virtual void correctSpecies(); //- Correct the momentumTransport - virtual void correctTurbulence(); + virtual void correctMomentumTransport(); //- Correct the energy transport - virtual void correctEnergyTransport(); + virtual void correctThermophysicalTransport(); //- Correct the face velocity for moving meshes virtual void correctUf(); diff --git a/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseSystem/phaseSystem.C b/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseSystem/phaseSystem.C index 7202f1b0df..517006badf 100644 --- a/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseSystem/phaseSystem.C +++ b/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseSystem/phaseSystem.C @@ -644,20 +644,20 @@ void Foam::phaseSystem::correctSpecies() } -void Foam::phaseSystem::correctTurbulence() +void Foam::phaseSystem::correctMomentumTransport() { forAll(phaseModels_, phasei) { - phaseModels_[phasei].correctTurbulence(); + phaseModels_[phasei].correctMomentumTransport(); } } -void Foam::phaseSystem::correctEnergyTransport() +void Foam::phaseSystem::correctThermophysicalTransport() { forAll(phaseModels_, phasei) { - phaseModels_[phasei].correctEnergyTransport(); + phaseModels_[phasei].correctThermophysicalTransport(); } } diff --git a/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseSystem/phaseSystem.H b/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseSystem/phaseSystem.H index 84cd2c2d43..44219c6ef3 100644 --- a/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseSystem/phaseSystem.H +++ b/applications/solvers/modules/multiphaseEuler/phaseSystems/phaseSystem/phaseSystem.H @@ -636,10 +636,10 @@ public: virtual void correctSpecies(); //- Correct the momentumTransport - virtual void correctTurbulence(); + virtual void correctMomentumTransport(); //- Correct the energy transport e.g. alphat - virtual void correctEnergyTransport(); + virtual void correctThermophysicalTransport(); //- Update the fluid properties for mesh changes virtual void meshUpdate(); diff --git a/applications/solvers/modules/solid/solid.C b/applications/solvers/modules/solid/solid.C index af8e6a4c75..1448ca946c 100644 --- a/applications/solvers/modules/solid/solid.C +++ b/applications/solvers/modules/solid/solid.C @@ -156,7 +156,9 @@ bool Foam::solvers::solid::moveMesh() void Foam::solvers::solid::prePredictor() -{} +{ + thermophysicalTransport->predict(); +} void Foam::solvers::solid::momentumPredictor() @@ -195,12 +197,13 @@ void Foam::solvers::solid::pressureCorrector() {} -void Foam::solvers::solid::momentumTransportCorrector() -{} - - -void Foam::solvers::solid::thermophysicalTransportCorrector() -{} +void Foam::solvers::solid::postCorrector() +{ + if (pimple.transportCorr()) + { + thermophysicalTransport->correct(); + } +} void Foam::solvers::solid::postSolve() diff --git a/applications/solvers/modules/solid/solid.H b/applications/solvers/modules/solid/solid.H index d4e62fc925..f91fe08da3 100644 --- a/applications/solvers/modules/solid/solid.H +++ b/applications/solvers/modules/solid/solid.H @@ -143,12 +143,8 @@ public: //- Construct and solve the pressure equation in the PISO loop virtual void pressureCorrector(); - //- Correct the momentum transport modelling - // Newtonian, non-Newtonian or turbulent - virtual void momentumTransportCorrector(); - //- Correct the thermophysical transport modelling - virtual void thermophysicalTransportCorrector(); + virtual void postCorrector(); //- Called after the PIMPLE loop at the end of the time-step virtual void postSolve(); diff --git a/src/ThermophysicalTransportModels/fluid/laminar/Fickian/Fickian.C b/src/ThermophysicalTransportModels/fluid/laminar/Fickian/Fickian.C index 5896ca0195..b739325ade 100644 --- a/src/ThermophysicalTransportModels/fluid/laminar/Fickian/Fickian.C +++ b/src/ThermophysicalTransportModels/fluid/laminar/Fickian/Fickian.C @@ -66,9 +66,7 @@ Fickian::Fickian this->coeffDict_.found("DT") ? this->thermo().composition().species().size() : 0 - ), - - Dm_(this->thermo().composition().species().size()) + ) {} @@ -437,15 +435,17 @@ tmp Fickian::divj template -void Fickian::correct() +void Fickian::predict() { - BasicThermophysicalTransportModel::correct(); + BasicThermophysicalTransportModel::predict(); const basicSpecieMixture& composition = this->thermo().composition(); const PtrList& Y = composition.Y(); const volScalarField& p = this->thermo().p(); const volScalarField& T = this->thermo().T(); + Dm_.setSize(Y.size()); + if (mixtureDiffusionCoefficients_) { forAll(Y, i) @@ -519,7 +519,8 @@ void Fickian::topoChange const polyTopoChangeMap& map ) { - correct(); + // Delete the cached Dm, will be re-created in predict + Dm_.clear(); } @@ -529,7 +530,8 @@ void Fickian::mapMesh const polyMeshMap& map ) { - correct(); + // Delete the cached Dm, will be re-created in predict + Dm_.clear(); } @@ -539,7 +541,8 @@ void Fickian::distribute const polyDistributionMap& map ) { - correct(); + // Delete the cached Dm, will be re-created in predict + Dm_.clear(); } diff --git a/src/ThermophysicalTransportModels/fluid/laminar/Fickian/Fickian.H b/src/ThermophysicalTransportModels/fluid/laminar/Fickian/Fickian.H index 92c9f32532..9855754e13 100644 --- a/src/ThermophysicalTransportModels/fluid/laminar/Fickian/Fickian.H +++ b/src/ThermophysicalTransportModels/fluid/laminar/Fickian/Fickian.H @@ -144,7 +144,7 @@ public: virtual tmp divj(volScalarField& Yi) const; //- Update the diffusion coefficients - virtual void correct(); + virtual void predict(); // Mesh changes diff --git a/src/ThermophysicalTransportModels/fluid/laminar/FickianFourier/FickianFourier.C b/src/ThermophysicalTransportModels/fluid/laminar/FickianFourier/FickianFourier.C index c9b03b5fb9..b2b08c91bc 100644 --- a/src/ThermophysicalTransportModels/fluid/laminar/FickianFourier/FickianFourier.C +++ b/src/ThermophysicalTransportModels/fluid/laminar/FickianFourier/FickianFourier.C @@ -50,7 +50,7 @@ FickianFourier ) { read(); - this->correct(); + this->predict(); this->printCoeffs(typeName); } diff --git a/src/ThermophysicalTransportModels/fluid/laminar/Fourier/Fourier.C b/src/ThermophysicalTransportModels/fluid/laminar/Fourier/Fourier.C index 9e2c6e0a20..40ed016ea2 100644 --- a/src/ThermophysicalTransportModels/fluid/laminar/Fourier/Fourier.C +++ b/src/ThermophysicalTransportModels/fluid/laminar/Fourier/Fourier.C @@ -170,12 +170,12 @@ Fourier::divj(volScalarField& Yi) const template -void Fourier::correct() +void Fourier::predict() { laminarThermophysicalTransportModel < BasicThermophysicalTransportModel - >::correct(); + >::predict(); } diff --git a/src/ThermophysicalTransportModels/fluid/laminar/Fourier/Fourier.H b/src/ThermophysicalTransportModels/fluid/laminar/Fourier/Fourier.H index dcd10f1984..b8b0fe2ba8 100644 --- a/src/ThermophysicalTransportModels/fluid/laminar/Fourier/Fourier.H +++ b/src/ThermophysicalTransportModels/fluid/laminar/Fourier/Fourier.H @@ -126,7 +126,7 @@ public: virtual tmp divj(volScalarField& Yi) const; //- Correct the Fourier viscosity - virtual void correct(); + virtual void predict(); }; diff --git a/src/ThermophysicalTransportModels/fluid/laminar/MaxwellStefan/MaxwellStefan.C b/src/ThermophysicalTransportModels/fluid/laminar/MaxwellStefan/MaxwellStefan.C index 1edcfc90f4..27de4df9c8 100644 --- a/src/ThermophysicalTransportModels/fluid/laminar/MaxwellStefan/MaxwellStefan.C +++ b/src/ThermophysicalTransportModels/fluid/laminar/MaxwellStefan/MaxwellStefan.C @@ -608,9 +608,9 @@ void MaxwellStefan::transform template -void MaxwellStefan::correct() +void MaxwellStefan::predict() { - BasicThermophysicalTransportModel::correct(); + BasicThermophysicalTransportModel::predict(); const basicSpecieMixture& composition = this->thermo().composition(); const label d = composition.defaultSpecie(); diff --git a/src/ThermophysicalTransportModels/fluid/laminar/MaxwellStefan/MaxwellStefan.H b/src/ThermophysicalTransportModels/fluid/laminar/MaxwellStefan/MaxwellStefan.H index b8e9e6f4ad..44d874e3a7 100644 --- a/src/ThermophysicalTransportModels/fluid/laminar/MaxwellStefan/MaxwellStefan.H +++ b/src/ThermophysicalTransportModels/fluid/laminar/MaxwellStefan/MaxwellStefan.H @@ -209,7 +209,7 @@ public: virtual tmp divj(volScalarField& Yi) const; //- Update the diffusion coefficients and flux corrections - virtual void correct(); + virtual void predict(); }; diff --git a/src/ThermophysicalTransportModels/fluid/laminar/MaxwellStefanFourier/MaxwellStefanFourier.C b/src/ThermophysicalTransportModels/fluid/laminar/MaxwellStefanFourier/MaxwellStefanFourier.C index d44cbaabe6..1de28e3840 100644 --- a/src/ThermophysicalTransportModels/fluid/laminar/MaxwellStefanFourier/MaxwellStefanFourier.C +++ b/src/ThermophysicalTransportModels/fluid/laminar/MaxwellStefanFourier/MaxwellStefanFourier.C @@ -50,7 +50,7 @@ MaxwellStefanFourier ) { read(); - this->correct(); + this->predict(); this->printCoeffs(typeName); } diff --git a/src/ThermophysicalTransportModels/fluid/laminar/laminarThermophysicalTransportModel/laminarThermophysicalTransportModel.C b/src/ThermophysicalTransportModels/fluid/laminar/laminarThermophysicalTransportModel/laminarThermophysicalTransportModel.C index c6d459773e..7769f6e212 100644 --- a/src/ThermophysicalTransportModels/fluid/laminar/laminarThermophysicalTransportModel/laminarThermophysicalTransportModel.C +++ b/src/ThermophysicalTransportModels/fluid/laminar/laminarThermophysicalTransportModel/laminarThermophysicalTransportModel.C @@ -161,6 +161,16 @@ bool Foam::laminarThermophysicalTransportModel } +template +void Foam::laminarThermophysicalTransportModel +< + BasicThermophysicalTransportModel +>::predict() +{ + BasicThermophysicalTransportModel::predict(); +} + + template void Foam::laminarThermophysicalTransportModel < diff --git a/src/ThermophysicalTransportModels/fluid/laminar/laminarThermophysicalTransportModel/laminarThermophysicalTransportModel.H b/src/ThermophysicalTransportModels/fluid/laminar/laminarThermophysicalTransportModel/laminarThermophysicalTransportModel.H index 85eb37d52a..e7b29d7775 100644 --- a/src/ThermophysicalTransportModels/fluid/laminar/laminarThermophysicalTransportModel/laminarThermophysicalTransportModel.H +++ b/src/ThermophysicalTransportModels/fluid/laminar/laminarThermophysicalTransportModel/laminarThermophysicalTransportModel.H @@ -186,7 +186,12 @@ public: const label patchi ) const = 0; - //- Correct the laminar transport + //- Predict the laminar transport coefficients if possible + // without solving thermophysical transport model equations + virtual void predict(); + + //- Solve the thermophysical transport model equations + // and correct the laminar transport coefficients virtual void correct(); diff --git a/src/ThermophysicalTransportModels/fluid/laminar/unityLewisFourier/unityLewisFourier.C b/src/ThermophysicalTransportModels/fluid/laminar/unityLewisFourier/unityLewisFourier.C index 5fc8abd7d0..2bc723216a 100644 --- a/src/ThermophysicalTransportModels/fluid/laminar/unityLewisFourier/unityLewisFourier.C +++ b/src/ThermophysicalTransportModels/fluid/laminar/unityLewisFourier/unityLewisFourier.C @@ -154,12 +154,12 @@ divj(volScalarField& Yi) const template -void unityLewisFourier::correct() +void unityLewisFourier::predict() { laminarThermophysicalTransportModel < BasicThermophysicalTransportModel - >::correct(); + >::predict(); } diff --git a/src/ThermophysicalTransportModels/fluid/laminar/unityLewisFourier/unityLewisFourier.H b/src/ThermophysicalTransportModels/fluid/laminar/unityLewisFourier/unityLewisFourier.H index b97b8cb083..ee9da39c65 100644 --- a/src/ThermophysicalTransportModels/fluid/laminar/unityLewisFourier/unityLewisFourier.H +++ b/src/ThermophysicalTransportModels/fluid/laminar/unityLewisFourier/unityLewisFourier.H @@ -143,7 +143,7 @@ public: virtual tmp divj(volScalarField& Yi) const; //- Correct the unityLewisFourier viscosity - virtual void correct(); + virtual void predict(); }; diff --git a/src/ThermophysicalTransportModels/fluid/turbulence/FickianEddyDiffusivity/FickianEddyDiffusivity.C b/src/ThermophysicalTransportModels/fluid/turbulence/FickianEddyDiffusivity/FickianEddyDiffusivity.C index f28cb0575c..c813a92742 100644 --- a/src/ThermophysicalTransportModels/fluid/turbulence/FickianEddyDiffusivity/FickianEddyDiffusivity.C +++ b/src/ThermophysicalTransportModels/fluid/turbulence/FickianEddyDiffusivity/FickianEddyDiffusivity.C @@ -52,7 +52,7 @@ FickianEddyDiffusivity Sct_("Sct", dimless, this->coeffDict_) { read(); - this->correct(); + this->predict(); this->printCoeffs(typeName); } diff --git a/src/ThermophysicalTransportModels/fluid/turbulence/LES/LESThermophysicalTransportModel/LESThermophysicalTransportModel.C b/src/ThermophysicalTransportModels/fluid/turbulence/LES/LESThermophysicalTransportModel/LESThermophysicalTransportModel.C index f4bdc38517..c1c9927feb 100644 --- a/src/ThermophysicalTransportModels/fluid/turbulence/LES/LESThermophysicalTransportModel/LESThermophysicalTransportModel.C +++ b/src/ThermophysicalTransportModels/fluid/turbulence/LES/LESThermophysicalTransportModel/LESThermophysicalTransportModel.C @@ -174,6 +174,14 @@ bool Foam::LESThermophysicalTransportModel } +template +void Foam::LESThermophysicalTransportModel:: +predict() +{ + BasicThermophysicalTransportModel::predict(); +} + + template void Foam::LESThermophysicalTransportModel:: correct() diff --git a/src/ThermophysicalTransportModels/fluid/turbulence/LES/LESThermophysicalTransportModel/LESThermophysicalTransportModel.H b/src/ThermophysicalTransportModels/fluid/turbulence/LES/LESThermophysicalTransportModel/LESThermophysicalTransportModel.H index ec110f12d6..60a41988f3 100644 --- a/src/ThermophysicalTransportModels/fluid/turbulence/LES/LESThermophysicalTransportModel/LESThermophysicalTransportModel.H +++ b/src/ThermophysicalTransportModels/fluid/turbulence/LES/LESThermophysicalTransportModel/LESThermophysicalTransportModel.H @@ -154,7 +154,12 @@ public: // of mixture for patch [W/m/K] virtual tmp kappaEff(const label patchi) const = 0; - //- Correct the LES transport + //- Predict the LES transport coefficients if possible + // without solving thermophysical transport model equations + virtual void predict(); + + //- Solve the thermophysical transport model equations + // and correct the LES transport coefficients virtual void correct(); diff --git a/src/ThermophysicalTransportModels/fluid/turbulence/RAS/RASThermophysicalTransportModel/RASThermophysicalTransportModel.C b/src/ThermophysicalTransportModels/fluid/turbulence/RAS/RASThermophysicalTransportModel/RASThermophysicalTransportModel.C index 57d657bf25..8c60507d84 100644 --- a/src/ThermophysicalTransportModels/fluid/turbulence/RAS/RASThermophysicalTransportModel/RASThermophysicalTransportModel.C +++ b/src/ThermophysicalTransportModels/fluid/turbulence/RAS/RASThermophysicalTransportModel/RASThermophysicalTransportModel.C @@ -174,6 +174,14 @@ bool Foam::RASThermophysicalTransportModel } +template +void Foam::RASThermophysicalTransportModel:: +predict() +{ + BasicThermophysicalTransportModel::predict(); +} + + template void Foam::RASThermophysicalTransportModel:: correct() diff --git a/src/ThermophysicalTransportModels/fluid/turbulence/RAS/RASThermophysicalTransportModel/RASThermophysicalTransportModel.H b/src/ThermophysicalTransportModels/fluid/turbulence/RAS/RASThermophysicalTransportModel/RASThermophysicalTransportModel.H index 0098e109c9..e7c066d6ef 100644 --- a/src/ThermophysicalTransportModels/fluid/turbulence/RAS/RASThermophysicalTransportModel/RASThermophysicalTransportModel.H +++ b/src/ThermophysicalTransportModels/fluid/turbulence/RAS/RASThermophysicalTransportModel/RASThermophysicalTransportModel.H @@ -154,7 +154,12 @@ public: // of mixture for patch [W/m/K] virtual tmp kappaEff(const label patchi) const = 0; - //- Correct the RAS transport + //- Predict the RAS transport coefficients if possible + // without solving thermophysical transport model equations + virtual void predict(); + + //- Solve the thermophysical transport model equations + // and correct the RAS transport coefficients virtual void correct(); diff --git a/src/ThermophysicalTransportModels/fluid/turbulence/eddyDiffusivity/eddyDiffusivity.C b/src/ThermophysicalTransportModels/fluid/turbulence/eddyDiffusivity/eddyDiffusivity.C index c2e080ebf2..9d0c6cf00b 100644 --- a/src/ThermophysicalTransportModels/fluid/turbulence/eddyDiffusivity/eddyDiffusivity.C +++ b/src/ThermophysicalTransportModels/fluid/turbulence/eddyDiffusivity/eddyDiffusivity.C @@ -203,9 +203,9 @@ eddyDiffusivity::divj template -void eddyDiffusivity::correct() +void eddyDiffusivity::predict() { - TurbulenceThermophysicalTransportModel::correct(); + TurbulenceThermophysicalTransportModel::predict(); correctAlphat(); } diff --git a/src/ThermophysicalTransportModels/fluid/turbulence/eddyDiffusivity/eddyDiffusivity.H b/src/ThermophysicalTransportModels/fluid/turbulence/eddyDiffusivity/eddyDiffusivity.H index f65fed8426..136fc8512f 100644 --- a/src/ThermophysicalTransportModels/fluid/turbulence/eddyDiffusivity/eddyDiffusivity.H +++ b/src/ThermophysicalTransportModels/fluid/turbulence/eddyDiffusivity/eddyDiffusivity.H @@ -183,7 +183,7 @@ public: virtual tmp divj(volScalarField& Yi) const; //- Correct the eddyDiffusivity viscosity - virtual void correct(); + virtual void predict(); }; diff --git a/src/ThermophysicalTransportModels/fluid/turbulence/unityLewisEddyDiffusivity/unityLewisEddyDiffusivity.C b/src/ThermophysicalTransportModels/fluid/turbulence/unityLewisEddyDiffusivity/unityLewisEddyDiffusivity.C index 442cfc8615..26987ac9ad 100644 --- a/src/ThermophysicalTransportModels/fluid/turbulence/unityLewisEddyDiffusivity/unityLewisEddyDiffusivity.C +++ b/src/ThermophysicalTransportModels/fluid/turbulence/unityLewisEddyDiffusivity/unityLewisEddyDiffusivity.C @@ -205,9 +205,9 @@ unityLewisEddyDiffusivity::divj template void unityLewisEddyDiffusivity:: -correct() +predict() { - TurbulenceThermophysicalTransportModel::correct(); + TurbulenceThermophysicalTransportModel::predict(); correctAlphat(); } diff --git a/src/ThermophysicalTransportModels/fluid/turbulence/unityLewisEddyDiffusivity/unityLewisEddyDiffusivity.H b/src/ThermophysicalTransportModels/fluid/turbulence/unityLewisEddyDiffusivity/unityLewisEddyDiffusivity.H index b2e06c46d4..771adb5e34 100644 --- a/src/ThermophysicalTransportModels/fluid/turbulence/unityLewisEddyDiffusivity/unityLewisEddyDiffusivity.H +++ b/src/ThermophysicalTransportModels/fluid/turbulence/unityLewisEddyDiffusivity/unityLewisEddyDiffusivity.H @@ -205,7 +205,7 @@ public: virtual tmp divj(volScalarField& Yi) const; //- Correct the unityLewisEddyDiffusivity viscosity - virtual void correct(); + virtual void predict(); }; diff --git a/src/ThermophysicalTransportModels/solid/anisotropic/anisotropic.C b/src/ThermophysicalTransportModels/solid/anisotropic/anisotropic.C index eaa9a83632..98a253502c 100644 --- a/src/ThermophysicalTransportModels/solid/anisotropic/anisotropic.C +++ b/src/ThermophysicalTransportModels/solid/anisotropic/anisotropic.C @@ -434,9 +434,16 @@ Foam::solidThermophysicalTransportModels::anisotropic::divq } -void Foam::solidThermophysicalTransportModels::anisotropic::correct() +void Foam::solidThermophysicalTransportModels::anisotropic::predict() { - solidThermophysicalTransportModel::correct(); + solidThermophysicalTransportModel::predict(); + + // Recalculate zonesPatchFaces if they have been deleted + // following mesh changes + if (!zonesPatchFaces_.size()) + { + setZonesPatchFaces(); + } } @@ -451,7 +458,8 @@ void Foam::solidThermophysicalTransportModels::anisotropic::topoChange const polyTopoChangeMap& map ) { - setZonesPatchFaces(); + // Delete the cached zonesPatchFaces, will be re-created in predict + zonesPatchFaces_.clear(); } @@ -460,7 +468,8 @@ void Foam::solidThermophysicalTransportModels::anisotropic::mapMesh const polyMeshMap& map ) { - setZonesPatchFaces(); + // Delete the cached zonesPatchFaces, will be re-created in predict + zonesPatchFaces_.clear(); } @@ -469,7 +478,8 @@ void Foam::solidThermophysicalTransportModels::anisotropic::distribute const polyDistributionMap& map ) { - setZonesPatchFaces(); + // Delete the cached zonesPatchFaces, will be re-created in predict + zonesPatchFaces_.clear(); } diff --git a/src/ThermophysicalTransportModels/solid/anisotropic/anisotropic.H b/src/ThermophysicalTransportModels/solid/anisotropic/anisotropic.H index 9467adad03..0a10518f78 100644 --- a/src/ThermophysicalTransportModels/solid/anisotropic/anisotropic.H +++ b/src/ThermophysicalTransportModels/solid/anisotropic/anisotropic.H @@ -187,7 +187,7 @@ public: virtual tmp divq(volScalarField& he) const; //- Correct the anisotropic viscosity - virtual void correct(); + virtual void predict(); // Mesh changes diff --git a/src/ThermophysicalTransportModels/solid/isotropic/isotropic.C b/src/ThermophysicalTransportModels/solid/isotropic/isotropic.C index 34e291dad6..9958557baf 100644 --- a/src/ThermophysicalTransportModels/solid/isotropic/isotropic.C +++ b/src/ThermophysicalTransportModels/solid/isotropic/isotropic.C @@ -117,9 +117,9 @@ Foam::solidThermophysicalTransportModels::isotropic::divq } -void Foam::solidThermophysicalTransportModels::isotropic::correct() +void Foam::solidThermophysicalTransportModels::isotropic::predict() { - solidThermophysicalTransportModel::correct(); + solidThermophysicalTransportModel::predict(); } diff --git a/src/ThermophysicalTransportModels/solid/isotropic/isotropic.H b/src/ThermophysicalTransportModels/solid/isotropic/isotropic.H index b8304ed67b..a86b2d5b03 100644 --- a/src/ThermophysicalTransportModels/solid/isotropic/isotropic.H +++ b/src/ThermophysicalTransportModels/solid/isotropic/isotropic.H @@ -92,7 +92,7 @@ public: virtual tmp divq(volScalarField& he) const; //- Correct the isotropic viscosity - virtual void correct(); + virtual void predict(); }; diff --git a/src/ThermophysicalTransportModels/solid/solidThermophysicalTransportModel/solidThermophysicalTransportModel.C b/src/ThermophysicalTransportModels/solid/solidThermophysicalTransportModel/solidThermophysicalTransportModel.C index 6d165b1522..c8fe2fde4b 100644 --- a/src/ThermophysicalTransportModels/solid/solidThermophysicalTransportModel/solidThermophysicalTransportModel.C +++ b/src/ThermophysicalTransportModels/solid/solidThermophysicalTransportModel/solidThermophysicalTransportModel.C @@ -148,6 +148,10 @@ bool Foam::solidThermophysicalTransportModel::read() } +void Foam::solidThermophysicalTransportModel::predict() +{} + + void Foam::solidThermophysicalTransportModel::correct() {} diff --git a/src/ThermophysicalTransportModels/solid/solidThermophysicalTransportModel/solidThermophysicalTransportModel.H b/src/ThermophysicalTransportModels/solid/solidThermophysicalTransportModel/solidThermophysicalTransportModel.H index d16b938716..e32739229a 100644 --- a/src/ThermophysicalTransportModels/solid/solidThermophysicalTransportModel/solidThermophysicalTransportModel.H +++ b/src/ThermophysicalTransportModels/solid/solidThermophysicalTransportModel/solidThermophysicalTransportModel.H @@ -158,9 +158,13 @@ public: //- Return the source term for the energy equation virtual tmp divq(volScalarField& he) const = 0; + //- Predict the transport coefficients if possible + // without solving thermophysical transport model equations + virtual void predict() = 0; + //- Solve the thermophysical transport model equations // and correct the transport coefficients - virtual void correct() = 0; + virtual void correct(); }; diff --git a/src/ThermophysicalTransportModels/thermophysicalTransportModel/thermophysicalTransportModel.C b/src/ThermophysicalTransportModels/thermophysicalTransportModel/thermophysicalTransportModel.C index 7763d08517..fcc0d34dd7 100644 --- a/src/ThermophysicalTransportModels/thermophysicalTransportModel/thermophysicalTransportModel.C +++ b/src/ThermophysicalTransportModels/thermophysicalTransportModel/thermophysicalTransportModel.C @@ -68,6 +68,10 @@ bool Foam::thermophysicalTransportModel::read() } +void Foam::thermophysicalTransportModel::predict() +{} + + void Foam::thermophysicalTransportModel::correct() {} diff --git a/src/ThermophysicalTransportModels/thermophysicalTransportModel/thermophysicalTransportModel.H b/src/ThermophysicalTransportModels/thermophysicalTransportModel/thermophysicalTransportModel.H index 7ca13b91d8..1d36495e66 100644 --- a/src/ThermophysicalTransportModels/thermophysicalTransportModel/thermophysicalTransportModel.H +++ b/src/ThermophysicalTransportModels/thermophysicalTransportModel/thermophysicalTransportModel.H @@ -105,9 +105,13 @@ public: //- Return the source term for the energy equation virtual tmp divq(volScalarField& he) const = 0; + //- Predict the transport coefficients if possible + // without solving thermophysical transport model equations + virtual void predict() = 0; + //- Solve the thermophysical transport model equations // and correct the transport coefficients - virtual void correct() = 0; + virtual void correct(); // Member Operators diff --git a/src/finiteVolume/solver/solver.H b/src/finiteVolume/solver/solver.H index 3319ae3cfb..a589147bc7 100644 --- a/src/finiteVolume/solver/solver.H +++ b/src/finiteVolume/solver/solver.H @@ -162,11 +162,8 @@ public: //- Construct and solve the pressure equation in the PISO loop virtual void pressureCorrector() = 0; - //- Correct the momentum transport modelling - virtual void momentumTransportCorrector() = 0; - - //- Correct the thermophysical transport modelling - virtual void thermophysicalTransportCorrector() = 0; + //- Correct the momentum and thermophysical transport modelling + virtual void postCorrector() = 0; //- Called after the PIMPLE loop at the end of the time-step virtual void postSolve() = 0;