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

update htl system, add README file, update test results #46

Merged
merged 39 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
aa935e5
add HTL geospatial
jiananf2 Sep 22, 2023
51c9cd9
Merge branch 'main' into pfas
jiananf2 Sep 22, 2023
4025d8c
Merge branch 'main' into pfas
jiananf2 Sep 22, 2023
3f2961e
Merge branch 'pfas' of https://github.com/QSD-Group/EXPOsan into pfas
jiananf2 Sep 22, 2023
27ed94c
change biochar to hydrochar
jiananf2 Sep 23, 2023
6922f89
remove repetitive code
jiananf2 Sep 23, 2023
081f66b
minor format update
jiananf2 Sep 23, 2023
a1e69ba
Merge branch 'main' into pfas
jiananf2 Sep 29, 2023
f3a7e79
move geospatial analysis to local
jiananf2 Oct 2, 2023
1a241f0
increase min approach T for HXN
jiananf2 Oct 6, 2023
17ab9c5
add HTL geospatial
jiananf2 Oct 8, 2023
423dd3d
modify TEA input
jiananf2 Oct 8, 2023
58efea3
update matrices' name
jiananf2 Oct 8, 2023
cfc831a
add plant-level decarbonization plot
jiananf2 Oct 10, 2023
e94ca77
Merge branch 'main' into pfas
jiananf2 Oct 10, 2023
a061fb0
modify plant-level decarbonization plot
jiananf2 Oct 11, 2023
5014d9c
add distance boxplot and regional level plot
jiananf2 Oct 12, 2023
3d99f3d
remove unused parameters
jiananf2 Oct 14, 2023
dbc9a19
add WRRFs sludge GHG map
jiananf2 Oct 16, 2023
f7d6327
Merge branch 'main' into pfas
jiananf2 Oct 21, 2023
5b257eb
better characterize different feedstocks
jiananf2 Oct 22, 2023
b463bdf
add cost and LCA to makeup water
jiananf2 Oct 25, 2023
eb4686b
Merge branch 'main' into pfas
jiananf2 Oct 25, 2023
839d6f6
update HTL HX and add new metrics
jiananf2 Oct 26, 2023
cdc9f09
update makeup water price and add uncertainty
jiananf2 Oct 27, 2023
c2535c3
add .yml file
jiananf2 Oct 27, 2023
141f013
move makeup_water_price to TEA
jiananf2 Oct 27, 2023
2c9e246
update food waste moisture content
jiananf2 Oct 28, 2023
b1314a6
change waste_price to waste_cost
jiananf2 Oct 29, 2023
5df605b
minor format update
jiananf2 Nov 4, 2023
fa428c3
change 'CAPEX' to 'TIC'
jiananf2 Nov 7, 2023
cf80b87
add MCF analysis
jiananf2 Nov 13, 2023
2cd1ab2
Create README.rst
jiananf2 Nov 16, 2023
c32874f
add example system figure
jiananf2 Nov 17, 2023
fa10bb1
update README.rst
jiananf2 Nov 17, 2023
4666bae
add parameters to create_system
jiananf2 Nov 17, 2023
bf3e96d
update test results for htl
jiananf2 Nov 17, 2023
9743c9c
Merge branch 'main' into pfas
jiananf2 Nov 17, 2023
d5dc221
fixing gh workflow
yalinli2 Nov 17, 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
200 changes: 200 additions & 0 deletions exposan/htl/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
=============================================================================================
htl: Hydrothermal Liquefaction-based Wet Organic Waste Management / Biofuel Production System
=============================================================================================

Summary
-------
This module includes a hydrothermal liquefaction (HTL)-based system for wet organic waste management and biofuel production, as described in
Feng et al. [1]_

Key sanunits included in this module include:

- hydrothermal liquefaction (``HydrothermalLiquefaction``)
- catalytic hydrothermal gasification (``CatalyticHydrothermalGasification``)
- hydrotreating (``Hydrotreaing``)
- hydrocracking (``Hydrocracking``)
- combined heat and power unit (``CombinedHeatPower``)

Feedstocks for the htl system are characterized by their moisture content and biochemical compositions (ash, lipid, protein, carbohydrate).
Tested feedstocks include:

- wastewater sludge/biosolid
- food waste
- fats, oils, greases (FOG)
- green waste (a.k.a. yard waste)
- animal manure

The products of this system include:

- struvite
- ammonium sulfate
- naphtha
- renewable diesel
- electricity

The system has three different configurations:

- baseline (``configuration='baseline'``)
- remove phosphorus extraction from hydrochar (``configuration='no_P'``)
- add a pressure swing adsorption unit for hydrogen recycle (``configuration='PSA'``)

An example htl system layout (``configuration='baseline'``):

.. figure:: ./readme_figures/example_system.png

A full list of the packages in the environment used to generate the results is included in `htl.yml <https://github.com/QSD-Group/EXPOsan/blob/pfas/exposan/htl/htl.yml>`_.

Getting Started
---------------
.. code-block:: python

