Skip to content

Commit

Permalink
Infrastructure work to support SmoothVLE2
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Lee committed Apr 17, 2024
1 parent 3a1d54a commit a3f141f
Show file tree
Hide file tree
Showing 10 changed files with 1,774 additions and 438 deletions.
490 changes: 153 additions & 337 deletions idaes/models/properties/modular_properties/base/generic_property.py

Large diffs are not rendered by default.

30 changes: 18 additions & 12 deletions idaes/models/properties/modular_properties/base/tests/test_vle.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@
)
from idaes.core.solvers import get_solver

from idaes.models.properties.modular_properties.base.generic_property import (
_init_Pbub,
_init_Pdew,
_init_Tbub,
_init_Tdew,
)
from idaes.models.properties.modular_properties.state_definitions import FTPx
from idaes.models.properties.modular_properties.eos.ideal import Ideal
from idaes.models.properties.modular_properties.phase_equil import SmoothVLE
Expand Down Expand Up @@ -218,7 +224,7 @@ def test_build(self, model):

@pytest.mark.unit
def test_init_bubble_temperature(self, model):
model.props._init_Tbub(model.props[1], pyunits.K)
_init_Tbub(model.props[1], pyunits.K)

assert pytest.approx(365.35, abs=0.01) == value(
model.props[1].temperature_bubble[("Vap", "Liq")]
Expand All @@ -232,7 +238,7 @@ def test_init_bubble_temperature(self, model):

@pytest.mark.unit
def test_init_dew_temperature(self, model):
model.props._init_Tdew(model.props[1], pyunits.K)
_init_Tdew(model.props[1], pyunits.K)

assert pytest.approx(372.02, abs=0.01) == value(
model.props[1].temperature_dew[("Vap", "Liq")]
Expand All @@ -246,7 +252,7 @@ def test_init_dew_temperature(self, model):

@pytest.mark.unit
def test_init_bubble_pressure(self, model):
model.props._init_Pbub(model.props[1], pyunits.K)
_init_Pbub(model.props[1])

assert pytest.approx(109479, abs=1) == value(
model.props[1].pressure_bubble[("Vap", "Liq")]
Expand All @@ -260,7 +266,7 @@ def test_init_bubble_pressure(self, model):

@pytest.mark.unit
def test_init_dew_pressure(self, model):
model.props._init_Pdew(model.props[1], pyunits.K)
_init_Pdew(model.props[1])

assert pytest.approx(89820, abs=1) == value(
model.props[1].pressure_dew[("Vap", "Liq")]
Expand Down Expand Up @@ -524,7 +530,7 @@ def test_build(self, model):

@pytest.mark.unit
def test_init_bubble_temperature(self, model):
model.props._init_Tbub(model.props[1], pyunits.K)
_init_Tbub(model.props[1], pyunits.K)

assert pytest.approx(365.35, abs=0.01) == value(
model.props[1].temperature_bubble[("Vap", "Liq")]
Expand All @@ -538,7 +544,7 @@ def test_init_bubble_temperature(self, model):

@pytest.mark.unit
def test_init_dew_temperature(self, model):
model.props._init_Tdew(model.props[1], pyunits.K)
_init_Tdew(model.props[1], pyunits.K)

assert pytest.approx(372.02, abs=0.01) == value(
model.props[1].temperature_dew[("Vap", "Liq")]
Expand All @@ -552,7 +558,7 @@ def test_init_dew_temperature(self, model):

@pytest.mark.unit
def test_init_bubble_pressure(self, model):
model.props._init_Pbub(model.props[1], pyunits.K)
_init_Pbub(model.props[1])

assert pytest.approx(109479, abs=1) == value(
model.props[1].pressure_bubble[("Vap", "Liq")]
Expand All @@ -566,7 +572,7 @@ def test_init_bubble_pressure(self, model):

@pytest.mark.unit
def test_init_dew_pressure(self, model):
model.props._init_Pdew(model.props[1], pyunits.K)
_init_Pdew(model.props[1])

assert pytest.approx(89820, abs=1) == value(
model.props[1].pressure_dew[("Vap", "Liq")]
Expand Down Expand Up @@ -703,7 +709,7 @@ def test_build(self, model):

@pytest.mark.unit
def test_init_bubble_temperature(self, model):
model.props._init_Tbub(model.props[1], pyunits.K)
_init_Tbub(model.props[1], pyunits.K)

assert pytest.approx(361.50, abs=0.01) == value(
model.props[1].temperature_bubble[("Vap", "Liq")]
Expand All @@ -720,7 +726,7 @@ def test_init_bubble_temperature(self, model):

@pytest.mark.unit
def test_init_dew_temperature(self, model):
model.props._init_Tdew(model.props[1], pyunits.K)
_init_Tdew(model.props[1], pyunits.K)

assert pytest.approx(370.23, abs=0.01) == value(
model.props[1].temperature_dew[("Vap", "Liq")]
Expand All @@ -737,7 +743,7 @@ def test_init_dew_temperature(self, model):

@pytest.mark.unit
def test_init_bubble_pressure(self, model):
model.props._init_Pbub(model.props[1], pyunits.K)
_init_Pbub(model.props[1])

assert pytest.approx(118531, abs=1) == value(
model.props[1].pressure_bubble[("Vap", "Liq")]
Expand All @@ -754,7 +760,7 @@ def test_init_bubble_pressure(self, model):

@pytest.mark.unit
def test_init_dew_pressure(self, model):
model.props._init_Pdew(model.props[1], pyunits.K)
_init_Pdew(model.props[1])

assert pytest.approx(95056, abs=1) == value(
model.props[1].pressure_dew[("Vap", "Liq")]
Expand Down
Loading

0 comments on commit a3f141f

Please sign in to comment.