Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sweep analysis for electroNP flowsheet #1077

Merged
merged 61 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from 49 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
7d35890
add
luohezhiming Mar 16, 2023
4766c52
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Mar 16, 2023
ef81bae
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Mar 22, 2023
168bbaf
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Mar 27, 2023
a09b4e9
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Mar 30, 2023
44a22e8
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Mar 31, 2023
1c1a135
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Apr 5, 2023
401f997
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Apr 10, 2023
258f6fe
delete redundant files
luohezhiming Apr 11, 2023
2c994c3
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Apr 17, 2023
5b6baed
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Apr 21, 2023
0afa551
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Apr 24, 2023
479fb6d
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Apr 28, 2023
b393ed0
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming May 9, 2023
708ad0a
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming May 12, 2023
5a69761
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming May 17, 2023
112415a
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming May 19, 2023
93737c0
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming May 25, 2023
3162e34
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming May 26, 2023
637b32d
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming May 29, 2023
ea4e066
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jun 5, 2023
84a2900
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jun 7, 2023
17bc5e3
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jun 12, 2023
f816483
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jun 13, 2023
5070b6b
add sensitivity analysis
luohezhiming Jun 14, 2023
94c0d87
add sweep analysis
luohezhiming Jun 14, 2023
fea68e3
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jun 14, 2023
2f24258
Merge branch 'main' into electroNP_flowsheet_analysis
luohezhiming Jun 14, 2023
4e00192
add sweep analysis
luohezhiming Jun 14, 2023
11501c1
add more analysis
luohezhiming Jun 15, 2023
4454b7f
add analysis
luohezhiming Jun 16, 2023
c19fba5
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jun 20, 2023
f0fa980
revise file
luohezhiming Jun 20, 2023
00abb0c
add more analysis
luohezhiming Jun 21, 2023
0754d21
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jun 22, 2023
9dcece1
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jun 22, 2023
c0f1afe
Merge branch 'main' into electroNP_flowsheet_analysis
luohezhiming Jun 22, 2023
3a59826
revise flowsheet
luohezhiming Jun 23, 2023
aa39be3
revise analysis
luohezhiming Jun 27, 2023
a5325c9
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jun 27, 2023
c4bc3ef
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jul 5, 2023
991343b
Merge branch 'main' into electroNP_flowsheet3
luohezhiming Jul 5, 2023
e317d5e
add sweep analysis
luohezhiming Jul 7, 2023
bb8ca41
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jul 7, 2023
ffb686e
Merge branch 'main' into electroNP_flowsheet3
luohezhiming Jul 7, 2023
c4a60cc
delete scaling factors
luohezhiming Jul 7, 2023
a35aa0f
revise test file
luohezhiming Jul 7, 2023
22d789d
revise opex frac
luohezhiming Jul 7, 2023
1368258
plinting code
luohezhiming Jul 10, 2023
e858266
Update watertap/costing/units/electroNP.py
luohezhiming Jul 11, 2023
b0fdd3a
Update watertap/costing/units/electroNP.py
luohezhiming Jul 11, 2023
f7aa5e8
Update watertap/costing/units/electroNP.py
luohezhiming Jul 11, 2023
0c1cad3
Update watertap/examples/flowsheets/case_studies/electroNP/multi_swee…
luohezhiming Jul 11, 2023
ff5a4c7
clean up the code
luohezhiming Jul 11, 2023
83006fe
revise value
luohezhiming Jul 11, 2023
5afdc55
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jul 11, 2023
35c26de
Merge branch 'main' into electroNP_flowsheet3
luohezhiming Jul 11, 2023
f6c19cc
add test for display_costing
luohezhiming Jul 12, 2023
35ecf79
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jul 12, 2023
311175e
Merge branch 'main' into electroNP_flowsheet3
luohezhiming Jul 12, 2023
a8efd9a
Merge branch 'main' into electroNP_flowsheet3
adam-a-a Jul 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 31 additions & 2 deletions watertap/costing/units/electroNP.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,36 @@ def build_electroNP_cost_param_block(blk):
units=pyo.units.hr,
)
blk.sizing_cost = pyo.Var(
initialize=1.25,
initialize=1000,
doc="Reactor sizing cost",
units=pyo.units.USD_2020 / pyo.units.m**3,
)

costing = blk.parent_block()
blk.magnesium_chloride_cost = pyo.Param(
mutable=True,
initialize=0.0786,
doc="Magnesium chloride cost",
units=pyo.units.USD_2020 / pyo.units.kg,
)
costing.add_defined_flow("magnesium chloride", blk.magnesium_chloride_cost)

