diff --git a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C index 7cb8936f18..76267d4fa6 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C @@ -30,27 +30,7 @@ License #include "volFields.H" #include "surfaceFields.H" -// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // - -bool Foam::totalPressureFvPatchScalarField::calcBuoyancy() const -{ - if (buoyancy_) - { - return true; - } - - if (db().foundObject("pd")) - { - const volScalarField& pd = db().lookupObject("pd"); - if (pd.dimensions() == dimPressure) - { - return true; - } - } - - return false; -} - +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -66,7 +46,6 @@ Foam::totalPressureFvPatchScalarField::totalPressureFvPatchScalarField rhoName_("none"), psiName_("none"), gamma_(0.0), - buoyancy_(false), p0_(p.size(), 0.0) {} @@ -84,7 +63,6 @@ Foam::totalPressureFvPatchScalarField::totalPressureFvPatchScalarField rhoName_(dict.lookupOrDefault("rho", "none")), psiName_(dict.lookupOrDefault("psi", "none")), gamma_(readScalar(dict.lookup("gamma"))), - buoyancy_(dict.lookupOrDefault("buoyancy", false)), p0_("p0", dict, p.size()) { if (dict.found("value")) @@ -115,7 +93,6 @@ Foam::totalPressureFvPatchScalarField::totalPressureFvPatchScalarField rhoName_(ptf.rhoName_), psiName_(ptf.psiName_), gamma_(ptf.gamma_), - buoyancy_(ptf.buoyancy_), p0_(ptf.p0_, mapper) {} @@ -131,7 +108,6 @@ Foam::totalPressureFvPatchScalarField::totalPressureFvPatchScalarField rhoName_(tppsf.rhoName_), psiName_(tppsf.psiName_), gamma_(tppsf.gamma_), - buoyancy_(tppsf.buoyancy_), p0_(tppsf.p0_) {} @@ -148,7 +124,6 @@ Foam::totalPressureFvPatchScalarField::totalPressureFvPatchScalarField rhoName_(tppsf.rhoName_), psiName_(tppsf.psiName_), gamma_(tppsf.gamma_), - buoyancy_(tppsf.buoyancy_), p0_(tppsf.p0_) {} @@ -190,18 +165,9 @@ void Foam::totalPressureFvPatchScalarField::updateCoeffs(const vectorField& Up) const fvsPatchField& phip = patch().lookupPatchField(phiName_); - scalarField gh(patch().size(), 0.0); - if (calcBuoyancy()) - { - const dictionary& environmentalProperties = - db().lookupObject("environmentalProperties"); - const dimensionedVector g = environmentalProperties.lookup("g"); - gh = g.value() & patch().Cf(); - } - if (psiName_ == "none" && rhoName_ == "none") { - operator==(p0_ - 0.5*(1.0 - pos(phip))*magSqr(Up) - gh); + operator==(p0_ - 0.5*(1.0 - pos(phip))*magSqr(Up)); } else if (rhoName_ == "none") { @@ -217,7 +183,7 @@ void Foam::totalPressureFvPatchScalarField::updateCoeffs(const vectorField& Up) p0_ /pow ( - (1.0 + psip*gM1ByG*0.5*(1.0 - pos(phip))*magSqr(Up)), + (1.0 + 0.5*psip*gM1ByG*(1.0 - pos(phip))*magSqr(Up)), 1.0/gM1ByG ) ); @@ -232,7 +198,7 @@ void Foam::totalPressureFvPatchScalarField::updateCoeffs(const vectorField& Up) const fvPatchField& rho = patch().lookupPatchField(rhoName_); - operator==(p0_ - rho*(0.5*(1.0 - pos(phip))*magSqr(Up) + gh)); + operator==(p0_ - 0.5*rho*(1.0 - pos(phip))*magSqr(Up)); } else { @@ -268,7 +234,6 @@ void Foam::totalPressureFvPatchScalarField::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; - os.writeKeyword("buoyancy") << buoyancy_ << token::END_STATEMENT << nl; p0_.writeEntry("p0", os); writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.H index 2a02502980..4206f1f081 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.H @@ -37,7 +37,6 @@ SourceFiles #define totalPressureFvPatchScalarField_H #include "fixedValueFvPatchFields.H" -#include "Switch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -70,19 +69,10 @@ class totalPressureFvPatchScalarField //- Heat capacity ratio scalar gamma_; - //- Flag to include buoyancy effects (applying BC to pd) - Switch buoyancy_; - //- Total pressure scalarField p0_; - //- Private member functions - - //- Helper function to determine whether to include buoyancy effects - bool calcBuoyancy() const; - - public: //- Runtime type information