From 51a2313c3ecb5157e39ad5e14cbb57dba5e38ba9 Mon Sep 17 00:00:00 2001
From: andy <andy>
Date: Tue, 4 Dec 2012 18:07:24 +0000
Subject: [PATCH] BUG: potentialFreeSurfaceFoam - Corrected pressure
 calculation - mantis #654

---
 .../potentialFreeSurfaceFoam/createFields.H   | 44 +------------------
 .../potentialFreeSurfaceFoam/pEqn.H           |  2 +-
 2 files changed, 2 insertions(+), 44 deletions(-)

diff --git a/applications/solvers/incompressible/potentialFreeSurfaceFoam/createFields.H b/applications/solvers/incompressible/potentialFreeSurfaceFoam/createFields.H
index 4437f4983dd..27af553b77c 100644
--- a/applications/solvers/incompressible/potentialFreeSurfaceFoam/createFields.H
+++ b/applications/solvers/incompressible/potentialFreeSurfaceFoam/createFields.H
@@ -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;
diff --git a/applications/solvers/incompressible/potentialFreeSurfaceFoam/pEqn.H b/applications/solvers/incompressible/potentialFreeSurfaceFoam/pEqn.H
index 5a521a04fff..42b72484d1d 100644
--- a/applications/solvers/incompressible/potentialFreeSurfaceFoam/pEqn.H
+++ b/applications/solvers/incompressible/potentialFreeSurfaceFoam/pEqn.H
@@ -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();
-- 
GitLab