Skip to content
Snippets Groups Projects
Commit 8a123413 authored by Henry's avatar Henry
Browse files

adjustPhi: Corrected for closed-volume, moving-mesh incompressible simulations

parent 25ba73c1
No related branches found
No related tags found
No related merge requests found
...@@ -32,6 +32,7 @@ License ...@@ -32,6 +32,7 @@ License
#include "fvcDiv.H" #include "fvcDiv.H"
#include "fixedValueFvPatchFields.H" #include "fixedValueFvPatchFields.H"
#include "adjustPhi.H" #include "adjustPhi.H"
#include "fvcMeshPhi.H"
#include "pimpleControl.H" #include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...@@ -81,7 +82,12 @@ void Foam::CorrectPhi ...@@ -81,7 +82,12 @@ void Foam::CorrectPhi
pcorrTypes pcorrTypes
); );
adjustPhi(phi, U, pcorr); if (pcorr.needReference())
{
fvc::makeRelative(phi, U);
adjustPhi(phi, U, pcorr);
fvc::makeAbsolute(phi, U);
}
while (pimple.correctNonOrthogonal()) while (pimple.correctNonOrthogonal())
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -26,7 +26,6 @@ License ...@@ -26,7 +26,6 @@ License
#include "adjustPhi.H" #include "adjustPhi.H"
#include "volFields.H" #include "volFields.H"
#include "surfaceFields.H" #include "surfaceFields.H"
#include "processorFvsPatchFields.H"
#include "inletOutletFvPatchFields.H" #include "inletOutletFvPatchFields.H"
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
...@@ -40,9 +39,6 @@ bool Foam::adjustPhi ...@@ -40,9 +39,6 @@ bool Foam::adjustPhi
{ {
if (p.needReference()) if (p.needReference())
{ {
// p coefficients should not be updated here
// p.boundaryField().updateCoeffs();
scalar massIn = 0.0; scalar massIn = 0.0;
scalar fixedMassOut = 0.0; scalar fixedMassOut = 0.0;
scalar adjustableMassOut = 0.0; scalar adjustableMassOut = 0.0;
...@@ -54,7 +50,7 @@ bool Foam::adjustPhi ...@@ -54,7 +50,7 @@ bool Foam::adjustPhi
const fvPatchVectorField& Up = U.boundaryField()[patchi]; const fvPatchVectorField& Up = U.boundaryField()[patchi];
const fvsPatchScalarField& phip = bphi[patchi]; const fvsPatchScalarField& phip = bphi[patchi];
if (!isA<processorFvsPatchScalarField>(phip)) if (!phip.coupled())
{ {
if (Up.fixesValue() && !isA<inletOutletFvPatchVectorField>(Up)) if (Up.fixesValue() && !isA<inletOutletFvPatchVectorField>(Up))
{ {
...@@ -130,7 +126,7 @@ bool Foam::adjustPhi ...@@ -130,7 +126,7 @@ bool Foam::adjustPhi
const fvPatchVectorField& Up = U.boundaryField()[patchi]; const fvPatchVectorField& Up = U.boundaryField()[patchi];
fvsPatchScalarField& phip = bphi[patchi]; fvsPatchScalarField& phip = bphi[patchi];
if (!isA<processorFvsPatchScalarField>(phip)) if (!phip.coupled())
{ {
if if
( (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment