STYLE: Updated poly thermo naming conventions

This commit is contained in:
andy
2010-10-18 13:03:44 +01:00
parent d98c5f9b24
commit a732cb54d9
12 changed files with 194 additions and 292 deletions

View File

@ -37,9 +37,9 @@ template<int PolySize>
icoPolynomial<PolySize>::icoPolynomial(Istream& is) icoPolynomial<PolySize>::icoPolynomial(Istream& is)
: :
specie(is), specie(is),
rhoPolynomial_("rhoPolynomial", is) rhoCoeffs_("rhoCoeffs<" + Foam::name(PolySize) + '>', is)
{ {
rhoPolynomial_ *= this->W(); rhoCoeffs_ *= this->W();
} }
@ -47,9 +47,9 @@ template<int PolySize>
icoPolynomial<PolySize>::icoPolynomial(const dictionary& dict) icoPolynomial<PolySize>::icoPolynomial(const dictionary& dict)
: :
specie(dict), specie(dict),
rhoPolynomial_(dict.lookup("rhoPolynomial")) rhoCoeffs_(dict.lookup("rhoCoeffs<" + Foam::name(PolySize) + '>'))
{ {
rhoPolynomial_ *= this->W(); rhoCoeffs_ *= this->W();
} }
@ -59,8 +59,8 @@ template<int PolySize>
void icoPolynomial<PolySize>::write(Ostream& os) const void icoPolynomial<PolySize>::write(Ostream& os) const
{ {
specie::write(os); specie::write(os);
os.writeKeyword("rhoPolynomial") << rhoPolynomial_/this->W() os.writeKeyword(word("rhoCoeffs<" + Foam::name(PolySize) + '>'))
<< token::END_STATEMENT << nl; << rhoCoeffs_/this->W() << token::END_STATEMENT << nl;
} }
@ -70,7 +70,8 @@ template<int PolySize>
Ostream& operator<<(Ostream& os, const icoPolynomial<PolySize>& ip) Ostream& operator<<(Ostream& os, const icoPolynomial<PolySize>& ip)
{ {
os << static_cast<const specie&>(ip) << tab os << static_cast<const specie&>(ip) << tab
<< "rhoPolynomial" << tab << ip.rhoPolynomial_/ip.W(); << "rhoCoeffs<" << Foam::name(PolySize) << '>' << tab
<< ip.rhoCoeffs_/ip.W();
os.check os.check
( (

View File

@ -98,9 +98,9 @@ class icoPolynomial
{ {
// Private data // Private data
//- Density //- Density polynomial coefficients
// Note: input in [kg/m3], but internally uses [kg/m3/kmol] // Note: input in [kg/m3], but internally uses [kg/m3/kmol]
Polynomial<PolySize> rhoPolynomial_; Polynomial<PolySize> rhoCoeffs_;
public: public:

View File

@ -31,11 +31,11 @@ template<int PolySize>
inline Foam::icoPolynomial<PolySize>::icoPolynomial inline Foam::icoPolynomial<PolySize>::icoPolynomial
( (
const specie& sp, const specie& sp,
const Polynomial<PolySize>& rhoPoly const Polynomial<PolySize>& rhoCoeffs
) )
: :
specie(sp), specie(sp),
rhoPolynomial_(rhoPoly) rhoCoeffs_(rhoCoeffs)
{} {}
@ -48,7 +48,7 @@ inline Foam::icoPolynomial<PolySize>::icoPolynomial
) )
: :
specie(ip), specie(ip),
rhoPolynomial_(ip.rhoPolynomial_) rhoCoeffs_(ip.rhoCoeffs_)
{} {}
@ -60,7 +60,7 @@ inline Foam::icoPolynomial<PolySize>::icoPolynomial
) )
: :
specie(name, ip), specie(name, ip),
rhoPolynomial_(ip.rhoPolynomial_) rhoCoeffs_(ip.rhoCoeffs_)
{} {}
@ -99,7 +99,7 @@ Foam::icoPolynomial<PolySize>::New(const dictionary& dict)
template<int PolySize> template<int PolySize>
inline Foam::scalar Foam::icoPolynomial<PolySize>::rho(scalar, scalar T) const inline Foam::scalar Foam::icoPolynomial<PolySize>::rho(scalar, scalar T) const
{ {
return rhoPolynomial_.evaluate(T)/this->W(); return rhoCoeffs_.evaluate(T)/this->W();
} }
@ -127,7 +127,7 @@ inline Foam::icoPolynomial<PolySize>& Foam::icoPolynomial<PolySize>::operator=
{ {
specie::operator=(ip); specie::operator=(ip);
rhoPolynomial_ = ip.rhoPolynomial_; rhoCoeffs_ = ip.rhoCoeffs_;
return *this; return *this;
} }
@ -146,7 +146,7 @@ inline void Foam::icoPolynomial<PolySize>::operator+=
molr1 /= this->nMoles(); molr1 /= this->nMoles();
scalar molr2 = ip.nMoles()/this->nMoles(); scalar molr2 = ip.nMoles()/this->nMoles();
rhoPolynomial_ = molr1*rhoPolynomial_ + molr2*ip.rhoPolynomial_; rhoCoeffs_ = molr1*rhoCoeffs_ + molr2*ip.rhoCoeffs_;
} }
@ -163,7 +163,7 @@ inline void Foam::icoPolynomial<PolySize>::operator-=
molr1 /= this->nMoles(); molr1 /= this->nMoles();
scalar molr2 = ip.nMoles()/this->nMoles(); scalar molr2 = ip.nMoles()/this->nMoles();
rhoPolynomial_ = molr1*rhoPolynomial_ - molr2*ip.rhoPolynomial_; rhoCoeffs_ = molr1*rhoCoeffs_ - molr2*ip.rhoCoeffs_;
} }
@ -191,7 +191,7 @@ Foam::icoPolynomial<PolySize> Foam::operator+
( (
static_cast<const specie&>(ip1) static_cast<const specie&>(ip1)
+ static_cast<const specie&>(ip2), + static_cast<const specie&>(ip2),
molr1*ip1.rhoPolynomial_ + molr2*ip2.rhoPolynomial_ molr1*ip1.rhoCoeffs_ + molr2*ip2.rhoCoeffs_
); );
} }
@ -211,7 +211,7 @@ Foam::icoPolynomial<PolySize> Foam::operator-
( (
static_cast<const specie&>(ip1) static_cast<const specie&>(ip1)
- static_cast<const specie&>(ip2), - static_cast<const specie&>(ip2),
molr1*ip1.rhoPolynomial_ - molr2*ip2.rhoPolynomial_ molr1*ip1.rhoCoeffs_ - molr2*ip2.rhoCoeffs_
); );
} }
@ -226,7 +226,7 @@ Foam::icoPolynomial<PolySize> Foam::operator*
return icoPolynomial<PolySize> return icoPolynomial<PolySize>
( (
s*static_cast<const specie&>(ip), s*static_cast<const specie&>(ip),
ip.rhoPolynomial_ ip.rhoCoeffs_
); );
} }

