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 TVC model #1516

Merged
merged 29 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
3fb9746
add TVC model
ElmiraShamlou Nov 5, 2024
599affa
add TVC cost
ElmiraShamlou Nov 5, 2024
e6e1c26
linting
ElmiraShamlou Nov 5, 2024
fdaa9f5
Merge branch 'main' into TVC
ElmiraShamlou Nov 5, 2024
daf87c6
linting
ElmiraShamlou Nov 5, 2024
5c5db27
Mergr branch 'TVC' of https://github.com/ElmiraShamlou/watertap into TVC
ElmiraShamlou Nov 5, 2024
8abd3d5
modifications
ElmiraShamlou Nov 5, 2024
bc0582c
add reference
ElmiraShamlou Nov 5, 2024
5f8e27b
Merge branch 'main' into TVC
ElmiraShamlou Nov 6, 2024
aa5c91b
Merge branch 'main' into TVC
ElmiraShamlou Dec 11, 2024
c540392
Update watertap/unit_models/tests/test_thermo_compressor_0D.py
ElmiraShamlou Dec 13, 2024
5363bc3
Update watertap/unit_models/tests/test_thermo_compressor_0D.py
ElmiraShamlou Dec 13, 2024
08526d9
Update watertap/unit_models/thermo_compressor_0D.py
ElmiraShamlou Dec 13, 2024
0f64c06
Update watertap/unit_models/tests/test_thermo_compressor_0D.py
ElmiraShamlou Dec 13, 2024
19e406a
name change themor compressor to steam ejector
ElmiraShamlou Dec 13, 2024
05fce39
Merge branch 'TVC' of https://github.com/ElmiraShamlou/watertap into TVC
ElmiraShamlou Dec 13, 2024
c479eb3
add documents and implement requested modifications
ElmiraShamlou Dec 13, 2024
0810bd0
apply variable bounds
ElmiraShamlou Dec 13, 2024
6435f63
resolve doc issue
ElmiraShamlou Dec 13, 2024
0eec313
Merge branch 'main' into TVC
ElmiraShamlou Dec 13, 2024
5e28c52
updates doc
ElmiraShamlou Dec 13, 2024
94b7c39
Merge branch 'TVC' of https://github.com/ElmiraShamlou/watertap into TVC
ElmiraShamlou Dec 13, 2024
0dc3a52
Update docs/technical_reference/unit_models/steam_ejector.rst
ElmiraShamlou Dec 13, 2024
cfe6e8d
Update docs/technical_reference/unit_models/steam_ejector.rst
ElmiraShamlou Dec 13, 2024
f9ec4a0
Merge branch 'main' into TVC
ElmiraShamlou Dec 13, 2024
9fbb652
arrange vars, sets, and equations, add reference, add NA for no bounds
ElmiraShamlou Dec 13, 2024
ca97e53
Merge branch 'TVC' of https://github.com/ElmiraShamlou/watertap into TVC
ElmiraShamlou Dec 13, 2024
ab3db5b
refine doc
ElmiraShamlou Dec 13, 2024
83d1e5c
modifes TCF, PCF, and degree
ElmiraShamlou Dec 13, 2024
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
1 change: 1 addition & 0 deletions docs/technical_reference/unit_models/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Unit Models
pump
reverse_osmosis_0D
reverse_osmosis_1D
steam_ejector
stoichiometric_reactor
thickener
translators/index
Expand Down
76 changes: 76 additions & 0 deletions docs/technical_reference/unit_models/steam_ejector.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
Steam Jet Ejector
================================
This Steam Jet Ejector unit model:
* Simulates the performance of a steam jet ejector for thermal vapor compression.
* Uses semi-empirical correlations for entrainment ratio, pressure correction factor (PCF), and temperature correction factor (TCF), based on El-Dessouky (1997).
* Operates in steady-state only.
* Assumes the discharge mixture pressure equals its saturation pressure.

.. index::
pair: watertap.unit_models.steam_ejector;steam_ejector

.. currentmodule:: watertap.unit_models.steam_ejector

Degrees of Freedom
-------------------
In addition to the inlet state variables (i.e., temperature, pressure, and component flowrates for motive steam and entrained vapor), the Steam Ejector model has at least 1 degree of freedom that must be fixed for the unit to be fully specified. Typically, the following variables are fixed:

* Entrainment ratio
* Compression ratio

Model Structure
------------------
This Steam Ejector model consists of state blocks for the properties of the motive steam inlet, entrained vapor inlet, and discharge mixture. It incorporates semi-empirical equations to model key performance parameters.



Sets
----
.. csv-table::
:header: "Description", "Symbol", "Indices"

"Time", ":math:`t`", "[0]"
"Inlet/Outlet", ":math:`x`", "['in', 'out']"
"Phases", ":math:`p`", "['Liq', 'Vap']"
"Components", ":math:`j`", "['H2O']"

