Adsorption Energies#

Pre-trained ODAC models are versatile across various MOF-related tasks. To begin, we’ll start with a fundamental application: calculating the adsorption energy for a single CO2 molecule. This serves as an excellent and simple demonstration of what you can achieve with these datasets and models.

For predicting the adsorption energy of a single CO2 molecule within a MOF structure, the adsorption energy (\(E_{\mathrm{ads}}\)) is defined as:

\[ E_{\mathrm{ads}} = E_{\mathrm{MOF+CO2}} - E_{\mathrm{MOF}} - E_{\mathrm{CO2}} \tag{1}\]

Each term on the right-hand side represents the energy of the relaxed state of the indicated chemical system. For a comprehensive understanding of our methodology for computing these adsorption energies, please refer to our paper.

Loading Pre-trained Models#

A pre-trained model can be loaded using FAIRChemCalculator. In this example, we’ll employ UMA to determine the CO2 adsorption energies.

from fairchem.core import FAIRChemCalculator, pretrained_mlip

predictor = pretrained_mlip.get_predict_unit("uma-s-1p1")
calc = FAIRChemCalculator(predictor, task_name="odac")
WARNING:root:device was not explicitly set, using device='cuda'.

Adsorption in rigid MOFs: CO2 Adsorption Energy in Mg-MOF-74#

Let’s apply our knowledge to Mg-MOF-74, a widely studied MOF known for its excellent CO2 adsorption properties. Its structure comprises magnesium atomic complexes connected by a carboxylated and oxidized benzene ring, serving as an organic linker. Previous studies consistently report the CO2 adsorption energy for Mg-MOF-74 to be around -0.40 eV [1] [2] [3].

Our goal is to verify if we can achieve a similar value by performing a simple single-point calculation using UMA. In the ODAC23 dataset, all MOF structures are identified by their CSD (Cambridge Structural Database) code. For Mg-MOF-74, this code is OPAGIX. We’ve extracted a specific OPAGIX+CO2 configuration from the dataset, which exhibits the lowest adsorption energy among its counterparts.

import matplotlib.pyplot as plt
from ase.io import read
from ase.visualize.plot import plot_atoms

mof_co2 = read("structures/OPAGIX_w_CO2.cif")
mof = read("structures/OPAGIX.cif")
co2 = read("structures/co2.xyz")

fig, ax = plt.subplots(figsize=(5, 4.5), dpi=250)
plot_atoms(mof_co2, ax)
ax.set_axis_off()
../../_images/5d0d87751a2c838512e931cd479c6f60fcca902f43fa061961a3f469282cb6c0.png

The final step in calculating the adsorption energy involves connecting the FAIRChemCalculator to each relaxed structure: OPAGIX+CO2, OPAGIX, and CO2. The structures used here are already relaxed from ODAC23. For simplicity, we assume here that further relaxations can be neglected. We will show how to go beyond this assumption in the next section.

mof_co2.calc = calc
mof.calc = calc
co2.calc = calc

E_ads = (
    mof_co2.get_potential_energy()
    - mof.get_potential_energy()
    - co2.get_potential_energy()
)

print(f"Adsorption energy of CO2 in Mg-MOF-74: {E_ads:.3f} eV")
Adsorption energy of CO2 in Mg-MOF-74: -0.459 eV

Adsorption in flexible MOFs#

The adsorption energy calculation method outlined above is typically performed with rigid MOFs for simplicity. Both experimental and modeling literature have shown, however, that MOF flexibility can be important in accurately capturing the underlying chemistry of adsorption [1] [2] [3]. In particular, uptake can be improved by treating MOFs as flexible. Two types of MOF flexibility can be considered: intrinsic flexibility and deformation induced by guest molecules. In the Open DAC Project, we consider the latter MOF deformation by allowing the atomic positions of the MOF to relax during geometry optimization [4]. The addition of additional degrees of freedoms can complicate the computation of the adsorption energy and necessitates an extra step in the calculation procedure.