View File

@ -37,22 +37,22 @@ Foam::hPolynomialThermo<EquationOfState, PolySize>::hPolynomialThermo
EquationOfState(is), EquationOfState(is),
Hf_(readScalar(is)), Hf_(readScalar(is)),
Sf_(readScalar(is)), Sf_(readScalar(is)),
cpPolynomial_("cpPolynomial", is), CpCoeffs_("CpCoeffs<" + Foam::name(PolySize) + '>', is),
hPolynomial_(), hCoeffs_(),
sPolynomial_() sCoeffs_()
{ {
Hf_ *= this->W(); Hf_ *= this->W();
Sf_ *= this->W(); Sf_ *= this->W();
cpPolynomial_ *= this->W(); CpCoeffs_ *= this->W();
hPolynomial_ = cpPolynomial_.integrate(); hCoeffs_ = CpCoeffs_.integrate();
sPolynomial_ = cpPolynomial_.integrateMinus1(); sCoeffs_ = CpCoeffs_.integrateMinus1();
// Offset h poly so that it is relative to the enthalpy at Tstd // Offset h poly so that it is relative to the enthalpy at Tstd
hPolynomial_[0] += Hf_ - hPolynomial_.evaluate(specie::Tstd); hCoeffs_[0] += Hf_ - hCoeffs_.evaluate(specie::Tstd);
// Offset s poly so that it is relative to the entropy at Tstd // Offset s poly so that it is relative to the entropy at Tstd
sPolynomial_[0] += Sf_ - sPolynomial_.evaluate(specie::Tstd); sCoeffs_[0] += Sf_ - sCoeffs_.evaluate(specie::Tstd);
} }
@ -65,22 +65,22 @@ Foam::hPolynomialThermo<EquationOfState, PolySize>::hPolynomialThermo
EquationOfState(dict), EquationOfState(dict),
Hf_(readScalar(dict.lookup("Hf"))), Hf_(readScalar(dict.lookup("Hf"))),
Sf_(readScalar(dict.lookup("Sf"))), Sf_(readScalar(dict.lookup("Sf"))),
cpPolynomial_(dict.lookup("cpPolynomial")), CpCoeffs_(dict.lookup("CpCoeffs<" + Foam::name(PolySize) + '>')),
hPolynomial_(), hCoeffs_(),
sPolynomial_() sCoeffs_()
{ {
Hf_ *= this->W(); Hf_ *= this->W();
Sf_ *= this->W(); Sf_ *= this->W();
cpPolynomial_ *= this->W(); CpCoeffs_ *= this->W();
hPolynomial_ = cpPolynomial_.integrate(); hCoeffs_ = CpCoeffs_.integrate();
sPolynomial_ = cpPolynomial_.integrateMinus1(); sCoeffs_ = CpCoeffs_.integrateMinus1();
// Offset h poly so that it is relative to the enthalpy at Tstd // Offset h poly so that it is relative to the enthalpy at Tstd
hPolynomial_[0] += Hf_ - hPolynomial_.evaluate(specie::Tstd); hCoeffs_[0] += Hf_ - hCoeffs_.evaluate(specie::Tstd);
// Offset s poly so that it is relative to the entropy at Tstd // Offset s poly so that it is relative to the entropy at Tstd
sPolynomial_[0] += Sf_ - sPolynomial_.evaluate(specie::Tstd); sCoeffs_[0] += Sf_ - sCoeffs_.evaluate(specie::Tstd);
} }
@ -95,8 +95,8 @@ void Foam::hPolynomialThermo<EquationOfState, PolySize>::write
EquationOfState::write(os); EquationOfState::write(os);
os.writeKeyword("Hf") << Hf_/this->W() << token::END_STATEMENT << nl; os.writeKeyword("Hf") << Hf_/this->W() << token::END_STATEMENT << nl;
os.writeKeyword("Sf") << Sf_/this->W() << token::END_STATEMENT << nl; os.writeKeyword("Sf") << Sf_/this->W() << token::END_STATEMENT << nl;
os.writeKeyword("cpPolynomial") << cpPolynomial_/this->W() os.writeKeyword(word("CpCoeffs<" + Foam::name(PolySize) + '>'))
<< token::END_STATEMENT << nl; << CpCoeffs_/this->W() << token::END_STATEMENT << nl;
} }
@ -112,7 +112,8 @@ Foam::Ostream& Foam::operator<<
os << static_cast<const EquationOfState&>(pt) << tab os << static_cast<const EquationOfState&>(pt) << tab
<< pt.Hf_/pt.W() << tab << pt.Hf_/pt.W() << tab
<< pt.Sf_/pt.W() << tab << pt.Sf_/pt.W() << tab
<< "cpPolynomial" << tab << pt.cpPolynomial_/pt.W(); << "CpCoeffs<" << Foam::name(PolySize) << '>' << tab
<< pt.CpCoeffs_/pt.W();
os.check os.check
( (

View File

@ -107,14 +107,15 @@ class hPolynomialThermo
// Note: input in [J/kg/K], but internally uses [J/kmol/K] // Note: input in [J/kg/K], but internally uses [J/kmol/K]
scalar Sf_; scalar Sf_;
//- Specific heat at constant pressure [J/(kg.K)] //- Specific heat at constant pressure polynomial coeffs [J/(kg.K)]
Polynomial<PolySize> cpPolynomial_; Polynomial<PolySize> CpCoeffs_;
//- Enthalpy - derived from cp [J/kg] - relative to Tstd //- Enthalpy polynomial coeffs - derived from cp [J/kg]
typename Polynomial<PolySize>::intPolyType hPolynomial_; // NOTE: relative to Tstd
typename Polynomial<PolySize>::intPolyType hCoeffs_;
//- Entropy - derived from cp [J/(kg.K)] - relative to Tstd //- Entropy - derived from Cp [J/(kg.K)] - relative to Tstd
Polynomial<PolySize> sPolynomial_; Polynomial<PolySize> sCoeffs_;
// Private Member Functions // Private Member Functions
@ -125,9 +126,9 @@ class hPolynomialThermo
const EquationOfState& pt, const EquationOfState& pt,
const scalar Hf, const scalar Hf,
const scalar Sf, const scalar Sf,
const Polynomial<PolySize>& cpPoly, const Polynomial<PolySize>& CpCoeffs,
const typename Polynomial<PolySize>::intPolyType& hPoly, const typename Polynomial<PolySize>::intPolyType& hCoeffs,
const Polynomial<PolySize>& sPoly const Polynomial<PolySize>& sCoeffs
); );

