Simulating Eclipse/DATA input files
The DATA format is commonly used in reservoir simulation. JutulDarcy can set up cases on this format and includes a fully featured grid builder for corner-point grids. Once a case has been set up, it uses the same types as a regular JutulDarcy simulation, allowing modification and use of the case in differentiable workflows.
We begin by loading the SPE9 dataset via the GeoEnergyIO package. This package includes a set of open datasets that can be used for testing and benchmarking. The SPE9 dataset is a 3D model with a corner-point grid and a set of wells produced by the Society of Petroleum Engineers. The specific version of the file included here is taken from the OPM tests repository.
using JutulDarcy, GeoEnergyIO
pth = GeoEnergyIO.test_input_file_path("SPE9", "SPE9.DATA");
Set up and run a simulation
We have supressed the output of the simulation to avoid cluttering the documentation, but we can set the info_level
to a higher value to see the output.
If we do not need the case, we could also have simulated by passing the path: ws, states = simulate_data_file(pth)
case = setup_case_from_data_file(pth)
ws, states = simulate_reservoir(case);
PVT: Fixing table for low pressure conditions.
Jutul: Simulating 2 years, 24.22 weeks as 90 report steps
╭────────────────┬──────────┬──────────────┬──────────╮
│ Iteration type │ Avg/step │ Avg/ministep │ Total │
│ │ 90 steps │ 98 ministeps │ (wasted) │
├────────────────┼──────────┼──────────────┼──────────┤
│ Newton │ 3.43333 │ 3.15306 │ 309 (0) │
│ Linearization │ 4.52222 │ 4.15306 │ 407 (0) │
│ Linear solver │ 10.8667 │ 9.97959 │ 978 (0) │
│ Precond apply │ 21.7333 │ 19.9592 │ 1956 (0) │
╰────────────────┴──────────┴──────────────┴──────────╯
╭───────────────┬─────────┬────────────┬─────────╮
│ Timing type │ Each │ Relative │ Total │
│ │ ms │ Percentage │ s │
├───────────────┼─────────┼────────────┼─────────┤
│ Properties │ 2.7084 │ 4.95 % │ 0.8369 │
│ Equations │ 14.0273 │ 33.76 % │ 5.7091 │
│ Assembly │ 3.3145 │ 7.98 % │ 1.3490 │
│ Linear solve │ 2.5393 │ 4.64 % │ 0.7847 │
│ Linear setup │ 12.0320 │ 21.98 % │ 3.7179 │
│ Precond apply │ 0.9672 │ 11.19 % │ 1.8919 │
│ Update │ 1.1315 │ 2.07 % │ 0.3496 │
│ Convergence │ 1.5799 │ 3.80 % │ 0.6430 │
│ Input/Output │ 0.6718 │ 0.39 % │ 0.0658 │
│ Other │ 5.0645 │ 9.25 % │ 1.5649 │
├───────────────┼─────────┼────────────┼─────────┤
│ Total │ 54.7343 │ 100.00 % │ 16.9129 │
╰───────────────┴─────────┴────────────┴─────────╯
Show the input data
The input data takes the form of a Dict:
case.input_data
Dict{String, Any} with 6 entries:
"RUNSPEC" => OrderedDict{String, Any}("TITLE"=>"SPE 9", "DIMENS"=>[24, 25, 1…
"GRID" => OrderedDict{String, Any}("cartDims"=>(24, 25, 15), "CURRENT_BOX…
"PROPS" => OrderedDict{String, Any}("PVTW"=>Any[[2.48211e7, 1.0034, 4.3511…
"SUMMARY" => OrderedDict{String, Any}()
"SCHEDULE" => Dict{String, Any}("STEPS"=>OrderedDict{String, Any}[OrderedDict…
"SOLUTION" => OrderedDict{String, Any}("EQUIL"=>Any[[2753.87, 2.48211e7, 3032…
We can also examine the for example RUNSPEC section, which is also represented as a Dict.
case.input_data["RUNSPEC"]
OrderedDict{String, Any} with 13 entries:
"TITLE" => "SPE 9"
"DIMENS" => [24, 25, 15]
"OIL" => true
"WATER" => true
"GAS" => true
"DISGAS" => true
"FIELD" => true
"START" => DateTime("2015-01-01T00:00:00")
"WELLDIMS" => [26, 5, 1, 26, 5, 10, 5, 4, 3, 0, 1, 1, 10, 201]
"TABDIMS" => [1, 1, 40, 20, 1, 20, 20, 1, 1, -1 … -1, 10, 10, 10, -1, 5, 5…
"EQLDIMS" => [1, 100, 50, 1, 50]
"UNIFIN" => true
"UNIFOUT" => true
Plot the simulation model
These plot are normally interactive, but if you are reading the published online documentation static screenshots will be inserted instead.
using GLMakie
plot_reservoir(case.model, states)
Plot the well responses
We can plot the well responses (rates and pressures) in an interactive viewer. Multiple wells can be plotted simultaneously, with options to select which units are to be used for plotting.
plot_well_results(ws)
Plot the field responses
Similar to the wells, we can also plot field-wide measurables. We plot the field gas production rate and the average pressure as the initial selection. If you are running this case interactively you can select which measurables to plot.
We observe that the field pressure steadily decreases over time, as a result of the gas production. The drop in pressure is not uniform, as during the period where little gas is produced, the decrease in field pressure is slower.
plot_reservoir_measurables(case, ws, states, left = :fgpr, right = :pres)
Example on GitHub
If you would like to run this example yourself, it can be downloaded from the JutulDarcy.jl GitHub repository as a script, or as a Jupyter Notebook
This example took 32.800192214 seconds to complete.
This page was generated using Literate.jl.