The figure below shows water adsorption in the MOF with CSD code WOBHEB with added defects (WOBHEB_0.11_0) from a DFT simulation. A typical adsorption energy calculation would only seek to capture the effects shaded in purple, which include both chemisorption and non-bonded interactions between the host and guest molecule. When allowing the MOF to relax, however, the adsorption energy also includes the energetic effect of the MOF deformation highlighted in green.

To account for this deformation, it is vital to use the most energetically favorable MOF geometry for the empty MOF term in Eqn. 1. Including MOF atomic coordinates as degrees of freedom can result in three possible outcomes:

  1. The MOF does not deform, so the energies of the relaxed empty MOF and the MOF in the adsorbed state are the same

  2. The MOF deforms to a less energetically favorable geometry than its ground state

  3. The MOF locates a new energetically favorable geoemtry relative to the empty MOF relaxation

The first outcome requires no additional computation because the MOF rigidity assumption is valid. The second outcome represents physical and reversible deformation where the MOF returns to its empty ground state upon removal of the guest molecule. The third outcome is often the result of the guest molecule breaking local symmetry. We also found cases in ODAC in which both outcomes 2 and 3 occur within the same MOF.

To ensure the most energetically favorable empty MOF geometry is found, an addition empty MOF relaxation should be performed after MOF + adsorbate relaxation. The guest molecule should be removed, and the MOF should be relaxed starting from its geometry in the adsorbed state. If all deformation is reversible, the MOF will return to its original empty geometry. Otherwise, the lowest energy (most favorable) MOF geometry should be taken as the reference energy, \(E_{\mathrm{MOF}}\), in Eqn. 1.

H2O Adsorption Energy in Flexible WOBHEB with UMA#

The first part of this tutorial demonstrates how to perform a single point adsorption energy calculation using UMA. To treat MOFs as flexible, we perform all calculations on geometries determined by geometry optimization. The following example corresponds to the figure shown above (H2O adsorption in WOBHEB_0.11_0).

In this tutorial, \(E_{x}(r_{y})\) corresponds to the energy of \(x\) determined from geometry optimization of \(y\).

First, we obtain the energy of the empty MOF from relaxation of only the MOF: \(E_{\mathrm{MOF}}(r_{\mathrm{MOF}})\)

import ase.io
from ase.optimize import BFGS

mof = ase.io.read("structures/WOBHEB_0.11.cif")
mof.calc = calc
relax = BFGS(mof)
relax.run(fmax=0.05)
E_mof_empty = mof.get_potential_energy()
print(f"Energy of empty MOF: {E_mof_empty:.3f} eV")
      Step     Time          Energy          fmax
