Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

Commit

Permalink
Update wells_intro.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
moyner committed Apr 18, 2022
1 parent bd22eec commit c5560a8
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions darcy/wells_intro.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ dt = repeat([30.0]*day, 12*5)
## Inject a full pore-volume (at reference conditions) of gas
# We first define an injection rate
reservoir = reservoir_model(model);
pv = reservoir.domain.grid.pore_volumes
pv = pore_volume(model)
inj_rate = sum(pv)/sum(dt)
# We then set up a total rate target (positive value for injection)
# together with a corresponding injection control that specifies the
Expand All @@ -57,13 +57,17 @@ P_ctrl = ProducerControl(bhp_target)
controls = Dict()
controls[:Injector] = I_ctrl
controls[:Producer] = P_ctrl
facility = model.models.Facility
surface_forces = setup_forces(facility, control = controls)
# Set up forces for the whole model. For this example, all forces are defaulted
# (amounting to no-flow for the reservoir).
forces = setup_forces(model, Facility = surface_forces)
forces = setup_reservoir_forces(model, control = controls)
## Finally simulate!
sim, config = setup_reservoir_simulator(model, state0, parameters)
states, reports = simulate(sim, dt, forces = forces, config = config);
sim, config = setup_reservoir_simulator(model, state0, parameters, info_level = 0)
states, reports = simulate!(sim, dt, forces = forces, config = config);

## Once the simulation is done, we can plot the states
plot_interactive(g, map(x -> x[:Reservoir], states))
f, = plot_interactive(g, map(x -> x[:Reservoir], states))
display(f)
## Plot the wells
wd = full_well_outputs(sim.model, parameters, states)
time = report_times(reports)
plot_well_results(wd, time)

0 comments on commit c5560a8

Please sign in to comment.