View File

@ -33,17 +33,17 @@ inline Foam::hPolynomialThermo<EquationOfState, PolySize>::hPolynomialThermo
const EquationOfState& pt, const EquationOfState& pt,
const scalar Hf, const scalar Hf,
const scalar Sf, const scalar Sf,
const Polynomial<PolySize>& cpPoly, const Polynomial<PolySize>& CpCoeffs,
const typename Polynomial<PolySize>::intPolyType& hPoly, const typename Polynomial<PolySize>::intPolyType& hCoeffs,
const Polynomial<PolySize>& sPoly const Polynomial<PolySize>& sCoeffs
) )
: :
EquationOfState(pt), EquationOfState(pt),
Hf_(Hf), Hf_(Hf),
Sf_(Sf), Sf_(Sf),
cpPolynomial_(cpPoly), CpCoeffs_(CpCoeffs),
hPolynomial_(hPoly), hCoeffs_(hCoeffs),
sPolynomial_(sPoly) sCoeffs_(sCoeffs)
{} {}
@ -58,9 +58,9 @@ inline Foam::hPolynomialThermo<EquationOfState, PolySize>::hPolynomialThermo
EquationOfState(pt), EquationOfState(pt),
Hf_(pt.Hf_), Hf_(pt.Hf_),
Sf_(pt.Sf_), Sf_(pt.Sf_),
cpPolynomial_(pt.cpPolynomial_), CpCoeffs_(pt.CpCoeffs_),
hPolynomial_(pt.hPolynomial_), hCoeffs_(pt.hCoeffs_),
sPolynomial_(pt.sPolynomial_) sCoeffs_(pt.sCoeffs_)
{} {}
@ -74,9 +74,9 @@ inline Foam::hPolynomialThermo<EquationOfState, PolySize>::hPolynomialThermo
EquationOfState(name, pt), EquationOfState(name, pt),
Hf_(pt.Hf_), Hf_(pt.Hf_),
Sf_(pt.Sf_), Sf_(pt.Sf_),
cpPolynomial_(pt.cpPolynomial_), CpCoeffs_(pt.CpCoeffs_),
hPolynomial_(pt.hPolynomial_), hCoeffs_(pt.hCoeffs_),
sPolynomial_(pt.sPolynomial_) sCoeffs_(pt.sCoeffs_)
{} {}
@ -88,7 +88,7 @@ inline Foam::scalar Foam::hPolynomialThermo<EquationOfState, PolySize>::cp
const scalar T const scalar T
) const ) const
{ {
return cpPolynomial_.evaluate(T); return CpCoeffs_.evaluate(T);
} }
@ -98,7 +98,7 @@ inline Foam::scalar Foam::hPolynomialThermo<EquationOfState, PolySize>::h
const scalar T const scalar T
) const ) const
{ {
return hPolynomial_.evaluate(T); return hCoeffs_.evaluate(T);
} }
@ -126,7 +126,7 @@ inline Foam::scalar Foam::hPolynomialThermo<EquationOfState, PolySize>::s
const scalar T const scalar T
) const ) const
{ {
return sPolynomial_.evaluate(T); return sCoeffs_.evaluate(T);
} }
@ -143,9 +143,9 @@ Foam::hPolynomialThermo<EquationOfState, PolySize>::operator=
Hf_ = pt.Hf_; Hf_ = pt.Hf_;
Sf_ = pt.Sf_; Sf_ = pt.Sf_;
cpPolynomial_ = pt.cpPolynomial_; CpCoeffs_ = pt.CpCoeffs_;
hPolynomial_ = pt.hPolynomial_; hCoeffs_ = pt.hCoeffs_;
sPolynomial_ = pt.sPolynomial_; sCoeffs_ = pt.sCoeffs_;
return *this; return *this;
} }
@ -166,9 +166,9 @@ inline void Foam::hPolynomialThermo<EquationOfState, PolySize>::operator+=
Hf_ = molr1*Hf_ + molr2*pt.Hf_; Hf_ = molr1*Hf_ + molr2*pt.Hf_;
Sf_ = molr1*Sf_ + molr2*pt.Sf_; Sf_ = molr1*Sf_ + molr2*pt.Sf_;
cpPolynomial_ = molr1*cpPolynomial_ + molr2*pt.cpPolynomial_; CpCoeffs_ = molr1*CpCoeffs_ + molr2*pt.CpCoeffs_;
hPolynomial_ = molr1*hPolynomial_ + molr2*pt.hPolynomial_; hCoeffs_ = molr1*hCoeffs_ + molr2*pt.hCoeffs_;
sPolynomial_ = molr1*sPolynomial_ + molr2*pt.sPolynomial_; sCoeffs_ = molr1*sCoeffs_ + molr2*pt.sCoeffs_;
} }
@ -187,9 +187,9 @@ inline void Foam::hPolynomialThermo<EquationOfState, PolySize>::operator-=
Hf_ = molr1*Hf_ - molr2*pt.Hf_; Hf_ = molr1*Hf_ - molr2*pt.Hf_;
Sf_ = molr1*Sf_ - molr2*pt.Sf_; Sf_ = molr1*Sf_ - molr2*pt.Sf_;
cpPolynomial_ = molr1*cpPolynomial_ - molr2*pt.cpPolynomial_; CpCoeffs_ = molr1*CpCoeffs_ - molr2*pt.CpCoeffs_;
hPolynomial_ = molr1*hPolynomial_ - molr2*pt.hPolynomial_; hCoeffs_ = molr1*hCoeffs_ - molr2*pt.hCoeffs_;
sPolynomial_ = molr1*sPolynomial_ - molr2*pt.sPolynomial_; sCoeffs_ = molr1*sCoeffs_ - molr2*pt.sCoeffs_;
} }
@ -223,9 +223,9 @@ inline Foam::hPolynomialThermo<EquationOfState, PolySize> Foam::operator+
eofs, eofs,
molr1*pt1.Hf_ + molr2*pt2.Hf_, molr1*pt1.Hf_ + molr2*pt2.Hf_,
molr1*pt1.Sf_ + molr2*pt2.Sf_, molr1*pt1.Sf_ + molr2*pt2.Sf_,
molr1*pt1.cpPolynomial_ + molr2*pt2.cpPolynomial_, molr1*pt1.CpCoeffs_ + molr2*pt2.CpCoeffs_,
molr1*pt1.hPolynomial_ + molr2*pt2.hPolynomial_, molr1*pt1.hCoeffs_ + molr2*pt2.hCoeffs_,
molr1*pt1.sPolynomial_ + molr2*pt2.sPolynomial_ molr1*pt1.sCoeffs_ + molr2*pt2.sCoeffs_
); );
} }
@ -248,9 +248,9 @@ inline Foam::hPolynomialThermo<EquationOfState, PolySize> Foam::operator-
eofs, eofs,
molr1*pt1.Hf_ - molr2*pt2.Hf_, molr1*pt1.Hf_ - molr2*pt2.Hf_,
molr1*pt1.Sf_ - molr2*pt2.Sf_, molr1*pt1.Sf_ - molr2*pt2.Sf_,
molr1*pt1.cpPolynomial_ - molr2*pt2.cpPolynomial_, molr1*pt1.CpCoeffs_ - molr2*pt2.CpCoeffs_,
molr1*pt1.hPolynomial_ - molr2*pt2.hPolynomial_, molr1*pt1.hCoeffs_ - molr2*pt2.hCoeffs_,
molr1*pt1.sPolynomial_ - molr2*pt2.sPolynomial_ molr1*pt1.sCoeffs_ - molr2*pt2.sCoeffs_
); );
} }
@ -267,9 +267,9 @@ inline Foam::hPolynomialThermo<EquationOfState, PolySize> Foam::operator*
s*static_cast<const EquationOfState&>(pt), s*static_cast<const EquationOfState&>(pt),
pt.Hf_, pt.Hf_,
pt.Sf_, pt.Sf_,
pt.cpPolynomial_, pt.CpCoeffs_,
pt.hPolynomial_, pt.hCoeffs_,
pt.sPolynomial_ pt.sCoeffs_
); );
} }

