Yuan (Cyrus) Chiang commited on
Commit
a671cbd
·
unverified ·
1 Parent(s): 1925de9

Add `ORBv2` hydrogen combustion result (#32)

Browse files

* add orbv2 hydrogen combustion; add flame temperature

* update references

mlip_arena/models/registry.yaml CHANGED
@@ -308,6 +308,7 @@ ORBv2:
308
  - eos_alloy
309
  gpu-tasks:
310
  - homonuclear-diatomics
 
311
  github: https://github.com/orbital-materials/orb-models
312
  doi:
313
  date: 2024-10-15
 
308
  - eos_alloy
309
  gpu-tasks:
310
  - homonuclear-diatomics
311
+ - combustion
312
  github: https://github.com/orbital-materials/orb-models
313
  doi:
314
  date: 2024-10-15
mlip_arena/tasks/combustion/orb/hydrogen.json CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:dcb5dcd6d47241796c3c3bb4672b1167019adf1d24f13342ab1e1fea33cbdae7
3
- size 240030
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f46a474a9d9419fbb3ee297b918cb1992d540f311c6942980c5986149d142d91
3
+ size 465101
mlip_arena/tasks/combustion/water.ipynb CHANGED
@@ -287,7 +287,7 @@
287
  "name": "python",
288
  "nbconvert_exporter": "python",
289
  "pygments_lexer": "ipython3",
290
- "version": "3.11.10"
291
  },
292
  "widgets": {
293
  "application/vnd.jupyter.widget-state+json": {
 
287
  "name": "python",
288
  "nbconvert_exporter": "python",
289
  "pygments_lexer": "ipython3",
290
+ "version": "3.11.8"
291
  },
292
  "widgets": {
293
  "application/vnd.jupyter.widget-state+json": {
serve/tasks/combustion.py CHANGED
@@ -33,7 +33,8 @@ models = container.multiselect(
33
  "M3GNet",
34
  "SevenNet",
35
  "ORB",
36
- "EquiformerV2(OC22)",
 
37
  "eSCN(OC20)",
38
  ],
39
  )
@@ -61,13 +62,13 @@ if not models:
61
 
62
  @st.cache_data
63
  def get_data(models):
64
- families = [MODELS[str(model)]["family"] for model in models]
65
  dfs = [
66
- pd.read_json(DATA_DIR / family.lower() / "hydrogen.json") for family in families
 
67
  ]
68
- df = pd.concat(dfs, ignore_index=True)
69
- df.drop_duplicates(inplace=True, subset=["formula", "method"])
70
- return df
71
 
72
 
73
  df = get_data(models)
@@ -95,6 +96,17 @@ for method in df["method"].unique():
95
  ),
96
  )
97
 
 
 
 
 
 
 
 
 
 
 
 
98
  fig.update_layout(
99
  title="Hydrogen Combustion (2H2 + O2 -> 2H2O, 64 units)",
100
  xaxis_title="Timestep",
@@ -136,8 +148,19 @@ fig.add_trace(
136
  ),
137
  )
