StrataTrapper
Advanced modelling of CO2 migration and trapping.
https://github.com/imperialcollegelondon/stratatrapper
Category: Emissions
Sub Category: Carbon Capture
Keywords
capillary-pressure carbon-dioxide co2 co2-storage heterogeneity matlab opm-flow pflotran porous-media-flow reservoir-simulation upscaling
Last synced: about 9 hours ago
JSON representation
Repository metadata
Field scale model generation and upscaling toolkit
- Host: GitHub
- URL: https://github.com/imperialcollegelondon/stratatrapper
- Owner: ImperialCollegeLondon
- License: bsd-3-clause
- Created: 2024-01-10T17:00:18.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2026-03-01T21:13:37.000Z (21 days ago)
- Last Synced: 2026-03-01T21:40:36.636Z (21 days ago)
- Topics: capillary-pressure, carbon-dioxide, co2, co2-storage, heterogeneity, matlab, opm-flow, pflotran, porous-media-flow, reservoir-simulation, upscaling
- Language: MATLAB
- Homepage: https://imperialcollegelondon.github.io/StrataTrapper
- Size: 20.6 MB
- Stars: 12
- Watchers: 2
- Forks: 1
- Open Issues: 10
- Releases: 28
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Citation: CITATION.cff
- Notice: NOTICE.txt
README.md
Field scale model generation and upscaling toolkit
Repository: github.com/ImperialCollegeLondon/StrataTrapper

