From d444cb168dcad5a1a494e03a399937e013b7a5b4 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Thu, 23 May 2024 15:41:24 +0100 Subject: [PATCH] multiphaseEuler::phaseSystem::correctBoundaryFlux: Update the phase fluxes from the phase face-velocity and make relative This update is necessary for mesh topology changes and mesh-to-mesh mapping which update the phase face-velocity fields but not the fluxes. --- .../phaseSystem/phaseSystem/phaseSystem.C | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/applications/modules/multiphaseEuler/phaseSystem/phaseSystem/phaseSystem.C b/applications/modules/multiphaseEuler/phaseSystem/phaseSystem/phaseSystem.C index cc7f478857..592b976d7d 100644 --- a/applications/modules/multiphaseEuler/phaseSystem/phaseSystem/phaseSystem.C +++ b/applications/modules/multiphaseEuler/phaseSystem/phaseSystem/phaseSystem.C @@ -689,9 +689,9 @@ void Foam::phaseSystem::meshUpdate() void Foam::phaseSystem::correctBoundaryFlux() { - forAll(movingPhases(), movingPhasei) + forAll(movingPhaseModels_, movingPhasei) { - phaseModel& phase = movingPhases()[movingPhasei]; + phaseModel& phase = movingPhaseModels_[movingPhasei]; tmp tU(phase.U()); const volVectorField::Boundary& UBf = tU().boundaryField(); @@ -726,9 +726,18 @@ void Foam::phaseSystem::correctPhi nonOrthogonalSolutionControl& pimple ) { - forAll(movingPhases(), movingPhasei) + // Update the phase fluxes from the phase face-velocity and make relative + forAll(movingPhaseModels_, movingPhasei) { - phaseModel& phase = movingPhases()[movingPhasei]; + phaseModel& phase = movingPhaseModels_[movingPhasei]; + phase.phiRef() = mesh_.Sf() & phase.UfRef(); + MRF_.makeRelative(phase.phiRef()); + fvc::makeRelative(phase.phiRef(), phase.U()); + } + + forAll(movingPhaseModels_, movingPhasei) + { + phaseModel& phase = movingPhaseModels_[movingPhasei]; volVectorField::Boundary& Ubf = phase.URef().boundaryFieldRef(); surfaceVectorField::Boundary& UfBf = phase.UfRef().boundaryFieldRef(); @@ -756,9 +765,9 @@ void Foam::phaseSystem::correctPhi phi_ = Zero; PtrList alphafs(phaseModels_.size()); - forAll(movingPhases(), movingPhasei) + forAll(movingPhaseModels_, movingPhasei) { - phaseModel& phase = movingPhases()[movingPhasei]; + phaseModel& phase = movingPhaseModels_[movingPhasei]; const label phasei = phase.index(); const volScalarField& alpha = phase; @@ -774,7 +783,7 @@ void Foam::phaseSystem::correctPhi fv::correctPhi ( phi_, - movingPhases()[0].U(), + movingPhaseModels_[0].U(), p_rgh, autoPtr(), divU, @@ -815,7 +824,7 @@ void Foam::phaseSystem::correctPhi // Make the flux relative to the mesh motion MRF_.makeRelative(phi_); - fvc::makeRelative(phi_, movingPhases()[0].U()); + fvc::makeRelative(phi_, movingPhaseModels_[0].U()); setMixturePhi(alphafs, phi_); }