BUG: potentialFreeSurfaceFoam - Corrected pressure calculation - mantis #654
This commit is contained in:
parent
d22ba2b633
commit
51a2313c3e
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user