View File

@ -32,11 +32,11 @@ template<class Thermo, int PolySize>
Foam::polynomialTransport<Thermo, PolySize>::polynomialTransport(Istream& is) Foam::polynomialTransport<Thermo, PolySize>::polynomialTransport(Istream& is)
: :
Thermo(is), Thermo(is),
muPolynomial_("muPolynomial", is), muCoeffs_("muCoeffs<" + Foam::name(PolySize) + '>', is),
kappaPolynomial_("kappaPolynomial", is) kappaCoeffs_("kappaCoeffs<" + Foam::name(PolySize) + '>', is)
{ {
muPolynomial_ *= this->W(); muCoeffs_ *= this->W();
kappaPolynomial_ *= this->W(); kappaCoeffs_ *= this->W();
} }
@ -47,11 +47,11 @@ Foam::polynomialTransport<Thermo, PolySize>::polynomialTransport
) )
: :
Thermo(dict), Thermo(dict),
muPolynomial_(dict.lookup("muPolynomial")), muCoeffs_(dict.lookup("muCoeffs<" + Foam::name(PolySize) + '>')),
kappaPolynomial_(dict.lookup("kappaPolynomial")) kappaCoeffs_(dict.lookup("kappaCoeffs<" + Foam::name(PolySize) + '>'))
{ {
muPolynomial_ *= this->W(); muCoeffs_ *= this->W();
kappaPolynomial_ *= this->W(); kappaCoeffs_ *= this->W();
} }
@ -63,10 +63,10 @@ void Foam::polynomialTransport<Thermo, PolySize>::write(Ostream& os) const
os << this->name() << endl; os << this->name() << endl;
os << token::BEGIN_BLOCK << incrIndent << nl; os << token::BEGIN_BLOCK << incrIndent << nl;
Thermo::write(os); Thermo::write(os);
os.writeKeyword("muPolynomial") << muPolynomial_/this->W() os.writeKeyword(word("muCoeffs<" + Foam::name(PolySize) + '>'))
<< token::END_STATEMENT << nl; << muCoeffs_/this->W() << token::END_STATEMENT << nl;
os.writeKeyword("kappaPolynomial") << kappaPolynomial_/this->W() os.writeKeyword(word("kappaCoeffs<" + Foam::name(PolySize) + '>'))
<< token::END_STATEMENT << nl; << kappaCoeffs_/this->W() << token::END_STATEMENT << nl;
os << decrIndent << token::END_BLOCK << nl; os << decrIndent << token::END_BLOCK << nl;
} }
@ -81,8 +81,10 @@ Foam::Ostream& Foam::operator<<
) )
{ {
os << static_cast<const Thermo&>(pt) << tab os << static_cast<const Thermo&>(pt) << tab
<< "muPolynomial" << tab << pt.muPolynomial_/pt.W() << tab << "muCoeffs<" << Foam::name(PolySize) << '>' << tab
<< "kappaPolynomial" << tab << pt.kappaPolynomial_/pt.W(); << pt.muCoeffs_/pt.W() << tab
<< "kappaCoeffs<" << Foam::name(PolySize) << '>' << tab
<< pt.kappaCoeffs_/pt.W();
os.check os.check
( (

View File

@ -94,13 +94,13 @@ class polynomialTransport
{ {
// Private data // Private data
//- Dynamic viscosity //- Dynamic viscosity polynomial coefficients
// Note: input in [Pa.s], but internally uses [Pa.s/kmol] // Note: input in [Pa.s], but internally uses [Pa.s/kmol]
Polynomial<PolySize> muPolynomial_; Polynomial<PolySize> muCoeffs_;
//- Thermal conductivity //- Thermal conductivity polynomial coefficients
// Note: input in [W/m/K], but internally uses [W/m/K/kmol] // Note: input in [W/m/K], but internally uses [W/m/K/kmol]
Polynomial<PolySize> kappaPolynomial_; Polynomial<PolySize> kappaCoeffs_;
// Private Member Functions // Private Member Functions

View File

@ -34,8 +34,8 @@ inline Foam::polynomialTransport<Thermo, PolySize>::polynomialTransport
) )
: :
Thermo(pt), Thermo(pt),
muPolynomial_(pt.muPolynomial_), muCoeffs_(pt.muCoeffs_),
kappaPolynomial_(pt.kappaPolynomial_) kappaCoeffs_(pt.kappaCoeffs_)
{} {}
@ -43,13 +43,13 @@ template<class Thermo, int PolySize>
inline Foam::polynomialTransport<Thermo, PolySize>::polynomialTransport inline Foam::polynomialTransport<Thermo, PolySize>::polynomialTransport
( (
const Thermo& t, const Thermo& t,
const Polynomial<PolySize>& muPoly, const Polynomial<PolySize>& muCoeffs,
const Polynomial<PolySize>& kappaPoly const Polynomial<PolySize>& kappaCoeffs
) )
: :
Thermo(t), Thermo(t),
muPolynomial_(muPoly), muCoeffs_(muCoeffs),
kappaPolynomial_(kappaPoly) kappaCoeffs_(kappaCoeffs)
{} {}
@ -61,8 +61,8 @@ inline Foam::polynomialTransport<Thermo, PolySize>::polynomialTransport
) )
: :
Thermo(name, pt), Thermo(name, pt),
muPolynomial_(pt.muPolynomial_), muCoeffs_(pt.muCoeffs_),
kappaPolynomial_(pt.kappaPolynomial_) kappaCoeffs_(pt.kappaCoeffs_)
{} {}
@ -107,7 +107,7 @@ inline Foam::scalar Foam::polynomialTransport<Thermo, PolySize>::mu
const scalar T const scalar T
) const ) const
{ {
return muPolynomial_.evaluate(T)/this->W(); return muCoeffs_.evaluate(T)/this->W();
} }
@ -117,7 +117,7 @@ inline Foam::scalar Foam::polynomialTransport<Thermo, PolySize>::kappa
const scalar T const scalar T
) const ) const
{ {
return kappaPolynomial_.evaluate(T)/this->W(); return kappaCoeffs_.evaluate(T)/this->W();
} }
@ -147,8 +147,8 @@ Foam::polynomialTransport<Thermo, PolySize>::operator=
{ {
Thermo::operator=(pt); Thermo::operator=(pt);
muPolynomial_ = pt.muPolynomial_; muCoeffs_ = pt.muCoeffs_;
kappaPolynomial_ = pt.kappaPolynomial_; kappaCoeffs_ = pt.kappaCoeffs_;
return *this; return *this;
} }
@ -167,8 +167,8 @@ inline void Foam::polynomialTransport<Thermo, PolySize>::operator+=
molr1 /= this->nMoles(); molr1 /= this->nMoles();
scalar molr2 = pt.nMoles()/this->nMoles(); scalar molr2 = pt.nMoles()/this->nMoles();
muPolynomial_ = molr1*muPolynomial_ + molr2*pt.muPolynomial_; muCoeffs_ = molr1*muCoeffs_ + molr2*pt.muCoeffs_;
kappaPolynomial_ = molr1*kappaPolynomial_ + molr2*pt.kappaPolynomial_; kappaCoeffs_ = molr1*kappaCoeffs_ + molr2*pt.kappaCoeffs_;
} }
@ -185,8 +185,8 @@ inline void Foam::polynomialTransport<Thermo, PolySize>::operator-=
molr1 /= this->nMoles(); molr1 /= this->nMoles();
scalar molr2 = pt.nMoles()/this->nMoles(); scalar molr2 = pt.nMoles()/this->nMoles();
muPolynomial_ = molr1*muPolynomial_ - molr2*pt.muPolynomial_; muCoeffs_ = molr1*muCoeffs_ - molr2*pt.muCoeffs_;
kappaPolynomial_ = molr1*kappaPolynomial_ - molr2*pt.kappaPolynomial_; kappaCoeffs_ = molr1*kappaCoeffs_ - molr2*pt.kappaCoeffs_;
} }
@ -220,8 +220,8 @@ inline Foam::polynomialTransport<Thermo, PolySize> Foam::operator+
return polynomialTransport<Thermo, PolySize> return polynomialTransport<Thermo, PolySize>
( (
t, t,
molr1*pt1.muPolynomial_ + molr2*pt2.muPolynomial_, molr1*pt1.muCoeffs_ + molr2*pt2.muCoeffs_,
molr1*pt1.kappaPolynomial_ + molr2*pt2.kappaPolynomial_ molr1*pt1.kappaCoeffs_ + molr2*pt2.kappaCoeffs_
); );
} }
@ -244,8 +244,8 @@ inline Foam::polynomialTransport<Thermo, PolySize> Foam::operator-
return polynomialTransport<Thermo, PolySize> return polynomialTransport<Thermo, PolySize>
( (
t, t,
molr1*pt1.muPolynomial_ - molr2*pt2.muPolynomial_, molr1*pt1.muCoeffs_ - molr2*pt2.muCoeffs_,
molr1*pt1.kappaPolynomial_ - molr2*pt2.kappaPolynomial_ molr1*pt1.kappaCoeffs_ - molr2*pt2.kappaCoeffs_
); );
} }
@ -260,8 +260,8 @@ inline Foam::polynomialTransport<Thermo, PolySize> Foam::operator*
return polynomialTransport<Thermo, PolySize> return polynomialTransport<Thermo, PolySize>
( (
s*static_cast<const Thermo&>(pt), s*static_cast<const Thermo&>(pt),
pt.muPolynomial_, pt.muCoeffs_,
pt.kappaPolynomial_ pt.kappaCoeffs_
); );
} }

