Wells and controls
Well setup routines
Wells can be set up using the convenience functions setup_well
and setup_vertical_well
. These routines act on the output from reservoir_domain
and can set up both types of wells. We recommend that you use these functions instead of manually calling the well constructors.
JutulDarcy.WellGroup Type
WellGroup(wells::Vector{Symbol}; can_shut_wells = true)
Create a well group that can control the given set of wells.
Types of wells
Simple wells
JutulDarcy.SimpleWell Type
SimpleWell(reservoir_cells; <keyword arguments>)
Set up a simple well.
Note
setup_vertical_well
or setup_well
are the recommended way of setting up wells.
Fields
volume
perforations
surface
name
explicit_dp
Equations
Multisegment wells
JutulDarcy.MultiSegmentWell Type
MultiSegmentWell(reservoir_cells, volumes, centers;
N = nothing,
name = :Well,
perforation_cells = nothing,
segment_models = nothing,
segment_length = nothing,
reference_depth = 0,
dz = nothing,
surface_conditions = default_surface_cond(),
accumulator_volume = mean(volumes),
)
Create well perforated in a vector of reservoir_cells
with corresponding volumes
and cell centers
.
Note
setup_vertical_well
or setup_well
are the recommended way of setting up wells.
Fields
volumes
perforations
neighborship
top
centers
surface
name
segment_models
JutulDarcy.SegmentWellBoreFrictionHB Type
Hagedorn and Brown well bore friction model for a segment.
JutulDarcy.PotentialDropBalanceWell Type
PotentialDropBalanceWell(discretization)
Equation for the pressure drop equation in a multisegment well. This equation lives on the segment between each node and balances the pressure difference across the segment with the hydrostatic difference and well friction present in the current flow regime.
Well controls and limits
Types of well controls
JutulDarcy.InjectorControl Type
InjectorControl(target, mix, density = 1.0, phases = ((1, 1.0)), temperature = 293.15)
Well control that specifies injection into the reservoir. target
specifies the type of target and mix
defines the injection mass fractions for all species in the model during injection.
For example, for a three-component system made up of CO2, H2O and H2, setting [0.1, 0.6, 0.3] would mean that the injection stream would contain 1 part CO2, 6 parts H2O and 3 parts H2 by mass. For an immiscible system (e.g. LiquidPhase(), VaporPhase()
) the species corresponds to phases and [0.3, 0.7] would mean a 3 to 7 mixture of liquid and vapor by mass.
The density of the injected fluid at surface conditions is given by density
which is defaulted to 1.0 if not given.
See also ProducerControl
, DisabledControl
.
JutulDarcy.ProducerControl Type
ProducerControl(target)
Well control for production out of the reservoir. target
specifies the type of target (for example BottomHolePressureTarget()
).
See also DisabledControl
, InjectorControl
.
JutulDarcy.DisabledControl Type
DisabledControl()
Control that disables a well. If a well is disabled, it is disconnected from the surface network and no flow occurs between the well and the top side. Mass transfer can still occur inside the well, and between the well and the reservoir unless perforations are also closed by a PerforationMask
.
See also ProducerControl
, InjectorControl
.
JutulDarcy.replace_target Function
replace_target(ctrl, new_target)
Create new well control using ctrl
as a template that operates under new_target
.
JutulDarcy.default_limits Function
default_limits(ctrl)
Create reasonable default limits for well control ctrl
, for example to avoid BHP injectors turning into producers.
Types of well targets
JutulDarcy.BottomHolePressureTarget Type
BottomHolePressureTarget(q, phase)
Bottom-hole pressure (bhp) target with target pressure value bhp
. A well operating under a bhp constraint will keep the well pressure at the bottom hole (typically the top of the perforations) fixed at this value unless doing so would violate other constraints, like the well switching from injection to production when declared as an injector.
Examples
julia> BottomHolePressureTarget(100e5)
BottomHolePressureTarget with value 100.0 [bar]
JutulDarcy.SinglePhaseRateTarget Type
SinglePhaseRateTarget(q, phase)
Single-phase well target with value q
specified for phase
.
Examples
julia> SinglePhaseRateTarget(0.001, LiquidPhase())
SinglePhaseRateTarget of 0.001 [m^3/s] for LiquidPhase()
JutulDarcy.SurfaceLiquidRateTarget Type
SurfaceLiquidRateTarget(q)
Well target of specified liquid rate at surface conditions with value q
. Typically used for a ProducerControl
as you have full control over the mixture composition during injection.
Liquid rate, sometimes abbreviated LRAT, is made up of the phases that remain liquid at surface conditions. Typically, this will be water and oil if present in the model, but never different types of gas. If a producing becomes nearly or completely flooded by gas the well can go to very high or even infinite flows. It is therefore important to combine this control with a limit such as a bottom-hole-pressure constraint.
JutulDarcy.SurfaceOilRateTarget Type
SurfaceOilRateTarget(q)
Well target of specified oil rate with value q
at surface conditions. Typically used for a ProducerControl
as oil, for economic reasons, is rarely injected into the subsurface. Abbreviated as ORAT in some settings.
JutulDarcy.SurfaceGasRateTarget Type
SurfaceGasRateTarget(q)
Well target of specified gas rate with value q
at surface conditions.
Often used for both InjectorControl
ProducerControl
. Abbreviated as GRAT in some settings. If used for production it is important to also impose limits, as the well rate may become very high if there is little gas present.
JutulDarcy.SurfaceWaterRateTarget Type
SurfaceWaterRateTarget(q)
Well target of specified water rate with value q
at surface conditions.
Often used for both InjectorControl
ProducerControl
. If used for production it is important to also impose limits, as the well rate may become very high if there is little water present.
JutulDarcy.TotalRateTarget Type
TotalRateTarget(q)
Well target of specified total rate (sum of all phases) with value q
at surface conditions.
Often used for both InjectorControl
ProducerControl
.
JutulDarcy.HistoricalReservoirVoidageTarget Type
HistoricalReservoirVoidageTarget(q, weights)
Historical RESV target for history matching cases. See ReservoirVoidageTarget
. For historical rates, the weights described in that target are computed based on the reservoir pressure and conditions at the previous time-step.
JutulDarcy.ReservoirVoidageTarget Type
ReservoirVoidageTarget(q, weights)
RESV target for history matching cases. The weights
input should have one entry per phase (or pseudocomponent) in the system. The well control equation is then:
where
This constraint is typically set up from .DATA files for black-oil and immiscible cases.
JutulDarcy.DisabledTarget Type
DisabledTarget(q)
Disabled target used when a well is under DisabledControl()
only. The well will be disconnected from the surface.
JutulDarcy.TotalReservoirRateTarget Type
TotalReservoirRateTarget(q)
Well target of specified total rate (sum of all phases) with value q
at reservoir conditions.
Often used for both InjectorControl
ProducerControl
.
Implementation of well controls
JutulDarcy.well_target Function
Well target contribution from well itself (disabled, zero value)
Well target contribution from well itself (bhp)
Well target contribution from well itself (surface volume, injector)
Well target contribution from well itself (reservoir volume, injector)
Well target contribution from well itself (surface volume, injector)
Well target contribution from well itself (surface volume, producer)
Well target contribution from well itself (RESV, producer)
Well outputs
JutulDarcy.print_well_result_table Function
print_well_result_table(wr::WellResults, wells)
print_well_result_table(wr::WellResults, wells, outputs)
Print summary tables that show the well responses.
Imposing limits on wells (multiple constraints)
Well forces
Perforations and WI adjustments
JutulDarcy.PerforationMask Type
mask = PerforationMask(mask::Vector)
Create a perforation mask. This can be passed to setup_forces
for a well under the mask
argument. The mask should equal the number of perforations in the well and is applied to the reference well indices in a multiplicative fashion. For example, if a well named :Injector
has two perforations, the following mask would disable the first perforation and decrease the connection strength for the second perforation by 50%:
mask = PerforationMask([0.0, 0.5])
iforces = setup_forces(W, mask = mask)
forces = setup_reservoir_forces(model, control = controls, Injector = iforces)
JutulDarcy.Perforations Type
Perforations()
Entity that defines perforations: Connections from well cells to reservoir cells.
Other forces
Can use SourceTerm
or FlowBoundaryCondition