[Thermo] Remove unnecessary overrides of VPStandardStateTP methods
setPressure, setTemperature, and setState_TP are all implemented generally in VPStandardStateTP. The specialization in child classes is always handled in calcDensity().
This commit is contained in:
parent
a9379e6f71
commit
f6d19ccd59
10 changed files with 9 additions and 209 deletions
|
|
@ -641,26 +641,6 @@ public:
|
|||
* cause an exception to be thrown.
|
||||
*/
|
||||
|
||||
//! Return the thermodynamic pressure (Pa).
|
||||
/*!
|
||||
* For this incompressible system, we return the internally stored
|
||||
* independent value of the pressure.
|
||||
*/
|
||||
virtual doublereal pressure() const;
|
||||
|
||||
//! Set the internally stored pressure (Pa) at constant temperature and
|
||||
//! composition
|
||||
/*!
|
||||
* This method sets the pressure within the object. The water model is a
|
||||
* completely compressible model. Also, the dielectric constant is pressure
|
||||
* dependent.
|
||||
*
|
||||
* @param p input Pressure (Pa)
|
||||
*
|
||||
* @todo Implement a variable pressure capability
|
||||
*/
|
||||
virtual void setPressure(doublereal p);
|
||||
|
||||
protected:
|
||||
virtual void calcDensity();
|
||||
|
||||
|
|
@ -699,17 +679,6 @@ public:
|
|||
*/
|
||||
virtual void setMolarDensity(const doublereal conc);
|
||||
|
||||
//! Set the temperature (K)
|
||||
/*!
|
||||
* This function sets the temperature, and makes sure that the value
|
||||
* propagates to underlying objects, such as the water standard state model.
|
||||
*
|
||||
* @param temp Temperature in kelvin
|
||||
*/
|
||||
virtual void setTemperature(const doublereal temp);
|
||||
|
||||
virtual void setState_TP(doublereal t, doublereal p);
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @name Activities, Standard States, and Activity Concentrations
|
||||
|
|
|
|||
|
|
@ -103,19 +103,6 @@ public:
|
|||
//! @name Mechanical Properties
|
||||
//! @{
|
||||
|
||||
//! Set the internally stored pressure (Pa) at constant temperature and
|
||||
//! composition
|
||||
/*!
|
||||
* This method sets the pressure within the object. The water model is a
|
||||
* completely compressible model. Also, the dielectric constant is pressure
|
||||
* dependent.
|
||||
*
|
||||
* @param p input Pressure (Pa)
|
||||
*
|
||||
* @todo Implement a variable pressure capability
|
||||
*/
|
||||
virtual void setPressure(doublereal p);
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Calculate the density of the mixture using the partial molar volumes and
|
||||
|
|
@ -252,7 +239,6 @@ public:
|
|||
* @{
|
||||
*/
|
||||
|
||||
virtual void setState_TP(doublereal t, doublereal p);
|
||||
virtual void setMassFractions(const doublereal* const y);
|
||||
virtual void setMassFractions_NoNorm(const doublereal* const y);
|
||||
virtual void setMoleFractions(const doublereal* const x);
|
||||
|
|
|
|||
|
|
@ -1305,26 +1305,6 @@ public:
|
|||
*/
|
||||
//!@{
|
||||
|
||||
/**
|
||||
* Pressure. Units: Pa.
|
||||
* For this incompressible system, we return the internally stored
|
||||
* independent value of the pressure.
|
||||
*/
|
||||
virtual doublereal pressure() const;
|
||||
|
||||
//! Set the internally stored pressure (Pa) at constant temperature and
|
||||
//! composition
|
||||
/*!
|
||||
* This method sets the pressure within the object. The water model is a
|
||||
* completely compressible model. Also, the dielectric constant is pressure
|
||||
* dependent.
|
||||
*
|
||||
* @param p input Pressure (Pa)
|
||||
*
|
||||
* @todo Implement a variable pressure capability
|
||||
*/
|
||||
virtual void setPressure(doublereal p);
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Calculate the density of the mixture using the partial
|
||||
|
|
@ -1350,8 +1330,6 @@ protected:
|
|||
void calcDensity();
|
||||
|
||||
public:
|
||||
virtual doublereal density() const;
|
||||
|
||||
//! Set the internally stored density (kg/m^3) of the phase.
|
||||
/*!
|
||||
* Overwritten setDensity() function is necessary because the density is not
|
||||
|
|
@ -1386,17 +1364,6 @@ public:
|
|||
*/
|
||||
void setMolarDensity(const doublereal conc);
|
||||
|
||||
//! Set the temperature (K)
|
||||
/*!
|
||||
* This function sets the temperature, and makes sure that the value
|
||||
* propagates to underlying objects, such as the water standard state model.
|
||||
*
|
||||
* @param temp Temperature in kelvin
|
||||
*/
|
||||
virtual void setTemperature(const doublereal temp);
|
||||
|
||||
virtual void setState_TP(doublereal t, doublereal p);
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @name Activities, Standard States, and Activity Concentrations
|
||||
|
|
|
|||
|
|
@ -202,15 +202,6 @@ public:
|
|||
*/
|
||||
//@{
|
||||
|
||||
/**
|
||||
* Set the pressure at constant temperature. Units: Pa. This method sets a
|
||||
* constant within the object. The mass density is not a function of
|
||||
* pressure.
|
||||
*
|
||||
* @param p Input Pressure
|
||||
*/
|
||||
virtual void setPressure(doublereal p);
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Calculate the density of the mixture using the partial molar volumes and
|
||||
|
|
@ -257,8 +248,6 @@ public:
|
|||
*/
|
||||
void setMolarDensity(const doublereal rho);
|
||||
|
||||
virtual void setState_TP(doublereal t, doublereal p);
|
||||
|
||||
//! The isothermal compressibility. Units: 1/Pa.
|
||||
/*!
|
||||
* The isothermal compressibility is defined as
|
||||
|
|
|
|||
|
|
@ -296,9 +296,7 @@ public:
|
|||
* @{
|
||||
*/
|
||||
|
||||
virtual void setTemperature(const doublereal t);
|
||||
virtual void setPressure(doublereal p);
|
||||
virtual void setState_TP(doublereal t, doublereal p);
|
||||
virtual void calcDensity();
|
||||
|
||||
//! Calculate ion mole fractions from neutral molecule mole fractions.
|
||||
/*!
|
||||
|
|
|
|||
|
|
@ -195,32 +195,6 @@ doublereal DebyeHuckel::cv_mole() const
|
|||
|
||||
// ------- Mechanical Equation of State Properties ------------------------
|
||||
|
||||
doublereal DebyeHuckel::pressure() const
|
||||
{
|
||||
return m_Pcurrent;
|
||||
}
|
||||
|
||||
void DebyeHuckel::setPressure(doublereal p)
|
||||
{
|
||||
setState_TP(temperature(), p);
|
||||
}
|
||||
|
||||
void DebyeHuckel::setState_TP(doublereal t, doublereal p)
|
||||
{
|
||||
Phase::setTemperature(t);
|
||||
|
||||
// Store the current pressure
|
||||
m_Pcurrent = p;
|
||||
|
||||
// update the standard state thermo. This involves calling the water
|
||||
// function and setting the pressure
|
||||
_updateStandardStateThermo();
|
||||
|
||||
// Calculate all of the other standard volumes. Note these are constant for
|
||||
// now
|
||||
calcDensity();
|
||||
}
|
||||
|
||||
void DebyeHuckel::calcDensity()
|
||||
{
|
||||
if (m_waterSS) {
|
||||
|
|
@ -258,11 +232,6 @@ void DebyeHuckel::setMolarDensity(const doublereal conc)
|
|||
}
|
||||
}
|
||||
|
||||
void DebyeHuckel::setTemperature(const doublereal temp)
|
||||
{
|
||||
setState_TP(temp, m_Pcurrent);
|
||||
}
|
||||
|
||||
// ------- Activities and Activity Concentrations
|
||||
|
||||
void DebyeHuckel::getActivityConcentrations(doublereal* c) const
|
||||
|
|
|
|||
|
|
@ -84,11 +84,6 @@ void GibbsExcessVPSSTP::setConcentrations(const doublereal* const c)
|
|||
|
||||
// ------------ Mechanical Properties ------------------------------
|
||||
|
||||
void GibbsExcessVPSSTP::setPressure(doublereal p)
|
||||
{
|
||||
setState_TP(temperature(), p);
|
||||
}
|
||||
|
||||
void GibbsExcessVPSSTP::calcDensity()
|
||||
{
|
||||
vector_fp vbar = getPartialMolarVolumesVector();
|
||||
|
|
@ -100,21 +95,6 @@ void GibbsExcessVPSSTP::calcDensity()
|
|||
Phase::setDensity(dd);
|
||||
}
|
||||
|
||||
void GibbsExcessVPSSTP::setState_TP(doublereal t, doublereal p)
|
||||
{
|
||||
Phase::setTemperature(t);
|
||||
|
||||
// Store the current pressure
|
||||
m_Pcurrent = p;
|
||||
|
||||
// update the standard state thermo. This involves calling the water
|
||||
// function and setting the pressure
|
||||
updateStandardStateThermo();
|
||||
|
||||
// Calculate the partial molar volumes, and then the density of the fluid
|
||||
calcDensity();
|
||||
}
|
||||
|
||||
// - Activities, Standard States, Activity Concentrations -----------
|
||||
void GibbsExcessVPSSTP::getActivityConcentrations(doublereal* c) const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -482,16 +482,6 @@ doublereal HMWSoln::cv_mole() const
|
|||
|
||||
// ------- Mechanical Equation of State Properties ------------------------
|
||||
|
||||
doublereal HMWSoln::pressure() const
|
||||
{
|
||||
return m_Pcurrent;
|
||||
}
|
||||
|
||||
void HMWSoln::setPressure(doublereal p)
|
||||
{
|
||||
setState_TP(temperature(), p);
|
||||
}
|
||||
|
||||
void HMWSoln::calcDensity()
|
||||
{
|
||||
static const int cacheId = m_cache.getId();
|
||||
|
|
@ -500,6 +490,12 @@ void HMWSoln::calcDensity()
|
|||
return;
|
||||
}
|
||||
|
||||
// Store the internal density of the water SS. Note, we would have to do
|
||||
// this for all other species if they had pressure dependent properties.
|
||||
m_densWaterSS = m_waterSS->density();
|
||||
|
||||
// Calculate all of the other standard volumes. Note these are constant for
|
||||
// now
|
||||
double* vbar = &m_pp[0];
|
||||
getPartialMolarVolumes(vbar);
|
||||
double* x = &m_tmpV[0];
|
||||
|
|
@ -512,11 +508,6 @@ void HMWSoln::calcDensity()
|
|||
Phase::setDensity(dd);
|
||||
}
|
||||
|
||||
double HMWSoln::density() const
|
||||
{
|
||||
return Phase::density();
|
||||
}
|
||||
|
||||
void HMWSoln::setDensity(const doublereal rho)
|
||||
{
|
||||
double dens_old = density();
|
||||
|
|
@ -532,31 +523,6 @@ void HMWSoln::setMolarDensity(const doublereal rho)
|
|||
"Density is not an independent variable");
|
||||
}
|
||||
|
||||
void HMWSoln::setTemperature(const doublereal temp)
|
||||
{
|
||||
setState_TP(temp, m_Pcurrent);
|
||||
}
|
||||
|
||||
void HMWSoln::setState_TP(doublereal temp, doublereal pres)
|
||||
{
|
||||
Phase::setTemperature(temp);
|
||||
|
||||
// Store the current pressure
|
||||
m_Pcurrent = pres;
|
||||
|
||||
// update the standard state thermo. This involves calling the water
|
||||
// function and setting the pressure
|
||||
updateStandardStateThermo();
|
||||
|
||||
// Store the internal density of the water SS. Note, we would have to do
|
||||
// this for all other species if they had pressure dependent properties.
|
||||
m_densWaterSS = m_waterSS->density();
|
||||
|
||||
// Calculate all of the other standard volumes. Note these are constant for
|
||||
// now
|
||||
calcDensity();
|
||||
}
|
||||
|
||||
// ------- Activities and Activity Concentrations
|
||||
|
||||
void HMWSoln::getActivityConcentrations(doublereal* c) const
|
||||
|
|
|
|||
|
|
@ -168,11 +168,6 @@ doublereal IdealMolalSoln::cv_mole() const
|
|||
|
||||
// ------- Mechanical Equation of State Properties ------------------------
|
||||
|
||||
void IdealMolalSoln::setPressure(doublereal p)
|
||||
{
|
||||
setState_TP(temperature(), p);
|
||||
}
|
||||
|
||||
void IdealMolalSoln::calcDensity()
|
||||
{
|
||||
double* vbar = &m_pp[0];
|
||||
|
|
@ -213,14 +208,6 @@ void IdealMolalSoln::setMolarDensity(const doublereal conc)
|
|||
}
|
||||
}
|
||||
|
||||
void IdealMolalSoln::setState_TP(doublereal temp, doublereal pres)
|
||||
{
|
||||
Phase::setTemperature(temp);
|
||||
m_Pcurrent = pres;
|
||||
updateStandardStateThermo();
|
||||
calcDensity();
|
||||
}
|
||||
|
||||
// ------- Activities and Activity Concentrations
|
||||
|
||||
void IdealMolalSoln::getActivityConcentrations(doublereal* c) const
|
||||
|
|
|
|||
|
|
@ -406,22 +406,11 @@ void IonsFromNeutralVPSSTP::getdlnActCoeffdlnN(const size_t ld, doublereal* dlnA
|
|||
}
|
||||
}
|
||||
|
||||
void IonsFromNeutralVPSSTP::setTemperature(const doublereal temp)
|
||||
{
|
||||
IonsFromNeutralVPSSTP::setState_TP(temp, pressure());
|
||||
}
|
||||
|
||||
void IonsFromNeutralVPSSTP::setPressure(doublereal p)
|
||||
{
|
||||
IonsFromNeutralVPSSTP::setState_TP(temperature(), p);
|
||||
}
|
||||
|
||||
void IonsFromNeutralVPSSTP::setState_TP(doublereal t, doublereal p)
|
||||
void IonsFromNeutralVPSSTP::calcDensity()
|
||||
{
|
||||
// This is a two phase process. First, we calculate the standard states
|
||||
// within the neutral molecule phase.
|
||||
neutralMoleculePhase_->setState_TP(t, p);
|
||||
VPStandardStateTP::setState_TP(t,p);
|
||||
neutralMoleculePhase_->setState_TP(temperature(), pressure());
|
||||
|
||||
// Calculate the partial molar volumes, and then the density of the fluid
|
||||
Phase::setDensity(neutralMoleculePhase_->density());
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue