diff --git a/docs/technical_reference/flowsheets/extended_BSM2.rst b/docs/technical_reference/flowsheets/extended_BSM2.rst index d18fee9a5e..7b6131173c 100644 --- a/docs/technical_reference/flowsheets/extended_BSM2.rst +++ b/docs/technical_reference/flowsheets/extended_BSM2.rst @@ -193,8 +193,6 @@ Additional Variables "Reactor 7 oxygen mass transfer coefficient",":math:`KLa_{R7}`", "240", ":math:`\text{hr}^{-1}`" "Dissolved oxygen concentration at equilibrium",":math:`S_{O, eq}`", "8e-3", ":math:`\text{hr}^{-1}`" - - Additional Constraints ---------------------- diff --git a/watertap/flowsheets/full_water_resource_recovery_facility/BSM2_P_extension.py b/watertap/flowsheets/full_water_resource_recovery_facility/BSM2_P_extension.py index 69544df8d3..51ea6ec635 100644 --- a/watertap/flowsheets/full_water_resource_recovery_facility/BSM2_P_extension.py +++ b/watertap/flowsheets/full_water_resource_recovery_facility/BSM2_P_extension.py @@ -120,7 +120,7 @@ def main(bio_P=False): m.fs.R6.outlet.conc_mass_comp[:, "S_O2"].unfix() m.fs.R7.outlet.conc_mass_comp[:, "S_O2"].unfix() - # Resolve with controls in place + # Re-solve with controls in place results = solve(m) pyo.assert_optimal_termination(results) @@ -548,6 +548,10 @@ def scale_variables(m): ) iscale.set_scaling_factor(block.control_volume.material_balances, 1e3) + iscale.set_scaling_factor(m.fs.AD.KH_co2, 1e1) + iscale.set_scaling_factor(m.fs.AD.KH_ch4, 1e1) + iscale.set_scaling_factor(m.fs.AD.KH_h2, 1e1) + # Apply scaling scale_variables(m) iscale.calculate_scaling_factors(m) @@ -612,7 +616,7 @@ def initialize_system(m, bio_P=False, solver=None): (0, "X_AUT"): 0.25, (0, "X_H"): 23.0, (0, "X_I"): 11.3, - (0, "X_PAO"): 10.8, + (0, "X_PAO"): 10.9, (0, "X_PHA"): 0.0058, (0, "X_PP"): 2.9, (0, "X_S"): 3.8, @@ -872,9 +876,82 @@ def display_performance_metrics(m): pyo.units.get_units(m.fs.AD.liquid_phase.properties_in[0].flow_vol), ) + print("---- Feed Metrics----") + print( + "Feed TSS concentration", + pyo.value(m.fs.FeedWater.properties[0].TSS), + pyo.units.get_units(m.fs.FeedWater.properties[0].TSS), + ) + print( + "Feed COD concentration", + pyo.value(m.fs.FeedWater.properties[0].COD), + pyo.units.get_units(m.fs.FeedWater.properties[0].COD), + ) + print( + "BOD5 concentration", + pyo.value(m.fs.FeedWater.properties[0].BOD5["raw"]), + pyo.units.get_units(m.fs.FeedWater.properties[0].BOD5["raw"]), + ) + print( + "TKN concentration", + pyo.value(m.fs.FeedWater.properties[0].TKN), + pyo.units.get_units(m.fs.FeedWater.properties[0].TKN), + ) + print( + "SNOX concentration", + pyo.value(m.fs.FeedWater.properties[0].SNOX), + pyo.units.get_units(m.fs.FeedWater.properties[0].SNOX), + ) + print( + "Organic phosphorus concentration", + pyo.value(m.fs.FeedWater.properties[0].SP_organic), + pyo.units.get_units(m.fs.FeedWater.properties[0].SP_organic), + ) + print( + "Inorganic phosphorus concentration", + pyo.value(m.fs.FeedWater.properties[0].SP_inorganic), + pyo.units.get_units(m.fs.FeedWater.properties[0].SP_inorganic), + ) + + print("---- Effluent Metrics----") + print( + "TSS concentration", + pyo.value(m.fs.Treated.properties[0].TSS), + pyo.units.get_units(m.fs.Treated.properties[0].TSS), + ) + print( + "COD concentration", + pyo.value(m.fs.Treated.properties[0].COD), + pyo.units.get_units(m.fs.Treated.properties[0].COD), + ) + print( + "BOD5 concentration", + pyo.value(m.fs.Treated.properties[0].BOD5["effluent"]), + pyo.units.get_units(m.fs.Treated.properties[0].BOD5["effluent"]), + ) + print( + "TKN concentration", + pyo.value(m.fs.Treated.properties[0].TKN), + pyo.units.get_units(m.fs.Treated.properties[0].TKN), + ) + print( + "SNOX concentration", + pyo.value(m.fs.Treated.properties[0].SNOX), + pyo.units.get_units(m.fs.Treated.properties[0].SNOX), + ) + print( + "Organic phosphorus concentration", + pyo.value(m.fs.Treated.properties[0].SP_organic), + pyo.units.get_units(m.fs.Treated.properties[0].SP_organic), + ) + print( + "Inorganic phosphorus concentration", + pyo.value(m.fs.Treated.properties[0].SP_inorganic), + pyo.units.get_units(m.fs.Treated.properties[0].SP_inorganic), + ) + if __name__ == "__main__": - # This method builds and runs a steady state activated sludge flowsheet. m, results = main(bio_P=False) stream_table = create_stream_table_dataframe( diff --git a/watertap/flowsheets/full_water_resource_recovery_facility/BSM2_P_extension_ui.png b/watertap/flowsheets/full_water_resource_recovery_facility/BSM2_P_extension_ui.png index 194c339fa3..7017e84a70 100644 Binary files a/watertap/flowsheets/full_water_resource_recovery_facility/BSM2_P_extension_ui.png and b/watertap/flowsheets/full_water_resource_recovery_facility/BSM2_P_extension_ui.png differ diff --git a/watertap/flowsheets/full_water_resource_recovery_facility/BSM2_ui.png b/watertap/flowsheets/full_water_resource_recovery_facility/BSM2_ui.png index 194c339fa3..ebaf96f320 100644 Binary files a/watertap/flowsheets/full_water_resource_recovery_facility/BSM2_ui.png and b/watertap/flowsheets/full_water_resource_recovery_facility/BSM2_ui.png differ diff --git a/watertap/property_models/unit_specific/activated_sludge/asm1_properties.py b/watertap/property_models/unit_specific/activated_sludge/asm1_properties.py index 0bc992a8bc..2a2c183686 100644 --- a/watertap/property_models/unit_specific/activated_sludge/asm1_properties.py +++ b/watertap/property_models/unit_specific/activated_sludge/asm1_properties.py @@ -149,7 +149,7 @@ def build(self): domain=pyo.PositiveReals, doc="Conversion factor applied for TSS calculation", ) - self.BOD5_factor = pyo.Var( + self.BOD5_factor = pyo.Param( ["raw", "effluent"], initialize={"raw": 0.65, "effluent": 0.25}, units=pyo.units.dimensionless, diff --git a/watertap/property_models/unit_specific/activated_sludge/modified_asm2d_properties.py b/watertap/property_models/unit_specific/activated_sludge/modified_asm2d_properties.py index be2e2d0488..6f612561c2 100644 --- a/watertap/property_models/unit_specific/activated_sludge/modified_asm2d_properties.py +++ b/watertap/property_models/unit_specific/activated_sludge/modified_asm2d_properties.py @@ -13,10 +13,15 @@ Thermophysical property package to be used in conjunction with modified ASM2d reactions. Reference: -X. Flores-Alsina, K. Solon, C.K. Mbamba, S. Tait, K.V. Gernaey, U. Jeppsson, D.J. Batstone, +[1] X. Flores-Alsina, K. Solon, C.K. Mbamba, S. Tait, K.V. Gernaey, U. Jeppsson, D.J. Batstone, Modelling phosphorus (P), sulfur (S) and iron (Fe) interactions for dynamic simulations of anaerobic digestion processes, Water Research. 95 (2016) 370-382. https://www.sciencedirect.com/science/article/pii/S0043135416301397 +[2] K. Solon, X. Flores-Alsina, C. Kazadi Mbamba, D. Ikumi, E.I.P. Volcke, C. Vaneeckhaute, G. Ekama, +P.A. Vanrolleghem, D.J. Batstone, K.V. Gernaey, U. Jeppsson, Plant-wide modelling of phosphorus transformations in +wastewater treatment systems: Impacts of control and operational strategies, Water Research. 113 (2017) 97-110 +https://www.sciencedirect.com/science/article/pii/S0043135417300829 + """ # Import Pyomo libraries @@ -38,7 +43,6 @@ from idaes.core.util.model_statistics import degrees_of_freedom from idaes.core.util.initialization import fix_state_vars, revert_state_vars import idaes.logger as idaeslog -import idaes.core.util.scaling as iscale # Some more information about this module __author__ = "Marcus Holly, Adam Atia, Xinhong Liu" @@ -210,6 +214,99 @@ def build(self): doc="ISS fractional content of biomass", ) + # Effluent Quality Index (EQI) parameters [2] + self.i_NSF = pyo.Var( + initialize=0.03352, + units=pyo.units.dimensionless, + domain=pyo.NonNegativeReals, + doc="N content of fermentable substrate, S_F, [kg N/kg COD]", + ) + self.i_NSI = pyo.Var( + initialize=0.06003, + units=pyo.units.dimensionless, + domain=pyo.NonNegativeReals, + doc="N content of inert soluble COD S_I, [kg N/kg COD]", + ) + self.i_NXI = pyo.Var( + initialize=0.06003, + units=pyo.units.dimensionless, + domain=pyo.NonNegativeReals, + doc="N content of inert particulate COD X_I, [kg N/kg COD]", + ) + self.i_NXS = pyo.Var( + initialize=0.03352, + units=pyo.units.dimensionless, + domain=pyo.NonNegativeReals, + doc="N content of slowly biodegradable substrate X_S, [kg N/kg COD]", + ) + self.i_NBM = pyo.Var( + initialize=0.08615, + units=pyo.units.dimensionless, + domain=pyo.NonNegativeReals, + doc="N content of biomass, X_H, X_PAO, X_AUT, [kg N/kg COD]", + ) + self.f_SI = pyo.Var( + initialize=0.00, + units=pyo.units.dimensionless, + domain=pyo.NonNegativeReals, + doc="Production of S_I in hydrolysis, [kg COD/kg COD]", + ) + self.f_XIH = pyo.Var( + initialize=0.1, + units=pyo.units.dimensionless, + domain=pyo.NonNegativeReals, + doc="Fraction of inert COD generated in lysis of X_H, [kg COD/kg COD]", + ) + self.f_XIP = pyo.Var( + initialize=0.1, + units=pyo.units.dimensionless, + domain=pyo.NonNegativeReals, + doc="Fraction of inert COD generated in lysis of X_PAO and X_PHA, [kg COD/kg COD]", + ) + self.f_XIA = pyo.Var( + initialize=0.1, + units=pyo.units.dimensionless, + domain=pyo.NonNegativeReals, + doc="Fraction of inert COD generated in lysis of X_AUT, [kg COD/kg COD]", + ) + self.i_PSF = pyo.Var( + initialize=0.00559, + units=pyo.units.dimensionless, + domain=pyo.NonNegativeReals, + doc="P content of fermentable substrate, S_F, [kg P/kg COD]", + ) + self.i_PSI = pyo.Var( + initialize=0.00649, + units=pyo.units.dimensionless, + domain=pyo.NonNegativeReals, + doc="P content of inert soluble COD S_I, [kg P/kg COD]", + ) + self.i_PXI = pyo.Var( + initialize=0.00649, + units=pyo.units.dimensionless, + domain=pyo.NonNegativeReals, + doc="P content of inert particulate COD X_I, [kg P/kg COD]", + ) + self.i_PXS = pyo.Var( + initialize=0.00559, + units=pyo.units.dimensionless, + domain=pyo.NonNegativeReals, + doc="P content of slowly biodegradable substrate X_S, [kg P/kg COD]", + ) + self.i_PBM = pyo.Var( + initialize=0.02154, + units=pyo.units.dimensionless, + domain=pyo.NonNegativeReals, + doc="P content of biomass, X_H, X_PAO, X_AUT, [kg P/kg COD]", + ) + self.BOD5_factor = pyo.Param( + ["raw", "effluent"], + initialize={"raw": 0.65, "effluent": 0.25}, + units=pyo.units.dimensionless, + domain=pyo.PositiveReals, + doc="Conversion factor for BOD5", + ) + # Fix Vars that are treated as Params for v in self.component_objects(pyo.Var): v.fix() @@ -229,6 +326,12 @@ def define_metadata(cls, obj): "VSS": {"method": "_VSS"}, "ISS": {"method": "_ISS"}, "TSS": {"method": "_TSS"}, + "COD": {"method": "_COD"}, + "TKN": {"method": "_TKN"}, + "SNOX": {"method": "_SNOX"}, + "BOD5": {"method": "_BOD5"}, + "SP_organic": {"method": "_SP_organic"}, + "SP_inorganic": {"method": "_SP_inorganic"}, } ) obj.add_default_units( @@ -383,68 +486,127 @@ def build(self): units=pyo.units.kg / pyo.units.m**3, ) - # On-demand properties - def _VSS(self): - self.VSS = pyo.Var( - initialize=1, - domain=pyo.NonNegativeReals, - doc="Volatile suspended solids", - units=pyo.units.kg / pyo.units.m**3, - ) - # TODO: X_SRB not included yet in biomass term summation - def rule_VSS(b): - return ( - b.VSS - == b.conc_mass_comp["X_I"] / b.params.CODtoVSS_XI - + b.conc_mass_comp["X_S"] / b.params.CODtoVSS_XS + def _VSS(self): + vss = ( + self.conc_mass_comp["X_I"] / self.params.CODtoVSS_XI + + self.conc_mass_comp["X_S"] / self.params.CODtoVSS_XS + ( - b.conc_mass_comp["X_H"] - + b.conc_mass_comp["X_PAO"] - + b.conc_mass_comp["X_AUT"] + self.conc_mass_comp["X_H"] + + self.conc_mass_comp["X_PAO"] + + self.conc_mass_comp["X_AUT"] ) - / b.params.CODtoVSS_XBM - + b.conc_mass_comp["X_PHA"] / b.params.CODtoVSS_XPHA + / self.params.CODtoVSS_XBM + + self.conc_mass_comp["X_PHA"] / self.params.CODtoVSS_XPHA ) + return vss - self.eq_VSS = pyo.Constraint(rule=rule_VSS) - - def _ISS(self): - self.ISS = pyo.Var( - initialize=1, - domain=pyo.NonNegativeReals, - doc="Inorganic suspended solids", - units=pyo.units.kg / pyo.units.m**3, - ) + self.VSS = pyo.Expression(rule=_VSS, doc="Volatile suspended solids") - # TODO: Several HFO and other terms omitted since not included yet. - def rule_ISS(b): - return ( - b.ISS - == b.params.f_ISS_BM + def _ISS(self): + iss = ( + self.params.f_ISS_BM * ( - b.conc_mass_comp["X_H"] - + b.conc_mass_comp["X_PAO"] - + b.conc_mass_comp["X_AUT"] + self.conc_mass_comp["X_H"] + + self.conc_mass_comp["X_PAO"] + + self.conc_mass_comp["X_AUT"] ) - / b.params.CODtoVSS_XBM - + b.params.ISS_P * b.conc_mass_comp["X_PP"] + / self.params.CODtoVSS_XBM + + self.params.ISS_P * self.conc_mass_comp["X_PP"] ) + return iss + + self.ISS = pyo.Expression(rule=_ISS, doc="Inorganic suspended solids") + + def _TSS(self): + tss = self.VSS + self.ISS + return tss + + self.TSS = pyo.Expression(rule=_TSS, doc="Total suspended solids") + + def _COD(self): + cod = ( + self.conc_mass_comp["S_F"] + + self.conc_mass_comp["S_A"] + + self.conc_mass_comp["S_I"] + + self.conc_mass_comp["X_I"] + + self.conc_mass_comp["X_S"] + + self.conc_mass_comp["X_H"] + + self.conc_mass_comp["X_PAO"] + + self.conc_mass_comp["X_PHA"] + + self.conc_mass_comp["X_AUT"] + ) + return cod + + self.COD = pyo.Expression(rule=_COD, doc="Chemical oxygen demand") + + def _TKN(self): + tkn = ( + self.conc_mass_comp["S_NH4"] + + self.params.i_NSF * self.conc_mass_comp["S_F"] + + self.params.i_NSI * self.conc_mass_comp["S_I"] + + self.params.i_NXI * self.conc_mass_comp["X_I"] + + self.params.i_NXS * self.conc_mass_comp["X_S"] + + self.params.i_NBM + * ( + self.conc_mass_comp["X_H"] + + self.conc_mass_comp["X_PAO"] + + self.conc_mass_comp["X_AUT"] + ) + ) + return tkn - self.eq_ISS = pyo.Constraint(rule=rule_ISS) + self.TKN = pyo.Expression(rule=_TKN, doc="Kjeldahl nitrogen") - def _TSS(self): - self.TSS = pyo.Var( - initialize=1, - domain=pyo.NonNegativeReals, - doc="Total suspended solids", - units=pyo.units.kg / pyo.units.m**3, + def _SNOX(self): + snox = self.conc_mass_comp["S_NO3"] + + return snox + + self.SNOX = pyo.Expression(rule=_SNOX, doc="Nitrogen oxide") + + def _BOD5(self, i): + bod5 = ( + self.conc_mass_comp["S_F"] + + self.conc_mass_comp["S_A"] + + (1 - self.params.f_SI) * self.conc_mass_comp["X_S"] + + (1 - self.params.f_XIH) * self.conc_mass_comp["X_H"] + + (1 - self.params.f_XIP) + * (self.conc_mass_comp["X_PAO"] + self.conc_mass_comp["X_PHA"]) + + (1 - self.params.f_XIA) * self.conc_mass_comp["X_AUT"] + ) + + return self.params.BOD5_factor[i] * bod5 + + self.BOD5 = pyo.Expression( + ["raw", "effluent"], rule=_BOD5, doc="Five-day biological oxygen demand" ) - def rule_TSS(b): - return b.TSS == b.VSS + b.ISS + def _SP_organic(self): + sp_organic = ( + self.conc_mass_comp["X_PP"] + + self.params.i_PSF * self.conc_mass_comp["S_F"] + + self.params.i_PSI * self.conc_mass_comp["S_I"] + + self.params.i_PXI * self.conc_mass_comp["X_I"] + + self.params.i_PXS * self.conc_mass_comp["X_S"] + + self.params.i_PBM + * ( + self.conc_mass_comp["X_H"] + + self.conc_mass_comp["X_PAO"] + + self.conc_mass_comp["X_AUT"] + ) + ) + return sp_organic - self.eq_TSS = pyo.Constraint(rule=rule_TSS) + self.SP_organic = pyo.Expression(rule=_SP_organic, doc="Organic phosphorus") + + def _SP_inorganic(self): + sp_inorganic = self.conc_mass_comp["S_PO4"] + return sp_inorganic + + self.SP_inorganic = pyo.Expression( + rule=_SP_inorganic, doc="Inorganic phosphorus" + ) def get_material_flow_terms(self, p, j): if j == "H2O": @@ -500,16 +662,3 @@ def get_material_flow_basis(self): def calculate_scaling_factors(self): super().calculate_scaling_factors() - - # TODO: revisit scaling of these new on-demand props - if self.is_property_constructed("VSS"): - if iscale.get_scaling_factor(self.VSS) is None: - iscale.set_scaling_factor(self.VSS, 1) - - if self.is_property_constructed("ISS"): - if iscale.get_scaling_factor(self.ISS) is None: - iscale.set_scaling_factor(self.ISS, 1) - - if self.is_property_constructed("TSS"): - if iscale.get_scaling_factor(self.TSS) is None: - iscale.set_scaling_factor(self.TSS, 1) diff --git a/watertap/property_models/unit_specific/activated_sludge/tests/test_asm1_thermo.py b/watertap/property_models/unit_specific/activated_sludge/tests/test_asm1_thermo.py index a118504595..bc8dd6312b 100644 --- a/watertap/property_models/unit_specific/activated_sludge/tests/test_asm1_thermo.py +++ b/watertap/property_models/unit_specific/activated_sludge/tests/test_asm1_thermo.py @@ -170,7 +170,7 @@ def test_build(self, model): assert value(model.props[1].params.i_xp) == 0.06 assert isinstance(model.props[1].params.COD_to_SS, Var) assert value(model.props[1].params.COD_to_SS) == 0.75 - assert isinstance(model.props[1].params.BOD5_factor, Var) + assert isinstance(model.props[1].params.BOD5_factor, Param) assert value(model.props[1].params.BOD5_factor["raw"]) == 0.65 assert value(model.props[1].params.BOD5_factor["effluent"]) == 0.25 diff --git a/watertap/property_models/unit_specific/activated_sludge/tests/test_modified_asm2d_thermo.py b/watertap/property_models/unit_specific/activated_sludge/tests/test_modified_asm2d_thermo.py index 22455d8c12..6a6fec043b 100644 --- a/watertap/property_models/unit_specific/activated_sludge/tests/test_modified_asm2d_thermo.py +++ b/watertap/property_models/unit_specific/activated_sludge/tests/test_modified_asm2d_thermo.py @@ -29,7 +29,6 @@ ) from watertap.core.solvers import get_solver -from watertap.property_models.tests.property_test_harness import PropertyAttributeError # ----------------------------------------------------------------------------- @@ -153,6 +152,66 @@ def test_build(self, model): assert model.params.f_ISS_BM.is_fixed() assert value(model.params.f_ISS_BM) == 0.15 + assert isinstance(model.params.i_NSF, Var) + assert model.params.i_NSF.is_fixed() + assert value(model.params.i_NSF) == 0.03352 + + assert isinstance(model.params.i_NSI, Var) + assert model.params.i_NSI.is_fixed() + assert value(model.params.i_NSI) == 0.06003 + + assert isinstance(model.params.i_NXI, Var) + assert model.params.i_NXI.is_fixed() + assert value(model.params.i_NXI) == 0.06003 + + assert isinstance(model.params.i_NXS, Var) + assert model.params.i_NXS.is_fixed() + assert value(model.params.i_NXS) == 0.03352 + + assert isinstance(model.params.i_NBM, Var) + assert model.params.i_NBM.is_fixed() + assert value(model.params.i_NBM) == 0.08615 + + assert isinstance(model.params.f_SI, Var) + assert model.params.f_SI.is_fixed() + assert value(model.params.f_SI) == 0 + + assert isinstance(model.params.f_XIH, Var) + assert model.params.f_XIH.is_fixed() + assert value(model.params.f_XIH) == 0.1 + + assert isinstance(model.params.f_XIP, Var) + assert model.params.f_XIP.is_fixed() + assert value(model.params.f_XIP) == 0.1 + + assert isinstance(model.params.f_XIA, Var) + assert model.params.f_XIA.is_fixed() + assert value(model.params.f_XIA) == 0.1 + + assert isinstance(model.params.i_PSF, Var) + assert model.params.i_PSF.is_fixed() + assert value(model.params.i_PSF) == 0.00559 + + assert isinstance(model.params.i_PSI, Var) + assert model.params.i_PSI.is_fixed() + assert value(model.params.i_PSI) == 0.00649 + + assert isinstance(model.params.i_PXI, Var) + assert model.params.i_PXI.is_fixed() + assert value(model.params.i_PXI) == 0.00649 + + assert isinstance(model.params.i_PXS, Var) + assert model.params.i_PXS.is_fixed() + assert value(model.params.i_PXS) == 0.00559 + + assert isinstance(model.params.i_PBM, Var) + assert model.params.i_PBM.is_fixed() + assert value(model.params.i_PBM) == 0.02154 + + assert isinstance(model.params.BOD5_factor, Param) + assert value(model.params.BOD5_factor["raw"]) == 0.65 + assert value(model.params.BOD5_factor["effluent"]) == 0.25 + class TestStateBlock(object): @pytest.fixture(scope="class") @@ -203,24 +262,6 @@ def test_build(self, model): metadata = model.params.get_metadata().properties - # check that properties are not built if not demanded - for v in metadata.list_supported_properties(): - if metadata[v.name].method is not None: - if model.props[1].is_property_constructed(v.name): - raise PropertyAttributeError( - "Property {v_name} is an on-demand property, but was found " - "on the stateblock without being demanded".format(v_name=v.name) - ) - - # check that properties are built if demanded - for v in metadata.list_supported_properties(): - if metadata[v.name].method is not None: - if not hasattr(model.props[1], v.name): - raise PropertyAttributeError( - "Property {v_name} is an on-demand property, but was not built " - "when demanded".format(v_name=v.name) - ) - @pytest.mark.unit def test_get_material_flow_terms(self, model): for p in model.params.phase_list: diff --git a/watertap/unit_models/tests/test_aeration_tank.py b/watertap/unit_models/tests/test_aeration_tank.py index 952444e874..343a5d961e 100644 --- a/watertap/unit_models/tests/test_aeration_tank.py +++ b/watertap/unit_models/tests/test_aeration_tank.py @@ -175,9 +175,9 @@ def test_build(self, model): == model.fs.unit.control_volume.mass_transfer_term[k] ) - assert number_variables(model) == 102 + assert number_variables(model) == 100 assert number_total_constraints(model) == 49 - assert number_unused_variables(model) == 3 + assert number_unused_variables(model) == 1 @pytest.mark.component def test_units(self, model): diff --git a/watertap/unit_models/tests/test_dewatering_unit.py b/watertap/unit_models/tests/test_dewatering_unit.py index 13e01e912d..50a157ae62 100644 --- a/watertap/unit_models/tests/test_dewatering_unit.py +++ b/watertap/unit_models/tests/test_dewatering_unit.py @@ -188,9 +188,9 @@ def test_build(self, du): assert hasattr(du.fs.unit.overflow, "pressure") assert hasattr(du.fs.unit.overflow, "alkalinity") - assert number_variables(du) == 85 + assert number_variables(du) == 83 assert number_total_constraints(du) == 62 - assert number_unused_variables(du) == 6 + assert number_unused_variables(du) == 4 @pytest.mark.unit def test_dof(self, du): diff --git a/watertap/unit_models/translators/tests/test_translator_adm1_asm1.py b/watertap/unit_models/translators/tests/test_translator_adm1_asm1.py index 81c0680a20..50c3311f2f 100644 --- a/watertap/unit_models/translators/tests/test_translator_adm1_asm1.py +++ b/watertap/unit_models/translators/tests/test_translator_adm1_asm1.py @@ -173,7 +173,7 @@ def test_build(self, admasm): assert hasattr(admasm.fs.unit.outlet, "pressure") assert hasattr(admasm.fs.unit.outlet, "alkalinity") - assert number_variables(admasm) == 138 + assert number_variables(admasm) == 136 assert number_total_constraints(admasm) == 16 assert number_unused_variables(admasm.fs.unit) == 4 diff --git a/watertap/unit_models/translators/tests/test_translator_adm1_asm2d.py b/watertap/unit_models/translators/tests/test_translator_adm1_asm2d.py index c417a4671c..e4b532e45f 100644 --- a/watertap/unit_models/translators/tests/test_translator_adm1_asm2d.py +++ b/watertap/unit_models/translators/tests/test_translator_adm1_asm2d.py @@ -192,7 +192,7 @@ def test_build(self, asmadm): assert hasattr(asmadm.fs.unit.outlet, "temperature") assert hasattr(asmadm.fs.unit.outlet, "pressure") - assert number_variables(asmadm) == 264 + assert number_variables(asmadm) == 278 assert number_total_constraints(asmadm) == 21 assert number_unused_variables(asmadm.fs.unit) == 4 diff --git a/watertap/unit_models/translators/tests/test_translator_asm1_adm1.py b/watertap/unit_models/translators/tests/test_translator_asm1_adm1.py index c362a4a90e..45a3252dda 100644 --- a/watertap/unit_models/translators/tests/test_translator_asm1_adm1.py +++ b/watertap/unit_models/translators/tests/test_translator_asm1_adm1.py @@ -163,7 +163,7 @@ def test_build(self, asmadm): assert hasattr(asmadm.fs.unit.outlet, "anions") assert hasattr(asmadm.fs.unit.outlet, "cations") - assert number_variables(asmadm) == 143 + assert number_variables(asmadm) == 141 assert number_total_constraints(asmadm) == 34 assert number_unused_variables(asmadm.fs.unit) == 0 diff --git a/watertap/unit_models/translators/tests/test_translator_asm2d_adm1.py b/watertap/unit_models/translators/tests/test_translator_asm2d_adm1.py index 44070458e1..f525eb46e2 100644 --- a/watertap/unit_models/translators/tests/test_translator_asm2d_adm1.py +++ b/watertap/unit_models/translators/tests/test_translator_asm2d_adm1.py @@ -194,7 +194,7 @@ def test_build(self, asmadm): assert hasattr(asmadm.fs.unit.outlet, "anions") assert hasattr(asmadm.fs.unit.outlet, "cations") - assert number_variables(asmadm) == 264 + assert number_variables(asmadm) == 278 assert number_total_constraints(asmadm) == 34 # TODO: Result of SN2_AS2 being unused. Remove? It's also unused in the c-code @@ -459,7 +459,7 @@ def test_build(self, asmadm): assert hasattr(asmadm.fs.unit.outlet, "anions") assert hasattr(asmadm.fs.unit.outlet, "cations") - assert number_variables(asmadm) == 264 + assert number_variables(asmadm) == 278 assert number_total_constraints(asmadm) == 34 # TODO: Result of SN2_AS2 being unused. Remove? It's also unused in the c-code