blk.phosphorus_recovery_revenue = pyo.Param(
luohezhiming marked this conversation as resolved.
Show resolved Hide resolved
mutable=True,
initialize=-0.07,
doc="Phosphorus recovery revenue",
luohezhiming marked this conversation as resolved.
Show resolved Hide resolved
units=pyo.units.USD_2020 / pyo.units.kg,
)
costing.add_defined_flow("phosphorus salt product", blk.phosphorus_recovery_revenue)


@register_costing_parameter_block(
build_rule=build_electroNP_cost_param_block,
parameter_block_name="electroNP",
)
def cost_electroNP(blk, cost_electricity_flow=True, cost_MgCl2_flow=True):
def cost_electroNP(
blk, cost_electricity_flow=True, cost_MgCl2_flow=True, cost_product_flow=True
luohezhiming marked this conversation as resolved.
Show resolved Hide resolved
):
"""
ElectroNP costing method
"""
Expand Down Expand Up @@ -64,6 +83,16 @@ def cost_electroNP(blk, cost_electricity_flow=True, cost_MgCl2_flow=True):
"magnesium chloride",
)

if cost_product_flow:
blk.costing_package.cost_flow(
pyo.units.convert(
blk.unit_model.byproduct.flow_vol[t0]
* blk.unit_model.byproduct.conc_mass_comp[t0, "S_PO4"],
to_units=pyo.units.kg / pyo.units.hr,
),
"phosphorus salt product",
)