The StrataTrapper codes
This is the StrataTrapper upscaling toolkit.
It can also generate heterogeneous fine-scale models with specific correlation lengths
to re-upscale given coarse-scale two-phase flow models.
Another tool is the reduced-physics model CO2GraVISim.
In StrataTrapper-models
repository, we publish field-scale models upscaled with StrataTrapper.
Structure
Top-level scripts and functions are in the repository root,
and the rest is in src/ folder.
demo.m script is an implementation of the running guideline below.
Feel free to play with it and use as an example for your own scripts.
Running
- Run
startup.mto setup MATLAB Path.- Optional: start a parallel pool to run computations there.
- Read or generate target coarse grid dimensions
and input fine-scale porosity and permeability for each coarse block. - Setup input rock-fluid properties and algorithm options represented by
ParamsandOptionsclasses.
Pass an array ofParamsfor multiple-region models. - Create integer
maskto:- filter out impermeable cells
and/or compute an arbitrary subset of cells by putting0s - Put index
nof the input array ofParams
to map coarse cells to the corresponding regions
- filter out impermeable cells
- Run
strata_trapperfunction
with arbitrary number of parallel workers
optionally enabling a UI progress bar. - Visualise outputs with
plot_resultfunction - Export the outputs to PFLOTRAN-OGS
or OPM Flow format
usingogs_export
oropm_exportfunction, respectively.
Tips:
- Usually, MATLAB runs
startup.mscripts automatically
if they are in a startup folder. - The heaviest part of the algorithm is essentially parallel with no synchronisation.
So, using several parallel workers usually results
in a proportional performance boost.
MEX acceleration
We provide the CodeGenMex class to automatically build
a MEX-accelerated version of the upscale function.
% 1. compile MEX functions
codegen_mex = CodeGenMex().config().build();
% 2. use strata_trapper normally
...
% 3. recompile MEX functions when the source code changes
codegen_mex.build();
% 4. delete MEX functions to use the original
codegen_mex.clear();
Requires MATLAB Coder.
Versions
The original version of the toolkit is v0.1.0.
It has its own structure and some unique functionality,
so it may worth attention as much as later versions.
CHANGELOG.md describes the version history and key changes.
Other versions can be accessed via
tags and
releases
sections of the repository.
Contributing
Everyone is welcome to open
issues and
pull requests.
References
The StrataTrapper algorithm as well as motivation
and theory behind it are in the paper:
Samuel J. Jackson, Samuel Krevor
Small-Scale Capillary Heterogeneity
Linked to Rapid Plume Migration During CO2 Storage
Geophysical Research Letters | 2020
https://doi.org/10.1029/2020GL088616
Citation (CITATION.cff)
# https://github.com/citation-file-format/citation-file-format
cff-version: 1.2.0
title: "StrataTrapper upscaling toolkit"
message: >-
If you use this software,
please put the copyright NOTICE.txt in your developments
and cite using CITATION.cff provided in the repository
or generated by Zenodo
authors:
- &djmaxus
family-names: Elizarev
given-names: Maksim
alias: djmaxus
orcid: "https://orcid.org/0000-0002-5279-2877"
website: "https://djmaxus.dev"
- family-names: Jackson
given-names: Samuel J
- family-names: An
given-names: Senyou
- family-names: Wenck
given-names: Nele
- family-names: Muggeridge
given-names: Ann
- &skrevor
family-names: Krevor
given-names: Samuel
doi: "10.5281/zenodo.15438164"
contact:
- *djmaxus
- *skrevor
keywords:
- MATLAB
- CO2
- upscaling
- carbon dioxide
- heterogeneity
- reservoir simulation
- porous media flow
- pflotran
- capillary pressure
- CO2 storage
license: BSD-3-Clause
repository-code: "https://github.com/ImperialCollegeLondon/StrataTrapper"
type: software
url: "https://imperialcollegelondon.github.io/StrataTrapper/"
Owner metadata
- Name: Imperial College London
- Login: ImperialCollegeLondon
- Email: icgithub-support@imperial.ac.uk
- Kind: organization
- Description: Imperial College main code repository
- Website:
- Location: Imperial College London
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/1220306?v=4
- Repositories: 311
- Last ynced at: 2023-03-14T09:25:14.124Z
- Profile URL: https://github.com/ImperialCollegeLondon
GitHub Events
Total
- Release event: 11
- Delete event: 65
- Pull request event: 151
- Issues event: 26
- Watch event: 9
- Issue comment event: 21
- Push event: 258
- Pull request review comment event: 23
- Pull request review event: 62
- Create event: 84
Last Year
- Release event: 5
- Delete event: 48
- Pull request event: 99
- Issues event: 13
- Watch event: 3
- Issue comment event: 13
- Push event: 161
- Pull request review comment event: 23
- Pull request review event: 55
- Create event: 56
Committers metadata
Last synced: 2 days ago
Total Commits: 295
Total Committers: 5
Avg Commits per committer: 59.0
Development Distribution Score (DDS): 0.288
Commits in past year: 148
Committers in past year: 3
Avg Commits per committer in past year: 49.333
Development Distribution Score (DDS) in past year: 0.216
| Name | Commits | |
|---|---|---|
| Max Elizarev | 4****s | 210 |
| Senyou An | 3****n | 40 |
| github-actions[bot] | 4****] | 27 |
| dependabot[bot] | 4****] | 17 |
| skrevor | 4****r | 1 |
Issue and Pull Request metadata
Last synced: 2 days ago
Total issues: 15
Total pull requests: 265
Average time to close issues: 25 days
Average time to close pull requests: 1 day
Total issue authors: 1
Total pull request authors: 4
Average comments per issue: 0.13
Average comments per pull request: 0.12
Merged pull request: 204
Bot issues: 0
Bot pull requests: 94
Past year issues: 11
Past year pull requests: 118
Past year average time to close issues: about 1 month
Past year average time to close pull requests: 1 day
Past year issue authors: 1
Past year pull request authors: 3
Past year average comments per issue: 0.18
Past year average comments per pull request: 0.14
Past year merged pull request: 91
Past year bot issues: 0
Past year bot pull requests: 50
Top Issue Authors
- djmaxus (15)
Top Pull Request Authors
- djmaxus (167)
- github-actions[bot] (70)
- dependabot[bot] (24)
- skrevor (4)
Top Issue Labels
- feature (4)
- infrastructure (4)
- optimisation (2)
- github_actions (2)
- documentation (1)
- bug (1)
- good first issue (1)
- enhancement (1)
Top Pull Request Labels
- autorelease: pending (45)
- dependencies (24)
- autorelease: tagged (22)
- github_actions (20)
- feature (9)
- bug (4)
- documentation (2)
Score: 4.700480365792417