Skip to content

Commit

Permalink
Handle CPRW + split_wells
Browse files Browse the repository at this point in the history
  • Loading branch information
moyner committed Nov 16, 2024
1 parent 22106d5 commit 292b33f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ function setup_reservoir_model(reservoir::DataDomain, system::JutulSystem;
# Then we set up all the wells
mode = PredictionMode()
if length(wells) > 0
facility_to_add = OrderedDict()
for (well_no, w) in enumerate(wells)
if ismissing(wells_systems)
wsys = system
Expand Down Expand Up @@ -438,11 +439,16 @@ function setup_reservoir_model(reservoir::DataDomain, system::JutulSystem;
if split_wells
wg = WellGroup([wname], can_shut_wells = can_shut_wells)
F = SimulationModel(wg, mode, context = context, data_domain = DataDomain(wg))
models[Symbol(string(wname)*string(:_ctrl))] = F
facility_to_add[Symbol(string(wname)*string(:_ctrl))] = F
end
end
# Add facility that groups the wells
if !split_wells
if split_wells
# We have been gathering these above, put them at the end.
for (k, v) in pairs(facility_to_add)
models[k] = v
end
else
wg = WellGroup(map(x -> x.name, wells), can_shut_wells = can_shut_wells)
F = SimulationModel(wg, mode, context = context, data_domain = DataDomain(wg))
models[:Facility] = F
Expand Down

0 comments on commit 292b33f

Please sign in to comment.