Example #1
0
def test_compress_fact_phase_Vap(m):
    assert isinstance(Cubic.compress_fact_phase(m.props[1], "Vap"),
                      ExternalFunctionExpression)
    assert pytest.approx(value(f_Zv(0, Av, Bv)), rel=1e-5) == value(
        Cubic.compress_fact_phase(m.props[1], "Vap"))
    assert pytest.approx(value(
        Cubic.compress_fact_phase(m.props[1], "Vap")), rel=1e-5) == Zv
Example #2
0
def test_compress_fact_phase_Liq(m):
    assert isinstance(Cubic.compress_fact_phase(m.props[1], "Liq"),
                      ExternalFunctionExpression)
    assert pytest.approx(value(f_Zl(0, Al, Bl)), rel=1e-5) == value(
        Cubic.compress_fact_phase(m.props[1], "Liq"))
    assert pytest.approx(value(
        Cubic.compress_fact_phase(m.props[1], "Liq")), rel=1e-5) == Zl
Example #3
0
def test_compress_fact_phase_invalid_phase(m_sol):
    with pytest.raises(PropertyNotSupportedError):
        Cubic.compress_fact_phase(m_sol.props[1], "Sol")