138
 
 
 
 
 
 
 
 
 
 
 
 
139
  fig.update_layout(
140
- title="Hydrogen Combustion (2H2 + O2 -> 2H2O, 64 units)",
141
  xaxis_title="Timestep",
142
  yaxis_title="Temperature (K)",
143
  # yaxis2=dict(
@@ -154,6 +177,10 @@ st.plotly_chart(fig)
154
 
155
  # Energy
156
 
 
 
 
 
157
  fig = go.Figure()
158
 
159
  for method in df["method"].unique():
@@ -161,7 +188,7 @@ for method in df["method"].unique():
161
  fig.add_trace(
162
  go.Scatter(
163
  x=row["timestep"],
164
- y=np.array(row["energies"]) - row["energies"][0],
165
  mode="lines",
166
  name=method,
167
  line=dict(
@@ -173,11 +200,48 @@ for method in df["method"].unique():
173
  ),
174
  )
175
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
  fig.update_layout(
177
- # title="Hydrogen Combustion (2H2 + O2 -> 2H2O, 64 units)",
178
- xaxis_title="Timestep",
179
- yaxis_title="Potential Energy 𝚫 (eV)",
180
- # template="plotly_dark",
181
  )
182
 
183
  st.plotly_chart(fig)
@@ -216,9 +280,8 @@ st.plotly_chart(fig)
216
 
217
  fig = go.Figure()
218
 
219
- exp_ref = -68.3078 # kcal/mol
220
 
221
- df["reaction_energy"] = df["energies"].apply(lambda x: x[-1] - x[0]) / 128 * 23.0609 # kcal/mol
222
 
223
  df["reaction_energy_abs_err"] = np.abs(df["reaction_energy"] - exp_ref)
224
 
@@ -250,7 +313,7 @@ fig.add_annotation(
250
  xanchor="center",
251
  y=exp_ref,
252
  yanchor="bottom",
253
- text=f"Experiment: {exp_ref} kcal/mol [1]",
254
  showarrow=False,
255
  font=dict(
256
  color="Red",
@@ -354,6 +417,34 @@ def get_com_drifts(df):
354
 
355
  df_exploded = get_com_drifts(df)
356
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
357
  if "play" not in st.session_state:
358
  st.session_state.play = False
359
 
@@ -465,3 +556,13 @@ def draw_com_drifts_plot():
465
 
466
 
467
  draw_com_drifts_plot()
 
 
 
 
 
 
 
 
 
 
 
33
  "M3GNet",
34
  "SevenNet",
35
  "ORB",
36
+ "ORBv2",
37
+ "EquiformerV2(OC20)",
38
  "eSCN(OC20)",
39
  ],
40
  )
 
62
 
63
  @st.cache_data
64
  def get_data(models):
65
+ # List comprehension for concise looping and filtering
66
  dfs = [
67
+ pd.read_json(DATA_DIR / MODELS[str(model)]["family"].lower() / "hydrogen.json")[lambda df: df["method"] == model]
68
+ for model in models
69
  ]
70
+ # Concatenate all filtered DataFrames
71
+ return pd.concat(dfs, ignore_index=True)
 
72
 
73
 
74
  df = get_data(models)
 
96
  ),
97
  )
98
 
99
+ fig.add_vrect(
100
+ x0=512345.94,
101
+ x1=666667,
102
+ fillcolor="lightblue",
103
+ opacity=0.2,
104
+ layer="below",
105
+ line_width=0,
106
+ annotation_text="Flame Temp. [1]",
107
+ annotation_position="top",
108
+ )
109
+
110
  fig.update_layout(
111
  title="Hydrogen Combustion (2H2 + O2 -> 2H2O, 64 units)",
112
  xaxis_title="Timestep",
 
148
  ),
149
  )
150
 
