Skip to content

Commit bdf05c6

Browse files
authored
Add field 'fraction' to ReinjectionTarget to support reinjecting only a fraction of the other wells' total rates + add proper constructor (#214)
1 parent 0a0c4ae commit bdf05c6

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/facility/controls.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ function get_control_target_value(target::ReinjectionTarget, model, state)
447447
cond_well = FacilityVariablesForWell(model, state, well)
448448
qtot -= cond_well.total_mass_rate
449449
end
450+
qtot *= target.fraction
450451
return max(qtot, MIN_ACTIVE_WELL_RATE)
451452
end
452453

src/facility/types.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,13 @@ end
571571
mutable struct ReinjectionTarget <: WellTarget
572572
value
573573
wells::Vector{Symbol}
574+
fraction::Float64
575+
function ReinjectionTarget(wells, fraction::Float64=1.0)
576+
if wells isa Symbol
577+
wells = [wells]
578+
end
579+
return new(NaN, wells, fraction)
580+
end
574581
end
575582

576583
"""

0 commit comments

Comments
 (0)