-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_mrst_grid_spe11.jl
43 lines (37 loc) · 1.37 KB
/
run_mrst_grid_spe11.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using Jutul, JutulDarcy, HYPRE, CSP11, GLMakie
# basename = "cPEBI_2640x380"
# basename = "cPEBI_819x117"
# basename = "horizon-cut_100x50";specase = :b
# basename = "struct20x20x20";specase = :c
basename = "struct100x100x100";specase = :c
case, name = setup_spe11_case_from_mrst_grid(basename, case = specase, thermal = true);
pth = jutul_output_path(name, subfolder = "csp11")
domain = reservoir_domain(case.model)
hook, csv_pth, f = CSP11.get_reporting_hook(pth, domain);
restart = true #'true' will continue sim where it left off
res = simulate_reservoir(case,
output_path = pth,
max_timestep = 1*si_unit(:year),
report_level = 1,
tol_cnv = 0.001,
post_ministep_hook = hook,
relaxation = SimpleRelaxation(),
max_nonlinear_iterations = 20,
max_timestep_cuts = 100,
info_level = 1,
restart = restart
);
ws, states = res;
##write to mrst format
mrst_output_path = pth*"_mrst"
JutulDarcy.write_reservoir_simulator_output_to_mrst(case.model[:Reservoir], states, res.result.reports, case.forces, mrst_output_path)
## Plotting
model = case.model
using GLMakie
plot_facies = false
fig = plot_reservoir(model, states, title = name, transparency = false, alpha = 0.5 + 0.5*!plot_facies)
if plot_facies
ax = fig.current_axis[]
plot_cell_data!(ax, domain.representation, Float64.(domain[:satnum]), transparency = false, alpha = 0.5, colormap = :gray1)
end
fig