Example #1
0
 void VPSSMgr_Water_HKFT::setState_TP(doublereal temp, doublereal pres) {
    if (m_tlast != temp) {
      m_tlast = temp;
      m_plast = pres;
      _updateStandardStateThermo();
    } else if (m_plast != pres) {
      m_plast = pres;
      _updateStandardStateThermo();
    }
  }
void VPSSMgr_Water_HKFT::setState_T(doublereal temp)
{
    if (m_tlast != temp) {
        m_tlast = temp;
        _updateStandardStateThermo();
    }
}
void VPSSMgr_Water_HKFT::setState_P(doublereal pres)
{
    if (m_plast != pres) {
        m_plast = pres;
        _updateStandardStateThermo();
    }
}
Example #4
0
void IdealMolalSoln::getActivities(doublereal* ac) const
{
    _updateStandardStateThermo();

    // Update the molality array, m_molalities(). This requires an update due to
    // mole fractions
    if (IMS_typeCutoff_ == 0) {
        calcMolalities();
        for (size_t k = 0; k < m_kk; k++) {
            ac[k] = m_molalities[k];
        }
        double xmolSolvent = moleFraction(0);
        // Limit the activity coefficient to be finite as the solvent mole
        // fraction goes to zero.
        xmolSolvent = std::max(m_xmolSolventMIN, xmolSolvent);
        ac[0] = exp((xmolSolvent - 1.0)/xmolSolvent);
    } else {

        s_updateIMS_lnMolalityActCoeff();

        // Now calculate the array of activities.
        for (size_t k = 1; k < m_kk; k++) {
            ac[k] = m_molalities[k] * exp(IMS_lnActCoeffMolal_[k]);
        }
        double xmolSolvent = moleFraction(0);
        ac[0] = exp(IMS_lnActCoeffMolal_[0]) * xmolSolvent;
    }
}
Example #5
0
 void VPStandardStateTP::updateStandardStateThermo() const {
   double Tnow = temperature();
   if (Tnow != m_Tlast_ss || m_Pcurrent != m_Plast_ss) {
     _updateStandardStateThermo();
   }
 }
Example #6
0
void VPSSMgr::updateStandardStateThermo()
{
    _updateStandardStateThermo();
}