def test_enth_mol_phase_comp(m): for j in m.params.component_list: m.params.get_component(j).config.enth_mol_liq_comp = dummy_call m.params.get_component(j).config.enth_mol_ig_comp = dummy_call assert str(Ideal.enth_mol_phase_comp(m.props[1], "Liq", j)) == str(42) assert str(Ideal.enth_mol_phase_comp(m.props[1], "Vap", j)) == str(42)
def test_enth_mol_phase_comp(m): for j in m.params.component_list: m.params.get_component(j).config.enth_mol_liq_comp = dummy_call m.params.get_component(j).config.enth_mol_ig_comp = dummy_call m.params.get_component(j).config.dens_mol_liq_comp = dummy_call2 for j in m.params.component_list: assert str(Ideal.enth_mol_phase_comp( m.props[1], "Liq", j)) == str(42 + (m.props[1].pressure - m.params.pressure_ref) / m.props[1].dens_mol_phase["Liq"]) assert str(Ideal.enth_mol_phase_comp(m.props[1], "Vap", j)) == str(42)
def test_enth_mol_phase_sol(m_sol): for j in m_sol.params.component_list: m_sol.params.get_component(j).config.enth_mol_sol_comp = dummy_call m_sol.params.get_component(j).config.dens_mol_liq_comp = dummy_call2 m_sol.params.get_component(j).config.dens_mol_sol_comp = dummy_call2 for j in m_sol.params.component_list: assert str(Ideal.enth_mol_phase_comp( m_sol.props[1], "Sol", j)) == str(42 + (m_sol.props[1].pressure - m_sol.params.pressure_ref) / m_sol.props[1].dens_mol_phase["Sol"])
def test_enth_mol_phase_invalid_phase(m_sol): with pytest.raises(PropertyNotSupportedError): Ideal.enth_mol_phase_comp(m_sol.props[1], "Sol", "foo")