BFGS:    0 22:47:30    -1077.274064        0.206406
BFGS:    1 22:47:31    -1077.276780        0.152729
BFGS:    2 22:47:31    -1077.281942        0.169926
BFGS:    3 22:47:31    -1077.284769        0.155781
BFGS:    4 22:47:31    -1077.288836        0.108789
BFGS:    5 22:47:31    -1077.291023        0.086440
BFGS:    6 22:47:32    -1077.293360        0.093412
BFGS:    7 22:47:32    -1077.295415        0.100145
BFGS:    8 22:47:32    -1077.297832        0.102523
BFGS:    9 22:47:32    -1077.300015        0.091601
BFGS:   10 22:47:33    -1077.302007        0.079044
BFGS:   11 22:47:33    -1077.304136        0.105551
BFGS:   12 22:47:33    -1077.306722        0.087934
BFGS:   13 22:47:33    -1077.309513        0.086336
BFGS:   14 22:47:33    -1077.312263        0.086879
BFGS:   15 22:47:34    -1077.314701        0.106262
BFGS:   16 22:47:34    -1077.316992        0.106205
BFGS:   17 22:47:34    -1077.319483        0.085512
BFGS:   18 22:47:34    -1077.322264        0.109636
BFGS:   19 22:47:35    -1077.325133        0.148702
BFGS:   20 22:47:35    -1077.327766        0.125907
BFGS:   21 22:47:35    -1077.329920        0.069080
BFGS:   22 22:47:35    -1077.331950        0.087274
BFGS:   23 22:47:35    -1077.334273        0.125228
BFGS:   24 22:47:36    -1077.336832        0.166655
BFGS:   25 22:47:36    -1077.339542        0.145543
BFGS:   26 22:47:36    -1077.342150        0.087657
BFGS:   27 22:47:36    -1077.344540        0.076209
BFGS:   28 22:47:37    -1077.346891        0.148933
BFGS:   29 22:47:37    -1077.349785        0.170194
BFGS:   30 22:47:37    -1077.352532        0.109261
BFGS:   31 22:47:37    -1077.354750        0.070363
BFGS:   32 22:47:37    -1077.356777        0.089701
BFGS:   33 22:47:38    -1077.358657        0.124264
BFGS:   34 22:47:38    -1077.360596        0.108052
BFGS:   35 22:47:38    -1077.362469        0.068602
BFGS:   36 22:47:38    -1077.364166        0.070179
BFGS:   37 22:47:39    -1077.365713        0.105463
BFGS:   38 22:47:39    -1077.367258        0.104150
BFGS:   39 22:47:39    -1077.368769        0.062965
BFGS:   40 22:47:39    -1077.370141        0.058175
BFGS:   41 22:47:39    -1077.371384        0.059064
BFGS:   42 22:47:40    -1077.372481        0.063231
BFGS:   43 22:47:40    -1077.373500        0.055352
BFGS:   44 22:47:40    -1077.374478        0.047142
Energy of empty MOF: -1077.374 eV

Next, we add the H2O guest molecule and relax the MOF + adsorbate to obtain \(E_{\mathrm{MOF+H2O}}(r_{\mathrm{MOF+H2O}})\).

mof_h2o = ase.io.read("structures/WOBHEB_H2O.cif")
mof_h2o.calc = calc
relax = BFGS(mof_h2o)
relax.run(fmax=0.05)
E_combo = mof_h2o.get_potential_energy()
print(f"Energy of MOF + H2O: {E_combo:.3f} eV")
      Step     Time          Energy          fmax
