Skip to content

Commit 4a7afa7

Browse files
authored
Merge pull request #307 from jmartin4nrel/meoh-plot
Methanol: Sprucing up plots for white paper
2 parents 856cfbd + 66a7790 commit 4a7afa7

2 files changed

Lines changed: 80 additions & 37 deletions

File tree

Lines changed: 78 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
import pandas as pd
2+
import matplotlib.dates as mdates
23
import matplotlib.pyplot as plt
34

45

6+
myFmt = mdates.DateFormatter("%m/%d")
7+
8+
59
def plot_methanol(model):
6-
plt.clf()
10+
fig = plt.figure(figsize=(8, 8))
711

812
times = pd.date_range("2013", periods=8760, freq="1h")
913

1014
# Electricity to H2 using Electrolyzer
1115
plt.subplot(3, 2, 1)
12-
plt.title("Electrolyzer")
16+
T = plt.title("Electrolyzer")
17+
T.set_position([-0.2, 1.1])
1318
elyzer_elec_in = (
1419
model.plant.electrolyzer.eco_pem_electrolyzer_performance.get_val("electricity_in") / 1000
1520
)
@@ -18,77 +23,115 @@ def plot_methanol(model):
1823
/ 1000
1924
* 24
2025
)
21-
plt.plot(times, elyzer_elec_in, label="electricity_in [MW]", color=[0.5, 0.5, 1])
26+
plt.plot(times, elyzer_elec_in, label="Electricity Available [MW]", color=[0.5, 0.5, 1])
2227
plt.plot(
2328
[times[0], times[-1]],
2429
[160, 160],
2530
"--",
26-
label="electrolyzer_max_input [MW]",
31+
label="Electrolyzer Capacity [MW]",
2732
color=[0.5, 0.5, 1],
2833
)
29-
plt.plot(times, elyzer_h2_out, label="hydrogen_out [t/d]", color=[1, 0.5, 0])
30-
plt.legend()
31-
plt.xlim(pd.to_datetime("2012-12-15"), pd.to_datetime("2013-01-31"))
34+
plt.plot(times, elyzer_h2_out, label="Hydrogen Produced [t/d]", color=[1, 0.5, 0])
35+
plt.legend(bbox_to_anchor=(0, 1.02), loc=3)
36+
plt.xlim(pd.to_datetime("2012-12-31"), pd.to_datetime("2013-01-31"))
37+
plt.xticks(["2013-01-01", "2013-01-08", "2013-01-15", "2013-01-22", "2013-01-29"])
38+
ax = plt.gca()
39+
ax.xaxis.set_major_formatter(myFmt)
40+
plt.xlabel("Day in simulated year")
41+
plt.ylabel(
42+
"Power\n[MW]\n \nFlow\n[t/d]", rotation="horizontal", va="center", ha="center", labelpad=20
43+
)
3244

3345
# Electricity to CO2 using DOC
3446
plt.subplot(3, 2, 2)
35-
plt.title("DOC")
47+
T = plt.title("Direct\nOcean\nCapture")
48+
T.set_position([-0.2, 1.1])
3649
doc_elec_in = model.plant.doc.direct_ocean_capture_performance.get_val("electricity_in") / 1e6
3750
doc_co2_out = model.plant.doc.direct_ocean_capture_performance.get_val("co2_out") / 1000
38-
plt.plot(times, doc_elec_in, label="electricity_in [MW]")
51+
plt.plot(times, doc_elec_in, label="Electricity Available [MW]", color=[0.5, 0.5, 1])
3952
plt.plot(
4053
[times[0], times[-1]],
4154
[43.32621908, 43.32621908],
4255
"--",
43-
label="doc_max_input [MW]",
56+
label="DOC Input Capacity [MW]",
4457
color=[0.5, 0.5, 1],
4558
)
46-
plt.plot(times, doc_co2_out, label="co2_out [t/hr]", color=[0.5, 0.25, 0])
47-
plt.legend()
48-
plt.xlim(pd.to_datetime("2012-12-15"), pd.to_datetime("2013-01-31"))
59+
plt.plot(times, doc_co2_out, label="CO$_2$ Produced [t/hr]", color=[0.5, 0.25, 0])
60+
plt.legend(bbox_to_anchor=(0, 1.02), loc=3)
61+
plt.xlim(pd.to_datetime("2012-12-31"), pd.to_datetime("2013-01-31"))
62+
plt.xticks(["2013-01-01", "2013-01-08", "2013-01-15", "2013-01-22", "2013-01-29"])
63+
ax = plt.gca()
64+
ax.xaxis.set_major_formatter(myFmt)
65+
plt.xlabel("Day in simulated year")
66+
plt.ylabel(
67+
"Power\n[MW]\n \nFlow\n[t/hr]", rotation="horizontal", va="center", ha="center", labelpad=20
68+
)
4969

