added offset to enthalpy poly (ref h at Tstd) and renamed s poly to ds

This commit is contained in:
andy
2009-10-21 17:52:27 +01:00
parent 3ac2b9388a
commit e0216666c3
3 changed files with 26 additions and 20 deletions

View File

@ -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
(

View File

@ -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
);

View File

@ -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_
);
}