JutulDarcy
Documentation for JutulDarcy.
JutulDarcy.MIN_ACTIVE_WELL_RATE
JutulDarcy.MIN_INITIAL_WELL_RATE
JutulDarcy.CPRPreconditioner
JutulDarcy.DisabledControl
JutulDarcy.DisabledTarget
JutulDarcy.ImmiscibleSaturation
JutulDarcy.InjectorControl
JutulDarcy.MinimalTPFAGrid
JutulDarcy.MixedWellSegmentFlow
JutulDarcy.Perforations
JutulDarcy.PhaseMassDensities
JutulDarcy.Pressure
JutulDarcy.ProducerControl
JutulDarcy.SegmentWellBoreFrictionHB
JutulDarcy.SinglePhaseRateTarget
JutulDarcy.SurfaceGasRateTarget
JutulDarcy.SurfaceLiquidRateTarget
JutulDarcy.SurfaceOilRateTarget
JutulDarcy.SurfaceWaterRateTarget
JutulDarcy.TabulatedRelPermSimple
JutulDarcy.ThreePhaseRelPerm
JutulDarcy.TotalRateTarget
JutulDarcy.full_well_outputs
JutulDarcy.half_face_two_point_flux_fused
JutulDarcy.half_face_two_point_flux_fused
JutulDarcy.half_face_two_point_flux_fused_gravity
JutulDarcy.half_face_two_point_flux_fused_gravity
JutulDarcy.half_face_two_point_kgradp
JutulDarcy.half_face_two_point_kgradp
JutulDarcy.half_face_two_point_kgradp_gravity
JutulDarcy.half_face_two_point_kgradp_gravity
JutulDarcy.replace_target
JutulDarcy.reservoir_linsolve
JutulDarcy.setup_reservoir_forces
JutulDarcy.setup_reservoir_model
JutulDarcy.setup_reservoir_simulator
JutulDarcy.setup_reservoir_state
JutulDarcy.simulate_mrst_case
JutulDarcy.two_phase_compositional_mass!
JutulDarcy.two_phase_compositional_mass!
JutulDarcy.well_mismatch
JutulDarcy.well_output
JutulDarcy.well_target
JutulDarcy.well_target
JutulDarcy.well_target
JutulDarcy.well_target
JutulDarcy.well_target
JutulDarcy.MIN_ACTIVE_WELL_RATE
— Constant(Absolute) Minimum well rate for a well that is not disabled.
JutulDarcy.MIN_INITIAL_WELL_RATE
— Constant(Absolute) Minimum initial rate for wells when controls are updated.
JutulDarcy.CPRPreconditioner
— TypeConstrained pressure residual
JutulDarcy.DisabledControl
— TypeDisabledControl()
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.
See also ProducerControl
, InjectorControl
.
JutulDarcy.DisabledTarget
— TypeDisabledTarget(q)
Disabled target used when a well is under DisabledControl()
only.
JutulDarcy.ImmiscibleSaturation
— TypeA single saturation that represents the "other" phase in a three phase compositional system where two phases are predicted by an EoS
JutulDarcy.InjectorControl
— TypeInjectorControl(target, mix, [density])
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.MinimalTPFAGrid
— TypeMinimalTPFAGrid(ϕ, N)
Generate a minimal grid suitable only for two-point flux discretization (TPFA) for given pore-volumes ϕ
and a neighborship matrix N
with size (2, n)
where n
is the number of internal faces.
JutulDarcy.MixedWellSegmentFlow
— TypeTwo point approximation with flux for wells
JutulDarcy.Perforations
— TypePerforations are connections from well cells to reservoir vcells
JutulDarcy.PhaseMassDensities
— TypeMass density of each phase
JutulDarcy.Pressure
— TypePressure
JutulDarcy.ProducerControl
— TypeProducerControl(target)
Well control for production out of the reservoir. target
specifies the type of target (for example BottomHolePressureTarget()
).
See also DisabledControl
, InjectorControl
.
JutulDarcy.SegmentWellBoreFrictionHB
— TypeHagedorn and Brown well bore friction model for a segment.
JutulDarcy.SinglePhaseRateTarget
— TypeSinglePhaseRateTarget(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.SurfaceGasRateTarget
— TypeSurfaceGasRateTarget(q)
Well target of specified gas rate with value q
at surface conditions.
JutulDarcy.SurfaceLiquidRateTarget
— TypeSurfaceLiquidRateTarget(q)
Well target of specified liquid rate with value q
(liquid/oil and water, but not gas) at surface conditions.
JutulDarcy.SurfaceOilRateTarget
— TypeSurfaceOilRateTarget(q)
Well target of specified oil rate with value q
at surface conditions.
JutulDarcy.SurfaceWaterRateTarget
— TypeSurfaceWaterRateTarget(q)
Well target of specified water rate with value q
at surface conditions.
JutulDarcy.TabulatedRelPermSimple
— TypeInterpolated multiphase rel. perm. that is simple (single region, no magic for more than two phases)
JutulDarcy.ThreePhaseRelPerm
— TypeInterpolated multiphase rel. perm. that is simple (single region, no magic for more than two phases)
JutulDarcy.TotalRateTarget
— TypeTotalRateTarget(q)
Well target of specified total rate of all phases with value q
at surface conditions.
JutulDarcy.full_well_outputs
— Methodfull_well_outputs(model, states, forces; targets = available_well_targets(model.models.Reservoir), shortname = false)
Get the full set of well outputs after a simulation has occured, for plotting or other post-processing.
JutulDarcy.half_face_two_point_flux_fused
— MethodTPFA-SPU Mobility * KGrad(p) without gravity. (Inner version, with explicit inputs)
JutulDarcy.half_face_two_point_flux_fused
— MethodTPFA-SPU Mobility * KGrad(p) without gravity. (Outer version, with conn_data input)
JutulDarcy.half_face_two_point_flux_fused_gravity
— MethodTPFA-SPU Mobility * (KGrad(p) + G). (Outer version, with conn_data input)
JutulDarcy.half_face_two_point_flux_fused_gravity
— MethodTPFA-SPU Mobility * (KGrad(p) + G). (Inner version, with explicit inputs)
JutulDarcy.half_face_two_point_kgradp
— MethodTPFA KGrad(p) without gravity. (Outer version, with conn_data input)
JutulDarcy.half_face_two_point_kgradp
— MethodTPFA KGrad(p) without gravity. (Inner version, with explicit inputs)
JutulDarcy.half_face_two_point_kgradp_gravity
— MethodTwo point Darcy flux with gravity - outer version that takes in NamedTuple for static parameters
JutulDarcy.half_face_two_point_kgradp_gravity
— MethodTwo point Darcy flux with gravity - inner version that takes in cells and transmissibily explicitly
JutulDarcy.replace_target
— Functionreplace_target(ctrl, new_target)
Create new well control using ctrl
as a template that operates under new_target
.
JutulDarcy.reservoir_linsolve
— Functionreservoir_linsolve(model; <keyword arguments>)
Set up iterative linear solver for a reservoir model from setup_reservoir_model
.
Arguments
model
: Reservoir model that will linearize the equations for the linear solverprecond=:cpr
: Preconditioner type to use: Either :cpr (Constrained-Pressure-Residual) or :ilu0 (block-incomplete-LU) (no effect ifsolver = :direct
).v=0
: verbosity (can lead to a large amount of output)solver=:bicgstab
: the symbol of a Krylov.jl solver (typically :gmres or :bicgstab)update_interval=:once
: how often the CPR AMG hierarchy is reconstructed (:once, :iteration, :ministep, :step)update_interval_partial=:iteration
: how often the pressure system is updated in CPRmax_coarse
: max size of coarse level if using AMGcpr_type=nothing
: type of CPR (:true_impes
,:quasi_impes
ornothing
for automatic)partial_update=true
: perform partial update of CPR preconditioner outside of AMG update (see above)rtol=1e-3
: relative tolerance for the linear solvermax_iterations=100
: limit for linear solver iterations
Additional keywords are passed onto the linear solver constructor.
JutulDarcy.setup_reservoir_forces
— Methodsetup_reservoir_forces(model; control = nothing, limits = nothing, set_default_limits = true, <keyword arguments>)
Set up driving forces for a reservoir model with wells
JutulDarcy.setup_reservoir_model
— Methodsetup_reservoir_model(reservoir, system; wells = [], <keyword arguments>)
setup_reservoir_model(reservoir, system; wells = [], context = DefaultContext(), reservoir_context = nothing, backend = :csc, <keyword arguments>)
Set up a reservoir MultiModel
for a given reservoir SimulationModel
and an optional vector of wells.
The routine automatically sets up a facility and couples the wells with the reservoir and that facility.
JutulDarcy.setup_reservoir_simulator
— Functionsetup_reservoir_simulator(models, initializer, parameters = nothing; <keyword arguments>)
Arguments
models
: either a single model or a Dict with the key :Reservoir for multimodelsinitializer
: used to setup state0, must be compatible withmodel
parameters
: initialized parameters, must be compatible withmodel
if providedlinear_solver=:bicgstab
: iterative solver to use (provided model supports it)precond=:cpr
: preconditioner for iterative solver: Either :cpr or :ilu0.rtol=1e-3
: relative tolerance for linear solverinitial_dt=3600*24.0
: initial time-step in seconds (one day by default)target_its=8
: target number of nonlinear iterations per time stepoffset_its=1
: dampening parameter for time step selector where larger values lead to more pessimistic estimates.tol_cnv=1e-3
: maximum allowable point-wise error (volume-balance)tol_mb=1e-7
: maximum alllowable integrated error (mass-balance)specialize=false
: use deep specialization of storage for faster execution, but significantly more compile time
Additional keyword arguments are passed onto simulator_config
.
JutulDarcy.setup_reservoir_state
— Methodsetup_reservoir_state(model, <keyword arguments>)
# Ex: For immiscible two-phase
setup_reservoir_state(model, Pressure = 1e5, Saturations = [0.2, 0.8])
Convenience constructor that initializes a state for a MultiModel
set up using setup_reservoir_model
. The main convenience over setup_state
is only the reservoir initialization values need be provided: wells are automatically initialized from the connected reservoir cells.
JutulDarcy.simulate_mrst_case
— Methodsimulate_mrst_case(file_name; kwarg...)
Simulate a MRST case from file_name
as exported by writeJutulInput
in MRST.
Arguments
file_name::String
: The path to a.mat
file that is to be simulated.extra_outputs::Vector{Symbol} = [:Saturations]
: Additional variables to output from the simulation.write_output::Bool = true
: Write output (in the default JLD2 format)output_path = nothing
: Directory for output files. Files will be written under this directory. Defaults to the folder offile_name
.write_mrst = true
: Write MRST compatible output after completed simulation that can be read byreadJutulOutput
in MRST.backend=:csc
: choice of backend for linear systems. :csc for default Julia sparse, :csr for experimental parallel CSR.verbose=true
: print some extra information specific to this routine upon callingnthreads=Threads.nthreads()
: number of threads to uselinear_solver=:bicgstab
: name of Krylov.jl solver to use, or :direct (for small cases only)info_level=0
: standard Jutul info_level. 0 for minimal printing, -1 for no printing, 1-5 for various levels of verbosity
Additional input arguments are passed onto setup_reservoir_simulator
and simulator_config
if applicable.
JutulDarcy.two_phase_compositional_mass!
— MethodUpdate total masses for two-phase compositional
JutulDarcy.two_phase_compositional_mass!
— MethodUpdate total masses for two-phase compositional where another immiscible phase is present
JutulDarcy.well_mismatch
— Methodwell_mismatch(qoi, wells, model_f, states_f, model_c, state_c, dt, step_no, forces; <keyword arguments>)
Compute well mismatch for a set of qoi's (well targets) and a set of well symbols.
JutulDarcy.well_output
— Functionwell_output(model, states, well_symbol, forces, target = BottomHolePressureTarget)
Get a specific well output from a valid operational target once a simulation is completed an states
are available.
JutulDarcy.well_target
— MethodWell target contribution from well itself (bhp)
JutulDarcy.well_target
— MethodWell target contribution from well itself (disabled, zero value)
JutulDarcy.well_target
— MethodWell target contribution from well itself (surface volume, injector)
JutulDarcy.well_target
— MethodWell target contribution from well itself (surface volume, injector)
JutulDarcy.well_target
— MethodWell target contribution from well itself (surface volume, producer)