From 6dc6d3d08929c2c2dc71a2ef09099a6352a3ead8 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Mon, 16 Oct 2023 19:41:39 +0100 Subject: [PATCH] phaseSystem::correctKinematics:: Ensure pressure is requested only for moving phase The pressure field is not available from stationary solid phases. --- .../phaseSystem/phaseSystem/phaseSystem.C | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/applications/modules/multiphaseEuler/phaseSystem/phaseSystem/phaseSystem.C b/applications/modules/multiphaseEuler/phaseSystem/phaseSystem/phaseSystem.C index b04e094834..302a19a7ab 100644 --- a/applications/modules/multiphaseEuler/phaseSystem/phaseSystem/phaseSystem.C +++ b/applications/modules/multiphaseEuler/phaseSystem/phaseSystem/phaseSystem.C @@ -600,13 +600,12 @@ void Foam::phaseSystem::correctKinematics() { phaseModels_[phasei].correctKinematics(); - updateDpdt = updateDpdt || phaseModels_[phasei].thermo().dpdt(); - } - - // Update the pressure time-derivative if required - if (updateDpdt) - { - dpdt_ = fvc::ddt(phaseModels_.begin()().fluidThermo().p()); + // Update the pressure time-derivative if required + if (!updateDpdt && phaseModels_[phasei].thermo().dpdt()) + { + dpdt_ = fvc::ddt(phaseModels_[phasei].fluidThermo().p()); + updateDpdt = true; + } } }