Physical systems
Immiscible, compositional, geothermal and black-oil flow
High-performance porous media and reservoir simulator based on automatic differentiation
JutulDarcy.jl is a general high-performance purpose porous media simulator toolbox (CO2 sequestration, gas/H2 storage, oil/gas fields) written in Julia based on Jutul.jl, developed by the Applied Computational Science group at SINTEF Digital.
A few highlights:
Immiscible, black-oil, compositional, CO2-brine and geothermal systems
Fully differentiable through adjoint method (history matching of parameters, optimization of well controls)
High performance, with optional support for compiling MPI parallel binaries
Consistent discretizations
Industry standard input formats - or make your own model as a script
3D visualization and tools for post-processing of simulation results
Getting started is the main setup guide that includes the basics of installing Julia and creating a Julia environment for JutulDarcy.jl
, written for users who may not already be familiar with Julia package management.
If you want to get started quickly: Install Julia and add the following packages together with a Makie backend library to your environment of choice using Julia's package manager Pkg
:
using Pkg
Pkg.add("GLMakie") # Plotting
Pkg.add("Jutul") # Base package
Pkg.add("JutulDarcy") # Reservoir simulator
To verify that everything is working, we have a minimal example that runs a industry standard input file and produces interactive plots. Note that interactive plotting requires GLMakie
, which may not work if you are running Julia over SSH.
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)
To get access to all the examples, you can generate a folder that contains the examples locally, you can run the following code to create a folder jutuldarcy_examples
in your current working directory:
using JutulDarcy
generate_jutuldarcy_examples()
These examples can then be run using include("jutuldarcy_examples/example_name.jl")
or opened in an editor to be run line by line. Alternatively, you can download all examples as Jupyter Notebooks.
If you use JutulDarcy for a scientific publication, please cite the main paper the following way:
O. Møyner, (2024). JutulDarcy.jl - a Fully Differentiable High-Performance Reservoir Simulator Based on Automatic Differentiation. ECMOR 2024, https://doi.org/10.3997/2214-4609.202437111
@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",
}
JutulDarcy.jl builds upon many of the excellent packages in the Julia ecosystem. Here are a few of them, and what they are used for:
ForwardDiff.jl implements the Dual number class used throughout the code
SparsityTracing.jl provides sparsity detection inside Jutul
Krylov.jl provides the iterative linear solvers
ILUZero.jl for ILU(0) preconditioners
AlgebraicMultigrid.jl for AMG preconditioners
HYPRE.jl for robust AMG preconditioners with MPI support
PartitionedArrays.jl for MPI assembly and linear solve
CUDA.jl for CUDA-GPU support
AMGX.jl for AMG on CUDA GPUs
Tullio.jl for automatically optimized loops and Polyester.jl for lightweight threads
TimerOutputs.jl and ProgressMeter.jl gives nice output to terminal.
Makie.jl is used for the visualization features
MultiComponentFlash.jl provides many of the compositional features
...and many more directly, and indirectly - see the Project.toml and Manifest files for a full list!