From 61c87b555270e0e9545daba33a1700f857045daa Mon Sep 17 00:00:00 2001 From: Johan Roenby Date: Tue, 30 Apr 2019 16:07:48 +0200 Subject: [PATCH] Introduced changes required to make isoAdvector and interIsoFoam work with morphing meshes: 1) In the alphaEqn.H U is made relative to mesh motion before the interface advection step, 2) in isoAdvection::advect() alpha must be multiplied by Vsc0()/Vsc(). Implementation tested and verified with 1) a spherical interface in a cubic domain with no flow, where the domain walls are squeezed together and 2) a spherical interfacee inside the sloshingCylinder, again with no flow, so the sphere should stay spherical, which it does. --- .../solvers/multiphase/interIsoFoam/alphaEqn.H | 13 +++++++++++++ .../isoAdvection/isoAdvection/isoAdvection.C | 8 +++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/applications/solvers/multiphase/interIsoFoam/alphaEqn.H b/applications/solvers/multiphase/interIsoFoam/alphaEqn.H index fda7a30c9b..8de0ac0161 100644 --- a/applications/solvers/multiphase/interIsoFoam/alphaEqn.H +++ b/applications/solvers/multiphase/interIsoFoam/alphaEqn.H @@ -1,6 +1,19 @@ { + // Temporarily making U relative to mesh motion + if (mesh.moving()) + { + U -= fvc::reconstruct(mesh.phi()); + } + // Updating alpha1 advector.advect(); + + // Making U absolute again after advection step + if (mesh.moving()) + { + U += fvc::reconstruct(mesh.phi()); + } + #include "rhofs.H" rhoPhi = advector.getRhoPhi(rho1f, rho2f); diff --git a/src/finiteVolume/fvMatrices/solvers/isoAdvection/isoAdvection/isoAdvection.C b/src/finiteVolume/fvMatrices/solvers/isoAdvection/isoAdvection/isoAdvection.C index ac7667e663..edb2d75f1c 100644 --- a/src/finiteVolume/fvMatrices/solvers/isoAdvection/isoAdvection/isoAdvection.C +++ b/src/finiteVolume/fvMatrices/solvers/isoAdvection/isoAdvection/isoAdvection.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- isoAdvector | Copyright (C) 2016-2017 DHI - Modified work | Copyright (C) 2018 Johan Roenby + Modified work | Copyright (C) 2019 Johan Roenby ------------------------------------------------------------------------------- License @@ -852,6 +852,12 @@ void Foam::isoAdvection::advect() // Do the isoAdvection on surface cells timeIntegratedFlux(); + // Adjust alpha for mesh motion + if (mesh_.moving()) + { + alpha1In_ *= (mesh_.Vsc0()/mesh_.Vsc()); + } + // Adjust dVf for unbounded cells limitFluxes();