From cdef200385b486fb5f7d81577dc79f42546ba8c6 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Tue, 7 May 2024 12:43:39 +0100 Subject: [PATCH] MRF: Make flux relative following correctPhi This fixes an incompatibility between MRF and adaptive mesh refinement --- applications/modules/VoFSolver/moveMesh.C | 3 ++- applications/modules/incompressibleFluid/moveMesh.C | 3 ++- applications/modules/isothermalFluid/moveMesh.C | 3 ++- .../multiphaseEuler/phaseSystem/phaseSystem/phaseSystem.C | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/applications/modules/VoFSolver/moveMesh.C b/applications/modules/VoFSolver/moveMesh.C index 5012210c2c..9d4cdd9850 100644 --- a/applications/modules/VoFSolver/moveMesh.C +++ b/applications/modules/VoFSolver/moveMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2022-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2022-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -100,6 +100,7 @@ void Foam::solvers::VoFSolver::motionCorrector() } // Make the fluxes relative to the mesh motion + MRF.makeRelative(phi_); fvc::makeRelative(phi_, U); } diff --git a/applications/modules/incompressibleFluid/moveMesh.C b/applications/modules/incompressibleFluid/moveMesh.C index 4cb514c9ed..8639d02f61 100644 --- a/applications/modules/incompressibleFluid/moveMesh.C +++ b/applications/modules/incompressibleFluid/moveMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2022-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2022-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -67,6 +67,7 @@ void Foam::solvers::incompressibleFluid::motionCorrector() ); // Make the flux relative to the mesh motion + MRF.makeRelative(phi_); fvc::makeRelative(phi_, U); } diff --git a/applications/modules/isothermalFluid/moveMesh.C b/applications/modules/isothermalFluid/moveMesh.C index 626b4e87d0..8b59cf3556 100644 --- a/applications/modules/isothermalFluid/moveMesh.C +++ b/applications/modules/isothermalFluid/moveMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2022-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2022-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -74,6 +74,7 @@ void Foam::solvers::isothermalFluid::motionCorrector() ); // Make the fluxes relative to the mesh-motion + MRF.makeRelative(phi_); fvc::makeRelative(phi_, rho, U); } diff --git a/applications/modules/multiphaseEuler/phaseSystem/phaseSystem/phaseSystem.C b/applications/modules/multiphaseEuler/phaseSystem/phaseSystem/phaseSystem.C index 302a19a7ab..5392b99680 100644 --- a/applications/modules/multiphaseEuler/phaseSystem/phaseSystem/phaseSystem.C +++ b/applications/modules/multiphaseEuler/phaseSystem/phaseSystem/phaseSystem.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -814,6 +814,7 @@ void Foam::phaseSystem::correctPhi } // Make the flux relative to the mesh motion + MRF_.makeRelative(phi_); fvc::makeRelative(phi_, movingPhases()[0].U()); setMixturePhi(alphafs, phi_);