Exemple #1
0
def test_enth_mol_phase(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

    assert str(Ideal.enth_mol_phase(
        m.props[1], "Vap")) == ('props[1].mole_frac_phase_comp[Vap,a]*42.0 + '
                                'props[1].mole_frac_phase_comp[Vap,b]*42.0 + '
                                'props[1].mole_frac_phase_comp[Vap,c]*42.0')
    assert str(Ideal.enth_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) +
        (m.props[1].pressure - m.params.pressure_ref) /
        m.props[1].dens_mol_phase["Liq"])
Exemple #2
0
def test_enth_mol_phase(m):
    m.props[1].enth_mol_phase_comp = Var(m.params.phase_list,
                                         m.params.component_list)

    for p in m.params.phase_list:
        assert str(Ideal.enth_mol_phase(m.props[1], p)) == str(
            sum(m.props[1].mole_frac_phase_comp[p, j] *
                m.props[1].enth_mol_phase_comp[p, j]
                for j in m.params.component_list))