sintefmath / JutulDarcy.jl

Darcy flow and reservoir simulator based on Jutul.jl
https://sintefmath.github.io/JutulDarcy.jl/dev
MIT License
80 stars 18 forks source link
blackoil carbon-sequestration co2-storage compositional darcy-flow geothermal julia mpi porous-media-flow reservoir-simulation simulation wells

Zenodo Dev Build Status

Jutul Darcy logo

[!TIP] Visit the docs at https://sintefmath.github.io/JutulDarcy.jl/dev/

Reservoir simulation in Julia

JutulDarcy.jl: Darcy-scale and subsurface flow (CO2 sequestration, gas/H2 storage, oil/gas fields) using Jutul.jl developed by the Applied Computational Science group at SINTEF Digital.

Getting started

Install Julia and add the package to your environment of choice:

using Pkg
Pkg.add("GLMakie")
Pkg.add("Jutul")
Pkg.add("JutulDarcy")

You can then run any of the examples in the examples directory by including them.

For a minimal example that runs a industry standard input file and produces interactive plots:

using JutulDarcy, GLMakie
spe9_dir = JutulDarcy.GeoEnergyIO.test_input_file_path("SPE9")
file_path = joinpath(spe9_dir, "SPE9.DATA")
case = setup_case_from_data_file(file_path)
result = simulate_reservoir(case)
plot_reservoir_simulation_result(case.model, result)

Note that interactive plotting requires GLMakie, which may not work if you are running Julia over SSH.

Key features

JutulDarcy is a general purpose porous media simulator with high performance written in Julia. It is fully differentiable with respect to forces and discretization parameters.

Physical systems

All solvers can incorporate general multisegment wells with rigorous mass balance, friction pressure loss, complex well limits and time-dependent controls.

Architecture

Input/output and workflow tools

The compositional simulator has been matched against commercial offerings, AD-GPRS and MRST. The blackoil simulator has been validated on the standard SPE benchmarks (SPE1, SPE9, ...).

Example run times on benchmarks

Name Cells Report steps Preconditioner Time [s]
SPE1CASE2 300 120 block-ILU(0) 0.30
SPE9 9000 35 block-ILU(0) 3.41
Egg 18553 123 CPR-block-ILU(0) 8.60
Norne 44417 247 CPR-block-ILU(0) 259.0
OLYMPUS1 192750 20 CPR-block-ILU(0) 162.5

Cases with CPR used hypre as the AMG solver. OYMPUS1 refers to realization 1 from the OLYMPUS optimization benchmark challenge.

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",
}

Paper is available from EAGE. If you use JutulDarcy in your work, please cite this paper.

A few of the packages used by Jutul and JutulDarcy

Jutul builds upon many of the excellent packages in the Julia ecosystem. Here are a few of them, and what they are used for:

...and many more, both directly in the Project.toml file and indirectly!

Additional examples and further reading

The documentation is still work in progress, but contains a fair bit of useful information. In addition, see the examples folder for more information. Some functionality is also demonstrated in the tests.

Internals and undocumented functions are subject to change at this time. However, the main interface for the reservoir simulator itself seen in the examples should be fairly stable.