5070
# H2 and Storage
5171
plt.subplot(3, 2, 3)
52-
plt.title("H2 Storage")
72+
T = plt.title("Hydrogen\nStorage")
73+
T.set_position([-0.2, 1.1])
5374
h2_storage_in = model.plant.electrolyzer_to_h2_storage_pipe.get_val("hydrogen_in") * 3600
5475
h2_storage_out = model.plant.h2_storage_to_methanol_pipe.get_val("hydrogen_out") * 3600
55-
plt.plot(times, h2_storage_in, label="hydrogen_in [kg/hr]", color=[1, 0.5, 0])
56-
plt.plot(times, h2_storage_out, label="hydrogen_out [kg/hr]", color=[0, 0.5, 0])
57-
plt.legend()
58-
plt.xlim(pd.to_datetime("2012-12-15"), pd.to_datetime("2013-01-31"))
76+
plt.plot(times, h2_storage_in, label="Hydrogen In [kg/hr]", color=[1, 0.5, 0])
77+
plt.plot(times, h2_storage_out, label="Hydrogen Out [kg/hr]", color=[0, 0.5, 0])
78+
plt.legend(bbox_to_anchor=(0, 1.02), loc=3)
79+
plt.xlim(pd.to_datetime("2012-12-31"), pd.to_datetime("2013-01-31"))
80+
plt.xticks(["2013-01-01", "2013-01-08", "2013-01-15", "2013-01-22", "2013-01-29"])
81+
ax = plt.gca()
82+
ax.xaxis.set_major_formatter(myFmt)
83+
plt.xlabel("Day in simulated year")
84+
plt.ylabel("Flow\n[kg/hr]", rotation="horizontal", va="center", ha="center", labelpad=20)
5985

6086
# H2 and Storage
6187
plt.subplot(3, 2, 4)
62-
plt.title("CO2 Storage")
88+
T = plt.title("CO$_2$\nStorage")
89+
T.set_position([-0.2, 1.1])
6390
co2_storage_in = model.plant.doc_to_co2_storage_pipe.get_val("co2_in")
6491
co2_storage_out = model.plant.co2_storage_to_methanol_pipe.get_val("co2_out")
65-
plt.plot(times, co2_storage_in, label="co2_in [kg/hr]", color=[0.5, 0.25, 0])
66-
plt.plot(times, co2_storage_out, label="co2_out [kg/hr]", color=[0, 0.25, 0.5])
67-
plt.legend()
68-
plt.xlim(pd.to_datetime("2012-12-15"), pd.to_datetime("2013-01-31"))
92+
plt.plot(times, co2_storage_in, label="CO$_2$ In [kg/hr]", color=[0.5, 0.25, 0])
93+
plt.plot(times, co2_storage_out, label="CO$_2$ Out [kg/hr]", color=[0, 0.25, 0.5])
94+
plt.legend(bbox_to_anchor=(0, 1.02), loc=3)
95+
plt.xlim(pd.to_datetime("2012-12-31"), pd.to_datetime("2013-01-31"))
96+
plt.xticks(["2013-01-01", "2013-01-08", "2013-01-15", "2013-01-22", "2013-01-29"])
97+
ax = plt.gca()
98+
ax.xaxis.set_major_formatter(myFmt)
99+
plt.xlabel("Day in simulated year")
100+
plt.ylabel("Flow\n[kg/hr]", rotation="horizontal", va="center", ha="center", labelpad=20)
69101

