From 80e13f80026f73f9ae0bedcecfd2e62364ca7166 Mon Sep 17 00:00:00 2001
From: Henry Weller <http://cfd.direct>
Date: Thu, 18 Jun 2015 15:10:48 +0100
Subject: [PATCH] rhoCentralFoam: Reverted correction to BCs

Reverted changes proposed in
http://openfoam.org/mantisbt/view.php?id=1548 as it adversely affects
fixed-value BCs and is formulated to fix an issue with an unphysical
case.  Further analysis of the handling of fixed pressure outlet
conditions as the Mach number approaches 1 is required.
---
 .../rhoCentralFoam/createFields.H             | 23 ++---------
 .../rhoCentralFoam/directionInterpolate.H     | 40 -------------------
 2 files changed, 4 insertions(+), 59 deletions(-)

diff --git a/applications/solvers/compressible/rhoCentralFoam/createFields.H b/applications/solvers/compressible/rhoCentralFoam/createFields.H
index 425ba78b877..632efaf9d15 100644
--- a/applications/solvers/compressible/rhoCentralFoam/createFields.H
+++ b/applications/solvers/compressible/rhoCentralFoam/createFields.H
@@ -42,8 +42,7 @@ volScalarField rho
         IOobject::NO_READ,
         IOobject::AUTO_WRITE
     ),
-    thermo.rho(),
-    derivedPatchFieldTypes(p)
+    thermo.rho()
 );
 
 volVectorField rhoU
@@ -56,8 +55,7 @@ volVectorField rhoU
         IOobject::NO_READ,
         IOobject::NO_WRITE
     ),
-    rho*U,
-    derivedPatchFieldTypes(U)
+    rho*U
 );
 
 volScalarField rhoE
@@ -70,8 +68,7 @@ volScalarField rhoE
         IOobject::NO_READ,
         IOobject::NO_WRITE
     ),
-    rho*(e + 0.5*magSqr(U)),
-    derivedPatchFieldTypes(T)
+    rho*(e + 0.5*magSqr(U))
 );
 
 surfaceScalarField pos
@@ -98,19 +95,7 @@ surfaceScalarField neg
     dimensionedScalar("neg", dimless, -1.0)
 );
 
-
-surfaceScalarField phi
-(
-    IOobject
-    (
-        "phi",
-        runTime.timeName(),
-        mesh,
-        IOobject::NO_READ,
-        IOobject::AUTO_WRITE
-    ),
-    mesh.Sf() & fvc::interpolate(rhoU)
-);
+surfaceScalarField phi("phi", mesh.Sf() & fvc::interpolate(rhoU));
 
 Info<< "Creating turbulence model\n" << endl;
 autoPtr<compressible::turbulenceModel> turbulence
diff --git a/applications/solvers/compressible/rhoCentralFoam/directionInterpolate.H b/applications/solvers/compressible/rhoCentralFoam/directionInterpolate.H
index a223ecb5032..7f4b6cd7b8e 100644
--- a/applications/solvers/compressible/rhoCentralFoam/directionInterpolate.H
+++ b/applications/solvers/compressible/rhoCentralFoam/directionInterpolate.H
@@ -26,47 +26,7 @@ tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > interpolate
 
     sf.rename(vf.name() + '_' + dir.name());
 
-    // Correct BCs of the positive (outgoing) fluxes
-    forAll(sf.boundaryField(), patchi)
-    {
-        if
-        (
-            !sf.boundaryField()[patchi].coupled()
-         && sf.boundaryField()[patchi].size()
-         && !vf.boundaryField()[patchi].fixesValue()
-         && dir.boundaryField()[patchi][0] > 0
-        )
-        {
-            sf.boundaryField()[patchi] =
-                vf.boundaryField()[patchi].patchInternalField();
-        }
-    }
-
     return tsf;
 }
 
-
-template<class Type>
-wordList derivedPatchFieldTypes
-(
-    const GeometricField<Type, fvPatchField, volMesh>& vf
-)
-{
-    wordList phiTypes
-    (
-        vf.boundaryField().size(),
-        calculatedFvPatchField<Type>::typeName
-    );
-
-    forAll(vf.boundaryField(), patchi)
-    {
-        if (vf.boundaryField()[patchi].fixesValue())
-        {
-            phiTypes[patchi] = fixedValueFvPatchField<Type>::typeName;
-        }
-    }
-
-    return phiTypes;
-}
-
 }
-- 
GitLab