From 8a12341385c884d8c34e7abb90928f2bca3338b5 Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 5 Mar 2015 20:12:39 +0000 Subject: [PATCH] adjustPhi: Corrected for closed-volume, moving-mesh incompressible simulations --- .../cfdTools/general/CorrectPhi/CorrectPhi.C | 8 +++++++- .../cfdTools/general/adjustPhi/adjustPhi.C | 10 +++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/finiteVolume/cfdTools/general/CorrectPhi/CorrectPhi.C b/src/finiteVolume/cfdTools/general/CorrectPhi/CorrectPhi.C index 9d0d5baecc..eaa8cf5edc 100644 --- a/src/finiteVolume/cfdTools/general/CorrectPhi/CorrectPhi.C +++ b/src/finiteVolume/cfdTools/general/CorrectPhi/CorrectPhi.C @@ -32,6 +32,7 @@ License #include "fvcDiv.H" #include "fixedValueFvPatchFields.H" #include "adjustPhi.H" +#include "fvcMeshPhi.H" #include "pimpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -81,7 +82,12 @@ void Foam::CorrectPhi pcorrTypes ); - adjustPhi(phi, U, pcorr); + if (pcorr.needReference()) + { + fvc::makeRelative(phi, U); + adjustPhi(phi, U, pcorr); + fvc::makeAbsolute(phi, U); + } while (pimple.correctNonOrthogonal()) { diff --git a/src/finiteVolume/cfdTools/general/adjustPhi/adjustPhi.C b/src/finiteVolume/cfdTools/general/adjustPhi/adjustPhi.C index 27622aeeb7..9a175a4294 100644 --- a/src/finiteVolume/cfdTools/general/adjustPhi/adjustPhi.C +++ b/src/finiteVolume/cfdTools/general/adjustPhi/adjustPhi.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,7 +26,6 @@ License #include "adjustPhi.H" #include "volFields.H" #include "surfaceFields.H" -#include "processorFvsPatchFields.H" #include "inletOutletFvPatchFields.H" // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * // @@ -40,9 +39,6 @@ bool Foam::adjustPhi { if (p.needReference()) { - // p coefficients should not be updated here - // p.boundaryField().updateCoeffs(); - scalar massIn = 0.0; scalar fixedMassOut = 0.0; scalar adjustableMassOut = 0.0; @@ -54,7 +50,7 @@ bool Foam::adjustPhi const fvPatchVectorField& Up = U.boundaryField()[patchi]; const fvsPatchScalarField& phip = bphi[patchi]; - if (!isA(phip)) + if (!phip.coupled()) { if (Up.fixesValue() && !isA(Up)) { @@ -130,7 +126,7 @@ bool Foam::adjustPhi const fvPatchVectorField& Up = U.boundaryField()[patchi]; fvsPatchScalarField& phip = bphi[patchi]; - if (!isA(phip)) + if (!phip.coupled()) { if (