예제 #1
0
def test_dens_mol_phase_liq(m):
    for j in m.params.component_list:
        m.params.get_component(j).config.dens_mol_liq_comp = dummy_call

    assert str(Ideal.dens_mol_phase(m.props[1], "Liq")) == str(
        sum(m.props[1].mole_frac_phase_comp["Liq", j] * 42
            for j in m.params.component_list))
예제 #2
0
def test_dens_mol_phase_sol(m_sol):
    for j in m_sol.params.component_list:
        m_sol.params.get_component(j).config.dens_mol_sol_comp = dummy_call
        m_sol.params.get_component(j).config.dens_mol_liq_comp = dummy_call

    assert str(Ideal.dens_mol_phase(m_sol.props[1], "Sol")) == str(
        1 / sum(m_sol.props[1].mole_frac_phase_comp["Sol", j] / 42
                for j in m_sol.params.component_list))
예제 #3
0
def test_dens_mol_phase_liq(m):
    for j in m.params.component_list:
        m.params.get_component(j).config.dens_mol_liq_comp = dummy_call

    assert str(Ideal.dens_mol_phase(m.props[1], "Liq")) == str(
        1 / (1 / 42 * m.props[1].mole_frac_phase_comp["Liq", "a"] +
             1 / 42 * m.props[1].mole_frac_phase_comp["Liq", "b"] +
             1 / 42 * m.props[1].mole_frac_phase_comp["Liq", "c"]))
예제 #4
0
def test_dens_mol_phase_invalid_phase(m_sol):
    with pytest.raises(PropertyNotSupportedError):
        Ideal.dens_mol_phase(m_sol.props[1], "Sol")
예제 #5
0
def test_dens_mol_phase_vap(m):
    assert str(Ideal.dens_mol_phase(
        m.props[1],
        "Vap")) == ('props[1].pressure/(kg*m**2/J/s**2*(8.314462618*(J)/mol/K)'
                    '*props[1].temperature)')