Table of Contents
A Python library for interpreting core flooding experiments
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
For modelling studies of underground storage of carbon dioxide and hydrogen, transport in the vadoze zone, contaminant hydrology as well as hydrocarbon recovery, it is important to have a consistent set of relative permeability and capillary pressure-saturation functions as inputs for numerical reservoir models in order to assess risks and uncertainties and provide forward-models for different scenarios. Such relative permeability and capillary-pressure saturations functions are typically obtained in Special Core Analysis (SCAL) where core flooding experiments are a central element (see also The Society of Core Analysts). Interpreation of such core flooding experiments by analytical approximations has several disadvantages and instead, interpretation by inverse modelling is the preferred approach. This project has been created to provide a standalone Python tool for the interpretation of such core flooding experiments. It contains
- a 1D numerical flow solver (Darcy fractional flow solver with capillarity in 1D) and
- an inverse modelling framework which is utilizing the optimization package called lmfit from Python
Flow simulator code and inverse modelling framework are research code. The 1D flow code has been validated against benchmarks developed by Jos Maas and respective benchmark examples are included as examples. The inverse modelling framework has been validated in a series of publications
-
S. Berg, E. Unsal, H. Dijk, Non-Uniqueness and Uncertainty Quantification of Relative Permeability Measurements by Inverse Modelling, Computers and Geotechnics 132, 103964, 2021.
-
S. Berg, E. Unsal, H. Dijk, Sensitivity and uncertainty analysis for parameterization of multi phase flow models, Transport in Porous Media 140(1), 27-57, 2021.
-
S. Berg, H. Dijk, E. Unsal, R. Hofmann, B. Zhao, V. Ahuja, Simultaneous Determination of Relative Permeability and Capillary Pressure from an Unsteady-State Core Flooding Experiment ? Computers and Geotechnics 168, 106091, 2024.
- Readme based on Best Readme Template
- Jupyter notebooks generated from .py files with jupytext
Read the paper to get some background info. Then install your favorite Python distribution of you don't already have one (we used Anaconda), install required libraries, download the code and run the examples.
The code and examples can be run from most modern Python distributions such as Anaconda. You may want to choose a distribution that has matplotlib
, numpy
and other standard packages pre-installed. There are a few extra libraries to install:
- pandas (using internally pandas data frames, but also to import/expert data)
- lmfit (the engine for the least squares fits)
- emcee (Markov chain Monte Carlo sampler, optional)
- numba (Just In Time compiler)
- seaborn (for statistical data visualization)
Quick installation by replicating the environment in Anaconda:
- Clone the repo
git clone https://github.com/sede-open/core2relperm.git
- Configure conda
conda update conda conda config --set ssl_verify false
- Replicate environment using either of the following commands:
conda env create -f environment.yml
- Activate the environment
conda activate relperm
Alternatively, if you face issues with above mentioned quick installtion, you can create the environment and install the Python packages manually as shown below:
- Create new environment and install required Python libraries
conda create -n relperm numpy matplotlib numba scipy seaborn pandas lmfit emcee
- For rendering in VSCode install the ipykernel package
conda install ipykernel
We included 4 SCAL benchmarks from https://www.jgmaas.com
benchmark_scores_Case1.ipynb
benchmark_scores_Case2.ipynb
benchmark_scores_Case3.ipynb
benchmark_scores_Case4.ipynb
that are benchmarking the 2-phase 1D flow solver defined in R. Lenormand, K. Lorentzen, J. G. Maas and D. Ruth, COMPARISON OF FOUR NUMERICAL SIMULATORS FOR SCAL EXPERIMENTS, SCA2016-006
We include 2 examples from the paper S. Berg, E. Unsal, H. Dijk, Sensitivity and uncertainty analysis for parameterization of multi phase flow models, Transport in Porous Media 140(1), 27-57, 2021.
- Fig. 09
example_Fig09_USS_dpw+dpo+noSwz.py
- Fig. 17
example_Fig17_USS_dpw+dpo+Swz_bumpfloods.py
The .py
files are also available as .ipynb
Jupyter notebooks (generated with jupytext). Respective markdown tags are included in the .py files to generate the formatting e.g. headers in the Jupyter notebooks.
- Add Changelog
- Add more examples from previous papers
- steady-state experiments
- matching real data
It would be great if you could contribute to this project. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
Distributed under the MIT License. See LICENSE.txt
for more information.
Steffen Berg - LinkedIn - [email protected]
Project Link: https://github.com/sede-open/Core2Relperm
We would like to acknowledge
- Sherin Mirza, Aarthi Thyagarajan and Luud Heck from Shell supporting the OpenSource release on GitHub
- Holger Ott, Omidreza Amrollahinasab (University of Leoben), and Jos Maas (PanTerra) for helpful discussions
- Tibi Sorop and Yingxue Wang for reviewing the paper manuscript
-
S. Berg, H. Dijk, E. Unsal, R. Hofmann, B. Zhao, V. Ahuja, Simultaneous Determination of Relative Permeability and Capillary Pressure from an Unsteady-State Core Flooding Experiment ? Computers and Geotechnics 168, 106091, 2024.
-
S. Berg, E. Unsal, H. Dijk, Non-Uniqueness and Uncertainty Quantification of Relative Permeability Measurements by Inverse Modelling, Computers and Geotechnics 132, 103964, 2021.
-
S. Berg, E. Unsal, H. Dijk, Sensitivity and uncertainty analysis for parameterization of multi phase flow models, Transport in Porous Media 140(1), 27-57, 2021.
-
R. Lenormand, K. Lorentzen, J. G. Maas and D. Ruth COMPARISON OF FOUR NUMERICAL SIMULATORS FOR SCAL EXPERIMENTS SCA2016-006