potentialFoam: Ensure that the flux field phi is relative in MRF regions
This commit is contained in:
@ -12,7 +12,7 @@ volVectorField U
|
|||||||
mesh
|
mesh
|
||||||
);
|
);
|
||||||
|
|
||||||
U = dimensionedVector(U.dimensions(), Zero);
|
U = Zero;
|
||||||
|
|
||||||
surfaceScalarField phi
|
surfaceScalarField phi
|
||||||
(
|
(
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -110,17 +110,18 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MRF.makeAbsolute(phi);
|
|
||||||
|
|
||||||
Info<< "Continuity error = "
|
Info<< "Continuity error = "
|
||||||
<< mag(fvc::div(phi))().weightedAverage(mesh.V()).value()
|
<< mag(fvc::div(phi))().weightedAverage(mesh.V()).value()
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
U = fvc::reconstruct(phi);
|
U = fvc::reconstruct(MRF.absolute(phi));
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
|
|
||||||
Info<< "Interpolated velocity error = "
|
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;
|
<< endl;
|
||||||
|
|
||||||
// Write U and phi
|
// Write U and phi
|
||||||
|
|||||||
Reference in New Issue
Block a user