Selected examples and notebooks

Run the MATLAB commands locally and inspect their saved results in the notebooks. Start with a representative storage or validation case, then use the smaller workflow checks to explore chemistry settings.

Choose how to run an example

  • Setup check: use runPhreeqcValidation('totalDays', 2, 'plotResults', false) or the four-cell mineral notebook to check dependencies. These short runs do not reproduce full-duration figures.

  • Tutorial run: follow a notebook’s stated grid, schedule, and physical switches. Storage examples can be substantially larger than setup checks.

  • Exact reproduction: use the configuration and source dataset identified for the displayed result. A default example with a different cycle count, grid, or kinetic model does not reproduce that figure.

  • Saved-result exploration: redraw the exported multirate histories or inspect the three-cycle animation. Their provenance records identify the saved inputs; the documentation build does not rerun MATLAB simulations.

Open h2-biochem/examples/Contents.m in this checkout for the example catalogue. Initialize H2sim with startupH2sim before running examples.

Small hydrogen-mixing animation

Hydrogen–methane mixing in a sealed section

A small adaptation of a published hydrogen benchmark. Watch gravity and diffusion redistribute two gases; no PHREEQC is required.

Hydrogen–methane mixing
Cyclic storage beneath an anticline

A four-layer Gaussian structure, cushion injection, shut-in and ten storage cycles. Watch the plume, well operation and hydrogen inventory.

Anticlinal hydrogen storage

Storage in saline aquifers

2D aquifer storage cycle

Hydrogen build-up, structural trapping, injection, and withdrawal in the existing aquifer model. Gravity, capillarity, and dissolved hydrogen.

2D hydrogen storage in an aquifer

Storage in depleted gas reservoirs

Five-cycle 2D storage with three reactions

The existing 2D case with residual methane, MET, ACE, and SRB. Compare bacterial and abiotic injection and withdrawal on the original grid.

2D compositional storage with three reactions

Thermodynamics

Phase partitioning and salting-out

Compare RK, SW, PR, and Henry–Setschenow calculations with supplied ePC-SAFT reference tables. Inspect the route to black-oil PVT tabulation.

Hydrogen–brine phase behavior

PHREEQC validation

Compositional PHREEQC full-cycle validation

A 20-cell, 250-day injection–storage–production comparison with a separate reference implementation. Compare H₂ consumption, dissolved hydrogen, pH, DIC, and the three metabolic pathways.

Complete-cycle PHREEQC validation
Full-cycle hydrogen consumption and dissolved-hydrogen evolution compared with the reference.

Complete-cycle PHREEQC validation. The source of the reference and the differences in chemistry splitting are described in the notebook.

Three-cycle 2D PHREEQC coupling

Hydrogen and microbial evolution in a layered reservoir

Completed three-cycle results, metabolic consumption, gas composition, pH, and a time-slider animation comparing mobile and cell-local populations.

Three-cycle reactive storage in 2D

Short chemistry walkthroughs

Mineral chemistry setup check

Four cells and two timesteps to check database loading, mineral inventories, pH, and saved output. A workflow check, not a spatial validation.

Mineral chemistry setup check
Multirate full-cycle comparison

A complete 250-day comparison with compositional PHREEQC: hydrogen consumption by reaction, pH, and dissolved inorganic carbon.

Separate flow and reaction timescales

Download the notebooks

Saved plots are embedded in the notebooks. The documentation build does not execute MATLAB or require a MATLAB notebook kernel.