Code reference¶
Browse the source repository, or use
MATLAB’s help and edit commands for local function documentation.
Entry points¶
Function |
Purpose |
|---|---|
|
Initialize code and dependencies |
|
2D structural trapping and five storage cycles |
|
MRST compositional microbial example |
|
Configure a multi-reaction benchmark |
|
Original MRST and three PHREEQC mineral configurations |
|
Coarse-flow / local-reaction multirate example |
|
Existing 2D reservoir case with MET, ACE, SRB, packed cycles, and selectable scenarios |
|
Compositional PHREEQC injection benchmark against an external reference |
|
Phase-partition and salting-out comparisons |
|
AMGCL CPR including bacterial and tracer unknowns; configurable native threads |
|
Load result MAT files; optionally stage network files locally for HDF5 |
|
Activate an optional locally compiled MRST gateway |
|
Paired profiling and state comparisons |
Output and replotting¶
The aquifer, compositional 2D, validation, and short chemistry examples save their setup and accepted states with MRST
packed simulation output. packed_setup.mat sits beside the saved states,
well solutions, and timestep reports. Changed inputs select a separate result
directory. Returned results contain the setup and state histories;
packedProblem identifies the black-oil and multirate output locations.
The mineral comparison returns one result per model configuration.
plotBlackOilAquifer2D(result);
plotH2BrineSolubilityStudy(study);
plotCompositionalBacterial2DThreeReactions(results);
plotCompositionalPhreeqcValidation(validation);
plotPhreeqcMineralComparison(comparison);
plotSequentialBiochemistryPhreeqc(summary);
plotPhreeqcBackendComparison(scenarios);
The compositional 2D MAT results retain physical fields while omitting
transient derivative/state-function caches. Complete restart states remain
in the packed directory. A completed MAT result with matching packed setup
can be reused without rereading every restart cache. Use loadH2simResults
when loading large result files through a network path; it
stages a temporary local copy for HDF5 and removes it after loading.
Plotting functions preserve values and export vector PDF and PNG figures.
outputDirectory='' disables export. Dimensionless distance uses actual
domain edges, rather than stretching cell centers to zero and one.
Hydrogen-consumption percentages refer to microbial reaction consumption, with the injection denominator stated by the figure. They are distinct from unrecovered gas or a production recovery factor.
Tests¶
checks = runtests('h2-biochem/tests');
assertSuccess(checks);
COM integration tests require the IPhreeqcCOM setup described in Installation. A skipped test does not validate a backend on that platform. The serial fallback tests cover both available and missing optional toolbox checks.
See PHREEQC coupling for the current conservation-audit limitations.