Skip to main content

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()
pyplot_fopr

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

jutuldarcy-1.0.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jutuldarcy-1.0.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file jutuldarcy-1.0.0.tar.gz.

File metadata

  • Download URL: jutuldarcy-1.0.0.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for jutuldarcy-1.0.0.tar.gz
Algorithm Hash digest
SHA256 cacbbedc7ddb72dcebc5b0ca7f5db66336b12d880736792828823367f662a3fa
MD5 fc8dcdbd4813035686a406d096079743
BLAKE2b-256 65fd2cefdf4b7738b1b64a909333372a3298089db8b4c12b1766320f1d5fe45d

See more details on using hashes here.

File details

Details for the file jutuldarcy-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: jutuldarcy-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for jutuldarcy-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 019b06b7f9d034a924bd79b14b7b766f27c690e5628d2d17931c248080f51adf
MD5 8812f834f115511b53d7104b2e6ea7cc
BLAKE2b-256 22dae960e3285c634b90f05f66a3d9ed601d4c52d26546e37772f40373a6ab25

See more details on using hashes here.

Supported by

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