151
+ fig.add_vrect(
152
+ x0=512345.94,
153
+ x1=666667,
154
+ fillcolor="lightblue",
155
+ opacity=0.2,
156
+ layer="below",
157
+ line_width=0,
158
+ annotation_text="Flame Temp.",
159
+ annotation_position="top",
160
+ )
161
+
162
  fig.update_layout(
163
+ # title="Hydrogen Combustion (2H2 + O2 -> 2H2O, 64 units)",
164
  xaxis_title="Timestep",
165
  yaxis_title="Temperature (K)",
166
  # yaxis2=dict(
 
177
 
178
  # Energy
179
 
180
+ exp_ref = -68.3078 # kcal/mol
181
+ factor = 23.0609
182
+ nh2os = 128
183
+
184
  fig = go.Figure()
185
 
186
  for method in df["method"].unique():
 
188
  fig.add_trace(
189
  go.Scatter(
190
  x=row["timestep"],
191
+ y=(np.array(row["energies"]) - row["energies"][0]) / nh2os * factor,
192
  mode="lines",
193
  name=method,
194
  line=dict(
 
200
  ),
201
  )
202
 
203
+ target_steps = df["target_steps"].iloc[0]
204
+
205
+ fig.add_shape(
206
+ go.layout.Shape(
207
+ type="line",
208
+ x0=0, x1=target_steps,
209
+ y0=exp_ref, y1=exp_ref, # y-values for the horizontal line
210
+ line=dict(color="Red", width=2, dash="dash"),
211
+ layer="below"
212
+ )
213
+ )
214
+
215
+ fig.add_annotation(
216
+ go.layout.Annotation(
217
+ x=0.5,
218
+ xref="paper",
219
+ xanchor="center",
220
+ y=exp_ref,
221
+ yanchor="bottom",
222
+ text=f"Experiment: {exp_ref} kcal/mol [2]",
223
+ showarrow=False,
224
+ font=dict(
225
+ color="Red",
226
+ ),
227
+ )
228
+ )
229
+
230
+ fig.add_vrect(
231
+ x0=512345.94,
232
+ x1=666667,
233
+ fillcolor="lightblue",
234
+ opacity=0.2,
235
+ layer="below",
236
+ line_width=0,
237
+ annotation_text="Flame Temp.",
238
+ annotation_position="top",
239
+ )
240
+
241
+
242
  fig.update_layout(
243
+ xaxis_title="Timestep <br> <span style='font-size: 10px;'>[2] Lide, D. R. (Ed.). (2004). CRC handbook of chemistry and physics (Vol. 85). CRC press.</span>",
244
+ yaxis_title="𝚫E (kcal/mol)",
 
 
245
  )
246
 
247
  st.plotly_chart(fig)
 
280
 
281
  fig = go.Figure()
282
 
 
283
 
284
+ df["reaction_energy"] = df["energies"].apply(lambda x: x[-1] - x[0]) / nh2os * factor # kcal/mol
285
 
286
  df["reaction_energy_abs_err"] = np.abs(df["reaction_energy"] - exp_ref)
287
 
 
313
  xanchor="center",
314
  y=exp_ref,
315
  yanchor="bottom",
316
+ text=f"Experiment: {exp_ref} kcal/mol [2]",
317
  showarrow=False,
318
  font=dict(
319
  color="Red",
 
417
 
418
  df_exploded = get_com_drifts(df)
419
 
420
+ fig = go.Figure()
421
+
422
+ for method in df_exploded["method"].unique():
423
+ row = df_exploded[df_exploded["method"] == method]
424
+ fig.add_trace(
425
+ go.Scatter(
426
+ x=row["timestep"],
427
+ y=row["total_com_drift"],
428
+ mode="lines",
429
+ name=method,
430
+ line=dict(
431
+ color=method_color_mapping[method],
432
+ # width=1
433
+ ),
434
+ marker=dict(color=method_color_mapping[method], size=3),
435
+ showlegend=True,
436
+
437
+ ),
438
+ )
439
+
440
+ fig.update_yaxes(type="log")
441
+ fig.update_layout(
442
+ xaxis_title="Timestep",
443
+ yaxis_title="Total COM drift (Å)",
444
+ )
445
+
446
+ st.plotly_chart(fig)
447
+
448
  if "play" not in st.session_state:
449
  st.session_state.play = False
450
 
 
556
 
557
 
558
  draw_com_drifts_plot()
559
+
560
+
561
+ st.markdown("""
562
+ ### References
563
+
564
+ [1] Hasche, A., Navid, A., Krause, H., & Eckart, S. (2023). Experimental and numerical assessment of the effects of hydrogen admixtures on premixed methane-oxygen flames. Fuel, 352, 128964.
565
+
566
+ [2] Lide, D. R. (Ed.). (2004). CRC handbook of chemistry and physics (Vol. 85). CRC press.
567
+ """
568
+ )