diff --git a/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.C b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.C index 7264041083d36774276d22b4cd14214dd4d6debc..497dc7c757bf83f5f466a6030efc32851bc91e0e 100644 --- a/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.C +++ b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.C @@ -40,8 +40,11 @@ Foam::hPolynomialThermo<EquationOfState, PolySize>::hPolynomialThermo Sf_(readScalar(is)), cpPolynomial_("cpPolynomial", is), dhPolynomial_(cpPolynomial_.integrate()), - sPolynomial_(cpPolynomial_.integrateMinus1()) -{} + dsPolynomial_(cpPolynomial_.integrateMinus1()) +{ + // Offset dh poly so that it is relative to the enthalpy at Tstd + dhPolynomial_[0] -= dhPolynomial_.evaluate(specie::Tstd); +} // * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // @@ -58,7 +61,7 @@ Foam::Ostream& Foam::operator<< << pt.Sf_ << tab << pt.cpPolynomial_ << tab << pt.dhPolynomial_ << tab - << pt.sPolynomial; + << pt.dsPolynomial; os.check ( diff --git a/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.H b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.H index ec3c752f24bc7273dfd7b9460f7429fd6018b603..a15d05adfe11822dae04268d061233c0cb96f28f 100644 --- a/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.H +++ b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.H @@ -106,14 +106,14 @@ class hPolynomialThermo //- Standard entropy [J/(kg.K)] scalar Sf_; - //- Specific heat at constant pressure + //- Specific heat at constant pressure [J/(kg.K)] Polynomial<PolySize> cpPolynomial_; - //- Enthalpy - derived from cp + //- Enthalpy - derived from cp [J/kg] - relative to Tstd typename Polynomial<PolySize>::intPolyType dhPolynomial_; - //- Entropy - derived from cp - Polynomial<PolySize> sPolynomial_; + //- Entropy - derived from cp [J/(kg.K)] + Polynomial<PolySize> dsPolynomial_; // Private member functions @@ -125,8 +125,8 @@ class hPolynomialThermo const scalar Hf, const scalar Sf, const Polynomial<PolySize>& cpPoly, - const typename Polynomial<PolySize>::intPolyType& hPoly, - const Polynomial<PolySize>& sPoly + const typename Polynomial<PolySize>::intPolyType& dhPoly, + const Polynomial<PolySize>& dsPoly ); diff --git a/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermoI.H b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermoI.H index 1382c6f3ecea86c65370e60741630ad03d3eabab..f575e970b4aed986ace1d0977970b381b4673d64 100644 --- a/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermoI.H +++ b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermoI.H @@ -36,7 +36,7 @@ inline Foam::hPolynomialThermo<EquationOfState, PolySize>::hPolynomialThermo const scalar Sf, const Polynomial<PolySize>& cpPoly, const typename Polynomial<PolySize>::intPolyType& dhPoly, - const Polynomial<PolySize>& sPoly + const Polynomial<PolySize>& dsPoly ) : EquationOfState(pt), @@ -44,7 +44,7 @@ inline Foam::hPolynomialThermo<EquationOfState, PolySize>::hPolynomialThermo Sf_(Sf), cpPolynomial_(cpPoly), dhPolynomial_(dhPoly), - sPolynomial_(sPoly) + dsPolynomial_(dsPoly) {} @@ -62,8 +62,11 @@ inline Foam::hPolynomialThermo<EquationOfState, PolySize>::hPolynomialThermo Sf_(pt.Sf_), cpPolynomial_(pt.cpPolynomial_), dhPolynomial_(pt.dhPolynomial_), - sPolynomial_(pt.sPolynomial_) -{} + dsPolynomial_(pt.dsPolynomial_) +{ + // Offset dh poly so that it is relative to the enthalpy at Tstd + dhPolynomial_[0] -= dhPolynomial_.evaluate(specie::Tstd); +} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // @@ -112,7 +115,7 @@ inline Foam::scalar Foam::hPolynomialThermo<EquationOfState, PolySize>::s const scalar T ) const { - return (sPolynomial_.evaluate(T) + Sf_)*this->W(); + return (dsPolynomial_.evaluate(T) + Sf_)*this->W(); } @@ -135,7 +138,7 @@ inline void Foam::hPolynomialThermo<EquationOfState, PolySize>::operator+= Sf_ = molr1*Sf_ + molr2*pt.Sf_; cpPolynomial_ = molr1*cpPolynomial_ + molr2*pt.cpPolynomial_; dhPolynomial_ = molr1*dhPolynomial_ + molr2*pt.dhPolynomial_; - sPolynomial_ = molr1*sPolynomial_ + molr2*pt.sPolynomial_; + dsPolynomial_ = molr1*dsPolynomial_ + molr2*pt.dsPolynomial_; } @@ -153,10 +156,10 @@ inline void Foam::hPolynomialThermo<EquationOfState, PolySize>::operator-= scalar molr2 = pt.nMoles()/this->nMoles(); Hf_ = molr1*Hf_ - molr2*pt.Hf_; - Sf_ = molr1*Hf_ - molr2*pt.Sf_; + Sf_ = molr1*Sf_ - molr2*pt.Sf_; cpPolynomial_ = molr1*cpPolynomial_ - molr2*pt.cpPolynomial_; dhPolynomial_ = molr1*dhPolynomial_ - molr2*pt.dhPolynomial_; - sPolynomial_ = molr1*sPolynomial_ - molr2*pt.sPolynomial_; + dsPolynomial_ = molr1*dsPolynomial_ - molr2*pt.dsPolynomial_; } @@ -184,7 +187,7 @@ inline Foam::hPolynomialThermo<EquationOfState, PolySize> Foam::operator+ molr1*pt1.Sf_ + molr2*pt2.Sf_, molr1*pt1.cpPolynomial_ + molr2*pt2.cpPolynomial_, molr1*pt1.dhPolynomial_ + molr2*pt2.dhPolynomial_, - molr1*pt1.sPolynomial_ + molr2*pt2.sPolynomial_ + molr1*pt1.dsPolynomial_ + molr2*pt2.dsPolynomial_ ); } @@ -211,7 +214,7 @@ inline Foam::hPolynomialThermo<EquationOfState, PolySize> Foam::operator- molr1*pt1.Sf_ - molr2*pt2.Sf_, molr1*pt1.cpPolynomial_ - molr2*pt2.cpPolynomial_, molr1*pt1.dhPolynomial_ - molr2*pt2.dhPolynomial_, - molr1*pt1.sPolynomial_ - molr2*pt2.sPolynomial_ + molr1*pt1.dsPolynomial_ - molr2*pt2.dsPolynomial_ ); } @@ -230,7 +233,7 @@ inline Foam::hPolynomialThermo<EquationOfState, PolySize> Foam::operator* pt.Sf_, pt.cpPolynomial_, pt.dhPolynomial_, - pt.sPolynomial_ + pt.dsPolynomial_ ); }