View File

@ -21,10 +21,10 @@ N2
molWeight 28.0134; molWeight 28.0134;
Hf 0; Hf 0;
Sf 0; Sf 0;
rhoPolynomial ( 3.8936 -0.016463 3.2101e-05 -2.9174e-08 9.9889e-12 0 0 0 ); rhoCoeffs<8> ( 3.8936 -0.016463 3.2101e-05 -2.9174e-08 9.9889e-12 0 0 0 );
cpPolynomial ( 979.08 0.41787 -0.0011761 1.6742e-06 -7.2559e-10 0 0 0 ); CpCoeffs<8> ( 979.08 0.41787 -0.0011761 1.6742e-06 -7.2559e-10 0 0 0 );
muPolynomial ( 1.5068e-06 6.1598e-08 -1.8188e-11 0 0 0 0 0 ); muCoeffs<8> ( 1.5068e-06 6.1598e-08 -1.8188e-11 0 0 0 0 0 );
kappaPolynomial ( 0.0031494 8.4997e-05 -1.2621e-08 0 0 0 0 0 ); kappaCoeffs<8> ( 0.0031494 8.4997e-05 -1.2621e-08 0 0 0 0 0 );
} }
O2 O2
@ -33,10 +33,10 @@ O2
molWeight 31.9988; molWeight 31.9988;
Hf 0; Hf 0;
Sf 0; Sf 0;
rhoPolynomial ( 4.4475 -0.018805 3.6667e-05 -3.3323e-08 1.141e-11 0 0 0 ); rhoCoeffs<8> ( 4.4475 -0.018805 3.6667e-05 -3.3323e-08 1.141e-11 0 0 0 );
cpPolynomial ( 834.84 0.29297 -0.00014959 3.4143e-07 -2.2786e-10 0 0 0 ); CpCoeffs<8> ( 834.84 0.29297 -0.00014959 3.4143e-07 -2.2786e-10 0 0 0 );
muPolynomial ( 1.5068e-06 6.1598e-08 -1.8188e-11 0 0 0 0 0 ); muCoeffs<8> ( 1.5068e-06 6.1598e-08 -1.8188e-11 0 0 0 0 0 );
kappaPolynomial ( 0.00016082 8.5301e-05 -1.4998e-08 0 0 0 0 0 ); kappaCoeffs<8> ( 0.00016082 8.5301e-05 -1.4998e-08 0 0 0 0 0 );
} }
H2O H2O
@ -45,10 +45,10 @@ H2O
molWeight 18.0153; molWeight 18.0153;
Hf -13423000; Hf -13423000;
Sf 10482; Sf 10482;
rhoPolynomial ( 2.5039 -0.010587 2.0643e-05 -1.8761e-08 6.4237e-12 0 0 0 ); rhoCoeffs<8> ( 2.5039 -0.010587 2.0643e-05 -1.8761e-08 6.4237e-12 0 0 0 );
cpPolynomial ( 1563.1 1.604 -0.0029334 3.2168e-06 -1.1571e-09 0 0 0 ); CpCoeffs<8> ( 1563.1 1.604 -0.0029334 3.2168e-06 -1.1571e-09 0 0 0 );
muPolynomial ( 1.5068e-06 6.1598e-08 -1.8188e-11 0 0 0 0 0 ); muCoeffs<8> ( 1.5068e-06 6.1598e-08 -1.8188e-11 0 0 0 0 0 );
kappaPolynomial ( 0.0037972 0.00015336 -1.1859e-08 0 0 0 0 0 ); kappaCoeffs<8> ( 0.0037972 0.00015336 -1.1859e-08 0 0 0 0 0 );
} }
air air
@ -57,10 +57,10 @@ air
molWeight 28.85; molWeight 28.85;
Hf 0; Hf 0;
Sf 0; Sf 0;
rhoPolynomial ( 4.0097 -0.016954 3.3057e-05 -3.0042e-08 1.0286e-11 0 0 0 ); rhoCoeffs<8> ( 4.0097 -0.016954 3.3057e-05 -3.0042e-08 1.0286e-11 0 0 0 );
cpPolynomial ( 948.76 0.39171 -0.00095999 1.393e-06 -6.2029e-10 0 0 0 ); CpCoeffs<8> ( 948.76 0.39171 -0.00095999 1.393e-06 -6.2029e-10 0 0 0 );
muPolynomial ( 1.5061e-06 6.16e-08 -1.819e-11 0 0 0 0 0 ); muCoeffs<8> ( 1.5061e-06 6.16e-08 -1.819e-11 0 0 0 0 0 );
kappaPolynomial ( 0.0025219 8.506e-05 -1.312e-08 0 0 0 0 0 ); kappaCoeffs<8> ( 0.0025219 8.506e-05 -1.312e-08 0 0 0 0 0 );
} }

