Skip to content

Commit

Permalink
[Thermo] Fix inconsistencies in PDSS_IonsFromNeutral
Browse files Browse the repository at this point in the history
The definitions of p0, Tmin, and Tmax were circular -- they queried the
STITbyPDSS object which just referenced the same PDSS_IonsFromNeutral
object. Instead, pull these properties from the associated "neutral molecule"
phase.

The overrides of setTemperature and temperature were unnecessary and likely to
cause problems.
  • Loading branch information
speth committed Feb 23, 2017
1 parent fca22d9 commit ff46dc9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
2 changes: 0 additions & 2 deletions include/cantera/thermo/PDSS_IonsFromNeutral.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ class PDSS_IonsFromNeutral : public PDSS_Nondimensional
//! @name Mechanical Equation of State Properties
//! @{

virtual void setTemperature(doublereal temp);
virtual doublereal temperature() const;
virtual void setState_TP(doublereal temp, doublereal pres);
virtual void setState_TR(doublereal temp, doublereal rho);

Expand Down
19 changes: 3 additions & 16 deletions src/thermo/PDSS_IonsFromNeutral.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ void PDSS_IonsFromNeutral::constructPDSSXML(VPStandardStateTP* tp, size_t spinde
void PDSS_IonsFromNeutral::initThermo()
{
PDSS::initThermo();
m_p0 = m_tp->speciesThermo().refPressure(m_spindex);
m_minTemp = m_spthermo->minTemp(m_spindex);
m_maxTemp = m_spthermo->maxTemp(m_spindex);
m_p0 = neutralMoleculePhase_->refPressure();
m_minTemp = neutralMoleculePhase_->minTemp();
m_maxTemp = neutralMoleculePhase_->maxTemp();
}

doublereal PDSS_IonsFromNeutral::enthalpy_RT() const
Expand Down Expand Up @@ -231,19 +231,6 @@ doublereal PDSS_IonsFromNeutral::molarVolume_ref() const
return val;
}

doublereal PDSS_IonsFromNeutral::temperature() const
{
// Obtain the temperature from the owning VPStandardStateTP object if you
// can.
m_temp = m_tp->temperature();
return m_temp;
}

void PDSS_IonsFromNeutral::setTemperature(doublereal temp)
{
m_temp = temp;
}

void PDSS_IonsFromNeutral::setState_TP(doublereal temp, doublereal pres)
{
m_pres = pres;
Expand Down

0 comments on commit ff46dc9

Please sign in to comment.