BFGS:    0 22:47:41    -1091.565589        1.145035
BFGS:    1 22:47:41    -1091.585062        0.314149
BFGS:    2 22:47:41    -1091.590211        0.243429
BFGS:    3 22:47:41    -1091.608170        0.237244
BFGS:    4 22:47:41    -1091.614631        0.227934
BFGS:    5 22:47:42    -1091.625217        0.186790
BFGS:    6 22:47:42    -1091.632354        0.178914
BFGS:    7 22:47:42    -1091.640628        0.175109
BFGS:    8 22:47:42    -1091.648042        0.184587
BFGS:    9 22:47:43    -1091.656147        0.160843
BFGS:   10 22:47:43    -1091.663842        0.178510
BFGS:   11 22:47:43    -1091.672294        0.188730
BFGS:   12 22:47:43    -1091.682085        0.157576
BFGS:   13 22:47:43    -1091.692981        0.177272
BFGS:   14 22:47:44    -1091.704439        0.158158
BFGS:   15 22:47:44    -1091.715506        0.191688
BFGS:   16 22:47:44    -1091.725708        0.197784
BFGS:   17 22:47:44    -1091.735322        0.163711
BFGS:   18 22:47:45    -1091.745539        0.151465
BFGS:   19 22:47:45    -1091.754025        0.170816
BFGS:   20 22:47:45    -1091.761495        0.153233
BFGS:   21 22:47:45    -1091.767898        0.152745
BFGS:   22 22:47:46    -1091.774204        0.166060
BFGS:   23 22:47:46    -1091.780882        0.135342
BFGS:   24 22:47:46    -1091.788358        0.180965
BFGS:   25 22:47:46    -1091.794277        0.204402
BFGS:   26 22:47:46    -1091.800643        0.131372
BFGS:   27 22:47:47    -1091.806523        0.189958
BFGS:   28 22:47:47    -1091.812304        0.199127
BFGS:   29 22:47:47    -1091.817177        0.151705
BFGS:   30 22:47:47    -1091.822207        0.100090
BFGS:   31 22:47:48    -1091.826299        0.124839
BFGS:   32 22:47:48    -1091.832529        0.177176
BFGS:   33 22:47:48    -1091.837117        0.245530
BFGS:   34 22:47:48    -1091.842047        0.112852
BFGS:   35 22:47:48    -1091.845761        0.333082
BFGS:   36 22:47:49    -1091.850845        0.173345
BFGS:   37 22:47:49    -1091.858456        0.159383
BFGS:   38 22:47:49    -1091.865271        0.142287
BFGS:   39 22:47:49    -1091.872001        0.137618
BFGS:   40 22:47:50    -1091.878144        0.283178
BFGS:   41 22:47:50    -1091.879175        0.617671
BFGS:   42 22:47:50    -1091.888049        0.447107
BFGS:   43 22:47:50    -1091.893925        0.263401
BFGS:   44 22:47:51    -1091.901260        0.213399
BFGS:   45 22:47:51    -1091.915077        0.275706
BFGS:   46 22:47:51    -1091.924115        0.349056
BFGS:   47 22:47:51    -1091.938024        0.233945
BFGS:   48 22:47:51    -1091.950545        0.674348
BFGS:   49 22:47:52    -1091.969514        0.487079
BFGS:   50 22:47:52    -1091.988478        0.475559
BFGS:   51 22:47:52    -1092.017899        0.615826
BFGS:   52 22:47:52    -1092.038008        0.739518
BFGS:   53 22:47:53    -1092.068154        0.561839
BFGS:   54 22:47:53    -1092.088823        0.653581
BFGS:   55 22:47:53    -1092.109892        0.490472
BFGS:   56 22:47:53    -1092.127569        0.276656
BFGS:   57 22:47:54    -1092.139283        0.244581
BFGS:   58 22:47:54    -1092.152679        0.238026
BFGS:   59 22:47:54    -1092.168139        0.291928
BFGS:   60 22:47:54    -1092.178895        0.383357
BFGS:   61 22:47:54    -1092.190116        0.420748
BFGS:   62 22:47:55    -1092.201114        0.370482
BFGS:   63 22:47:55    -1092.211821        0.288253
BFGS:   64 22:47:55    -1092.221928        0.205304
BFGS:   65 22:47:55    -1092.230115        0.155713
BFGS:   66 22:47:56    -1092.236492        0.117964
BFGS:   67 22:47:56    -1092.242277        0.102772
BFGS:   68 22:47:56    -1092.247819        0.145362
BFGS:   69 22:47:56    -1092.252833        0.160273
BFGS:   70 22:47:57    -1092.258211        0.117419
BFGS:   71 22:47:57    -1092.263088        0.074521
BFGS:   72 22:47:57    -1092.267285        0.125000
BFGS:   73 22:47:57    -1092.270950        0.181931
BFGS:   74 22:47:57    -1092.274421        0.190321
BFGS:   75 22:47:58    -1092.277765        0.166798
BFGS:   76 22:47:58    -1092.281370        0.097098
BFGS:   77 22:47:58    -1092.284321        0.093013
BFGS:   78 22:47:58    -1092.286917        0.100290
BFGS:   79 22:47:59    -1092.289402        0.088149
BFGS:   80 22:47:59    -1092.291485        0.072231
BFGS:   81 22:47:59    -1092.293331        0.073486
BFGS:   82 22:47:59    -1092.294877        0.078905
BFGS:   83 22:47:59    -1092.296254        0.073440
BFGS:   84 22:48:00    -1092.297660        0.069509
BFGS:   85 22:48:00    -1092.299139        0.082172
BFGS:   86 22:48:00    -1092.300888        0.096827
BFGS:   87 22:48:00    -1092.302574        0.089557
BFGS:   88 22:48:01    -1092.304390        0.061309
BFGS:   89 22:48:01    -1092.305948        0.054270
BFGS:   90 22:48:01    -1092.307323        0.048822
Energy of MOF + H2O: -1092.307 eV

