Skip to main content

Physics-inspired waterflood performance modeling

Project description

pywaterflood: Waterflood Connectivity Analysis

PyPI version Conda PyPI - Downloads

Documentation Status DOI status

License codecov pre-commit

pywaterflood provides tools for capacitance resistance modeling, a physics-inspired model for estimating well connectivity between injectors and producers or producers and other producers. It is useful for analyzing and optimizing waterfloods, CO2 floods, and geothermal projects.

Overview

A literature review has been written by Holanda, Gildin, Jensen, Lake and Kabir, entitled "A State-of-the-Art Literature Review on Capacitance Resistance Models for Reservoir Characterization and Performance Forecasting." They describe CRM as the following:

The Capacitance Resistance Model (CRM) is a fast way for modeling and simulating gas and waterflooding recovery processes, making it a useful tool for improving flood management in real-time. CRM is an input-output and material balance-based model, and requires only injection and production history, which are the most readily available data gathered throughout the production life of a reservoir.

There are several CRM versions (see Holanda et al., 2018). Through passing different parameters when creating the CRM instance, you can choose between CRMIP, where a unique time constant is used for each injector-producer pair, and CRMP, where a unique time constant is used for each producer. CRMIP is more reliable given sufficient data. With CRMP, you can reduce the number of unknowns, which is useful if available production data is limited.

Getting started

You can install this package from PyPI with the line

pip install pywaterflood

Or from conda/mamba with

conda install -c conda-forge pywaterflood

Then, read the docs to learn more. If you want to try it out online before installing it on your computer, you can run this google colab notebook.

A simple example

import numpy as np
import pandas as pd
from pywaterflood import CRM

gh_url = "https://raw.githubusercontent.com/frank1010111/pywaterflood/master/testing/data/"
prod = pd.read_csv(gh_url + 'production.csv', header=None).values
inj = pd.read_csv(gh_url + "injection.csv", header=None).values
time = pd.read_csv(gh_url + "time.csv", header=None).values[:,0]

crm = CRM(tau_selection='per-pair', constraints='up-to one')
crm.fit(prod, inj, time)
q_hat = crm.predict()
residuals = crm.residual()

print("MAE by well:", np.round(np.abs(residuals).mean(axis=0), 2), "barrels")
print("MAPE by well:", np.round(np.mean(np.abs(residuals) / prod * 100, axis=0), 2), "percent")
print("RMSE by well:", np.round(np.sqrt(np.sum(residuals**2, axis=0)), 2))

Contributing

Contributions are extremely welcome! Have an issue to report? Want to offer new features or documentation? Check out the contribution guide to help you set up. Discussions could start anytime at the discussions section.

pywaterflood uses Rust for computation and python as the high level interface. Luckily, maturin is a very convenient tool for working with mixed Python-Rust projects.

Running tests, building the package, linting to conform to code standards, and building the documentation are all handled by nox.

Running tests

The guide for getting started, has instructions for installing rust, python, and nox. At that point, both the lint and unit test sessions are run with the command

nox

License

This software library is released under a BSD 2-Clause License.

Acknowledgments

Capacitance resistance modeling would not have caught on without the persistence of two professors: Larry Lake and Jerry Jensen. Both of these gentlemen generously helped answer questions in the development of this library. Research funding for this project came from the Department of Energy grant "Optimizing Sweep based on Geochemical and Reservoir Characterization of the Residual Oil Zone of Hess Seminole Unit" (PI: Ian Duncan) and the State of Texas Advanced Resource Recovery program (PI: William Ambrose). Further development is supported by Penn State faculty promotion funds and volunteer time.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pywaterflood-0.3.3.tar.gz (973.4 kB view hashes)

Uploaded Source

Built Distributions

pywaterflood-0.3.3-pp310-pypy310_pp73-win_amd64.whl (157.8 kB view hashes)

Uploaded PyPy Windows x86-64

pywaterflood-0.3.3-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

pywaterflood-0.3.3-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (1.1 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

pywaterflood-0.3.3-pp310-pypy310_pp73-macosx_11_0_arm64.whl (261.8 kB view hashes)

Uploaded PyPy macOS 11.0+ ARM64

pywaterflood-0.3.3-pp310-pypy310_pp73-macosx_10_12_x86_64.whl (274.2 kB view hashes)

Uploaded PyPy macOS 10.12+ x86-64

pywaterflood-0.3.3-pp39-pypy39_pp73-win_amd64.whl (157.8 kB view hashes)

Uploaded PyPy Windows x86-64

pywaterflood-0.3.3-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

pywaterflood-0.3.3-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (1.1 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

pywaterflood-0.3.3-pp39-pypy39_pp73-macosx_11_0_arm64.whl (261.8 kB view hashes)

Uploaded PyPy macOS 11.0+ ARM64

pywaterflood-0.3.3-pp39-pypy39_pp73-macosx_10_12_x86_64.whl (274.2 kB view hashes)

Uploaded PyPy macOS 10.12+ x86-64

pywaterflood-0.3.3-pp38-pypy38_pp73-win_amd64.whl (157.6 kB view hashes)

Uploaded PyPy Windows x86-64

pywaterflood-0.3.3-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

pywaterflood-0.3.3-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (1.1 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

pywaterflood-0.3.3-pp38-pypy38_pp73-macosx_11_0_arm64.whl (261.9 kB view hashes)

Uploaded PyPy macOS 11.0+ ARM64

pywaterflood-0.3.3-pp38-pypy38_pp73-macosx_10_12_x86_64.whl (274.2 kB view hashes)

Uploaded PyPy macOS 10.12+ x86-64

pywaterflood-0.3.3-cp37-abi3-win_amd64.whl (157.2 kB view hashes)

Uploaded CPython 3.7+ Windows x86-64

pywaterflood-0.3.3-cp37-abi3-win32.whl (150.9 kB view hashes)

Uploaded CPython 3.7+ Windows x86

pywaterflood-0.3.3-cp37-abi3-musllinux_1_1_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.7+ musllinux: musl 1.1+ x86-64

pywaterflood-0.3.3-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ x86-64

pywaterflood-0.3.3-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

pywaterflood-0.3.3-cp37-abi3-macosx_11_0_arm64.whl (261.5 kB view hashes)

Uploaded CPython 3.7+ macOS 11.0+ ARM64

pywaterflood-0.3.3-cp37-abi3-macosx_10_12_x86_64.whl (273.5 kB view hashes)

Uploaded CPython 3.7+ macOS 10.12+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page