void VPSSMgr_Water_HKFT::_updateRefStateThermo() const { m_p0 = m_waterSS->pref_safe(m_tlast); m_waterSS->setState_TP(m_tlast, m_p0); m_h0_RT[0] = (m_waterSS->enthalpy_mole()) / (GasConstant * m_tlast); m_s0_R[0] = (m_waterSS->entropy_mole()) / GasConstant; m_cp0_R[0] = (m_waterSS->cp_mole()) / GasConstant; m_g0_RT[0] = (m_hss_RT[0] - m_sss_R[0]); m_V0[0] = (m_waterSS->density()) / m_vptp_ptr->molecularWeight(0); PDSS* ps; for (size_t k = 1; k < m_kk; k++) { ps = m_vptp_ptr->providePDSS(k); ps->setState_TP(m_tlast, m_p0); m_cp0_R[k] = ps->cp_R(); m_s0_R[k] = ps->entropy_mole() / GasConstant; m_g0_RT[k] = ps->gibbs_RT(); m_h0_RT[k] = m_g0_RT[k] + m_s0_R[k]; m_V0[k] = ps->molarVolume(); } m_waterSS->setState_TP(m_tlast, m_plast); for (size_t k = 1; k < m_kk; k++) { ps = m_vptp_ptr->providePDSS(k); ps->setState_TP(m_tlast, m_plast); } }
void VPSSMgr::_updateStandardStateThermo() { for (size_t k = 0; k < m_kk; k++) { PDSS* kPDSS = m_vptp_ptr->providePDSS(k); kPDSS->setState_TP(m_tlast, m_plast); } err("_updateStandardStateThermo()"); }
void VPSSMgr_General::_updateStandardStateThermo() { for (size_t k = 0; k < m_kk; k++) { PDSS* kPDSS = m_PDSS_ptrs[k]; kPDSS->setState_TP(m_tlast, m_plast); m_hss_RT[k] = kPDSS->enthalpy_RT(); m_sss_R[k] = kPDSS->entropy_R(); m_gss_RT[k] = m_hss_RT[k] - m_sss_R[k]; m_cpss_R[k] = kPDSS->cp_R(); m_Vss[k] = kPDSS->molarVolume(); } }
//==================================================================================================================== void VPSSMgr_General::_updateRefStateThermo() const { if (m_useTmpRefStateStorage) { for (size_t k = 0; k < m_kk; k++) { PDSS* kPDSS = m_PDSS_ptrs[k]; kPDSS->setState_TP(m_tlast, m_plast); m_h0_RT[k] = kPDSS->enthalpy_RT_ref(); m_s0_R[k] = kPDSS->entropy_R_ref(); m_g0_RT[k] = m_h0_RT[k] - m_s0_R[k]; m_cp0_R[k] = kPDSS->cp_R_ref(); m_V0[k] = kPDSS->molarVolume_ref(); } } }
/*! * Returns the vector of the * gibbs function of the reference state at the current temperature * of the solution and the reference pressure for the species. * units = J/kmol * * @param g Output vector contain the Gibbs free energies * of the reference state of the species * length = m_kk, units = J/kmol. */ void VPSSMgr_General::getGibbs_ref(doublereal* g) const { doublereal _rt = GasConstant * m_tlast; if (m_useTmpRefStateStorage) { std::copy(m_g0_RT.begin(), m_g0_RT.end(), g); scale(g, g+m_kk, g, _rt); } else { for (size_t k = 0; k < m_kk; k++) { PDSS* kPDSS = m_PDSS_ptrs[k]; kPDSS->setState_TP(m_tlast, m_plast); double h0_RT = kPDSS->enthalpy_RT_ref(); double s0_R = kPDSS->entropy_R_ref(); g[k] = _rt * (h0_RT - s0_R); } } }
void VPSSMgr_Water_HKFT::_updateStandardStateThermo() { // Do the water m_waterSS->setState_TP(m_tlast, m_plast); m_hss_RT[0] = (m_waterSS->enthalpy_mole()) / (GasConstant * m_tlast); m_sss_R[0] = (m_waterSS->entropy_mole()) / GasConstant; m_cpss_R[0] = (m_waterSS->cp_mole()) / GasConstant; m_gss_RT[0] = (m_hss_RT[0] - m_sss_R[0]); m_Vss[0] = (m_vptp_ptr->molecularWeight(0)) / (m_waterSS->density()); for (size_t k = 1; k < m_kk; k++) { PDSS* ps = m_vptp_ptr->providePDSS(k); ps->setState_TP(m_tlast, m_plast); m_cpss_R[k] = ps->cp_R(); m_sss_R[k] = ps->entropy_R(); m_gss_RT[k] = ps->gibbs_RT(); m_hss_RT[k] = m_gss_RT[k] + m_sss_R[k]; m_Vss[k] = ps->molarVolume(); } }
void VPSSMgr_Water_ConstVol::_updateStandardStateThermo() { doublereal RT = GasConstant * m_tlast; doublereal del_pRT = (m_plast - OneAtm) / (RT); for (int k = 1; k < m_kk; k++) { m_hss_RT[k] = m_h0_RT[k] + del_pRT * m_Vss[k]; m_cpss_R[k] = m_cp0_R[k]; m_sss_R[k] = m_s0_R[k]; m_gss_RT[k] = m_hss_RT[k] - m_sss_R[k]; // m_Vss[k] constant PDSS *kPDSS = m_vptp_ptr->providePDSS(k); kPDSS->setState_TP(m_tlast, m_plast); } // Do the water m_waterSS->setState_TP(m_tlast, m_plast); m_hss_RT[0] = (m_waterSS->enthalpy_mole())/ RT; m_sss_R[0] = (m_waterSS->entropy_mole()) / GasConstant; m_cpss_R[0] = (m_waterSS->cp_mole()) / GasConstant; m_gss_RT[0] = (m_hss_RT[0] - m_sss_R[0]); m_Vss[0] = (m_vptp_ptr->molecularWeight(0) / m_waterSS->density()); }