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 5 hours ago
JSON representation

Repository metadata

Field scale model generation and upscaling toolkit

README.md

Field scale model generation and upscaling toolkit

Repository: github.com/ImperialCollegeLondon/StrataTrapper

build
GitHub Tag
GitHub Release Date
License
DOI

StrataTrapper logo

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

  1. Run startup.m to setup MATLAB Path.
    1. Optional: start a parallel pool to run computations there.
  2. Read or generate target coarse grid dimensions
    and input fine-scale porosity and permeability for each coarse block.
  3. Setup input rock-fluid properties and algorithm options represented by
    Params and Options classes.
    Pass an array of Params for multiple-region models.
  4. Create integer mask to:
    • filter out impermeable cells
      and/or compute an arbitrary subset of cells by putting 0s
    • Put index n of the input array of Params
      to map coarse cells to the corresponding regions
  5. Run strata_trapper function
    with arbitrary number of parallel workers
    optionally enabling a UI progress bar.
  6. Visualise outputs with plot_result function
  7. Export the outputs to PFLOTRAN-OGS
    or OPM Flow format
    using ogs_export
    or opm_export function, respectively.

Tips:

  • Usually, MATLAB runs startup.m scripts 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.

Output compression

By default, strata_trapper outputs one set of saturation tables
per coarse cell per direction.
Such a number might be found too big in some situations.

With quantize,
toolkit can now compress the set of saturation tables
if they are similar enough or the acceptable approximation error is high.

Read compression README for more details.

MEX acceleration

We provide the CodeGenMex class to automatically build
a MEX-accelerated version of computationally-demanding functions
such as upscale.

% 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


GitHub Events

Total
Last Year

Committers metadata

Last synced: 2 days ago

Total Commits: 315
Total Committers: 6
Avg Commits per committer: 52.5
Development Distribution Score (DDS): 0.298

Commits in past year: 101
Committers in past year: 4
Avg Commits per committer in past year: 25.25
Development Distribution Score (DDS) in past year: 0.297

Name Email Commits
Max Elizarev 4****s 221
Senyou An 3****n 40
github-actions[bot] 4****] 30
dependabot[bot] 4****] 22
skrevor 4****r 1
GitHub Copilot g****t 1

Issue and Pull Request metadata

Last synced: about 8 hours ago

Total issues: 16
Total pull requests: 273
Average time to close issues: 24 days
Average time to close pull requests: 2 days
Total issue authors: 1
Total pull request authors: 4
Average comments per issue: 0.13
Average comments per pull request: 0.13
Merged pull request: 212
Bot issues: 0
Bot pull requests: 99

Past year issues: 7
Past year pull requests: 63
Past year average time to close issues: 2 months
Past year average time to close pull requests: 5 days
Past year issue authors: 1
Past year pull request authors: 3
Past year average comments per issue: 0.0
Past year average comments per pull request: 0.16
Past year merged pull request: 47
Past year bot issues: 0
Past year bot pull requests: 38

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/imperialcollegelondon/stratatrapper

Top Issue Authors

  • djmaxus (16)

Top Pull Request Authors

  • djmaxus (170)
  • github-actions[bot] (72)
  • dependabot[bot] (27)
  • skrevor (4)

Top Issue Labels

  • feature (4)
  • infrastructure (4)
  • github_actions (2)
  • bug (2)
  • optimisation (2)
  • enhancement (1)
  • documentation (1)
  • good first issue (1)

Top Pull Request Labels

  • autorelease: pending (45)
  • dependencies (27)
  • autorelease: tagged (24)
  • github_actions (24)
  • feature (10)
  • bug (5)
  • documentation (3)
  • refactor (1)
  • enhancement (1)

Score: 4.624972813284272