Skip to content

Commit

Permalink
add test for single effect to multi effect crystallizer
Browse files Browse the repository at this point in the history
  • Loading branch information
kurbansitterley committed Oct 9, 2024
1 parent a84ceea commit e0b5b44
Showing 1 changed file with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
units as pyunits,
)
from pyomo.network import Port
from idaes.core import FlowsheetBlock

from idaes.core import FlowsheetBlock
from idaes.core.util.model_statistics import (
degrees_of_freedom,
number_variables,
Expand All @@ -35,6 +35,7 @@
badly_scaled_var_generator,
)
from idaes.core import UnitModelCostingBlock
from idaes.core.util.exceptions import ConfigurationError

from watertap.core.solvers import get_solver
from watertap.property_models.unit_specific.cryst_prop_pack import (
Expand Down Expand Up @@ -289,6 +290,28 @@ def build_mec4():
return m


@pytest.mark.component
def test_single_effect_error():

m = ConcreteModel()
m.fs = FlowsheetBlock(dynamic=False)

m.fs.properties = NaClParameterBlock()
m.fs.vapor_properties = WaterParameterBlock()

error_msg = (
"The MultiEffectCrystallizer model requires more than 1 effect."
"To model a crystallizer with one effect, use the CrystallizerEffect model with 'standalone=True'."
)

with pytest.raises(ConfigurationError, match=error_msg):
m.fs.unit = MultiEffectCrystallizer(
property_package=m.fs.properties,
property_package_vapor=m.fs.vapor_properties,
number_effects=1,
)


class TestMultiEffectCrystallizer_2Effects:
@pytest.fixture(scope="class")
def MEC2_frame(self):
Expand Down

0 comments on commit e0b5b44

Please sign in to comment.