diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H b/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H
index b93ea3a020..675a410a16 100644
--- a/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H
+++ b/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H
@@ -155,7 +155,6 @@
phasei++;
}
Dp = mag(Dp);
- adjustPhi(phi0, U, p);
while (pimple.correctNonOrthogonal())
{
diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files
index 2d4930f385..db1aee788a 100644
--- a/src/finiteVolume/Make/files
+++ b/src/finiteVolume/Make/files
@@ -170,7 +170,7 @@ $(derivedFvPatchFields)/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvP
$(derivedFvPatchFields)/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/outletMappedUniformInlet/outletMappedUniformInletFvPatchFields.C
$(derivedFvPatchFields)/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C
-
+$(derivedFvPatchFields)/phaseHydrostaticPressure/phaseHydrostaticPressureFvPatchScalarField.C
fvsPatchFields = fields/fvsPatchFields
$(fvsPatchFields)/fvsPatchField/fvsPatchFields.C
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/phaseHydrostaticPressure/phaseHydrostaticPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/phaseHydrostaticPressure/phaseHydrostaticPressureFvPatchScalarField.C
new file mode 100644
index 0000000000..02539fb9fd
--- /dev/null
+++ b/src/finiteVolume/fields/fvPatchFields/derived/phaseHydrostaticPressure/phaseHydrostaticPressureFvPatchScalarField.C
@@ -0,0 +1,201 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
+ \\/ M anipulation |
+-------------------------------------------------------------------------------
+License
+ This file is part of OpenFOAM.
+
+ OpenFOAM is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with OpenFOAM. If not, see .
+
+\*---------------------------------------------------------------------------*/
+
+#include "phaseHydrostaticPressureFvPatchScalarField.H"
+#include "addToRunTimeSelectionTable.H"
+#include "fvPatchFieldMapper.H"
+#include "volFields.H"
+#include "surfaceFields.H"
+#include "uniformDimensionedFields.H"
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+Foam::phaseHydrostaticPressureFvPatchScalarField::
+phaseHydrostaticPressureFvPatchScalarField
+(
+ const fvPatch& p,
+ const DimensionedField& iF
+)
+:
+ mixedFvPatchScalarField(p, iF),
+ phaseName_("alpha"),
+ rho_(0.0),
+ pRefValue_(0.0),
+ pRefPoint_(vector::zero)
+{
+ this->refValue() = 0.0;
+ this->refGrad() = 0.0;
+ this->valueFraction() = 0.0;
+}
+
+
+Foam::phaseHydrostaticPressureFvPatchScalarField::
+phaseHydrostaticPressureFvPatchScalarField
+(
+ const fvPatch& p,
+ const DimensionedField& iF,
+ const dictionary& dict
+)
+:
+ mixedFvPatchScalarField(p, iF),
+ phaseName_(dict.lookupOrDefault("phaseName", "alpha")),
+ rho_(readScalar(dict.lookup("rho"))),
+ pRefValue_(readScalar(dict.lookup("pRefValue"))),
+ pRefPoint_(dict.lookup("pRefPoint"))
+{
+ this->refValue() = pRefValue_;
+
+ if (dict.found("value"))
+ {
+ fvPatchScalarField::operator=
+ (
+ scalarField("value", dict, p.size())
+ );
+ }
+ else
+ {
+ fvPatchScalarField::operator=(this->refValue());
+ }
+
+ this->refGrad() = 0.0;
+ this->valueFraction() = 0.0;
+}
+
+
+Foam::phaseHydrostaticPressureFvPatchScalarField::
+phaseHydrostaticPressureFvPatchScalarField
+(
+ const phaseHydrostaticPressureFvPatchScalarField& ptf,
+ const fvPatch& p,
+ const DimensionedField& iF,
+ const fvPatchFieldMapper& mapper
+)
+:
+ mixedFvPatchScalarField(ptf, p, iF, mapper),
+ phaseName_(ptf.phaseName_),
+ rho_(ptf.rho_),
+ pRefValue_(ptf.pRefValue_),
+ pRefPoint_(ptf.pRefPoint_)
+{}
+
+
+Foam::phaseHydrostaticPressureFvPatchScalarField::
+phaseHydrostaticPressureFvPatchScalarField
+(
+ const phaseHydrostaticPressureFvPatchScalarField& ptf
+)
+:
+ mixedFvPatchScalarField(ptf),
+ phaseName_(ptf.phaseName_)
+{}
+
+
+Foam::phaseHydrostaticPressureFvPatchScalarField::
+phaseHydrostaticPressureFvPatchScalarField
+(
+ const phaseHydrostaticPressureFvPatchScalarField& ptf,
+ const DimensionedField& iF
+)
+:
+ mixedFvPatchScalarField(ptf, iF),
+ phaseName_(ptf.phaseName_),
+ rho_(ptf.rho_),
+ pRefValue_(ptf.pRefValue_),
+ pRefPoint_(ptf.pRefPoint_)
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+void Foam::phaseHydrostaticPressureFvPatchScalarField::updateCoeffs()
+{
+ if (this->updated())
+ {
+ return;
+ }
+
+ const scalarField& alphap =
+ patch().lookupPatchField
+ (
+ phaseName_
+ );
+
+ const uniformDimensionedVectorField& g =
+ db().lookupObject("g");
+
+ // scalar rhor = 1000;
+ // scalarField alphap1 = max(min(alphap, 1.0), 0.0);
+ // valueFraction() = alphap1/(alphap1 + rhor*(1.0 - alphap1));
+ valueFraction() = max(min(alphap, 1.0), 0.0);
+
+ refValue() =
+ pRefValue_
+ + rho_*((g.value() & patch().Cf()) - (g.value() & pRefPoint_));
+
+ mixedFvPatchScalarField::updateCoeffs();
+}
+
+
+void Foam::phaseHydrostaticPressureFvPatchScalarField::write(Ostream& os) const
+{
+ fvPatchScalarField::write(os);
+ if (phaseName_ != "alpha")
+ {
+ os.writeKeyword("phaseName") << phaseName_ << token::END_STATEMENT << nl;
+ }
+ os.writeKeyword("rho") << rho_ << token::END_STATEMENT << nl;
+ os.writeKeyword("pRefValue") << pRefValue_ << token::END_STATEMENT << nl;
+ os.writeKeyword("pRefPoint") << pRefPoint_ << token::END_STATEMENT << nl;
+ writeEntry("value", os);
+}
+
+
+// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
+
+void Foam::phaseHydrostaticPressureFvPatchScalarField::operator=
+(
+ const fvPatchScalarField& ptf
+)
+{
+ fvPatchScalarField::operator=
+ (
+ valueFraction()*refValue()
+ + (1 - valueFraction())*ptf
+ );
+}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+ makePatchTypeField
+ (
+ fvPatchScalarField,
+ phaseHydrostaticPressureFvPatchScalarField
+ );
+}
+
+// ************************************************************************* //
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/phaseHydrostaticPressure/phaseHydrostaticPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/phaseHydrostaticPressure/phaseHydrostaticPressureFvPatchScalarField.H
new file mode 100644
index 0000000000..4c14094f49
--- /dev/null
+++ b/src/finiteVolume/fields/fvPatchFields/derived/phaseHydrostaticPressure/phaseHydrostaticPressureFvPatchScalarField.H
@@ -0,0 +1,223 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
+ \\/ M anipulation |
+-------------------------------------------------------------------------------
+License
+ This file is part of OpenFOAM.
+
+ OpenFOAM is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with OpenFOAM. If not, see .
+
+Class
+ Foam::phaseHydrostaticPressureFvPatchScalarField
+
+Description
+ Phase hydrostatic pressure boundary condition calculated as
+
+ pRefValue + rho*g.(x - pRefPoint)
+
+ where rho is provided and assumed uniform
+
+ applied according to the phase-fraction field provided:
+ 1 -> fix value to that provided
+ 0 -> zero-gradient
+
+SourceFiles
+ phaseHydrostaticPressureFvPatchScalarField.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef phaseHydrostaticPressureFvPatchScalarField_H
+#define phaseHydrostaticPressureFvPatchScalarField_H
+
+#include "mixedFvPatchFields.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+ Class phaseHydrostaticPressureFvPatch Declaration
+\*---------------------------------------------------------------------------*/
+
+class phaseHydrostaticPressureFvPatchScalarField
+:
+ public mixedFvPatchScalarField
+{
+
+protected:
+
+ // Protected data
+
+ //- Name of phase-fraction field
+ word phaseName_;
+
+ //- Constant density in the far-field
+ scalar rho_;
+
+ //- Reference pressure
+ scalar pRefValue_;
+
+ //- Reference pressure location
+ vector pRefPoint_;
+
+
+public:
+
+ //- Runtime type information
+ TypeName("phaseHydrostaticPressure");
+
+
+ // Constructors
+
+ //- Construct from patch and internal field
+ phaseHydrostaticPressureFvPatchScalarField
+ (
+ const fvPatch&,
+ const DimensionedField&
+ );
+
+ //- Construct from patch, internal field and dictionary
+ phaseHydrostaticPressureFvPatchScalarField
+ (
+ const fvPatch&,
+ const DimensionedField&,
+ const dictionary&
+ );
+
+ //- Construct by mapping given
+ // phaseHydrostaticPressureFvPatchScalarField onto a new patch
+ phaseHydrostaticPressureFvPatchScalarField
+ (
+ const phaseHydrostaticPressureFvPatchScalarField&,
+ const fvPatch&,
+ const DimensionedField&,
+ const fvPatchFieldMapper&
+ );
+
+ //- Construct as copy
+ phaseHydrostaticPressureFvPatchScalarField
+ (
+ const phaseHydrostaticPressureFvPatchScalarField&
+ );
+
+ //- Construct and return a clone
+ virtual tmp clone() const
+ {
+ return tmp
+ (
+ new phaseHydrostaticPressureFvPatchScalarField(*this)
+ );
+ }
+
+ //- Construct as copy setting internal field reference
+ phaseHydrostaticPressureFvPatchScalarField
+ (
+ const phaseHydrostaticPressureFvPatchScalarField&,
+ const DimensionedField&
+ );
+
+ //- Construct and return a clone setting internal field reference
+ virtual tmp clone
+ (
+ const DimensionedField& iF
+ ) const
+ {
+ return tmp
+ (
+ new phaseHydrostaticPressureFvPatchScalarField(*this, iF)
+ );
+ }
+
+
+ // Member functions
+
+ // Access
+
+ //- Return the phaseName
+ const word& phaseName() const
+ {
+ return phaseName_;
+ }
+
+ //- Return reference to the phaseName to allow adjustment
+ word& phaseName()
+ {
+ return phaseName_;
+ }
+
+ //- Return the constant density in the far-field
+ scalar rho() const
+ {
+ return rho_;
+ }
+
+ //- Return reference to the constant density in the far-field
+ // to allow adjustment
+ scalar& rho()
+ {
+ return rho_;
+ }
+
+ //- Return the reference pressure
+ scalar pRefValue() const
+ {
+ return pRefValue_;
+ }
+
+ //- Return reference to the reference pressure to allow adjustment
+ scalar& pRefValue()
+ {
+ return pRefValue_;
+ }
+
+ //- Return the pressure reference location
+ const vector& pRefPoint() const
+ {
+ return pRefPoint_;
+ }
+
+ //- Return reference to the pressure reference location
+ // to allow adjustment
+ vector& pRefPoint()
+ {
+ return pRefPoint_;
+ }
+
+
+ //- Update the coefficients associated with the patch field
+ virtual void updateCoeffs();
+
+ //- Write
+ virtual void write(Ostream&) const;
+
+
+ // Member operators
+
+ virtual void operator=(const fvPatchScalarField& pvf);
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //