potentialFoam: Ensure that the flux field phi is relative in MRF regions

This commit is contained in:
Henry Weller
2020-06-29 16:53:09 +01:00
parent 6f4b667181
commit 393d8e17fd
2 changed files with 7 additions and 6 deletions

View File

@ -12,7 +12,7 @@ volVectorField U
mesh
);
U = dimensionedVector(U.dimensions(), Zero);
U = Zero;
surfaceScalarField phi
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -110,17 +110,18 @@ int main(int argc, char *argv[])
}
}
MRF.makeAbsolute(phi);
Info<< "Continuity error = "
<< mag(fvc::div(phi))().weightedAverage(mesh.V()).value()
<< endl;
U = fvc::reconstruct(phi);
U = fvc::reconstruct(MRF.absolute(phi));
U.correctBoundaryConditions();
Info<< "Interpolated velocity error = "
<< (sqrt(sum(sqr(fvc::flux(U) - phi)))/sum(mesh.magSf())).value()
<< (
sqrt(sum(sqr(fvc::flux(U) - MRF.absolute(phi))))
/sum(mesh.magSf())
).value()
<< endl;
// Write U and phi