Skip to content

Commit

Permalink
[Thermo] Fix updating state of PDSS_IonsFromNeutral objects
Browse files Browse the repository at this point in the history
Setting T and P now updates the state of the underlying "neutral
molecule phase".

Also removed the unimplemented setState_TR method.
  • Loading branch information
speth committed Mar 7, 2019
1 parent bdc8168 commit d6d91f4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
1 change: 0 additions & 1 deletion include/cantera/thermo/PDSS_IonsFromNeutral.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ class PDSS_IonsFromNeutral : public PDSS_Nondimensional
//! @{

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

//! @}
//! @name Initialization of the Object
Expand Down
5 changes: 1 addition & 4 deletions src/thermo/PDSS_IonsFromNeutral.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,9 @@ doublereal PDSS_IonsFromNeutral::molarVolume_ref() const

void PDSS_IonsFromNeutral::setState_TP(doublereal temp, doublereal pres)
{
neutralMoleculePhase_->setState_TP(temp, pres);
m_pres = pres;
m_temp = temp;
}

void PDSS_IonsFromNeutral::setState_TR(doublereal temp, doublereal rho)
{
}

}
4 changes: 2 additions & 2 deletions test/thermo/phaseConstructors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ TEST(IonsFromNeutralConstructor, fromXML)

// Values for regression testing only -- no reference values known for comparison
EXPECT_NEAR(p->density(), 1984.3225978174073, 1e-6);
EXPECT_NEAR(p->enthalpy_mass(), -8035317241137.971, 1e-1);
EXPECT_NEAR(p->enthalpy_mass(), -14737778.668383721, 1e-6);
EXPECT_NEAR(mu[0], -4.66404010e+08, 1e1);
EXPECT_NEAR(mu[1], -2.88157298e+06, 1e-1);
}
Expand Down Expand Up @@ -150,7 +150,7 @@ TEST(IonsFromNeutralConstructor, fromScratch)

// Values for regression testing only -- same as XML test
EXPECT_NEAR(p.density(), 1984.3225978174073, 1e-6);
EXPECT_NEAR(p.enthalpy_mass(), -8035317241137.971, 1e-1);
EXPECT_NEAR(p.enthalpy_mass(), -14737778.668383721, 1e-6);
EXPECT_NEAR(mu[0], -4.66404010e+08, 1e1);
EXPECT_NEAR(mu[1], -2.88157298e+06, 1e-1);
}
Expand Down

0 comments on commit d6d91f4

Please sign in to comment.