mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: potentialFreeSurfaceFoam - Corrected pressure calculation - mantis #654
This commit is contained in:
@ -37,48 +37,6 @@
|
|||||||
|
|
||||||
#include "readGravitationalAcceleration.H"
|
#include "readGravitationalAcceleration.H"
|
||||||
|
|
||||||
Info<< "\nReading freeSurfaceProperties\n" << endl;
|
|
||||||
|
|
||||||
IOdictionary freeSurfaceProperties
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"freeSurfaceProperties",
|
|
||||||
runTime.constant(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
word freeSurfacePatch(freeSurfaceProperties.lookup("freeSurfacePatch"));
|
|
||||||
label freeSurfacePatchI = mesh.boundaryMesh().findPatchID(freeSurfacePatch);
|
|
||||||
if (freeSurfacePatchI < 0)
|
|
||||||
{
|
|
||||||
FatalErrorIn(args.executable())
|
|
||||||
<< "Patch " << freeSurfacePatch << " not found. "
|
|
||||||
<< "Available patches are:" << mesh.boundaryMesh().names()
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< "Creating field refLevel\n" << endl;
|
|
||||||
volVectorField refLevel
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"refLevel",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedVector("zero", dimLength, vector::zero)
|
|
||||||
);
|
|
||||||
|
|
||||||
refLevel.boundaryField()[freeSurfacePatchI]
|
|
||||||
== mesh.C().boundaryField()[freeSurfacePatchI];
|
|
||||||
|
|
||||||
Info<< "Creating field zeta\n" << endl;
|
Info<< "Creating field zeta\n" << endl;
|
||||||
volVectorField zeta
|
volVectorField zeta
|
||||||
(
|
(
|
||||||
@ -110,7 +68,7 @@
|
|||||||
|
|
||||||
// Force p_gh to be consistent with p
|
// Force p_gh to be consistent with p
|
||||||
// Height is made relative to field 'refLevel'
|
// Height is made relative to field 'refLevel'
|
||||||
p_gh = p - (g & (mesh.C() + zeta - refLevel));
|
p_gh = p - (g & mesh.C());
|
||||||
|
|
||||||
|
|
||||||
label p_ghRefCell = 0;
|
label p_ghRefCell = 0;
|
||||||
|
|||||||
@ -42,7 +42,7 @@ while (pimple.correctNonOrthogonal())
|
|||||||
// Explicitly relax pressure for momentum corrector
|
// Explicitly relax pressure for momentum corrector
|
||||||
p_gh.relax();
|
p_gh.relax();
|
||||||
|
|
||||||
p = p_gh + (g & (mesh.C() + zeta - refLevel));
|
p = p_gh + (g & mesh.C());
|
||||||
|
|
||||||
U = HbyA - rAU*fvc::grad(p_gh);
|
U = HbyA - rAU*fvc::grad(p_gh);
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
|
|||||||
Reference in New Issue
Block a user