def cost_electroNP_capital(blk, HRT, sizing_cost):
"""
Expand Down
24 changes: 17 additions & 7 deletions watertap/costing/watertap_costing_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,23 @@ def build_global_params(self):
units=pyo.units.kg / pyo.units.kWh,
)

self.magnesium_chloride_cost = pyo.Param(
mutable=True,
initialize=0.0786,
doc="Magnesium chloride cost",
units=pyo.units.USD_2020 / pyo.units.kg,
)
self.add_defined_flow("magnesium chloride", self.magnesium_chloride_cost)
# self.magnesium_chloride_cost = pyo.Param(
# mutable=True,
# initialize=0.0786,
# doc="Magnesium chloride cost",
# units=pyo.units.USD_2020 / pyo.units.kg,
# )
# self.add_defined_flow("magnesium chloride", self.magnesium_chloride_cost)
#
# self.phosphorus_recovery_revenue = pyo.Param(
# mutable=True,
# initialize=-0.07,
# doc="Phosphorus recovery revenue",
# units=pyo.units.USD_2020 / pyo.units.kg,
# )
# self.add_defined_flow(
# "phosphorus salt product", self.phosphorus_recovery_revenue
# )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete


# fix the parameters
self.fix_all_vars()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
units,
value,
assert_optimal_termination,
units as pyunits,
)
from pyomo.network import Arc
from idaes.core import (
Expand All @@ -35,18 +36,19 @@
from watertap.property_models.anaerobic_digestion.modified_adm1_reactions import (
ModifiedADM1ReactionParameterBlock,
)
from watertap.property_models.activated_sludge.simple_modified_asm2d_properties import (
SimpleModifiedASM2dParameterBlock,
from watertap.property_models.activated_sludge.modified_asm2d_properties import (
ModifiedASM2dParameterBlock,
)
from watertap.unit_models.translators.translator_adm1_simple_asm2d import (
Translator_ADM1_Simple_ASM2D,
from watertap.unit_models.translators.translator_adm1_asm2d import (
Translator_ADM1_ASM2D,
)
from watertap.unit_models.electroNP_ZO import ElectroNPZO
from idaes.core.util.tables import (
create_stream_table_dataframe,
stream_table_dataframe_to_string,
)
from idaes.core.util.initialization import propagate_state
from watertap.core.util.initialization import check_solve
from watertap.costing import WaterTAPCosting

# Set up logger
Expand All @@ -56,19 +58,17 @@
def build_flowsheet():
# flowsheet set up
m = pyo.ConcreteModel()

m.fs = FlowsheetBlock(dynamic=False)

m.fs.props_ADM1 = ModifiedADM1ParameterBlock()
m.fs.props_vap_ADM1 = ADM1_vaporParameterBlock()
m.fs.rxn_props_ADM1 = ModifiedADM1ReactionParameterBlock(
property_package=m.fs.props_ADM1
)
m.fs.props_ASM2D = SimpleModifiedASM2dParameterBlock(
additional_solute_list=["S_K", "S_Mg"]
)
m.fs.props_ASM2D = ModifiedASM2dParameterBlock()
m.fs.costing = WaterTAPCosting()

# Unit models
m.fs.AD = AD(
liquid_property_package=m.fs.props_ADM1,
vapor_property_package=m.fs.props_vap_ADM1,
Expand All @@ -78,7 +78,7 @@
)
m.fs.AD.costing = UnitModelCostingBlock(flowsheet_costing_block=m.fs.costing)

m.fs.translator_adm1_asm2d = Translator_ADM1_Simple_ASM2D(
m.fs.translator_adm1_asm2d = Translator_ADM1_ASM2D(
inlet_property_package=m.fs.props_ADM1,
outlet_property_package=m.fs.props_ASM2D,
reaction_package=m.fs.rxn_props_ADM1,
Expand All @@ -93,7 +93,7 @@
m.fs.costing.add_annual_water_production(
m.fs.electroNP.properties_treated[0].flow_vol
)
m.fs.costing.add_LCOW(m.fs.electroNP.properties_treated[0].flow_vol)
m.fs.costing.add_LCOW(m.fs.AD.inlet.flow_vol[0])

# connections
m.fs.stream_adm1_translator = Arc(
Expand All @@ -105,7 +105,7 @@
pyo.TransformationFactory("network.expand_arcs").apply_to(m)

# Feed conditions based on mass balance in Flores-Alsina, where 0 terms are expressed as 1e-9
m.fs.AD.inlet.flow_vol.fix(
m.fs.AD.inlet.flow_vol[0].fix(
170 * units.m**3 / units.day
) # Double check this value
m.fs.AD.inlet.temperature.fix(308.15)
Expand Down Expand Up @@ -153,6 +153,9 @@
m.fs.electroNP.energy_electric_flow_mass.fix(0.044 * units.kWh / units.kg)
m.fs.electroNP.magnesium_chloride_dosage.fix(0.388)

# Costing
m.fs.costing.electroNP.phosphorus_recovery_revenue = 0

# scaling
for var in m.fs.component_data_objects(pyo.Var, descend_into=True):
if "flow_vol" in var.name:
Expand All @@ -177,125 +180,101 @@
iscale.set_scaling_factor(var, 1e-1)
if "conc_mass_comp[X_I]" in var.name:
iscale.set_scaling_factor(var, 1e-1)
if "conc_mass_comp[S_O2]" in var.name:
iscale.set_scaling_factor(var, 1e4)
if "conc_mass_comp[S_N2]" in var.name:
iscale.set_scaling_factor(var, 1e4)
if "conc_mass_comp[S_NO3]" in var.name:
iscale.set_scaling_factor(var, 1e4)
if "conc_mass_comp[X_H]" in var.name:
iscale.set_scaling_factor(var, 1e4)
if "conc_mass_comp[X_PAO]" in var.name:
iscale.set_scaling_factor(var, 1e4)
if "conc_mass_comp[X_AUT]" in var.name:
iscale.set_scaling_factor(var, 1e4)
if "conc_mass_comp[X_MeOH]" in var.name:
iscale.set_scaling_factor(var, 1e4)
if "conc_mass_comp[X_MeP]" in var.name:
iscale.set_scaling_factor(var, 1e4)
if "conc_mass_comp[X_TSS]" in var.name:
iscale.set_scaling_factor(var, 1e4)
if "conc_mass_comp[S_ch4]" in var.name:
iscale.set_scaling_factor(var, 1e4)
if "conc_mass_comp[X_su]" in var.name:
iscale.set_scaling_factor(var, 1e4)
if "conc_mass_comp[X_fa]" in var.name:
iscale.set_scaling_factor(var, 1e4)
if "conc_mass_comp[X_c4]" in var.name:
iscale.set_scaling_factor(var, 1e4)
if "conc_mass_comp[X_pro]" in var.name:
iscale.set_scaling_factor(var, 1e4)
if "conc_mass_comp[X_ac]" in var.name:
iscale.set_scaling_factor(var, 1e4)
if "conc_mass_comp[X_h2]" in var.name:
iscale.set_scaling_factor(var, 1e4)

iscale.calculate_scaling_factors(m)

iscale.set_scaling_factor(m.fs.electroNP.properties_byproduct[0.0].flow_vol, 1e7)
iscale.set_scaling_factor(m.fs.AD.vapor_phase[0].pressure_sat, 1e-3)

skip_constraint = [
"S_O2",
"S_N2",
"X_AUT",
"X_PHA",
"S_I",
"S_NO3",
"S_Mg",
"X_MeP",
"X_MeOH",
"X_PAO",
"X_TSS",
"S_F",
"S_K",
"S_A",
"X_I",
"X_H",
"X_PP",
"X_S",
]

for i in skip_constraint:
m.fs.electroNP.solute_removal_equation[0.0, "Liq", i].deactivate()
m.fs.electroNP.solute_treated_equation[0.0, "Liq", i].deactivate()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you checked why we can skip this constraints and the model still works?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only reason I could imagine is the removal fraction is setting to a really small value 1e-7 and these components should just pass through, but I still want to keep these removal equations just in case if we want to update these removal fractions later.

m.fs.AD.initialize(outlvl=idaeslog.INFO_HIGH)
propagate_state(m.fs.stream_adm1_translator)
m.fs.translator_adm1_asm2d.initialize(outlvl=idaeslog.INFO_HIGH)
propagate_state(m.fs.stream_translator_electroNP)
m.fs.electroNP.initialize(outlvl=idaeslog.INFO_HIGH)
m.fs.costing.initialize()

solver = get_solver()

results = solver.solve(m, tee=True)
results = solve(m, tee=True)
return m, results


def solve(blk, solver=None, checkpoint=None, tee=False, fail_flag=True):
if solver is None:
solver = get_solver()
results = solver.solve(blk, tee=tee)
check_solve(results, checkpoint=checkpoint, logger=_log, fail_flag=fail_flag)
return results


def display_costing(m):
print("\nUnit Capital Costs\n")
print("\n----------Capital Cost----------")
total_capital_cost = value(

Check warning on line 210 in watertap/examples/flowsheets/case_studies/electroNP/electroNP_flowsheet.py

View check run for this annotation

Codecov / codecov/patch

watertap/examples/flowsheets/case_studies/electroNP/electroNP_flowsheet.py#L209-L210

Added lines #L209 - L210 were not covered by tests
pyunits.convert(m.fs.costing.total_capital_cost, to_units=pyunits.USD_2018)
)
normalized_capex = total_capital_cost / value(

Check warning on line 213 in watertap/examples/flowsheets/case_studies/electroNP/electroNP_flowsheet.py

View check run for this annotation

Codecov / codecov/patch

watertap/examples/flowsheets/case_studies/electroNP/electroNP_flowsheet.py#L213

Added line #L213 was not covered by tests
pyunits.convert(m.fs.AD.inlet.flow_vol[0], to_units=pyunits.m**3 / pyunits.hr)
)
print(f"Total Capital Costs: {total_capital_cost:.3f} $")
print(f"Normalized Capital Costs: {normalized_capex:.3f} $/m3/hr")
print("Capital Cost Breakdown")

Check warning on line 218 in watertap/examples/flowsheets/case_studies/electroNP/electroNP_flowsheet.py

View check run for this annotation

Codecov / codecov/patch

watertap/examples/flowsheets/case_studies/electroNP/electroNP_flowsheet.py#L216-L218

Added lines #L216 - L218 were not covered by tests
for u in m.fs.costing._registered_unit_costing:
print(
u.name,
" : ",
value(units.convert(u.capital_cost, to_units=units.USD_2018)),
" : {price:0.3f} $".format(
price=value(pyunits.convert(u.capital_cost, to_units=pyunits.USD_2018))
),
)
print("\n----------Operation Cost----------")
total_operating_cost = value(

Check warning on line 227 in watertap/examples/flowsheets/case_studies/electroNP/electroNP_flowsheet.py

View check run for this annotation

Codecov / codecov/patch

watertap/examples/flowsheets/case_studies/electroNP/electroNP_flowsheet.py#L226-L227

Added lines #L226 - L227 were not covered by tests
pyunits.convert(
m.fs.costing.total_operating_cost, to_units=pyunits.USD_2018 / pyunits.year
)
)
print(f"Total Operating Cost: {total_operating_cost:.3f} $/year")

Check warning on line 232 in watertap/examples/flowsheets/case_studies/electroNP/electroNP_flowsheet.py

View check run for this annotation

Codecov / codecov/patch

watertap/examples/flowsheets/case_studies/electroNP/electroNP_flowsheet.py#L232

Added line #L232 was not covered by tests

opex_fraction = value(

Check warning on line 234 in watertap/examples/flowsheets/case_studies/electroNP/electroNP_flowsheet.py

View check run for this annotation

Codecov / codecov/patch

watertap/examples/flowsheets/case_studies/electroNP/electroNP_flowsheet.py#L234

Added line #L234 was not covered by tests
pyunits.convert(
m.fs.costing.total_operating_cost, to_units=pyunits.USD_2018 / pyunits.year
)
/ pyunits.convert(
m.fs.AD.inlet.flow_vol[0], to_units=pyunits.m**3 / pyunits.year
)
/ m.fs.costing.LCOW
)
print(f"Operating cost fraction: {opex_fraction:.3f} $ opex / $ LCOW")

Check warning on line 243 in watertap/examples/flowsheets/case_studies/electroNP/electroNP_flowsheet.py

View check run for this annotation

Codecov / codecov/patch

watertap/examples/flowsheets/case_studies/electroNP/electroNP_flowsheet.py#L243

Added line #L243 was not covered by tests

print("\nUtility Costs\n")
print("Operating Cost Breakdown")

Check warning on line 245 in watertap/examples/flowsheets/case_studies/electroNP/electroNP_flowsheet.py

View check run for this annotation

Codecov / codecov/patch

watertap/examples/flowsheets/case_studies/electroNP/electroNP_flowsheet.py#L245

Added line #L245 was not covered by tests
for f in m.fs.costing.used_flows:
print(
f,
" : ",
value(
units.convert(
m.fs.costing.aggregate_flow_costs[f],
to_units=units.USD_2018 / units.year,
f.title(),
" : {price:0.3f} $/m3 feed".format(
price=value(
pyunits.convert(
m.fs.costing.aggregate_flow_costs[f],
to_units=pyunits.USD_2018 / pyunits.year,
)
/ pyunits.convert(
m.fs.AD.inlet.flow_vol[0],
to_units=pyunits.m**3 / pyunits.year,
)
)
),
)

print("")
total_capital_cost = value(
units.convert(m.fs.costing.total_capital_cost, to_units=units.USD_2018)
)
print(f"Total Capital Costs: {total_capital_cost:.2f} $")
total_operating_cost = value(
units.convert(
m.fs.costing.total_operating_cost, to_units=units.USD_2018 / units.year
)
)
print(f"Total Operating Costs: {total_operating_cost:.2f} $/year")
print("\n----------Energy----------")

Check warning on line 263 in watertap/examples/flowsheets/case_studies/electroNP/electroNP_flowsheet.py

View check run for this annotation

Codecov / codecov/patch

watertap/examples/flowsheets/case_studies/electroNP/electroNP_flowsheet.py#L263

Added line #L263 was not covered by tests

electricity_intensity = value(
units.convert(
m.fs.electroNP.energy_electric_flow_mass, to_units=units.kWh / units.kg
pyunits.convert(
m.fs.costing.aggregate_flow_electricity / m.fs.AD.inlet.flow_vol[0],
to_units=units.kWh / units.m**3,
)
)
print(f"Electricity Intensity: {electricity_intensity:.4f} kWh/kg - P")
print(f"Electricity Intensity: {electricity_intensity:.4f} kWh/m3")

Check warning on line 271 in watertap/examples/flowsheets/case_studies/electroNP/electroNP_flowsheet.py

View check run for this annotation

Codecov / codecov/patch

watertap/examples/flowsheets/case_studies/electroNP/electroNP_flowsheet.py#L271

Added line #L271 was not covered by tests

print("\n----------Levelized Cost----------")

Check warning on line 273 in watertap/examples/flowsheets/case_studies/electroNP/electroNP_flowsheet.py

View check run for this annotation

Codecov / codecov/patch

watertap/examples/flowsheets/case_studies/electroNP/electroNP_flowsheet.py#L273

Added line #L273 was not covered by tests
LCOW = value(
units.convert(m.fs.costing.LCOW, to_units=units.USD_2018 / units.m**3)
pyunits.convert(m.fs.costing.LCOW, to_units=pyunits.USD_2018 / pyunits.m**3)
)
print(f"Levelized Cost of Water: {LCOW:.4f} $/m^3")
print(f"Levelized Cost of Water: {LCOW:.3f} $/m^3")

Check warning on line 277 in watertap/examples/flowsheets/case_studies/electroNP/electroNP_flowsheet.py

View check run for this annotation

Codecov / codecov/patch

watertap/examples/flowsheets/case_studies/electroNP/electroNP_flowsheet.py#L277

Added line #L277 was not covered by tests


if __name__ == "__main__":
Expand All @@ -305,6 +284,7 @@
{
"AD inlet": m.fs.AD.inlet,
"AD liquid outlet": m.fs.AD.liquid_outlet,
"AD vapor outlet": m.fs.AD.vapor_outlet,
"Translator outlet": m.fs.translator_adm1_asm2d.outlet,
"ElectroNP treated": m.fs.electroNP.treated,
"ElectroNP byproduct": m.fs.electroNP.byproduct,
Expand Down
Loading