Reservoir simulation with JutulDarcy in Python.
Project description
PyJutulDarcy
Python wrapper for JutulDarcy.jl, a fully differentiable reservoir simulator written in Julia. This package facilitates automatic installation of JutulDarcy from Python, as well as a minimal interface that allows fast simulation of .DATA files in pure Python. For more details about JutulDarcy.jl, please see the Julia Documentation.
The package also provides access to all the functions of the Julia version under jutuldarcy.jl.JutulDarcy, jutuldarcy.jl.GeoEnergyIO and jutuldarcy.jl.Jutul. These functions are directly wrapped using JuliaCall. For more details, see the JuliaCall Documentation on converting of types.
Installation
The package can be installed with pip:
pip install jutuldarcy
On first time usage of the package JuliaCall will automatically install Julia and manage all dependency packages.
A minimal example
import jutuldarcy as jd
# Load SPE9 dataset to disk
pth = jd.test_file_path("SPE9", "SPE9.DATA")
# Simulate the model
res = jd.simulate_data_file(pth)
# Get field quantities and plot
import matplotlib.pyplot as plt
fopr = res["FIELD"]["FOPR"]
days = res["DAYS"]
plt.plot(days, fopr)
plt.ylabel("Field oil production")
plt.xlabel("Days")
plt.show()
Here, res is a standard dict containing the following fields:
- "FIELD": Field quantities (average pressure, total water injection, etc) as numpy arrays.
- "WELLS": Well quantities (bottom hole pressures, injection rates, production rates, etc)
- "STATES": Reservoir states for all active cells, given as a list with a dict for each timestep. For example,
res["STATES"][10]["Rs"]will give you an array of the solution gas-oil-ratio at step 10. - "DAYS": Array of the number of days elapsed for each step.
Optionally, convert = False can be passed to get access to the "full" output as seen in Julia, where it is possible to get access to grid geometry, model parameters, and so on.
Paper and citing
The main paper describing JutulDarcy.jl is JutulDarcy.jl - a Fully Differentiable High-Performance Reservoir Simulator Based on Automatic Differentiation:
@article{jutuldarcy_ecmor_2024,
author = "M{\o}yner, O.",
title = "JutulDarcy.jl - a Fully Differentiable High-Performance Reservoir Simulator Based on Automatic Differentiation",
year = "2024",
volume = "2024",
number = "1",
pages = "1-9",
doi = "https://doi.org/10.3997/2214-4609.202437111",
publisher = "European Association of Geoscientists \& Engineers",
issn = "2214-4609",
}
Contributing
Contributions that expose additional functionality is welcome.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jutuldarcy-1.0.1.tar.gz.
File metadata
- Download URL: jutuldarcy-1.0.1.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ef98aed4cfa8a6546f272e741f571873966dfcdd0f25abd9529f40017193499
|
|
| MD5 |
5f18f652db694c36c5d64e92df555e0d
|
|
| BLAKE2b-256 |
98bec06f3aaaa5aff29ddd505a8389cd41e803970add891b5e7ca9cb1b8622b3
|
File details
Details for the file jutuldarcy-1.0.1-py3-none-any.whl.
File metadata
- Download URL: jutuldarcy-1.0.1-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7258f43c8c19f5f4500f6347f8c4c1bbdf27f68e5fb774c407fa41b1a7e8901a
|
|
| MD5 |
77aa5cb3923b69258b0321798a07300f
|
|
| BLAKE2b-256 |
d199fb638e92b24cd642ab35f8f9163a738c84a5bf8d196a29402684b76ce1a1
|