diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.C index e9bd327072..c3b35384cd 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,7 +44,6 @@ uniformTotalPressureFvPatchScalarField rhoName_("none"), psiName_("none"), gamma_(0.0), - p0_(0.0), pressure_() {} @@ -63,7 +62,6 @@ uniformTotalPressureFvPatchScalarField rhoName_(dict.lookupOrDefault("rho", "none")), psiName_(dict.lookupOrDefault("psi", "none")), gamma_(readScalar(dict.lookup("gamma"))), - p0_(readScalar(dict.lookup("p0"))), pressure_(DataEntry::New("pressure", dict)) { if (dict.found("value")) @@ -75,7 +73,8 @@ uniformTotalPressureFvPatchScalarField } else { - fvPatchField::operator=(p0_); + scalar p0 = pressure_->value(this->db().time().timeOutputValue()); + fvPatchField::operator=(p0); } } @@ -95,7 +94,6 @@ uniformTotalPressureFvPatchScalarField rhoName_(ptf.rhoName_), psiName_(ptf.psiName_), gamma_(ptf.gamma_), - p0_(ptf.p0_), pressure_(ptf.pressure_().clone().ptr()) {} @@ -112,7 +110,6 @@ uniformTotalPressureFvPatchScalarField rhoName_(tppsf.rhoName_), psiName_(tppsf.psiName_), gamma_(tppsf.gamma_), - p0_(tppsf.p0_), pressure_(tppsf.pressure_().clone().ptr()) {} @@ -130,7 +127,6 @@ uniformTotalPressureFvPatchScalarField rhoName_(tppsf.rhoName_), psiName_(tppsf.psiName_), gamma_(tppsf.gamma_), - p0_(tppsf.p0_), pressure_(tppsf.pressure_().clone().ptr()) {} @@ -147,14 +143,14 @@ void Foam::uniformTotalPressureFvPatchScalarField::updateCoeffs return; } - p0_ = pressure_->value(this->db().time().timeOutputValue()); + scalar p0 = pressure_->value(this->db().time().timeOutputValue()); const fvsPatchField& phip = patch().lookupPatchField(phiName_); if (psiName_ == "none" && rhoName_ == "none") { - operator==(p0_ - 0.5*(1.0 - pos(phip))*magSqr(Up)); + operator==(p0 - 0.5*(1.0 - pos(phip))*magSqr(Up)); } else if (rhoName_ == "none") { @@ -167,7 +163,7 @@ void Foam::uniformTotalPressureFvPatchScalarField::updateCoeffs operator== ( - p0_ + p0 /pow ( (1.0 + 0.5*psip*gM1ByG*(1.0 - pos(phip))*magSqr(Up)), @@ -177,7 +173,7 @@ void Foam::uniformTotalPressureFvPatchScalarField::updateCoeffs } else { - operator==(p0_/(1.0 + 0.5*psip*(1.0 - pos(phip))*magSqr(Up))); + operator==(p0/(1.0 + 0.5*psip*(1.0 - pos(phip))*magSqr(Up))); } } else if (psiName_ == "none") @@ -185,7 +181,7 @@ void Foam::uniformTotalPressureFvPatchScalarField::updateCoeffs const fvPatchField& rho = patch().lookupPatchField(rhoName_); - operator==(p0_ - 0.5*rho*(1.0 - pos(phip))*magSqr(Up)); + operator==(p0 - 0.5*rho*(1.0 - pos(phip))*magSqr(Up)); } else { @@ -219,7 +215,6 @@ 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; - os.writeKeyword("p0") << p0_ << token::END_STATEMENT << nl; pressure_->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 aa77ffe2ca..325ed6e471 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -75,9 +75,6 @@ class uniformTotalPressureFvPatchScalarField //- Heat capacity ratio scalar gamma_; - //- Total pressure - scalar p0_; - //- Table of time vs total pressure, including the bounding treatment autoPtr > pressure_; @@ -178,18 +175,6 @@ public: return gamma_; } - //- Return the total pressure - scalar p0() const - { - return p0_; - } - - //- Return reference to the total pressure to allow adjustment - scalar p0() - { - return p0_; - } - // Evaluation functions