>>> # create an htl system by specifying system configuration, capacity, and feedstock's compositions:
>>> from exposan.htl import create_system
>>> sys = create_system(
... configuration='baseline', # system configurations ('baseline','no_P','PSA')
... capacity=100, # capacity in metric ton per day
... sludge_moisture_content=0.8,
... sludge_dw_ash_content=0.257,
... sludge_afdw_lipid_content=0.204,
... sludge_afdw_protein_content=0.463,
... )

>>> sys.show()
System: sys_baseline
ins...
[0] feedstock_assumed_in_wastewater
phase: 'l', T: 298.15 K, P: 101325 Pa
flow (kmol/hr): H2O 8.73e+05
[1] makeup_water
phase: 'l', T: 298.15 K, P: 101325 Pa
flow: 0
[2] recycle
phase: 'l', T: 298.15 K, P: 101325 Pa
flow: 0
[3] H2SO4
phase: 'l', T: 298.15 K, P: 101325 Pa
flow (kmol/hr): H2O 677
H2SO4 6.09
[4] MgCl2
phase: 's', T: 298.15 K, P: 101325 Pa
flow (kmol/hr): MgCl2 0.933
[5] NH4Cl
phase: 's', T: 298.15 K, P: 101325 Pa
flow: 0
[6] MgO
phase: 's', T: 298.15 K, P: 101325 Pa
flow (kmol/hr): MgO 1.46
[7] 7.8%_Ru/C
phase: 's', T: 298.15 K, P: 101325 Pa
flow (kmol/hr): CHG_catalyst 0.745
[8] NaOH
phase: 'l', T: 298.15 K, P: 101325 Pa
flow (kmol/hr): NaOH 0.00203
[9] Membrane_in
phase: 'l', T: 298.15 K, P: 101325 Pa
flow (kmol/hr): Membrane 0.0966
[10] H2
phase: 'l', T: 298.15 K, P: 101325 Pa
flow (kmol/hr): H2 98.8
[11] CoMo_alumina_HT
phase: 's', T: 298.15 K, P: 101325 Pa
flow (kmol/hr): HT_catalyst 0.149
[12] CoMo_alumina_HC
phase: 's', T: 298.15 K, P: 101325 Pa
flow (kmol/hr): HC_catalyst 0.00532
[13] s3
phase: 'l', T: 298.15 K, P: 101325 Pa
flow: 0
[14] natural_gas
phase: 'g', T: 298.15 K, P: 101325 Pa
flow: 0
[15] air
phase: 'g', T: 298.15 K, P: 101325 Pa
flow (kmol/hr): O2 83.4
N2 314
outs...
[0] treated_water
phase: 'l', T: 298.15 K, P: 101325 Pa
flow (kmol/hr): H2O 8.72e+05
[1] residual
phase: 's', T: 333.15 K, P: 2.08891e+07 Pa
flow (kmol/hr): Residual 327
[2] struvite
phase: 's', T: 333.15 K, P: 101325 Pa
flow (kmol/hr): Struvite 1.98
[3] ammonium_sulfate
phase: 'l', T: 298.15 K, P: 101325 Pa
flow (kmol/hr): NH42SO4 4.64
[4] Membrane_out
phase: 'l', T: 298.15 K, P: 101325 Pa
flow (kmol/hr): Membrane 0.0966
[5] solution
phase: 'l', T: 298.15 K, P: 101325 Pa
flow (kmol/hr): H2O 526
H2SO4 0.0898
[6] gasoline
phase: 'l', T: 333.15 K, P: 137895 Pa
flow (kmol/hr): C4H10 0.00747
TWOMBUTAN 0.0154
NPENTAN 0.11
TWOMPENTA 0.0579
CYCHEX 0.0277
HEXANE 0.0638
TWOMHEXAN 0.0509
... 1.96
[7] diesel
phase: 'l', T: 333.15 K, P: 128932 Pa
flow (kmol/hr): C9H20 0.000619
C10H22 0.0833
C4BENZ 0.115
C11H24 0.307
C10H12 0.195
C12H26 0.254
C13H28 0.0671
... 3.11
[8] CHG_catalyst_out
phase: 's', T: 298.15 K, P: 101325 Pa
flow (kmol/hr): CHG_catalyst 0.745
[9] HT_catalyst_out
phase: 's', T: 298.15 K, P: 101325 Pa
flow (kmol/hr): HT_catalyst 0.149
[10] HC_catalyst_out
phase: 's', T: 298.15 K, P: 101325 Pa
flow (kmol/hr): HC_catalyst 0.00532
[11] wastewater
phase: 'l', T: 332.93 K, P: 344738 Pa
flow (kmol/hr): H2O 1.14e+03
C 9.47
N 3.84
P 0.708
[12] emission
phase: 'g', T: 298.15 K, P: 101325 Pa
flow (kmol/hr): H2O 115
N2 314
CO2 42
[13] solid_ash
phase: 's', T: 298.15 K, P: 101325 Pa
flow: 0

>>> # You can look at TEA and LCA results by:
>>> sys.TEA
HTL_TEA: sys_baseline
NPV: -27,298,818 USD at 3.0% IRR

>>> sys.LCA
LCA: sys_baseline (lifetime 30 yr)
Impacts:
Construction Transportation Stream Others Total
Ecotoxicity (kg 2,4-D-eq) 6.94e+06 0 2.69e+09 1.63e+08 2.86e+09
OzoneDepletion (kg CFC-11-eq) 0.205 0 -104 33.9 -69.5
Carcinogenics (kg benzene-eq) 1.22e+05 0 2.23e+05 2.95e+06 3.3e+06
PhotochemicalOxidation (kg NOx-eq) 1.23e+04 0 5.33e+05 3.87e+05 9.33e+05
Eutrophication (kg N) 1e+03 0 -4.62e+05 3.48e+04 -4.26e+05
RespiratoryEffects (kg PM2.5-eq) 1.49e+04 0 4.1e+05 2.43e+05 6.67e+05
Acidification (moles of H+-eq) 1.27e+06 0 1.17e+08 4.54e+07 1.63e+08
NonCarcinogenics (kg toluene-eq) 1.49e+08 0 7.26e+09 3.18e+09 1.06e+10
GlobalWarming (kg CO2-eq) 4.87e+06 0 -1e+08 4.19e+08 3.24e+08

References
----------
.. [1] Feng et al., Characterizing the Opportunity Space for Sustainable Hydrothermal Valorization of Wet Organic Wastes. *Environmental Science and Technology*, *In revision*
6 changes: 2 additions & 4 deletions exposan/htl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def load(configuration='baseline'):
dct = globals()
dct.update(sys.flowsheet.to_dict())


def __getattr__(name):
if not _components_loaded or not _system_loaded:
raise AttributeError(
Expand All @@ -77,7 +76,7 @@ def __getattr__(name):
from .models import *

def simulate_and_save(model,
resample=True, samples_kwargs={'N':1000, 'rule':'L', 'seed':None},
resample=True, samples_kwargs={'N':1000, 'rule':'L', 'seed':3221},
include_spearman=True, spearman_kwargs={'nan_policy': 'omit'},
export_results=True, path='',notes=''):
if resample:
Expand All @@ -98,7 +97,7 @@ def simulate_and_save(model,
if export_results:
ID = model.system.flowsheet.ID
N = model.table.shape[0]
path = path or os.path.join(results_path, f'{date.today()}__{ID}_{N}_{notes}.xlsx')
path = path or os.path.join(results_path, f'{date.today()}_{ID}_{N}_{notes}.xlsx')
with pd.ExcelWriter(path) as writer:
parameters.to_excel(writer, sheet_name='Parameters')
results.to_excel(writer, sheet_name='Results')
Expand All @@ -107,7 +106,6 @@ def simulate_and_save(model,
r_df.to_excel(writer, sheet_name='Spearman_r')
p_df.to_excel(writer, sheet_name='Spearman_p')


__all__ = (
'htl_path',
'data_path',
Expand Down
8 changes: 4 additions & 4 deletions exposan/htl/_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ def create_components(set_thermo=True):
# made up value, so that HTL.ins[0].nu = 0.03 m2/s ~30000 cSt
# (NREL 2013 appendix B)

Biochar = Component('Biochar', phase='s', particle_size='Particulate',
Hydrochar = Component('Hydrochar', phase='s', particle_size='Particulate',
degradability='Undegradable', organic=False)
add_V_from_rho(Biochar, 1500) # assume 1500kg/m3
Biochar.copy_models_from(Chemical('CaCO3'),('Cn',))
add_V_from_rho(Hydrochar, 1500) # assume 1500kg/m3
Hydrochar.copy_models_from(Chemical('CaCO3'),('Cn',))

Biocrude = Component('Biocrude', search_ID='629-54-9',
particle_size='Soluble', degradability='Slowly',
Expand Down Expand Up @@ -384,7 +384,7 @@ def create_components(set_thermo=True):
Membrane.copy_models_from(Chemical('CaCO3'),('Cn',))

cmps = Components([Sludge_lipid, Sludge_protein, Sludge_carbo, Sludge_ash,
Struvite, Biochar, Residual,
Struvite, Hydrochar, Residual,
Biocrude, HTLaqueous, H2O, C, N, P,
O2, N2, CH4, C2H6, C3H8, CO2, CO, H2, NH3,
H2SO4, H3PO4, MgCl2, MgO, NaOH, NH42SO4, NH4Cl,
Expand Down
2 changes: 1 addition & 1 deletion exposan/htl/_process_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def _load_process_settings():
# =============================================================================
# set utility prices
# =============================================================================
bst.PowerUtility.price = 0.06879
bst.PowerUtility.price = 0.06879 # !!! the electricity price can be adjusted here

# # These utilities are provided by CHP thus cost already considered
# # setting the regeneration price to 0 or not will not affect the final results
Expand Down
Loading
Loading