70102
# H2 and CO2 to Methanol
71103
plt.subplot(3, 2, 5)
72-
plt.title("Methanol")
104+
T = plt.title("Methanol")
105+
T.set_position([-0.2, 1.1])
73106
meoh_h2_in = model.plant.methanol.co2h_methanol_plant_performance.get_val("hydrogen_in")
74107
meoh_co2_in = model.plant.methanol.co2h_methanol_plant_performance.get_val("co2_in")
75108
meoh_meoh_out = model.plant.methanol.co2h_methanol_plant_performance.get_val("methanol_out")
76-
plt.plot(times, meoh_h2_in, label="hydrogen_in [kg/hr]", color=[0, 0.5, 0])
77-
plt.plot(times, meoh_co2_in, label="co2_in [kg/hr]", color=[0, 0.25, 0.5])
78-
plt.plot(times, meoh_meoh_out, label="methanol_out [kg/hr]", color=[1, 0, 0.5])
79-
plt.legend()
80-
plt.xlim(pd.to_datetime("2012-12-15"), pd.to_datetime("2013-01-31"))
109+
plt.plot(times, meoh_h2_in, label="Hydrogen In [kg/hr]", color=[0, 0.5, 0])
110+
plt.plot(times, meoh_co2_in, label="CO$_2$ In [kg/hr]", color=[0, 0.25, 0.5])
111+
plt.plot(times, meoh_meoh_out, label="Methanol Out [kg/hr]", color=[1, 0, 0.5])
112+
plt.legend(bbox_to_anchor=(0, 1.02), loc=3)
113+
plt.xlim(pd.to_datetime("2012-12-31"), pd.to_datetime("2013-01-31"))
114+
plt.xticks(["2013-01-01", "2013-01-08", "2013-01-15", "2013-01-22", "2013-01-29"])
115+
ax = plt.gca()
116+
ax.xaxis.set_major_formatter(myFmt)
117+
plt.xlabel("Day in simulated year")
118+
plt.ylabel("Flow\n[kg/hr]", rotation="horizontal", va="center", ha="center", labelpad=20)
81119

82120
# H2 and CO2 storage SOC
83121
plt.subplot(3, 2, 6)
84-
plt.title("Storage SOC")
122+
T = plt.title("State of\nCharge\n(SOC)")
123+
T.set_position([-0.2, 1.1])
85124
h2_soc = model.plant.h2_storage.get_val("hydrogen_soc") * 100
86125
co2_soc = model.plant.co2_storage.get_val("co2_soc") * 100
87-
plt.plot(times, h2_soc, label="hydrogen_soc [%]", color=[1, 0.5, 0])
88-
plt.plot(times, co2_soc, label="co2_soc [%]", color=[0.5, 0.25, 0])
89-
plt.legend()
90-
plt.xlim(pd.to_datetime("2012-12-15"), pd.to_datetime("2013-01-31"))
126+
plt.plot(times, h2_soc, label="Hydrogen SOC [%]", color=[1, 0.5, 0])
127+
plt.plot(times, co2_soc, label="CO$_2$ SOC [%]", color=[0.5, 0.25, 0])
128+
plt.legend(bbox_to_anchor=(0, 1.02), loc=3)
129+
plt.xlim(pd.to_datetime("2012-12-31"), pd.to_datetime("2013-01-31"))
130+
plt.xticks(["2013-01-01", "2013-01-08", "2013-01-15", "2013-01-22", "2013-01-29"])
131+
ax = plt.gca()
132+
ax.xaxis.set_major_formatter(myFmt)
133+
plt.xlabel("Day in simulated year")
134+
plt.ylabel("SOC\n[kg]", rotation="horizontal", va="center", ha="center", labelpad=20)
91135

92-
fig = plt.gcf()
93136
fig.tight_layout()
94137
plt.show()

examples/03_methanol/co2_hydrogenation_doc/tech_config_co2h.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ technologies:
6868
demand_profile: 2108.73919484047
6969
cost_parameters:
7070
cost_year: 2022
71-
energy_capex: 383 # $/kg
71+
energy_capex: 383 # $/kg - based on https://www.hydrogen.energy.gov/docs/hydrogenprogramlibraries/pdfs/review22/st235_houchins_2022_p-pdf.pdf?Status=Master
7272
power_capex: .000001 # $/kg/h
7373
opex_fraction: .000001 # percent of capex
7474
doc:
@@ -120,7 +120,7 @@ technologies:
120120
demand_profile: 15388.3891
121121
cost_parameters:
122122
cost_year: 2022
123-
energy_capex: 5 # $/kg
123+
energy_capex: 5 # $/kg - based on https://www.maritime.dot.gov/sites/marad.dot.gov/files/2024-11/LCE%20MARAD%20CCS%20TEA%20Final%20Report%20-%2031%20May%202024%20%283%29.pdf
124124
power_capex: .000001 # $/kg/h
125125
opex_fraction: .000001 # percent of capex
126126
methanol:

0 commit comments

Comments
 (0)