Performance Metrics
--------------------
.. csv-table::
:header: "Metric", "Equation"

"Entrainment Ratio", ":math:`Ra = \frac{\dot{m}_{motive}}{\dot{m}_{entrained}}`"
"Compression Ratio", ":math:`CR = \frac{P_s}{P_{ev}}`"

Variables
----------
.. csv-table::
:header: "Description", "Symbol", "Variable Name", "Units", "Bounds"

"Entrainment Ratio", ":math:`Ra`", "entrainment_ratio", "Dimensionless", "<4"
"Compression Ratio", ":math:`CR`", "compression_ratio", "Dimensionless", ">1.89"
"Pressure Correction Factor", ":math:`PCF`", "PCF", "Dimensionless", "N/A"
"Temperature Correction Factor", ":math:`TCF`", "TCF", "Dimensionless", "N/A"
"Motive Steam Pressure", ":math:`P_m`", "properties_motive_steam[0].pressure", "kPa", "[100, 3500]"
"Entrained Vapor Pressure", ":math:`P_{ev}`", "properties_entrained_vapor[0].pressure", "kPa", "N/A"
"Discharge Mixture Pressure", ":math:`P_s`", "properties_discharge_mix[0].pressure", "kPa", "N/A"

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

"Pressure Correction Factor", ":math:`PCF = 3 \times 10^{-7} P_m^2 - 0.0009 P_m + 1.6101`"
"Temperature Correction Factor", ":math:`TCF = 2 \times 10^{-8} T_{ev}^2 - 0.0006 T_{ev} + 1.0047`"
"Entrainment Ratio Model", ":math:`Ra \times TCF = 0.296 \frac{P_s^{1.19}}{P_{ev}^{1.04}} \left(\frac{P_m}{P_{ev}}\right)^{0.015} PCF`"
"Entrainment Ratio Definition", ":math:`Ra = \frac{\dot{m}_{motive}}{\dot{m}_{entrained}}`"
"Compression Ratio", ":math:`CR = \frac{P_s}{P_{ev}}`"


Class Documentation
-------------------
* :mod:`watertap.unit_models.steam_ejector`

References
----------
El-Dessouky, H., Modeling and simulation of thermal vapor compression desalination plant. Symposium on Desalination of Seawater with Nuclear Energy, Taejon, Republic of Korea, 26-30 May, 1997.
79 changes: 79 additions & 0 deletions watertap/costing/unit_models/steam_ejector.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import pyomo.environ as pyo
from ..util import register_costing_parameter_block, make_capital_cost_var


def build_steam_ejector_cost_param_block(blk):
"""
Build the costing parameter block for the steam ejector.
"""
blk.base_cost = pyo.Var(
initialize=1949,
doc="Base cost coefficient for steam ejector",
units=pyo.units.USD_2020,
)
blk.cost_exponent = pyo.Var(
initialize=0.3,
doc="Cost scaling exponent",
units=pyo.units.dimensionless,
)

blk.steam_cost = pyo.Var(
initialize=0.008,
units=pyo.units.USD_2018 / pyo.units.kg,
doc="Steam cost per kg",
)

blk.parent_block().register_flow_type("steam", blk.steam_cost)


@register_costing_parameter_block(
build_rule=build_steam_ejector_cost_param_block,
parameter_block_name="steam_ejector",
)
def cost_steam_ejector(blk, cost_steam_flow=False):
"""
Thermo Compressor (Steam Ejector) Costing Method.

Capital cost is calculated using the equation:
Capital Cost (USD) = 1949 × (S + EV)^0.3 (Gabriel 2015, Desalination)
where:
S = Motive steam flow rate (kg/h)
EV = Entrained vapor flow rate (kg/h)

"""

make_capital_cost_var(blk)
blk.costing_package.add_cost_factor(blk, "TIC")

S = pyo.units.convert(
blk.unit_model.properties_motive_steam[0.0].flow_mass_phase_comp["Vap", "H2O"],
to_units=pyo.units.kg / pyo.units.hour,
)

EV = pyo.units.convert(
blk.unit_model.properties_entrained_vapor[0.0].flow_mass_phase_comp[
"Vap", "H2O"
],
to_units=pyo.units.kg / pyo.units.hour,
)

blk.capital_cost_constraint = pyo.Constraint(
expr=blk.capital_cost
== blk.cost_factor
* pyo.units.convert(
blk.costing_package.steam_ejector.base_cost
* (S + EV) ** blk.costing_package.steam_ejector.cost_exponent,
to_units=blk.costing_package.base_currency,
)
)

if cost_steam_flow:
blk.costing_package.cost_flow(
pyo.units.convert(
blk.unit_model.properties_motive_steam[0.0].flow_mass_phase_comp[
"Vap", "H2O"
],
to_units=pyo.units.kg / pyo.units.s,
),
"steam",
)
Loading
Loading