Skip to content
Snippets Groups Projects
Commit 51a2313c authored by andy's avatar andy
Browse files

BUG: potentialFreeSurfaceFoam - Corrected pressure calculation - mantis #654

parent d22ba2b6
Branches
Tags
No related merge requests found
......@@ -37,48 +37,6 @@
#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;
volVectorField zeta
(
......@@ -110,7 +68,7 @@
// Force p_gh to be consistent with p
// 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;
......
......@@ -42,7 +42,7 @@ while (pimple.correctNonOrthogonal())
// Explicitly relax pressure for momentum corrector
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.correctBoundaryConditions();
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment