From c762381f90887967b6d1eb3b1354fde453f97525 Mon Sep 17 00:00:00 2001 From: Vuko Vukcevic Date: Thu, 18 Jul 2019 15:23:59 +0200 Subject: [PATCH] Bugfix in solutionControl I made a mistake previously: in attempting to make the BC's fully consistent, I completely messed up the faceU field which is needed for all transient moving mesh simulations. --- .../solutionControl/solutionControl.C | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/solutionControl.C b/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/solutionControl.C index e0c332096..57dc90f7e 100644 --- a/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/solutionControl.C +++ b/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/solutionControl.C @@ -1019,18 +1019,11 @@ void Foam::solutionControl::reconstructTransientVelocity const volScalarField& p ) const { - // If the mesh is moving, flux needs to be relative before boundary - // conditions for velocity are corrected. VV and IG, 4/Jan/2016. - fvc::makeRelative(phi, U); - // Reconstruct the velocity using all the components from original equation U = 1.0/(1.0/rAU + ddtUEqn.A())* ( U/rAU + ddtUEqn.H() - fvc::grad(p) ); - - // Correct boundary conditions with relative flux - U.correctBoundaryConditions(); // Get name and the corresponding index const word& UName = U.name(); @@ -1074,6 +1067,13 @@ void Foam::solutionControl::reconstructTransientVelocity // Now that the normal component is zero, add the normal component from // conservative flux faceU += phi*rSf; + + // If the mesh is moving, flux needs to be relative before boundary + // conditions for velocity are corrected. VV and IG, 4/Jan/2016. + fvc::makeRelative(phi, U); + + // Correct boundary conditions with relative flux + U.correctBoundaryConditions(); }