We can now isolate the MOF atoms from the relaxed MOF + H2O geometry and see that the MOF has adopted a geometry that is less energetically favorable than the empty MOF by ~0.2 eV. The energy of the MOF in the adsorbed state corresponds to \(E_{\mathrm{MOF}}(r_{\mathrm{MOF+H2O}})\).

mof_adsorbed_state = mof_h2o[:-3]
mof_adsorbed_state.calc = calc
E_mof_adsorbed_state = mof_adsorbed_state.get_potential_energy()
print(f"Energy of MOF in the adsorbed state: {E_mof_adsorbed_state:.3f} eV")
Energy of MOF in the adsorbed state: -1077.090 eV

H2O adsorption in this MOF appears to correspond to Case #2 as outlined above. We can now perform re-relaxation of the empty MOF starting from the \(r_{\mathrm{MOF+H2O}}\) geometry.

relax = BFGS(mof_adsorbed_state)
relax.run(fmax=0.05)
E_mof_rerelax = mof_adsorbed_state.get_potential_energy()
print(f"Energy of re-relaxed empty MOF: {E_mof_rerelax:.3f} eV")
      Step     Time          Energy          fmax
BFGS:    0 22:48:01    -1077.090419        0.986709
BFGS:    1 22:48:02    -1077.122845        0.874456
BFGS:    2 22:48:02    -1077.172495        0.804517
BFGS:    3 22:48:02    -1077.212422        0.504111
BFGS:    4 22:48:02    -1077.232283        0.440954
BFGS:    5 22:48:02    -1077.250358        0.281342
BFGS:    6 22:48:03    -1077.261156        0.260876
BFGS:    7 22:48:03    -1077.270601        0.246585
BFGS:    8 22:48:03    -1077.279861        0.209260
BFGS:    9 22:48:03    -1077.286935        0.185492
BFGS:   10 22:48:04    -1077.292121        0.152507
BFGS:   11 22:48:04    -1077.296227        0.140234
BFGS:   12 22:48:04    -1077.299877        0.145439
BFGS:   13 22:48:04    -1077.304529        0.185775
BFGS:   14 22:48:04    -1077.309341        0.176256
BFGS:   15 22:48:05    -1077.313967        0.136187
BFGS:   16 22:48:05    -1077.318099        0.164968
BFGS:   17 22:48:05    -1077.322289        0.149129
BFGS:   18 22:48:05    -1077.326626        0.145864
BFGS:   19 22:48:06    -1077.330181        0.112989
BFGS:   20 22:48:06    -1077.332797        0.109438
BFGS:   21 22:48:06    -1077.335020        0.098389
BFGS:   22 22:48:06    -1077.337284        0.122418
BFGS:   23 22:48:06    -1077.339961        0.118948
BFGS:   24 22:48:07    -1077.342562        0.089241
BFGS:   25 22:48:07    -1077.344870        0.090565
BFGS:   26 22:48:07    -1077.346780        0.068571
BFGS:   27 22:48:07    -1077.348318        0.066639
BFGS:   28 22:48:08    -1077.350016        0.090178
BFGS:   29 22:48:08    -1077.351562        0.093830
BFGS:   30 22:48:08    -1077.353152        0.064746
BFGS:   31 22:48:08    -1077.354338        0.050542
BFGS:   32 22:48:09    -1077.355638        0.055105
BFGS:   33 22:48:09    -1077.357006        0.083062
BFGS:   34 22:48:09    -1077.358393        0.077432
BFGS:   35 22:48:09    -1077.359893        0.067585
BFGS:   36 22:48:10    -1077.361298        0.070138
BFGS:   37 22:48:10    -1077.362582        0.072320
BFGS:   38 22:48:10    -1077.363760        0.081766
BFGS:   39 22:48:10    -1077.365043        0.080135
BFGS:   40 22:48:10    -1077.366005        0.067641
BFGS:   41 22:48:11    -1077.366997        0.058114
BFGS:   42 22:48:11    -1077.368112        0.058032
BFGS:   43 22:48:11    -1077.369126        0.069798
BFGS:   44 22:48:11    -1077.370367        0.075310
BFGS:   45 22:48:12    -1077.371519        0.048775
Energy of re-relaxed empty MOF: -1077.372 eV

