{"id":47474930,"url":"https://github.com/ImperialCollegeLondon/StrataTrapper","last_synced_at":"2026-04-09T00:01:38.249Z","repository":{"id":228976029,"uuid":"741567808","full_name":"ImperialCollegeLondon/StrataTrapper","owner":"ImperialCollegeLondon","description":"Field scale model generation and upscaling toolkit","archived":false,"fork":false,"pushed_at":"2026-04-01T12:53:25.000Z","size":21619,"stargazers_count":12,"open_issues_count":5,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-04-03T04:23:29.010Z","etag":null,"topics":["capillary-pressure","carbon-dioxide","co2","co2-storage","heterogeneity","matlab","opm-flow","pflotran","porous-media-flow","reservoir-simulation","upscaling"],"latest_commit_sha":null,"homepage":"https://imperialcollegelondon.github.io/StrataTrapper","language":"MATLAB","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ImperialCollegeLondon.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE.txt","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-01-10T17:00:18.000Z","updated_at":"2026-04-01T12:53:29.000Z","dependencies_parsed_at":"2026-03-01T21:10:24.489Z","dependency_job_id":null,"html_url":"https://github.com/ImperialCollegeLondon/StrataTrapper","commit_stats":null,"previous_names":["imperialcollegelondon/stratatrapper"],"tags_count":30,"template":false,"template_full_name":null,"purl":"pkg:github/ImperialCollegeLondon/StrataTrapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImperialCollegeLondon%2FStrataTrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImperialCollegeLondon%2FStrataTrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImperialCollegeLondon%2FStrataTrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImperialCollegeLondon%2FStrataTrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ImperialCollegeLondon","download_url":"https://codeload.github.com/ImperialCollegeLondon/StrataTrapper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImperialCollegeLondon%2FStrataTrapper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31579058,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["capillary-pressure","carbon-dioxide","co2","co2-storage","heterogeneity","matlab","opm-flow","pflotran","porous-media-flow","reservoir-simulation","upscaling"],"created_at":"2026-03-25T13:00:32.984Z","updated_at":"2026-04-09T00:01:38.235Z","avatar_url":"https://github.com/ImperialCollegeLondon.png","language":"MATLAB","funding_links":[],"categories":["Emissions"],"sub_categories":["Carbon Capture"],"readme":"# Field scale model generation and upscaling toolkit\n\nRepository: [github.com/ImperialCollegeLondon/StrataTrapper](https://github.com/ImperialCollegeLondon/StrataTrapper)\n\n![build](https://github.com/ImperialCollegeLondon/StrataTrapper/actions/workflows/ci.yml/badge.svg?branch=main)\n![GitHub Tag](https://img.shields.io/github/v/tag/ImperialCollegeLondon/StrataTrapper?sort=semver\u0026style=flat\u0026label=version)\n![GitHub Release Date](https://img.shields.io/github/release-date/ImperialCollegeLondon/StrataTrapper?display_date=published_at\u0026style=flat\u0026label=dated)\n[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.15438164.svg)](https://doi.org/10.5281/zenodo.15438164)\n\n* [The StrataTrapper codes](#the-stratatrapper-codes)\n* [Structure](#structure)\n* [Running](#running)\n* [Output compression](#output-compression)\n* [MEX acceleration](#mex-acceleration)\n* [Versions](#versions)\n* [Contributing](#contributing)\n* [References](#references)\n\n![StrataTrapper logo](./img/StrataTrapper.jpg)\n\n## The StrataTrapper codes\n\nThis is the StrataTrapper **upscaling toolkit**.\nIt can also generate heterogeneous fine-scale models with specific correlation lengths\nto re-upscale given coarse-scale two-phase flow models.\n\nAnother tool is the **reduced-physics model** [CO2GraVISim](https://github.com/ajobutler/CO2GraVISim).\n\nIn [`StrataTrapper-models`](https://github.com/ImperialCollegeLondon/StrataTrapper-models)\nrepository, we publish field-scale models upscaled with StrataTrapper.\n\n## Structure\n\nTop-level scripts and functions are in the repository root,\nand the rest is in [`src/`](src) folder.\n\n[`demo.m`](demo.m) script is an implementation of the running guideline below.\\\nFeel free to play with it and use as an example for your own scripts.\n\n## Running\n\n1. Run [`startup.m`](startup.m) to setup MATLAB Path.\n   1. Optional: start a parallel pool to run computations there.\n2. Read or generate target coarse grid dimensions\nand input fine-scale porosity and permeability for each coarse block.\n3. Setup input rock-fluid properties and algorithm options represented by\n  [`Params`](src/Params.m) and [`Options`](src/Options.m) classes.\n  Pass an array of `Params` for multiple-region models.\n4. Create integer `mask` to:\n    * filter out impermeable cells\n    and/or compute an arbitrary subset of cells by putting `0`s\n    * Put index `n` of the input array of `Params`\n    to map coarse cells to the corresponding regions\n5. Run [`strata_trapper`](src/strata_trapper.m) function\nwith arbitrary number of parallel workers\noptionally enabling a UI progress bar.\n6. Visualise outputs with [`plot_result`](src/plot_result.m) function\n7. Export the outputs to [PFLOTRAN-OGS](https://docs.opengosim.com/)\nor [OPM Flow](https://opm-project.org/?page_id=19) format\nusing [`ogs_export`](src/export/ogs_export.m)\nor [`opm_export`](src/export/opm_export.m) function, respectively.\n\nTips:\n\n* Usually, MATLAB runs `startup.m` scripts automatically\nif they are in a startup folder.\n* The heaviest part of the algorithm is essentially parallel with no synchronisation.\nSo, using several parallel workers usually results\nin a proportional performance boost.\n\n## Output compression\n\nBy default, `strata_trapper` outputs one set of saturation tables\n**per coarse cell per direction**.\nSuch a number might be found too big in some situations.\n\nWith [`quantize`](src/compress/quantize.m),\ntoolkit can now compress the set of saturation tables\nif they are similar enough or the acceptable approximation error is high.\n\nRead [compression README](src/compress/README.md) for more details.\n\n## MEX acceleration\n\nWe provide the `CodeGenMex` class to automatically build\na MEX-accelerated version of computationally-demanding functions\nsuch as [`upscale`](src/upscale.m).\n\n```matlab\n% 1. compile MEX functions\ncodegen_mex = CodeGenMex().config().build();\n\n% 2. use strata_trapper normally\n...\n\n% 3. recompile MEX functions when the source code changes\ncodegen_mex.build();\n\n% 4. delete MEX functions to use the original\ncodegen_mex.clear();\n```\n\nRequires [MATLAB Coder](https://uk.mathworks.com/products/matlab-coder.html).\n\n## Versions\n\nThe original version of the toolkit is [v0.1.0](https://github.com/ImperialCollegeLondon/StrataTrapper/tree/v0.1.0).\\\nIt has its own structure and some unique functionality,\\\nso it may worth attention as much as later versions.\n\n[CHANGELOG.md](CHANGELOG.md) describes the version history and key changes.\n\nOther versions can be accessed via\n[tags](https://github.com/ImperialCollegeLondon/StrataTrapper/tags) and\n[releases](https://github.com/ImperialCollegeLondon/StrataTrapper/releases)\nsections of the repository.\n\n## Contributing\n\nEveryone is welcome to open\n[issues](https://github.com/ImperialCollegeLondon/StrataTrapper/issues) and\n[pull requests](https://github.com/ImperialCollegeLondon/StrataTrapper/pulls).\n\n## References\n\nThe StrataTrapper algorithm as well as motivation\nand theory behind it are in the paper:\n\n\u003e Samuel J. Jackson, Samuel Krevor\\\n\u003e **Small-Scale Capillary Heterogeneity**\n\u003e **Linked to Rapid Plume Migration During CO2 Storage**\\\n\u003e *Geophysical Research Letters* | 2020\\\n\u003e \u003chttps://doi.org/10.1029/2020GL088616\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FImperialCollegeLondon%2FStrataTrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FImperialCollegeLondon%2FStrataTrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FImperialCollegeLondon%2FStrataTrapper/lists"}