From 64aa9925e4c2c637fefa9cf8395a00d6168f29fb Mon Sep 17 00:00:00 2001
From: Henry Weller <http://cfd.direct>
Date: Thu, 16 Jun 2016 12:21:34 +0100
Subject: [PATCH] totalPressureFvPatchScalarField,
 uniformTotalPressureFvPatchScalarField: simplified and rationalized

    The modes of operation are set by the dimensions of the pressure field
    to which this boundary condition is applied, the \c psi entry and the value
    of \c gamma:
    \table
        Mode                    | dimensions | psi   | gamma
        incompressible subsonic | p/rho      |       |
        compressible subsonic   | p          | none  |
        compressible transonic  | p          | psi   | 1
        compressible supersonic | p          | psi   | > 1
    \endtable

    For most applications the totalPressure boundary condition now only
    requires p0 to be specified e.g.
    outlet
    {
        type            totalPressure;
        p0              uniform 1e5;
    }
---
 .../totalPressureFvPatchScalarField.C         | 76 ++++++++-------
 .../totalPressureFvPatchScalarField.H         | 39 ++++----
 .../uniformTotalPressureFvPatchScalarField.C  | 94 ++++++++++---------
 .../uniformTotalPressureFvPatchScalarField.H  | 31 +++---
 .../laminar/counterFlowFlame2D/0/p            |  4 -
 .../laminar/counterFlowFlame2DLTS/0/p         |  4 -
 .../rhoCentralDyMFoam/movingCone/0/p          |  4 -
 .../constant/boundaryConditions               |  4 -
 .../compressible/sonicDyMFoam/movingCone/0/p  |  4 -
 .../pimpleDyMFoam/movingCone/0/p              |  4 -
 .../incompressible/pimpleFoam/TJunction/0/p   |  7 +-
 .../pimpleFoam/TJunctionFan/0.orig/p          | 10 +-
 .../counterFlowFlame2DLTS/0/p                 |  4 -
 .../cavitatingFoam/les/throttle/0/p           |  3 -
 .../cavitatingFoam/les/throttle3D/0.orig/p    |  3 -
 .../cavitatingFoam/ras/throttle/0/p           |  3 -
 .../laminar/damBreak4phase/0.orig/p_rgh       |  4 -
 .../interDyMFoam/ras/DTCHull/0.orig/p_rgh     |  4 -
 .../ras/damBreakWithObstacle/0.orig/p_rgh     |  4 -
 .../ras/floatingObject/0.orig/p_rgh           |  4 -
 .../laminar/damBreak/damBreak/0/p_rgh         |  4 -
 .../interFoam/les/nozzleFlow2D/0/p_rgh        |  4 -
 .../interFoam/ras/DTCHull/0.orig/p_rgh        |  4 -
 .../interFoam/ras/damBreak/damBreak/0/p_rgh   |  4 -
 .../ras/damBreakPorousBaffle/0/p_rgh          |  4 -
 .../interFoam/ras/waterChannel/0/p_rgh        |  4 -
 .../interFoam/ras/weirOverflow/0.orig/p_rgh   |  4 -
 .../interMixingFoam/laminar/damBreak/0/p_rgh  |  4 -
 .../propeller/0.orig/p_rgh                    |  4 -
 .../damBreak4phase/0.orig/p_rgh               |  4 -
 .../damBreak4phaseFine/0.orig/p_rgh           |  4 -
 .../laminar/damBreak4phase/0.orig/p_rgh       |  4 -
 .../laminar/damBreak4phaseFine/0.orig/p_rgh   |  4 -
 33 files changed, 125 insertions(+), 237 deletions(-)

diff --git a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C
index 4e04151d19b..c88c0a59ffe 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C
@@ -41,7 +41,7 @@ Foam::totalPressureFvPatchScalarField::totalPressureFvPatchScalarField
     fixedValueFvPatchScalarField(p, iF),
     UName_("U"),
     phiName_("phi"),
-    rhoName_("none"),
+    rhoName_("rho"),
     psiName_("none"),
     gamma_(0.0),
     p0_(p.size(), 0.0)
@@ -58,9 +58,9 @@ Foam::totalPressureFvPatchScalarField::totalPressureFvPatchScalarField
     fixedValueFvPatchScalarField(p, iF),
     UName_(dict.lookupOrDefault<word>("U", "U")),
     phiName_(dict.lookupOrDefault<word>("phi", "phi")),
-    rhoName_(dict.lookupOrDefault<word>("rho", "none")),
+    rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
     psiName_(dict.lookupOrDefault<word>("psi", "none")),
