Skip to content

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.

julia
using JutulDarcy, GeoEnergyIO
pth = GeoEnergyIO.test_input_file_path("SPE9", "SPE9.DATA");

Set up and run a simulation

If we do not need the case, we could also have done: ws, states = simulate_data_file(pth)

julia
case = setup_case_from_data_file(pth)
ws, states = simulate_reservoir(case);
PVT: Fixing table for low pressure conditions.

Simulating 2 years, 24.22 weeks as 90 report steps   2%| |  ETA: 0:03:30
  Progress:  Solving step 2/90 (2.22% of time interval complete)
  Stats:     19 iterations in 4.52 s (237.73 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps   3%| |  ETA: 0:02:27
  Progress:  Solving step 3/90 (3.33% of time interval complete)
  Stats:     25 iterations in 4.82 s (192.68 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps   4%| |  ETA: 0:01:52
  Progress:  Solving step 4/90 (4.44% of time interval complete)
  Stats:     29 iterations in 4.96 s (171.21 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps   5%| |  ETA: 0:01:32
  Progress:  Solving step 5/90 (5.56% of time interval complete)
  Stats:     33 iterations in 5.12 s (155.06 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps   7%|▏|  ETA: 0:01:17
  Progress:  Solving step 6/90 (6.67% of time interval complete)
  Stats:     36 iterations in 5.23 s (145.34 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps   8%|▏|  ETA: 0:01:07
  Progress:  Solving step 7/90 (7.78% of time interval complete)
  Stats:     39 iterations in 5.35 s (137.19 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps   9%|▏|  ETA: 0:00:59
  Progress:  Solving step 8/90 (8.89% of time interval complete)
  Stats:     43 iterations in 5.50 s (127.96 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  10%|▏|  ETA: 0:00:53
  Progress:  Solving step 9/90 (10.00% of time interval complete)
  Stats:     46 iterations in 5.62 s (122.18 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  11%|▏|  ETA: 0:00:49
  Progress:  Solving step 10/90 (11.11% of time interval complete)
  Stats:     51 iterations in 5.80 s (113.74 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  12%|▏|  ETA: 0:00:45
  Progress:  Solving step 11/90 (12.22% of time interval complete)
  Stats:     54 iterations in 5.92 s (109.59 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  13%|▏|  ETA: 0:00:41
  Progress:  Solving step 12/90 (13.33% of time interval complete)
  Stats:     57 iterations in 6.04 s (105.96 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  14%|▏|  ETA: 0:00:38
  Progress:  Solving step 13/90 (14.44% of time interval complete)
  Stats:     61 iterations in 6.20 s (101.59 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  15%|▏|  ETA: 0:00:36
  Progress:  Solving step 14/90 (15.56% of time interval complete)
  Stats:     66 iterations in 6.38 s (96.68 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  16%|▏|  ETA: 0:00:34
  Progress:  Solving step 15/90 (16.67% of time interval complete)
  Stats:     69 iterations in 6.50 s (94.22 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  18%|▏|  ETA: 0:00:32
  Progress:  Solving step 16/90 (17.78% of time interval complete)
  Stats:     72 iterations in 6.62 s (92.00 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  19%|▏|  ETA: 0:00:30
  Progress:  Solving step 17/90 (18.89% of time interval complete)
  Stats:     75 iterations in 6.74 s (89.89 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  20%|▎|  ETA: 0:00:29
  Progress:  Solving step 18/90 (20.00% of time interval complete)
  Stats:     78 iterations in 6.86 s (88.00 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  21%|▎|  ETA: 0:00:27
  Progress:  Solving step 19/90 (21.11% of time interval complete)
  Stats:     81 iterations in 6.99 s (86.24 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  22%|▎|  ETA: 0:00:26
  Progress:  Solving step 20/90 (22.22% of time interval complete)
  Stats:     84 iterations in 7.15 s (85.13 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  23%|▎|  ETA: 0:00:25
  Progress:  Solving step 21/90 (23.33% of time interval complete)
  Stats:     87 iterations in 7.27 s (83.59 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  24%|▎|  ETA: 0:00:24
  Progress:  Solving step 22/90 (24.44% of time interval complete)
  Stats:     90 iterations in 7.39 s (82.15 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  25%|▎|  ETA: 0:00:23
  Progress:  Solving step 23/90 (25.56% of time interval complete)
  Stats:     93 iterations in 7.51 s (80.80 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  26%|▎|  ETA: 0:00:22
  Progress:  Solving step 24/90 (26.67% of time interval complete)
  Stats:     96 iterations in 7.64 s (79.58 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  27%|▎|  ETA: 0:00:21
  Progress:  Solving step 25/90 (27.78% of time interval complete)
  Stats:     99 iterations in 7.76 s (78.39 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  29%|▎|  ETA: 0:00:20
  Progress:  Solving step 26/90 (28.89% of time interval complete)
  Stats:     102 iterations in 7.88 s (77.26 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  30%|▎|  ETA: 0:00:19
  Progress:  Solving step 27/90 (30.00% of time interval complete)
  Stats:     105 iterations in 8.00 s (76.21 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  31%|▎|  ETA: 0:00:19
  Progress:  Solving step 28/90 (31.11% of time interval complete)
  Stats:     108 iterations in 8.12 s (75.21 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  32%|▍|  ETA: 0:00:18
  Progress:  Solving step 29/90 (32.22% of time interval complete)
  Stats:     111 iterations in 8.24 s (74.25 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  33%|▍|  ETA: 0:00:17
  Progress:  Solving step 30/90 (33.33% of time interval complete)
  Stats:     114 iterations in 8.38 s (73.49 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  34%|▍|  ETA: 0:00:17
  Progress:  Solving step 31/90 (34.44% of time interval complete)
  Stats:     117 iterations in 8.49 s (72.59 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  35%|▍|  ETA: 0:00:17
  Progress:  Solving step 32/90 (35.56% of time interval complete)
  Stats:     125 iterations in 8.78 s (70.27 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  36%|▍|  ETA: 0:00:16
  Progress:  Solving step 33/90 (36.67% of time interval complete)
  Stats:     130 iterations in 8.98 s (69.05 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  37%|▍|  ETA: 0:00:16
  Progress:  Solving step 34/90 (37.78% of time interval complete)
  Stats:     134 iterations in 9.13 s (68.14 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  38%|▍|  ETA: 0:00:15
  Progress:  Solving step 35/90 (38.89% of time interval complete)
  Stats:     139 iterations in 9.32 s (67.05 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  40%|▍|  ETA: 0:00:15
  Progress:  Solving step 36/90 (40.00% of time interval complete)
  Stats:     144 iterations in 9.55 s (66.33 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  41%|▍|  ETA: 0:00:15
  Progress:  Solving step 37/90 (41.11% of time interval complete)
  Stats:     150 iterations in 9.77 s (65.15 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  42%|▍|  ETA: 0:00:14
  Progress:  Solving step 38/90 (42.22% of time interval complete)
  Stats:     159 iterations in 10.11 s (63.56 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  43%|▍|  ETA: 0:00:14
  Progress:  Solving step 39/90 (43.33% of time interval complete)
  Stats:     164 iterations in 10.29 s (62.76 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  44%|▌|  ETA: 0:00:14
  Progress:  Solving step 40/90 (44.44% of time interval complete)
  Stats:     175 iterations in 10.71 s (61.18 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  45%|▌|  ETA: 0:00:14
  Progress:  Solving step 41/90 (45.56% of time interval complete)
  Stats:     179 iterations in 10.85 s (60.63 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  46%|▌|  ETA: 0:00:13
  Progress:  Solving step 42/90 (46.67% of time interval complete)
  Stats:     184 iterations in 11.04 s (59.98 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  47%|▌|  ETA: 0:00:13
  Progress:  Solving step 43/90 (47.78% of time interval complete)
  Stats:     188 iterations in 11.19 s (59.52 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  48%|▌|  ETA: 0:00:12
  Progress:  Solving step 44/90 (48.89% of time interval complete)
  Stats:     191 iterations in 11.31 s (59.21 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  49%|▌|  ETA: 0:00:12
  Progress:  Solving step 45/90 (50.00% of time interval complete)
  Stats:     194 iterations in 11.43 s (58.92 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  51%|▌|  ETA: 0:00:12
  Progress:  Solving step 46/90 (51.11% of time interval complete)
  Stats:     197 iterations in 11.55 s (58.65 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  52%|▌|  ETA: 0:00:11
  Progress:  Solving step 47/90 (52.22% of time interval complete)
  Stats:     200 iterations in 11.67 s (58.37 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  53%|▌|  ETA: 0:00:11
  Progress:  Solving step 48/90 (53.33% of time interval complete)
  Stats:     204 iterations in 11.83 s (57.98 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  55%|▌|  ETA: 0:00:10
  Progress:  Solving step 50/90 (55.56% of time interval complete)
  Stats:     209 iterations in 12.03 s (57.57 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  56%|▌|  ETA: 0:00:10
  Progress:  Solving step 51/90 (56.67% of time interval complete)
  Stats:     211 iterations in 12.15 s (57.60 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  57%|▋|  ETA: 0:00:09
  Progress:  Solving step 52/90 (57.78% of time interval complete)
  Stats:     214 iterations in 12.27 s (57.34 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  58%|▋|  ETA: 0:00:09
  Progress:  Solving step 53/90 (58.89% of time interval complete)
  Stats:     218 iterations in 12.42 s (56.98 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  60%|▋|  ETA: 0:00:08
  Progress:  Solving step 55/90 (61.11% of time interval complete)
  Stats:     222 iterations in 12.59 s (56.72 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  62%|▋|  ETA: 0:00:08
  Progress:  Solving step 56/90 (62.22% of time interval complete)
  Stats:     225 iterations in 12.71 s (56.51 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  64%|▋|  ETA: 0:00:07
  Progress:  Solving step 58/90 (64.44% of time interval complete)
  Stats:     230 iterations in 12.92 s (56.16 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  66%|▋|  ETA: 0:00:07
  Progress:  Solving step 60/90 (66.67% of time interval complete)
  Stats:     235 iterations in 13.12 s (55.82 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  67%|▋|  ETA: 0:00:07
  Progress:  Solving step 61/90 (67.78% of time interval complete)
  Stats:     238 iterations in 13.23 s (55.61 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  68%|▋|  ETA: 0:00:06
  Progress:  Solving step 62/90 (68.89% of time interval complete)
  Stats:     241 iterations in 13.35 s (55.40 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  70%|▊|  ETA: 0:00:06
  Progress:  Solving step 64/90 (71.11% of time interval complete)
  Stats:     245 iterations in 13.52 s (55.18 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  71%|▊|  ETA: 0:00:06
  Progress:  Solving step 65/90 (72.22% of time interval complete)
  Stats:     248 iterations in 13.64 s (54.98 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  73%|▊|  ETA: 0:00:05
  Progress:  Solving step 66/90 (73.33% of time interval complete)
  Stats:     250 iterations in 13.75 s (55.01 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  74%|▊|  ETA: 0:00:05
  Progress:  Solving step 67/90 (74.44% of time interval complete)
  Stats:     253 iterations in 13.87 s (54.81 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  76%|▊|  ETA: 0:00:05
  Progress:  Solving step 69/90 (76.67% of time interval complete)
  Stats:     258 iterations in 14.06 s (54.50 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  77%|▊|  ETA: 0:00:04
  Progress:  Solving step 70/90 (77.78% of time interval complete)
  Stats:     262 iterations in 14.22 s (54.26 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  79%|▊|  ETA: 0:00:04
  Progress:  Solving step 72/90 (80.00% of time interval complete)
  Stats:     266 iterations in 14.38 s (54.07 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  80%|▊|  ETA: 0:00:04
  Progress:  Solving step 73/90 (81.11% of time interval complete)
  Stats:     268 iterations in 14.49 s (54.07 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  82%|▉|  ETA: 0:00:03
  Progress:  Solving step 75/90 (83.33% of time interval complete)
  Stats:     272 iterations in 14.65 s (53.88 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  84%|▉|  ETA: 0:00:03
  Progress:  Solving step 76/90 (84.44% of time interval complete)
  Stats:     275 iterations in 14.79 s (53.77 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  86%|▉|  ETA: 0:00:03
  Progress:  Solving step 78/90 (86.67% of time interval complete)
  Stats:     279 iterations in 14.95 s (53.59 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  88%|▉|  ETA: 0:00:02
  Progress:  Solving step 80/90 (88.89% of time interval complete)
  Stats:     283 iterations in 15.12 s (53.41 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  90%|▉|  ETA: 0:00:02
  Progress:  Solving step 82/90 (91.11% of time interval complete)
  Stats:     287 iterations in 15.27 s (53.22 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  91%|▉|  ETA: 0:00:02
  Progress:  Solving step 83/90 (92.22% of time interval complete)
  Stats:     291 iterations in 15.42 s (52.99 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  93%|▉|  ETA: 0:00:01
  Progress:  Solving step 85/90 (94.44% of time interval complete)
  Stats:     295 iterations in 15.58 s (52.81 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  96%|█|  ETA: 0:00:01
  Progress:  Solving step 87/90 (96.67% of time interval complete)
  Stats:     299 iterations in 15.74 s (52.64 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps  98%|█|  ETA: 0:00:00
  Progress:  Solving step 89/90 (98.89% of time interval complete)
  Stats:     303 iterations in 15.91 s (52.52 ms each)






Simulating 2 years, 24.22 weeks as 90 report steps 100%|█| Time: 0:00:16
  Progress:  Solved step 90/90
  Stats:     307 iterations in 16.07 s (52.34 ms each)
╭────────────────┬──────────┬──────────────┬──────────╮
│ Iteration type │ Avg/step │ Avg/ministep │    Total │
│                │ 90 steps │ 96 ministeps │ (wasted) │
├────────────────┼──────────┼──────────────┼──────────┤
│ Newton         │  3.41111 │      3.19792 │  307 (0) │
│ Linearization  │  4.47778 │      4.19792 │  403 (0) │
│ Linear solver  │  10.8667 │      10.1875 │  978 (0) │
│ Precond apply  │  21.7333 │       20.375 │ 1956 (0) │
╰────────────────┴──────────┴──────────────┴──────────╯
╭───────────────┬─────────┬────────────┬─────────╮
│ Timing type   │    Each │   Relative │   Total │
│               │      ms │ Percentage │       s │
├───────────────┼─────────┼────────────┼─────────┤
│ Properties    │  2.6742 │     5.11 % │  0.8210 │
│ Equations     │ 13.0228 │    32.66 % │  5.2482 │
│ Assembly      │  2.7994 │     7.02 % │  1.1282 │
│ Linear solve  │  2.4283 │     4.64 % │  0.7455 │
│ Linear setup  │ 11.9643 │    22.86 % │  3.6730 │
│ Precond apply │  0.9703 │    11.81 % │  1.8979 │
│ Update        │  1.1646 │     2.23 % │  0.3575 │
│ Convergence   │  1.6265 │     4.08 % │  0.6555 │
│ Input/Output  │  0.8849 │     0.53 % │  0.0849 │
│ Other         │  4.7436 │     9.06 % │  1.4563 │
├───────────────┼─────────┼────────────┼─────────┤
│ Total         │ 52.3387 │   100.00 % │ 16.0680 │
╰───────────────┴─────────┴────────────┴─────────╯

Show the input data

The input data takes the form of a Dict:

julia
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.

julia
case.input_data["RUNSPEC"]
OrderedCollections.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.

julia
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.

julia
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.

julia
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 page was generated using Literate.jl.