The MOF returns to its original empty reference energy upon re-relaxation, confirming that this deformation is physically relevant and is induced by the adsorbate molecule. In Case #3, this re-relaxed energy will be more negative (more favorable) than the original empty MOF relaxation. Thus, we take the reference empty MOF energy (\(E_{\mathrm{MOF}}\) in Eqn. 1) to be the minimum of the original empty MOF energy and the re-relaxed MOf energy:

E_mof = min(E_mof_empty, E_mof_rerelax)

# get adsorbate reference energy
h2o = mof_h2o[-3:]
h2o.calc = calc
E_h2o = h2o.get_potential_energy()

# compute adsorption energy
E_ads = E_combo - E_mof - E_h2o
print(f"Adsorption energy of H2O in WOBHEB_0.11_0: {E_ads:.3f} eV")
Adsorption energy of H2O in WOBHEB_0.11_0: -0.685 eV

This adsorption energy closely matches that from DFT (–0.699 eV) [1]. The strong adsorption energy is a consequence of both H2O chemisorption and MOF deformation. We can decompose the adsorption energy into contributions from these two factors. Assuming rigid H2O molecules, we define \(E_{\mathrm{int}}\) and \(E_{\mathrm{MOF,deform}}\), respectively, as

\[ E_{\mathrm{int}} = E_{\mathrm{MOF+H2O}}(r_{\mathrm{MOF+H2O}}) - E_{\mathrm{MOF}}(r_{\mathrm{MOF+H2O}}) - E_{\mathrm{H2O}}(r_{\mathrm{MOF+H2O}}) \tag{2}\]
\[ E_{\mathrm{MOF,deform}} = E_{\mathrm{MOF}}(r_{\mathrm{MOF+H2O}}) - E_{\mathrm{MOF}}(r_{\mathrm{MOF}}) \tag{3}\]

\(E_{\mathrm{int}}\) describes host host–guest interactions for the MOF in the adsorbed state only. \(E_{\mathrm{MOF,deform}}\) quantifies the magnitude of deformation between the MOF in the adsorbed state and the most energetically favorable empty MOF geometry determined from the workflow presented here. It can be shown that

\[ E_{\mathrm{ads}} = E_{\mathrm{int}} + E_{\mathrm{MOF,deform}} \tag{4}\]

For H2O adsorption in WOBHEB_0.11, we have

E_int = E_combo - E_mof_adsorbed_state - E_h2o
print(f"E_int: {E_int}")
E_int: -0.9687449336050076
E_mof_deform = E_mof_adsorbed_state - E_mof_empty
print(f"E_mof_deform: {E_mof_deform}")
E_mof_deform: 0.2840595245361328
E_ads = E_int + E_mof_deform
print(f"E_ads: {E_ads}")
E_ads: -0.6846854090688748

\(E_{\mathrm{int}}\) is equivalent to \(E_{\mathrm{ads}}\) when the MOF is assumed to be rigid. In this case, failure to consider adsorbate-induced deformation would result in an overestimation of the adsorption energy magnitude.

Acknowledgements & Authors#

Logan Brabson and Sihoon Choi (Georgia Tech) and the OpenDAC project.