View File

@ -21,10 +21,10 @@ N2
molWeight 28.0134; molWeight 28.0134;
Hf 0; Hf 0;
Sf 0; Sf 0;
rhoPolynomial ( 3.8936 -0.016463 3.2101e-05 -2.9174e-08 9.9889e-12 0 0 0 ); rhoCoeffs<8> ( 3.8936 -0.016463 3.2101e-05 -2.9174e-08 9.9889e-12 0 0 0 );
cpPolynomial ( 979.08 0.41787 -0.0011761 1.6742e-06 -7.2559e-10 0 0 0 ); CpCoeffs<8> ( 979.08 0.41787 -0.0011761 1.6742e-06 -7.2559e-10 0 0 0 );
muPolynomial ( 1.5068e-06 6.1598e-08 -1.8188e-11 0 0 0 0 0 ); muCoeffs<8> ( 1.5068e-06 6.1598e-08 -1.8188e-11 0 0 0 0 0 );
kappaPolynomial ( 0.0031494 8.4997e-05 -1.2621e-08 0 0 0 0 0 ); kappaCoeffs<8> ( 0.0031494 8.4997e-05 -1.2621e-08 0 0 0 0 0 );
} }
O2 O2
@ -33,10 +33,10 @@ O2
molWeight 31.9988; molWeight 31.9988;
Hf 0; Hf 0;
Sf 0; Sf 0;
rhoPolynomial ( 4.4475 -0.018805 3.6667e-05 -3.3323e-08 1.141e-11 0 0 0 ); rhoCoeffs<8> ( 4.4475 -0.018805 3.6667e-05 -3.3323e-08 1.141e-11 0 0 0 );
cpPolynomial ( 834.84 0.29297 -0.00014959 3.4143e-07 -2.2786e-10 0 0 0 ); CpCoeffs<8> ( 834.84 0.29297 -0.00014959 3.4143e-07 -2.2786e-10 0 0 0 );
muPolynomial ( 1.5068e-06 6.1598e-08 -1.8188e-11 0 0 0 0 0 ); muCoeffs<8> ( 1.5068e-06 6.1598e-08 -1.8188e-11 0 0 0 0 0 );
kappaPolynomial ( 0.00016082 8.5301e-05 -1.4998e-08 0 0 0 0 0 ); kappaCoeffs<8> ( 0.00016082 8.5301e-05 -1.4998e-08 0 0 0 0 0 );
} }
H2O H2O
@ -45,10 +45,10 @@ H2O
molWeight 18.0153; molWeight 18.0153;
Hf -13423000; Hf -13423000;
Sf 10482; Sf 10482;
rhoPolynomial ( 2.5039 -0.010587 2.0643e-05 -1.8761e-08 6.4237e-12 0 0 0 ); rhoCoeffs<8> ( 2.5039 -0.010587 2.0643e-05 -1.8761e-08 6.4237e-12 0 0 0 );
cpPolynomial ( 1563.1 1.604 -0.0029334 3.2168e-06 -1.1571e-09 0 0 0 ); CpCoeffs<8> ( 1563.1 1.604 -0.0029334 3.2168e-06 -1.1571e-09 0 0 0 );
muPolynomial ( 1.5068e-06 6.1598e-08 -1.8188e-11 0 0 0 0 0 ); muCoeffs<8> ( 1.5068e-06 6.1598e-08 -1.8188e-11 0 0 0 0 0 );
kappaPolynomial ( 0.0037972 0.00015336 -1.1859e-08 0 0 0 0 0 ); kappaCoeffs<8> ( 0.0037972 0.00015336 -1.1859e-08 0 0 0 0 0 );
} }
air air
@ -57,10 +57,10 @@ air
molWeight 28.85; molWeight 28.85;
Hf 0; Hf 0;
Sf 0; Sf 0;
rhoPolynomial ( 4.0097 -0.016954 3.3057e-05 -3.0042e-08 1.0286e-11 0 0 0 ); rhoCoeffs<8> ( 4.0097 -0.016954 3.3057e-05 -3.0042e-08 1.0286e-11 0 0 0 );
cpPolynomial ( 948.76 0.39171 -0.00095999 1.393e-06 -6.2029e-10 0 0 0 ); CpCoeffs<8> ( 948.76 0.39171 -0.00095999 1.393e-06 -6.2029e-10 0 0 0 );
muPolynomial ( 1.5061e-06 6.16e-08 -1.819e-11 0 0 0 0 0 ); muCoeffs<8> ( 1.5061e-06 6.16e-08 -1.819e-11 0 0 0 0 0 );
kappaPolynomial ( 0.0025219 8.506e-05 -1.312e-08 0 0 0 0 0 ); kappaCoeffs<8> ( 0.0025219 8.506e-05 -1.312e-08 0 0 0 0 0 );
} }