-    gamma_(readScalar(dict.lookup("gamma"))),
+    gamma_(psiName_ != "none" ? readScalar(dict.lookup("gamma")) : 1),
     p0_("p0", dict, p.size())
 {
     if (dict.found("value"))
@@ -167,49 +167,59 @@ void Foam::totalPressureFvPatchScalarField::updateCoeffs
     const fvsPatchField<scalar>& phip =
         patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
 
-    if (psiName_ == "none" && rhoName_ == "none")
+    if (internalField().dimensions() == dimPressure)
     {
-        operator==(p0p - 0.5*(1.0 - pos(phip))*magSqr(Up));
-    }
-    else if (rhoName_ == "none")
-    {
-        const fvPatchField<scalar>& psip =
-            patch().lookupPatchField<volScalarField, scalar>(psiName_);
-
-        if (gamma_ > 1.0)
+        if (psiName_ == "none")
         {
-            scalar gM1ByG = (gamma_ - 1.0)/gamma_;
+            // Variable density and low-speed compressible flow
 
-            operator==
-            (
-                p0p
-               /pow
-                (
-                    (1.0 + 0.5*psip*gM1ByG*(1.0 - pos(phip))*magSqr(Up)),
-                    1.0/gM1ByG
-                )
-            );
+            const fvPatchField<scalar>& rho =
+                patch().lookupPatchField<volScalarField, scalar>(rhoName_);
+
+            operator==(p0p - 0.5*rho*(1.0 - pos(phip))*magSqr(Up));
         }
         else
         {
-            operator==(p0p/(1.0 + 0.5*psip*(1.0 - pos(phip))*magSqr(Up)));
+            // High-speed compressible flow
+
+            const fvPatchField<scalar>& psip =
+                patch().lookupPatchField<volScalarField, scalar>(psiName_);
+
+            if (gamma_ > 1)
+            {
+                scalar gM1ByG = (gamma_ - 1)/gamma_;
+
+                operator==
+                (
+                    p0p
+                   /pow
+                    (
+                        (1.0 + 0.5*psip*gM1ByG*(1.0 - pos(phip))*magSqr(Up)),
+                        1.0/gM1ByG
+                    )
+                );
+            }
+            else
+            {
+                operator==(p0p/(1.0 + 0.5*psip*(1.0 - pos(phip))*magSqr(Up)));
+            }
         }
+
     }
-    else if (psiName_ == "none")
+    else if (internalField().dimensions() == dimPressure/dimDensity)
     {
-        const fvPatchField<scalar>& rho =
-            patch().lookupPatchField<volScalarField, scalar>(rhoName_);
-
-        operator==(p0p - 0.5*rho*(1.0 - pos(phip))*magSqr(Up));
+        // Incompressible flow
+        operator==(p0p - 0.5*(1.0 - pos(phip))*magSqr(Up));
     }
     else
     {
         FatalErrorInFunction
-            << " rho or psi set inconsistently, rho = " << rhoName_
-            << ", psi = " << psiName_ << ".\n"
-            << "    Set either rho or psi or neither depending on the "
-               "definition of total pressure." << nl
-            << "    Set the unused variable(s) to 'none'.\n"
+            << " Incorrect pressure dimensions " << internalField().dimensions()
+            << nl
+            << "    Should be " << dimPressure
+            << " for compressible/variable density flow" << nl
+            << "    or " << dimPressure/dimDensity
+            << " for incompressible flow," << nl
             << "    on patch " << this->patch().name()
             << " of field " << this->internalField().name()
             << " in file " << this->internalField().objectPath()
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.H
index 3688572a86c..eb7d95d99bc 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.H
+++ b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.H
@@ -54,7 +54,7 @@ Description
             U       | velocity
         \endvartable
 
-    3. compressible transonic (\f$\gamma <= 1\f$):
+    3. compressible transonic (\f$\gamma = 1\f$):
         \f[
             p_p = \frac{p_0}{1 + 0.5 \psi |U|^2}
         \f]
@@ -78,27 +78,28 @@ Description
             G       | coefficient given by \f$\frac{\gamma}{1-\gamma}\f$
         \endvartable
 
-    The modes of operation are set via the combination of \c phi, \c rho, and
-    \c psi entries:
+    The modes of operation are set by the dimensions of the pressure field
+    to which this boundary condition is applied, the \c psi entry and the value
+    of \c gamma:
     \table
-        Mode                    | phi   | rho   | psi
-        incompressible subsonic | phi   | none  | none
-        compressible subsonic   | phi   | rho   | none
-        compressible transonic  | phi   | none  | psi
-        compressible supersonic | phi   | none  | psi
+        Mode                    | dimensions | psi   | gamma
+        incompressible subsonic | p/rho      |       |
+        compressible subsonic   | p          | none  |
+        compressible transonic  | p          | psi   | 1
+        compressible supersonic | p          | psi   | > 1
     \endtable
 
 
     \heading Patch usage
 
     \table
-        Property     | Description             | Required    | Default value
-        U            | velocity field name     | no          | U
-        phi          | flux field name         | no          | phi
-        rho          | density field name      | no          | none
-        psi          | compressibility field name | no       | none
-        gamma        | ratio of specific heats (Cp/Cv) | yes |
-        p0           | total pressure          | yes       |
+        Property     | Description                | Required | Default value
+        U            | Velocity field name        | no       | U
+        phi          | Flux field name            | no       | phi
+        rho          | Density field name         | no       | rho
+        psi          | Compressibility field name | no       | none
+        gamma        | (Cp/Cv)                    | no       | 1
+        p0           | Total pressure             | yes      |
     \endtable
 
     Example of the boundary condition specification:
@@ -106,18 +107,10 @@ Description
     myPatch
     {
         type            totalPressure;
-        U               U;
-        phi             phi;
-        rho             none;
-        psi             none;
-        gamma           1.4;
         p0              uniform 1e5;
     }
     \endverbatim
 
-Note
-    The default boundary behaviour is for subsonic, incompressible flow.
-
 SeeAlso
     Foam::fixedValueFvPatchField
 
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.C
index d812a80a3dc..744ac51b472 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.C
@@ -41,10 +41,10 @@ uniformTotalPressureFvPatchScalarField
     fixedValueFvPatchScalarField(p, iF),
     UName_("U"),
     phiName_("phi"),
-    rhoName_("none"),
+    rhoName_("rho"),
     psiName_("none"),
     gamma_(0.0),
-    pressure_()
+    p0_()
 {}
 
 
@@ -59,10 +59,10 @@ uniformTotalPressureFvPatchScalarField
     fixedValueFvPatchScalarField(p, iF),
     UName_(dict.lookupOrDefault<word>("U", "U")),
     phiName_(dict.lookupOrDefault<word>("phi", "phi")),
-    rhoName_(dict.lookupOrDefault<word>("rho", "none")),
+    rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
     psiName_(dict.lookupOrDefault<word>("psi", "none")),
-    gamma_(readScalar(dict.lookup("gamma"))),
-    pressure_(Function1<scalar>::New("pressure", dict))
+    gamma_(psiName_ != "none" ? readScalar(dict.lookup("gamma")) : 1),
+    p0_(Function1<scalar>::New("p0", dict))
 {
     if (dict.found("value"))
     {
@@ -74,7 +74,7 @@ uniformTotalPressureFvPatchScalarField
     else
     {
         const scalar t = this->db().time().timeOutputValue();
-        fvPatchScalarField::operator==(pressure_->value(t));
+        fvPatchScalarField::operator==(p0_->value(t));
     }
 }
 
@@ -94,14 +94,14 @@ uniformTotalPressureFvPatchScalarField
     rhoName_(ptf.rhoName_),
     psiName_(ptf.psiName_),
     gamma_(ptf.gamma_),
-    pressure_(ptf.pressure_, false)
+    p0_(ptf.p0_, false)
 {
     patchType() = ptf.patchType();
 
     // Set the patch pressure to the current total pressure
     // This is not ideal but avoids problems with the creation of patch faces
     const scalar t = this->db().time().timeOutputValue();
-    fvPatchScalarField::operator==(pressure_->value(t));
+    fvPatchScalarField::operator==(p0_->value(t));
 }
 
 
@@ -117,7 +117,7 @@ uniformTotalPressureFvPatchScalarField
     rhoName_(ptf.rhoName_),
     psiName_(ptf.psiName_),
     gamma_(ptf.gamma_),
-    pressure_(ptf.pressure_, false)
+    p0_(ptf.p0_, false)
 {}
 
 
@@ -134,7 +134,7 @@ uniformTotalPressureFvPatchScalarField
     rhoName_(ptf.rhoName_),
     psiName_(ptf.psiName_),
     gamma_(ptf.gamma_),
-    pressure_(ptf.pressure_, false)
+    p0_(ptf.p0_, false)
 {}
 
 
@@ -150,54 +150,64 @@ void Foam::uniformTotalPressureFvPatchScalarField::updateCoeffs
         return;
     }
 
-    scalar p0 = pressure_->value(this->db().time().timeOutputValue());
+    scalar p0 = p0_->value(this->db().time().timeOutputValue());
 
     const fvsPatchField<scalar>& phip =
         patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
 
-    if (psiName_ == "none" && rhoName_ == "none")
+    if (internalField().dimensions() == dimPressure)
     {
-        operator==(p0 - 0.5*(1.0 - pos(phip))*magSqr(Up));
-    }
-    else if (rhoName_ == "none")
-    {
-        const fvPatchField<scalar>& psip =
-            patch().lookupPatchField<volScalarField, scalar>(psiName_);
-
-        if (gamma_ > 1.0)
+        if (psiName_ == "none")
         {
-            scalar gM1ByG = (gamma_ - 1.0)/gamma_;
+            // Variable density and low-speed compressible flow
 
-            operator==
-            (
-                p0
-               /pow
-                (
-                    (1.0 + 0.5*psip*gM1ByG*(1.0 - pos(phip))*magSqr(Up)),
-                    1.0/gM1ByG
-                )
-            );
+            const fvPatchField<scalar>& rho =
+                patch().lookupPatchField<volScalarField, scalar>(rhoName_);
+
+            operator==(p0 - 0.5*rho*(1.0 - pos(phip))*magSqr(Up));
         }
         else
         {
-            operator==(p0/(1.0 + 0.5*psip*(1.0 - pos(phip))*magSqr(Up)));
+            // High-speed compressible flow
+
+            const fvPatchField<scalar>& psip =
+                patch().lookupPatchField<volScalarField, scalar>(psiName_);
+
+            if (gamma_ > 1)
+            {
+                scalar gM1ByG = (gamma_ - 1)/gamma_;
+
+                operator==
+                (
+                    p0
+                   /pow
+                    (
+                        (1.0 + 0.5*psip*gM1ByG*(1.0 - pos(phip))*magSqr(Up)),
+                        1.0/gM1ByG
+                    )
+                );
+            }
+            else
+            {
+                operator==(p0/(1.0 + 0.5*psip*(1.0 - pos(phip))*magSqr(Up)));
+            }
         }
+
     }
-    else if (psiName_ == "none")
+    else if (internalField().dimensions() == dimPressure/dimDensity)
     {
-        const fvPatchField<scalar>& rho =
-            patch().lookupPatchField<volScalarField, scalar>(rhoName_);
-
-        operator==(p0 - 0.5*rho*(1.0 - pos(phip))*magSqr(Up));
+        // Incompressible flow
+        operator==(p0 - 0.5*(1.0 - pos(phip))*magSqr(Up));
     }
     else
     {
         FatalErrorInFunction
-            << " rho or psi set inconsitently, rho = " << rhoName_
-            << ", psi = " << psiName_ << ".\n"
-            << "    Set either rho or psi or neither depending on the "
-               "definition of total pressure.\n"
-            << "    Set the unused variables to 'none'.\n"
+            << " Incorrect pressure dimensions " << internalField().dimensions()
+            << nl
+            << "    Should be " << dimPressure
+            << " for compressible/variable density flow" << nl
+            << "    or " << dimPressure/dimDensity
+            << " for incompressible flow," << nl
             << "    on patch " << this->patch().name()
             << " of field " << this->internalField().name()
             << " in file " << this->internalField().objectPath()
@@ -222,7 +232,7 @@ void Foam::uniformTotalPressureFvPatchScalarField::write(Ostream& os) const
     os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl;
     os.writeKeyword("psi") << psiName_ << token::END_STATEMENT << nl;
     os.writeKeyword("gamma") << gamma_ << token::END_STATEMENT << nl;
-    pressure_->writeData(os);
+    p0_->writeData(os);
     writeEntry("value", os);
 }
 
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.H
index 0f766e413d5..f67be25a938 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.H
+++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.H
@@ -29,18 +29,18 @@ Group
 
 Description
     This boundary condition provides a time-varying form of the uniform total
-    pressure boundary condition.
+    pressure boundary condition Foam::totalPressureFvPatchField.
 
     \heading Patch usage
 
     \table
-        Property     | Description             | Required    | Default value
-        U            | velocity field name     | no          | U
-        phi          | flux field name         | no          | phi
-        rho          | density field name      | no          | none
-        psi          | compressibility field name | no       | none
-        gamma        | ratio of specific heats (Cp/Cv) | yes |
-        pressure     | total pressure as a function of time | yes |
+        Property     | Description                | Required    | Default value
+        U            | Velocity field name        | no          | U
+        phi          | Flux field name            | no          | phi
+        rho          | Density field name         | no          | rho
+        psi          | Compressibility field name | no          | none
+        gamma        | (Cp/Cv)                    | no          | 1
+        p0           | Total pressure as a function of time | yes |
     \endtable
 
     Example of the boundary condition specification:
@@ -48,22 +48,13 @@ Description
     myPatch
     {
         type            uniformTotalPressure;
-        U               U;
-        phi             phi;
-        rho             rho;
-        psi             psi;
-        gamma           1.4;
-        pressure        uniform 1e5;
+        p0              uniform 1e5;
     }
     \endverbatim
 
-    The \c pressure entry is specified as a Function1 type, able to describe
+    The \c p0 entry is specified as a Function1 type, able to describe
     time varying functions.
 
-Note
-    The default boundary behaviour is for subsonic, incompressible flow.
-
-
 SeeAlso
     Foam::Function1Types
     Foam::uniformFixedValueFvPatchField
@@ -112,7 +103,7 @@ class uniformTotalPressureFvPatchScalarField
         scalar gamma_;
 
         //- Table of time vs total pressure, including the bounding treatment
-        autoPtr<Function1<scalar>> pressure_;
+        autoPtr<Function1<scalar>> p0_;
 
 
 public:
diff --git a/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D/0/p b/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D/0/p
index 1fec35ae1c6..d3bca9b21e5 100644
--- a/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D/0/p
+++ b/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D/0/p
@@ -33,10 +33,6 @@ boundaryField
     {
         type            totalPressure;
         p0              $internalField;
-        rho             none;
-        psi             none;
-        gamma           1;
-        value           $internalField;
     }
     frontAndBack
     {
diff --git a/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2DLTS/0/p b/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2DLTS/0/p
index 1fec35ae1c6..d3bca9b21e5 100644
--- a/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2DLTS/0/p
+++ b/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2DLTS/0/p
@@ -33,10 +33,6 @@ boundaryField
     {
         type            totalPressure;
         p0              $internalField;
-        rho             none;
-        psi             none;
-        gamma           1;
-        value           $internalField;
     }
     frontAndBack
     {
diff --git a/tutorials/compressible/rhoCentralDyMFoam/movingCone/0/p b/tutorials/compressible/rhoCentralDyMFoam/movingCone/0/p
index 0522075d327..196f5c7f2a5 100644
--- a/tutorials/compressible/rhoCentralDyMFoam/movingCone/0/p
+++ b/tutorials/compressible/rhoCentralDyMFoam/movingCone/0/p
@@ -39,10 +39,6 @@ boundaryField
     {
         type            totalPressure;
         p0              $internalField;
-        rho             none;
-        psi             none;
-        gamma           1;
-        value           $internalField;
     }
 
     farField
diff --git a/tutorials/compressible/rhoPimpleDyMFoam/annularThermalMixer/constant/boundaryConditions b/tutorials/compressible/rhoPimpleDyMFoam/annularThermalMixer/constant/boundaryConditions
index 9412b2521d6..6380ceb1eba 100644
--- a/tutorials/compressible/rhoPimpleDyMFoam/annularThermalMixer/constant/boundaryConditions
+++ b/tutorials/compressible/rhoPimpleDyMFoam/annularThermalMixer/constant/boundaryConditions
@@ -42,11 +42,7 @@ outlet
     p
     {
         type            totalPressure;
-        value           uniform 1e5;
         p0              uniform 1e5;
-        rho             rho;
-        psi             none;
-        gamma           1.4;
     }
 
     U
diff --git a/tutorials/compressible/sonicDyMFoam/movingCone/0/p b/tutorials/compressible/sonicDyMFoam/movingCone/0/p
index 0522075d327..196f5c7f2a5 100644
--- a/tutorials/compressible/sonicDyMFoam/movingCone/0/p
+++ b/tutorials/compressible/sonicDyMFoam/movingCone/0/p
@@ -39,10 +39,6 @@ boundaryField
     {
         type            totalPressure;
         p0              $internalField;
-        rho             none;
-        psi             none;
-        gamma           1;
-        value           $internalField;
     }
 
     farField
diff --git a/tutorials/incompressible/pimpleDyMFoam/movingCone/0/p b/tutorials/incompressible/pimpleDyMFoam/movingCone/0/p
index 92fe672c822..315aec8a091 100644
--- a/tutorials/incompressible/pimpleDyMFoam/movingCone/0/p
+++ b/tutorials/incompressible/pimpleDyMFoam/movingCone/0/p
@@ -39,10 +39,6 @@ boundaryField
     {
         type            totalPressure;
         p0              $internalField;
-        rho             none;
-        psi             none;
-        gamma           1;
-        value           uniform 0;
     }
 
     farField
diff --git a/tutorials/incompressible/pimpleFoam/TJunction/0/p b/tutorials/incompressible/pimpleFoam/TJunction/0/p
index 17217a216a1..d663238d281 100644
--- a/tutorials/incompressible/pimpleFoam/TJunction/0/p
+++ b/tutorials/incompressible/pimpleFoam/TJunction/0/p
@@ -23,16 +23,11 @@ boundaryField
     inlet
     {
         type            uniformTotalPressure;
-        pressure        table
+        p0              table
         (
             (0 10)
             (1 40)
         );
-        p0              40; // only used for restarts
-        rho             none;
-        psi             none;
-        gamma           1;
-        value           uniform 40;
     }
 
     outlet1
diff --git a/tutorials/incompressible/pimpleFoam/TJunctionFan/0.orig/p b/tutorials/incompressible/pimpleFoam/TJunctionFan/0.orig/p
index 42728c992c0..d41f644fe16 100644
--- a/tutorials/incompressible/pimpleFoam/TJunctionFan/0.orig/p
+++ b/tutorials/incompressible/pimpleFoam/TJunctionFan/0.orig/p
@@ -24,17 +24,11 @@ boundaryField
     inlet
     {
         type            uniformTotalPressure;
-        rho             none;
-        psi             none;
-        gamma           1;
-        pressure        table
-        2
+        p0              table
         (
             (0 10)
             (1 40)
-        )
-        ;
-        value           uniform 40;
+        );
     }
     outlet1
     {
diff --git a/tutorials/lagrangian/reactingParcelFoam/counterFlowFlame2DLTS/0/p b/tutorials/lagrangian/reactingParcelFoam/counterFlowFlame2DLTS/0/p
index 1fec35ae1c6..d3bca9b21e5 100644
--- a/tutorials/lagrangian/reactingParcelFoam/counterFlowFlame2DLTS/0/p
+++ b/tutorials/lagrangian/reactingParcelFoam/counterFlowFlame2DLTS/0/p
@@ -33,10 +33,6 @@ boundaryField
     {
         type            totalPressure;
         p0              $internalField;
-        rho             none;
-        psi             none;
-        gamma           1;
-        value           $internalField;
     }
     frontAndBack
     {
diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle/0/p b/tutorials/multiphase/cavitatingFoam/les/throttle/0/p
index fdd5db3dfea..d2d06233aa7 100644
--- a/tutorials/multiphase/cavitatingFoam/les/throttle/0/p
+++ b/tutorials/multiphase/cavitatingFoam/les/throttle/0/p
@@ -23,9 +23,6 @@ boundaryField
     inlet
     {
         type            totalPressure;
-        rho             rho;
-        psi             none;
-        gamma           1;
         p0              uniform 300e5;
     }
 
diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle3D/0.orig/p b/tutorials/multiphase/cavitatingFoam/les/throttle3D/0.orig/p
index 7bde4729a42..d007d373270 100644
--- a/tutorials/multiphase/cavitatingFoam/les/throttle3D/0.orig/p
+++ b/tutorials/multiphase/cavitatingFoam/les/throttle3D/0.orig/p
@@ -23,9 +23,6 @@ boundaryField
     inlet
     {
         type            totalPressure;
-        rho             rho;
-        psi             none;
-        gamma           1;
         p0              uniform 300e5;
     }
 
diff --git a/tutorials/multiphase/cavitatingFoam/ras/throttle/0/p b/tutorials/multiphase/cavitatingFoam/ras/throttle/0/p
index fdd5db3dfea..d2d06233aa7 100644
--- a/tutorials/multiphase/cavitatingFoam/ras/throttle/0/p
+++ b/tutorials/multiphase/cavitatingFoam/ras/throttle/0/p
@@ -23,9 +23,6 @@ boundaryField
     inlet
     {
         type            totalPressure;
-        rho             rho;
-        psi             none;
-        gamma           1;
         p0              uniform 300e5;
     }
 
diff --git a/tutorials/multiphase/compressibleMultiphaseInterFoam/laminar/damBreak4phase/0.orig/p_rgh b/tutorials/multiphase/compressibleMultiphaseInterFoam/laminar/damBreak4phase/0.orig/p_rgh
index c97740b9fe8..32450fed7b5 100644
--- a/tutorials/multiphase/compressibleMultiphaseInterFoam/laminar/damBreak4phase/0.orig/p_rgh
+++ b/tutorials/multiphase/compressibleMultiphaseInterFoam/laminar/damBreak4phase/0.orig/p_rgh
@@ -42,10 +42,6 @@ boundaryField
     {
         type            totalPressure;
         p0              uniform 1e5;
-        rho             rho;
-        psi             none;
-        gamma           1;
-        value           $internalField;
     }
 
     defaultFaces
diff --git a/tutorials/multiphase/interDyMFoam/ras/DTCHull/0.orig/p_rgh b/tutorials/multiphase/interDyMFoam/ras/DTCHull/0.orig/p_rgh
index 7546ea7122e..e8fe51c50d8 100644
--- a/tutorials/multiphase/interDyMFoam/ras/DTCHull/0.orig/p_rgh
+++ b/tutorials/multiphase/interDyMFoam/ras/DTCHull/0.orig/p_rgh
@@ -39,10 +39,6 @@ boundaryField
     {
         type            totalPressure;
         p0              uniform 0;
-        rho             rho;
-        psi             none;
-        gamma           1;
-        value           $internalField;
     }
 
     hull
diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0.orig/p_rgh b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0.orig/p_rgh
index bb91b933fe0..297c28eb09d 100644
--- a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0.orig/p_rgh
+++ b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0.orig/p_rgh
@@ -38,10 +38,6 @@ boundaryField
     {
         type            totalPressure;
         p0              uniform 0;
-        rho             rho;
-        psi             none;
-        gamma           1;
-        value           uniform 0;
     }
 }
 
diff --git a/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.orig/p_rgh b/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.orig/p_rgh
index 11d59b65de8..7602ec8372c 100644
--- a/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.orig/p_rgh
+++ b/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.orig/p_rgh
@@ -28,10 +28,6 @@ boundaryField
     {
         type            totalPressure;
         p0              uniform 0;
-        rho             rho;
-        psi             none;
-        gamma           1;
-        value           uniform 0;
     }
     floatingObject
     {
diff --git a/tutorials/multiphase/interFoam/laminar/damBreak/damBreak/0/p_rgh b/tutorials/multiphase/interFoam/laminar/damBreak/damBreak/0/p_rgh
index 64bcdfe9e2a..97c1c5f1180 100644
--- a/tutorials/multiphase/interFoam/laminar/damBreak/damBreak/0/p_rgh
+++ b/tutorials/multiphase/interFoam/laminar/damBreak/damBreak/0/p_rgh
@@ -42,10 +42,6 @@ boundaryField
     {
         type            totalPressure;
         p0              uniform 0;
-        rho             rho;
-        psi             none;
-        gamma           1;
-        value           uniform 0;
     }
 
     defaultFaces
diff --git a/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/p_rgh b/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/p_rgh
index 69ce1c56b57..913189f4ff1 100644
--- a/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/p_rgh
+++ b/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/p_rgh
@@ -39,10 +39,6 @@ boundaryField
     {
         type            totalPressure;
         p0              uniform 0;
-        rho             rho;
-        psi             none;
-        gamma           1;
-        value           uniform 0;
     }
 
     front
diff --git a/tutorials/multiphase/interFoam/ras/DTCHull/0.orig/p_rgh b/tutorials/multiphase/interFoam/ras/DTCHull/0.orig/p_rgh
index 7546ea7122e..e8fe51c50d8 100644
--- a/tutorials/multiphase/interFoam/ras/DTCHull/0.orig/p_rgh
+++ b/tutorials/multiphase/interFoam/ras/DTCHull/0.orig/p_rgh
@@ -39,10 +39,6 @@ boundaryField
     {
         type            totalPressure;
         p0              uniform 0;
-        rho             rho;
-        psi             none;
-        gamma           1;
-        value           $internalField;
     }
 
     hull
diff --git a/tutorials/multiphase/interFoam/ras/damBreak/damBreak/0/p_rgh b/tutorials/multiphase/interFoam/ras/damBreak/damBreak/0/p_rgh
index 64bcdfe9e2a..97c1c5f1180 100644
--- a/tutorials/multiphase/interFoam/ras/damBreak/damBreak/0/p_rgh
+++ b/tutorials/multiphase/interFoam/ras/damBreak/damBreak/0/p_rgh
@@ -42,10 +42,6 @@ boundaryField
     {
         type            totalPressure;
         p0              uniform 0;
-        rho             rho;
-        psi             none;
-        gamma           1;
-        value           uniform 0;
     }
 
     defaultFaces
diff --git a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/p_rgh b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/p_rgh
index f24e6e1ede3..57e3aa66bd2 100644
--- a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/p_rgh
+++ b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/0/p_rgh
@@ -42,11 +42,7 @@ boundaryField
     atmosphere
     {
         type            totalPressure;
-        rho             rho;
-        psi             none;
-        gamma           1;
         p0              uniform 0;
-        value           uniform 0;
     }
     defaultFaces
     {
diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/0/p_rgh b/tutorials/multiphase/interFoam/ras/waterChannel/0/p_rgh
index 128b2a26f52..fca212c4965 100644
--- a/tutorials/multiphase/interFoam/ras/waterChannel/0/p_rgh
+++ b/tutorials/multiphase/interFoam/ras/waterChannel/0/p_rgh
@@ -24,10 +24,6 @@ boundaryField
     {
         type            totalPressure;
         p0              uniform 0;
-        rho             rho;
-        psi             none;
-        gamma           1;
-        value           uniform 0;
     }
 
     ".*"
diff --git a/tutorials/multiphase/interFoam/ras/weirOverflow/0.orig/p_rgh b/tutorials/multiphase/interFoam/ras/weirOverflow/0.orig/p_rgh
index a36f8077f7e..cfd401c53c2 100644
--- a/tutorials/multiphase/interFoam/ras/weirOverflow/0.orig/p_rgh
+++ b/tutorials/multiphase/interFoam/ras/weirOverflow/0.orig/p_rgh
@@ -41,10 +41,6 @@ boundaryField
     {
         type            totalPressure;
         p0              uniform 0;
-        rho             none;
-        psi             none;
-        gamma           1;
-        value           uniform $pressure;
     }
 
     defaultFaces
diff --git a/tutorials/multiphase/interMixingFoam/laminar/damBreak/0/p_rgh b/tutorials/multiphase/interMixingFoam/laminar/damBreak/0/p_rgh
index 64bcdfe9e2a..97c1c5f1180 100644
--- a/tutorials/multiphase/interMixingFoam/laminar/damBreak/0/p_rgh
+++ b/tutorials/multiphase/interMixingFoam/laminar/damBreak/0/p_rgh
@@ -42,10 +42,6 @@ boundaryField
     {
         type            totalPressure;
         p0              uniform 0;
-        rho             rho;
-        psi             none;
-        gamma           1;
-        value           uniform 0;
     }
 
     defaultFaces
diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/0.orig/p_rgh b/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/0.orig/p_rgh
index 75384444999..873c3994ca7 100644
--- a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/0.orig/p_rgh
+++ b/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/0.orig/p_rgh
@@ -33,10 +33,6 @@ boundaryField
     {
         type            totalPressure;
         p0              $internalField;
-        rho             rho;
-        psi             none;
-        gamma           1;
-        value           $internalField;
     }
 
     wall
diff --git a/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/0.orig/p_rgh b/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/0.orig/p_rgh
index 22671e295d2..46470aab9a6 100644
--- a/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/0.orig/p_rgh
+++ b/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/0.orig/p_rgh
@@ -44,10 +44,6 @@ boundaryField
         p0              uniform 0;
         U               U.air;
         phi             phi.air;
-        rho             rho;
-        psi             none;
-        gamma           1;
-        value           uniform 0;
     }
 
     defaultFaces
diff --git a/tutorials/multiphase/multiphaseEulerFoam/damBreak4phaseFine/0.orig/p_rgh b/tutorials/multiphase/multiphaseEulerFoam/damBreak4phaseFine/0.orig/p_rgh
index 64bcdfe9e2a..97c1c5f1180 100644
--- a/tutorials/multiphase/multiphaseEulerFoam/damBreak4phaseFine/0.orig/p_rgh
+++ b/tutorials/multiphase/multiphaseEulerFoam/damBreak4phaseFine/0.orig/p_rgh
@@ -42,10 +42,6 @@ boundaryField
     {
         type            totalPressure;
         p0              uniform 0;
-        rho             rho;
-        psi             none;
-        gamma           1;
-        value           uniform 0;
     }
 
     defaultFaces
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.orig/p_rgh b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.orig/p_rgh
index 64bcdfe9e2a..97c1c5f1180 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.orig/p_rgh
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0.orig/p_rgh
@@ -42,10 +42,6 @@ boundaryField
     {
         type            totalPressure;
         p0              uniform 0;
-        rho             rho;
-        psi             none;
-        gamma           1;
-        value           uniform 0;
     }
 
     defaultFaces
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.orig/p_rgh b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.orig/p_rgh
index 64bcdfe9e2a..97c1c5f1180 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.orig/p_rgh
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0.orig/p_rgh
@@ -42,10 +42,6 @@ boundaryField
     {
         type            totalPressure;
         p0              uniform 0;
-        rho             rho;
-        psi             none;
-        gamma           1;
-        value           uniform 0;
     }
 
     defaultFaces
-- 
GitLab