Skip to content

Commit

Permalink
Add more detailed pressure exchanger (#1264)
Browse files Browse the repository at this point in the history
* add

* delete redundant files

* Add more detailed pressure exchanger

* code linting

* minor changes

* add test for multi_comp property package

* revise documentation

* change efficiency to universal variable

* temporary version

* Revise doc

* code pylint

* Resolve test problem

* New version of PX

* revise bounds for LPD

* revise leakage equations

* update doc

* code linting

* revise typo

* revise typos

* Update docs/technical_reference/unit_models/pressure_exchanger.rst

Co-authored-by: Adam Atia <aatia@keylogic.com>

* Update docs/technical_reference/unit_models/pressure_exchanger.rst

Co-authored-by: Adam Atia <aatia@keylogic.com>

* Update docs/technical_reference/unit_models/pressure_exchanger.rst

Co-authored-by: Adam Atia <aatia@keylogic.com>

* Update docs/technical_reference/unit_models/pressure_exchanger.rst

Co-authored-by: Adam Atia <aatia@keylogic.com>

* Update docs/technical_reference/unit_models/pressure_exchanger.rst

Co-authored-by: Adam Atia <aatia@keylogic.com>

* Update watertap/unit_models/pressure_exchanger.py

Co-authored-by: Adam Atia <aatia@keylogic.com>

* Update watertap/unit_models/pressure_exchanger.py

Co-authored-by: Adam Atia <aatia@keylogic.com>

* add comments

* resolve issue with inden

* rename LPS to feed_side and HPS to brine_side

* resolve tests problems

* revise test file

* efficiency equation change to ener_out/ener_in

* has_leakage for initialization

* Adjust dye desal with RO test solutions

---------

Co-authored-by: Adam Atia <aatia@keylogic.com>
Co-authored-by: MarcusHolly <marcus.holly@keylogic.com>
Co-authored-by: MarcusHolly <96305519+MarcusHolly@users.noreply.github.com>
  • Loading branch information
4 people authored Mar 26, 2024
1 parent bb02293 commit ab9870b
Show file tree
Hide file tree
Showing 10 changed files with 826 additions and 416 deletions.
66 changes: 59 additions & 7 deletions docs/technical_reference/unit_models/pressure_exchanger.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ This pressure exchanger unit model:
* is isothermal
* supports a single liquid phase only
* supports steady-state only
* assumes no mixing or leakage between the low and high pressure side
* assumes equal flowrates on both sides
* supports leakage and mixing effect

.. index::
pair: watertap.unit_models.pressure_exchanger;pressure_exchanger
Expand All @@ -32,9 +31,16 @@ Where the system is also subject to following constraints:

Figure 1. Schematic representation of an energy recovery system using a pressure exchanger.

When setting the ``has_mixing`` configuration option to ``True``, there is 1 additional variable ``mixing_vol`` that must be fixed.

When setting the ``has_leakage`` configuration option to ``True``, there is 1 additional variable ``leakage_vol`` that must be fixed.

When setting the ``pressure_exchange_calculation`` configuration option to ``PressureExchangeType.high_pressure_difference``,
there are 2 additional variables ``high_pressure_difference`` and ``low_pressure_difference`` that must be fixed. Instead, ``efficiency_pressure_exchanger`` is unfixed.

Model Structure
------------------
The pressure exchanger model consists of 2 `ControlVolume0DBlocks`: one for the low-pressure side and high-pressure side.
The pressure exchanger model consists of 2 `ControlVolume0DBlocks`: one for the feed side and brine side.

Sets
----
Expand All @@ -56,8 +62,14 @@ The pressure exchanger unit model includes the following variables:
:header: "Description", "Symbol", "Variable Name", "Index", "Units", "Pyomo Type"

"Efficiency", ":math:`\eta`", "efficiency_pressure_exchanger", "[t]", ":math:`\text{dimensionless}`", "Var"
"Volumetric leakage fraction", ":math:`\delta`", "leakage_vol", "[t]", ":math:`\text{dimensionless}`", "Var"
"Volumetric mixing fraction", ":math:`\chi`", "mixing_vol", "[t]", ":math:`\text{dimensionless}`", "Var"
"High pressure difference*", ":math:`HPD`", "high_pressure_difference", "[t]", ":math:`\text{Pa}`", "Var"
"Low pressure difference*", ":math:`LPD`", "low_pressure_difference", "[t]", ":math:`\text{Pa}`", "Var"

\*High pressure difference and low pressure difference are non-negative values

Each control volume (i.e. `low_presssure_side`, and `high_pressure_side`) has the following variables of interest:
Each control volume (i.e. `feed_side`, and `brine_side`) has the following variables of interest:

.. csv-table::
:header: "Description", "Symbol", "Variable Name", "Index", "Units", "Pyomo Type"
Expand All @@ -72,7 +84,9 @@ Each property block on both control volumes (i.e. `properties_in` and `propertie
.. csv-table::
:header: "Description", "Symbol", "Variable Name", "Index", "Units", "Pyomo Type"

"Mass flowrate", ":math:`M`", "flow_mass_phase_comp", "[p, j]", "\*", "Var"
"Volumetric flowrate", ":math:`Q`", "flow_vol", "None", "\*", "Var"
"Concentration", ":math:`C`", "conc_mass_phase_comp", "[p, j]", "\*", "Var"
"Temperature", ":math:`T`", "temperature", "[t]", "\*", "Var"
"Pressure", ":math:`P`", "pressure", "[t]", "\*", "Var"

Expand All @@ -81,17 +95,55 @@ Each property block on both control volumes (i.e. `properties_in` and `propertie

Equations
-----------
if ``has_leakage`` and ``has_mixing`` are set to default (``False``):

.. csv-table::
:header: "Description", "Equation"

"Mass balance for each side", ":math:`M_{out, j} = M_{in, j}`"
"Momentum balance for each side", ":math:`P_{out} = P_{in} + ΔP`"
"Isothermal assumption for each side", ":math:`T_{out} = T_{in}`"
"Equal volumetric flowrate*", ":math:`Q_{LPS} = Q_{HPS}`"
"Pressure transfer*", ":math:`ΔP_{LPS} = - \eta ΔP_{HPS}`"
"Equal volumetric flowrate*", ":math:`Q_{out, F} = Q_{in, F}`"
"Equal pressure*", ":math:`P_{out, B} = P_{in, F}`"
"Pressure transfer*", ":math:`ΔP_{F} = - \eta ΔP_{B}`"

\* F stands for feed side, B stands for brine side

if ``has_leakage`` is set to ``True``, then the equal volumetric flowrate equation is replaced by:

.. csv-table::
:header: "Description", "Equation"

"Equal volumetric flowrate", ":math:`Q_{out, F} = (1 - \delta) Q_{in, B}`"

if ``has_mixing`` is set to ``True``, the mass balance equations for each side become:

.. csv-table::
:header: "Description", "Equation"

"Mass balance for each side*", ":math:`M_{out, j} = M_{in, j} + MTT_{j}`"

\* MTT is mass transfer term into the control volume

and there are 3 additional constraints:

.. csv-table::
:header: "Description", "Equation"

"Mixing effect of solute*", ":math:`C_{out, F} = C_{in, F} (1-\chi) + C_{in, B} \chi`"
"Linking mass transfer terms", ":math:`MTT_{j, F} = -MTT_{j, B}`"
"Equal feed side volumetric flowrate", ":math:`Q_{out, F} = Q_{in, F}`"

\* C represents solute concentration

if ``pressure_change_calculation`` is set to ``PressureExchangeType.high_pressure_difference``,
then there is 1 additional constraint and the equal pressure equation is replaced:

.. csv-table::
:header: "Description", "Equation"

\* LPS stands for low pressure side, HPS stands for high pressure side
"Pressure drop across B,in and F, out", ":math:`P_{out, F} + HPD = P_{in, B}`"
"Pressure drop across B, out and F, in", ":math:`P_{out, B} = P_{in, F} + LPD`"

Class Documentation
-------------------
Expand Down
2 changes: 1 addition & 1 deletion watertap/costing/unit_models/pressure_exchanger.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def cost_pressure_exchanger(blk):
blk,
blk.costing_package.pressure_exchanger.cost,
pyo.units.convert(
blk.unit_model.low_pressure_side.properties_in[0].flow_vol,
blk.unit_model.feed_side.properties_in[0].flow_vol,
(pyo.units.meter**3 / pyo.units.hours),
),
)
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,10 @@ def build(erd_type=ERDtype.pressure_exchanger):
m.fs.s03 = Arc(source=m.fs.P1.outlet, destination=m.fs.M1.P1)
m.fs.s04 = Arc(source=m.fs.M1.outlet, destination=m.fs.RO.inlet)
m.fs.s05 = Arc(source=m.fs.RO.permeate, destination=m.fs.product.inlet)
m.fs.s06 = Arc(
source=m.fs.RO.retentate, destination=m.fs.PXR.high_pressure_inlet
)
m.fs.s07 = Arc(
source=m.fs.PXR.high_pressure_outlet, destination=m.fs.disposal.inlet
)
m.fs.s08 = Arc(source=m.fs.S1.PXR, destination=m.fs.PXR.low_pressure_inlet)
m.fs.s09 = Arc(source=m.fs.PXR.low_pressure_outlet, destination=m.fs.P2.inlet)
m.fs.s06 = Arc(source=m.fs.RO.retentate, destination=m.fs.PXR.brine_inlet)
m.fs.s07 = Arc(source=m.fs.PXR.brine_outlet, destination=m.fs.disposal.inlet)
m.fs.s08 = Arc(source=m.fs.S1.PXR, destination=m.fs.PXR.feed_inlet)
m.fs.s09 = Arc(source=m.fs.PXR.feed_outlet, destination=m.fs.P2.inlet)
m.fs.s10 = Arc(source=m.fs.P2.outlet, destination=m.fs.M1.P2)
elif erd_type == ERDtype.pump_as_turbine:
m.fs.s01 = Arc(source=m.fs.feed.outlet, destination=m.fs.P1.inlet)
Expand All @@ -184,8 +180,8 @@ def build(erd_type=ERDtype.pressure_exchanger):

if erd_type == ERDtype.pressure_exchanger:
iscale.set_scaling_factor(m.fs.P2.control_volume.work, 1e-3)
iscale.set_scaling_factor(m.fs.PXR.low_pressure_side.work, 1e-3)
iscale.set_scaling_factor(m.fs.PXR.high_pressure_side.work, 1e-3)
iscale.set_scaling_factor(m.fs.PXR.feed_side.work, 1e-3)
iscale.set_scaling_factor(m.fs.PXR.brine_side.work, 1e-3)
# touch properties used in specifying and initializing the model
m.fs.S1.mixed_state[0].mass_frac_phase_comp
m.fs.S1.PXR_state[0].flow_vol_phase["Liq"]
Expand Down Expand Up @@ -407,7 +403,7 @@ def initialize_pressure_exchanger(m, optarg):
# ---initialize splitter and pressure exchanger---
# pressure exchanger high pressure inlet
propagate_state(m.fs.s06) # propagate to PXR high pressure inlet from RO retentate
m.fs.PXR.high_pressure_side.properties_in.initialize(optarg=optarg)
m.fs.PXR.brine_side.properties_in.initialize(optarg=optarg)

# splitter inlet
propagate_state(m.fs.s01) # propagate to splitter inlet from feed
Expand All @@ -421,7 +417,7 @@ def initialize_pressure_exchanger(m, optarg):
"flow_vol_phase",
"Liq",
): value( # same volumetric flow rate as PXR high pressure inlet
m.fs.PXR.high_pressure_side.properties_in[0].flow_vol_phase["Liq"]
m.fs.PXR.brine_side.properties_in[0].flow_vol_phase["Liq"]
),
("mass_frac_phase_comp", ("Liq", "NaCl")): value(
m.fs.S1.mixed_state[0].mass_frac_phase_comp["Liq", "NaCl"]
Expand Down Expand Up @@ -627,12 +623,12 @@ def print_state(s, b):
print_state("Split 1 ", m.fs.S1.P1)
print_state("P1 out ", m.fs.P1.outlet)
print_state("Split 2 ", m.fs.S1.PXR)
print_state("PXR LP out", m.fs.PXR.low_pressure_outlet)
print_state("PXR feed out", m.fs.PXR.feed_outlet)
print_state("P2 out ", m.fs.P2.outlet)
print_state("Mix out ", m.fs.M1.outlet)
print_state("RO perm ", m.fs.RO.permeate)
print_state("RO reten ", m.fs.RO.retentate)
print_state("PXR HP out", m.fs.PXR.high_pressure_outlet)
print_state("PXR brine out", m.fs.PXR.brine_outlet)


if __name__ == "__main__":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,32 +61,32 @@ fs.P2.costing.capital_cost: 610.4424522403153
fs.P2.ratioP[0.0]: 1.0725115194945298
fs.P2.work_fluid[0.0]: 255.95071372759554
fs.PXR.costing.capital_cost: 973.1020678190223
fs.PXR.high_pressure_side.deltaP[0.0]: -7247342.029398318
fs.PXR.high_pressure_side.properties_in[0.0].dens_mass_phase[Liq]: 1045.9125190112295
fs.PXR.high_pressure_side.properties_in[0.0].flow_mass_phase_comp[Liq,H2O]: 0.49285444999999994
fs.PXR.high_pressure_side.properties_in[0.0].flow_mass_phase_comp[Liq,NaCl]: 0.035587728093265734
fs.PXR.high_pressure_side.properties_in[0.0].flow_vol_phase[Liq]: 0.0005052451027097726
fs.PXR.high_pressure_side.properties_in[0.0].mass_frac_phase_comp[Liq,H2O]: 0.9326553981332943
fs.PXR.high_pressure_side.properties_in[0.0].mass_frac_phase_comp[Liq,NaCl]: 0.06734460186670563
fs.PXR.high_pressure_side.properties_in[0.0].pressure: 7348667.029398319
fs.PXR.high_pressure_side.properties_in[0.0].temperature: 298.1500072638073
fs.PXR.high_pressure_side.properties_out[0.0].flow_mass_phase_comp[Liq,H2O]: 0.49285444999999994
fs.PXR.high_pressure_side.properties_out[0.0].flow_mass_phase_comp[Liq,NaCl]: 0.035587728093265734
fs.PXR.high_pressure_side.properties_out[0.0].pressure: 101325.0
fs.PXR.high_pressure_side.properties_out[0.0].temperature: 298.1500072638073
fs.PXR.low_pressure_side.deltaP[0.0]: 6884974.927928402
fs.PXR.low_pressure_side.properties_in[0.0].dens_mass_phase[Liq]: 1021.46
fs.PXR.low_pressure_side.properties_in[0.0].flow_mass_phase_comp[Liq,H2O]: 0.498024594422437
fs.PXR.low_pressure_side.properties_in[0.0].flow_mass_phase_comp[Liq,NaCl]: 0.018063068191487355
fs.PXR.low_pressure_side.properties_in[0.0].flow_vol_phase[Liq]: 0.0005052451027097726
fs.PXR.low_pressure_side.properties_in[0.0].mass_frac_phase_comp[Liq,H2O]: 0.965
fs.PXR.low_pressure_side.properties_in[0.0].mass_frac_phase_comp[Liq,NaCl]: 0.03500000000000001
fs.PXR.low_pressure_side.properties_in[0.0].pressure: 101325.0
fs.PXR.low_pressure_side.properties_in[0.0].temperature: 298.15
fs.PXR.low_pressure_side.properties_out[0.0].flow_mass_phase_comp[Liq,H2O]: 0.498024594422437
fs.PXR.low_pressure_side.properties_out[0.0].flow_mass_phase_comp[Liq,NaCl]: 0.018063068191487355
fs.PXR.low_pressure_side.properties_out[0.0].pressure: 6986299.927928403
fs.PXR.low_pressure_side.properties_out[0.0].temperature: 298.15
fs.PXR.brine_side.deltaP[0.0]: -7247342.029398318
fs.PXR.brine_side.properties_in[0.0].dens_mass_phase[Liq]: 1045.9125190112295
fs.PXR.brine_side.properties_in[0.0].flow_mass_phase_comp[Liq,H2O]: 0.49285444999999994
fs.PXR.brine_side.properties_in[0.0].flow_mass_phase_comp[Liq,NaCl]: 0.035587728093265734
fs.PXR.brine_side.properties_in[0.0].flow_vol_phase[Liq]: 0.0005052451027097726
fs.PXR.brine_side.properties_in[0.0].mass_frac_phase_comp[Liq,H2O]: 0.9326553981332943
fs.PXR.brine_side.properties_in[0.0].mass_frac_phase_comp[Liq,NaCl]: 0.06734460186670563
fs.PXR.brine_side.properties_in[0.0].pressure: 7348667.029398319
fs.PXR.brine_side.properties_in[0.0].temperature: 298.1500072638073
fs.PXR.brine_side.properties_out[0.0].flow_mass_phase_comp[Liq,H2O]: 0.49285444999999994
fs.PXR.brine_side.properties_out[0.0].flow_mass_phase_comp[Liq,NaCl]: 0.035587728093265734
fs.PXR.brine_side.properties_out[0.0].pressure: 101325.0
fs.PXR.brine_side.properties_out[0.0].temperature: 298.1500072638073
fs.PXR.feed_side.deltaP[0.0]: 6884974.927928402
fs.PXR.feed_side.properties_in[0.0].dens_mass_phase[Liq]: 1021.46
fs.PXR.feed_side.properties_in[0.0].flow_mass_phase_comp[Liq,H2O]: 0.498024594422437
fs.PXR.feed_side.properties_in[0.0].flow_mass_phase_comp[Liq,NaCl]: 0.018063068191487355
fs.PXR.feed_side.properties_in[0.0].flow_vol_phase[Liq]: 0.0005052451027097726
fs.PXR.feed_side.properties_in[0.0].mass_frac_phase_comp[Liq,H2O]: 0.965
fs.PXR.feed_side.properties_in[0.0].mass_frac_phase_comp[Liq,NaCl]: 0.03500000000000001
fs.PXR.feed_side.properties_in[0.0].pressure: 101325.0
fs.PXR.feed_side.properties_in[0.0].temperature: 298.15
fs.PXR.feed_side.properties_out[0.0].flow_mass_phase_comp[Liq,H2O]: 0.498024594422437
fs.PXR.feed_side.properties_out[0.0].flow_mass_phase_comp[Liq,NaCl]: 0.018063068191487355
fs.PXR.feed_side.properties_out[0.0].pressure: 6986299.927928403
fs.PXR.feed_side.properties_out[0.0].temperature: 298.15
fs.RO.feed_side.K[0.0,0.0,NaCl]: 3.4512803512388215e-05
fs.RO.feed_side.K[0.0,1.0,NaCl]: 2.7060824531310153e-05
fs.RO.feed_side.N_Re[0.0,0.0]: 339.4894225951861
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ def test_build(self, system_frame):
fs.s03: (fs.P1.outlet, fs.M1.P1),
fs.s04: (fs.M1.outlet, fs.RO.inlet),
fs.s05: (fs.RO.permeate, fs.product.inlet),
fs.s06: (fs.RO.retentate, fs.PXR.high_pressure_inlet),
fs.s07: (fs.PXR.high_pressure_outlet, fs.disposal.inlet),
fs.s08: (fs.S1.PXR, fs.PXR.low_pressure_inlet),
fs.s09: (fs.PXR.low_pressure_outlet, fs.P2.inlet),
fs.s06: (fs.RO.retentate, fs.PXR.brine_inlet),
fs.s07: (fs.PXR.brine_outlet, fs.disposal.inlet),
fs.s08: (fs.S1.PXR, fs.PXR.feed_inlet),
fs.s09: (fs.PXR.feed_outlet, fs.P2.inlet),
fs.s10: (fs.P2.outlet, fs.M1.P2),
}
for arc, port_tpl in arc_dict.items():
Expand Down Expand Up @@ -197,32 +197,30 @@ def test_initialize_system(self, system_frame):
# check results across pressure exchanger, proxy for both upstream and downstream of RO
# high pressure inlet
assert value(
m.fs.PXR.high_pressure_inlet.flow_mass_phase_comp[0, "Liq", "H2O"]
m.fs.PXR.brine_inlet.flow_mass_phase_comp[0, "Liq", "H2O"]
) == pytest.approx(0.4928, rel=1e-3)
assert value(
m.fs.PXR.high_pressure_inlet.flow_mass_phase_comp[0, "Liq", "NaCl"]
m.fs.PXR.brine_inlet.flow_mass_phase_comp[0, "Liq", "NaCl"]
) == pytest.approx(3.561e-2, rel=1e-3)
assert value(m.fs.PXR.high_pressure_inlet.temperature[0]) == pytest.approx(
assert value(m.fs.PXR.brine_inlet.temperature[0]) == pytest.approx(
298.15, rel=1e-3
)
assert value(m.fs.PXR.high_pressure_inlet.pressure[0]) == pytest.approx(
assert value(m.fs.PXR.brine_inlet.pressure[0]) == pytest.approx(
7.242e6, rel=1e-3
)
# low pressure inlet
assert value(
m.fs.PXR.low_pressure_inlet.flow_mass_phase_comp[0, "Liq", "H2O"]
m.fs.PXR.feed_inlet.flow_mass_phase_comp[0, "Liq", "H2O"]
) == pytest.approx(0.4980, rel=1e-3)
assert value(
m.fs.PXR.low_pressure_inlet.flow_mass_phase_comp[0, "Liq", "NaCl"]
m.fs.PXR.feed_inlet.flow_mass_phase_comp[0, "Liq", "NaCl"]
) == pytest.approx(1.806e-2, rel=1e-3)
assert value(m.fs.PXR.low_pressure_inlet.temperature[0]) == pytest.approx(
assert value(m.fs.PXR.feed_inlet.temperature[0]) == pytest.approx(
298.15, rel=1e-3
)
assert value(m.fs.PXR.low_pressure_inlet.pressure[0]) == pytest.approx(
101325, rel=1e-3
)
assert value(m.fs.PXR.feed_inlet.pressure[0]) == pytest.approx(101325, rel=1e-3)
# low pressure outlet
assert value(m.fs.PXR.low_pressure_outlet.pressure[0]) == pytest.approx(
assert value(m.fs.PXR.feed_outlet.pressure[0]) == pytest.approx(
6.885e6, rel=1e-3
)

Expand Down Expand Up @@ -310,12 +308,12 @@ def test_display_state(self, system_frame, capsys):
Split 1 : 0.505 kg/s, 35000 ppm, 1.0 bar
P1 out : 0.505 kg/s, 35000 ppm, 74.9 bar
Split 2 : 0.516 kg/s, 35000 ppm, 1.0 bar
PXR LP out: 0.516 kg/s, 35000 ppm, 68.9 bar
PXR feed out: 0.516 kg/s, 35000 ppm, 68.9 bar
P2 out : 0.516 kg/s, 35000 ppm, 74.9 bar
Mix out : 1.021 kg/s, 35000 ppm, 74.9 bar
RO perm : 0.493 kg/s, 240 ppm, 1.0 bar
RO reten : 0.528 kg/s, 67424 ppm, 72.4 bar
PXR HP out: 0.528 kg/s, 67424 ppm, 1.0 bar
PXR brine out: 0.528 kg/s, 67424 ppm, 1.0 bar
"""
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,16 +288,12 @@ def eq_flow_mass_comp(blk, j): # pylint: disable=function-redefined
desal.s01 = Arc(source=desal.S1.P1, destination=desal.P1.inlet)
desal.s02 = Arc(source=desal.P1.outlet, destination=desal.M1.P1)
desal.s03 = Arc(source=desal.M1.outlet, destination=desal.RO.inlet)
desal.s04 = Arc(
source=desal.RO.retentate, destination=desal.PXR.high_pressure_inlet
)
desal.s05 = Arc(source=desal.S1.PXR, destination=desal.PXR.low_pressure_inlet)
desal.s06 = Arc(
source=desal.PXR.low_pressure_outlet, destination=desal.P2.inlet
)
desal.s04 = Arc(source=desal.RO.retentate, destination=desal.PXR.brine_inlet)
desal.s05 = Arc(source=desal.S1.PXR, destination=desal.PXR.feed_inlet)
desal.s06 = Arc(source=desal.PXR.feed_outlet, destination=desal.P2.inlet)
desal.s07 = Arc(source=desal.P2.outlet, destination=desal.M1.P2)
m.fs.s_disposal = Arc(
source=desal.PXR.high_pressure_outlet, destination=m.fs.disposal.inlet
source=desal.PXR.brine_outlet, destination=m.fs.disposal.inlet
)
elif erd_type == "pump_as_turbine":
m.fs.s_tb_desal = Arc(
Expand Down Expand Up @@ -343,8 +339,8 @@ def eq_flow_mass_comp(blk, j): # pylint: disable=function-redefined
iscale.set_scaling_factor(desal.RO.area, 1e-4)
if erd_type == "pressure_exchanger":
iscale.set_scaling_factor(desal.P2.control_volume.work, 1e-5)
iscale.set_scaling_factor(desal.PXR.low_pressure_side.work, 1e-5)
iscale.set_scaling_factor(desal.PXR.high_pressure_side.work, 1e-5)
iscale.set_scaling_factor(desal.PXR.feed_side.work, 1e-5)
iscale.set_scaling_factor(desal.PXR.brine_side.work, 1e-5)
elif erd_type == "pump_as_turbine":
iscale.set_scaling_factor(desal.ERD.control_volume.work, 1e-5)
# calculate and propagate scaling factors
Expand Down
Loading

0 comments on commit ab9870b

Please sign in to comment.