View File

@ -1,158 +1,55 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object thermo.incompressiblePoly;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
N2 N2
{ {
nMoles 1; nMoles 1;
molWeight 28.0134; molWeight 28.0134;
Hf 0; Hf 0;
Sf 0; Sf 0;
rhoPolynomial rhoCoeffs<8> ( 3.8936 -0.016463 3.2101e-05 -2.9174e-08 9.9889e-12 0 0 0 );
( CpCoeffs<8> ( 979.08 0.41787 -0.0011761 1.6742e-06 -7.2559e-10 0 0 0 );
3.8936E+00 muCoeffs<8> ( 1.5068e-06 6.1598e-08 -1.8188e-11 0 0 0 0 0 );
-1.6463E-02 kappaCoeffs<8> ( 0.0031494 8.4997e-05 -1.2621e-08 0 0 0 0 0 );
3.2101E-05
-2.9174E-08
9.9889E-12
0
0
0
);
cpPolynomial
(
9.7908E+02
4.1787E-01
-1.1761E-03
1.6742E-06
-7.2559E-10
0
0
0
);
muPolynomial
(
1.5068E-06
6.1598E-08
-1.8188E-11
0
0
0
0
0
);
kappaPolynomial
(
3.1494E-03
8.4997E-05
-1.2621E-08
0
0
0
0
0
);
} }
H2O H2O
{ {
nMoles 1; nMoles 1;
molWeight 18.0153; molWeight 18.0153;
Hf -1.3423e07; Hf -13423000;
Sf 1.0482e04; Sf 10482;
rhoPolynomial rhoCoeffs<8> ( 2.5039 -0.010587 2.0643e-05 -1.8761e-08 6.4237e-12 0 0 0 );
( CpCoeffs<8> ( 1563.1 1.604 -0.0029334 3.2168e-06 -1.1571e-09 0 0 0 );
2.5039E+00 muCoeffs<8> ( 1.5068e-06 6.1598e-08 -1.8188e-11 0 0 0 0 0 );
-1.0587E-02 kappaCoeffs<8> ( 0.0037972 0.00015336 -1.1859e-08 0 0 0 0 0 );
2.0643E-05
-1.8761E-08
6.4237E-12
0
0
0
);
cpPolynomial
(
1.5631E+03
1.6040E+00
-2.9334E-03
3.2168E-06
-1.1571E-09
0
0
0
);
muPolynomial
(
1.5068E-06
6.1598E-08
-1.8188E-11
0
0
0
0
0
);
kappaPolynomial
(
3.7972E-03
1.5336E-04
-1.1859E-08
0
0
0
0
0
);
} }
air air
{ {
nMoles 1; nMoles 1;
molWeight 28.85; molWeight 28.85;
Hf 0.0; Hf 0;
Sf 0.0; Sf 0;
rhoPolynomial rhoCoeffs<8> ( 4.0097 -0.016954 3.3057e-05 -3.0042e-08 1.0286e-11 0 0 0 );
( CpCoeffs<8> ( 948.76 0.39171 -0.00095999 1.393e-06 -6.2029e-10 0 0 0 );
4.0097E+00 muCoeffs<8> ( 1.5061e-06 6.16e-08 -1.819e-11 0 0 0 0 0 );
-1.6954E-02 kappaCoeffs<8> ( 0.0025219 8.506e-05 -1.312e-08 0 0 0 0 0 );
3.3057E-05
-3.0042E-08
1.0286E-11
0
0
0
);
cpPolynomial
(
9.4876E+02
3.9171E-01
-9.5999E-04
1.3930E-06
-6.2029E-10
0
0
0
);
muPolynomial
(
1.5061E-06
6.1600E-08
-1.8190E-11
0
0
0
0
0
);
kappaPolynomial
(
2.5219E-03
8.5060E-05
-1.3120E-08
0
0
0
0
0
);
} }
// ************************************************************************* //