Compositional Multiphase Well Solver
Introduction
Here, we present a description of the well solvers. These solvers are designed to be coupled with the flow solvers. Their specific task is to implement the multi-segment well discretization using the fluid model used in the corresponding flow solver – i.e., either single-phase flow or compositional multiphase flow. In particular, the perforation terms computed by the well solvers are a source/sink term for the discrete reservoir equations assembled by the flow solvers.
In the input file, wells are handled by a WellManager solver.
It contains one child block per well, of type CompositionalMultiphaseWell (or SinglePhaseWell for single-phase flow),
and each well block in turn contains the operating constraints of the well (see Well Controls and Constraints).
The WellManager is then coupled to the reservoir flow solver by a reservoir solver,
CompositionalMultiphaseReservoir (or SinglePhaseReservoir), whose flowSolverName and wellSolverName attributes
point to the flow solver and to the WellManager, respectively.
The geometry of each well (trajectory, radius, perforations) is defined in the Mesh block with an InternalWell or VTKWell
element, whose wellControlsName attribute points to the name of the corresponding well block, and whose wellRegionName
points to a WellElementRegion defined in the ElementRegions block.
In the present description, we focus on the compositional multiphase well solver. The structure of the single-phase well solver is analogous and will not be described here for brevity.
Theory
Here, we give an overview of the well formulation implemented in GEOS. We review the set of Discrete Equations, and then we describe the Primary variables used the well solvers.
Discrete Equations
We assume that the well is discretized into segments denoted by the index .
Mass Conservation
In well segment , mass conservation for component
reads:
where we have neglected the accumulation term.
In the previous equation, is the upwinded mass fraction of component
at the interface between segments
and
,
is the total mass flux between segments
and
, and
is the source/sink term generated by the perforations – i.e., the connections between the well and the reservoir.
The upwinded mass fractions are computed as:
The perforation terms are obtained with:
where is the potential difference between the segment center and the reservoir center.
In the expression of the potential difference, the mixture density is computed as
.
The well index,
, is currently an input of the simulator.
The superscript
means that the variable is evaluated at the center of the reservoir element.
Volume Constraint Equation
As in the Compositional Multiphase Flow Solver, the system is closed with a volume constraint equation.
Pressure Relations
In the current implementation of the well solver, we assume a hydrostatic equilibrium:
where is the arithmetic average of the mixture densities evaluated in segments
and
.
Pressure drop components due to friction and acceleration are not implemented at the moment.
Well Controls and Constraints
The well is operated under a set of constraints, defined as child blocks of the well block. At any time, exactly one of them is active (it is the control of the well) and provides the control equation for the top segment; the other ones act as limits.
If the well is controlled by its bottom-hole pressure (BHP), we add the following constraint for the pressure of the top segment of the well:
If the well is controlled by a rate, we add the following constraint for the rate at the top of the first segment, denoted by :
The available constraints are:
Constraint |
Well type |
Meaning |
|---|---|---|
|
producer |
Lower limit on the bottom-hole pressure ( |
|
injector |
Upper limit on the bottom-hole pressure ( |
|
producer |
Limit on the volumetric rate of phase |
|
producer |
Limit on the total volumetric rate ( |
|
producer |
Limit on the total mass rate ( |
|
injector |
Limit on the total volumetric rate ( |
|
injector |
Limit on the total mass rate ( |
|
injector |
Limit on the volumetric rate of phase |
The BHP constraints require a referenceElevation, the elevation at which the bottom-hole pressure is measured.
The injection constraints also specify the composition (injectionStream, given as global component fractions)
and the temperature (injectionTemperature) of the injected fluid.
Each constraint value is either a constant (e.g. targetBHP, volumeRate) or a time-dependent function given
by constraintScheduleTableName; exactly one of the two must be provided.
A constraint can be disabled with constraintActive="0".
Rates are evaluated at reservoir conditions by default, or at surface conditions if useSurfaceConditions="1"
(using the surfacePressure and surfaceTemperature attributes of the well block).
The attributes of the well block set the well type (producer or injector) and the initial control,
control, which must be one of BHP, phaseVolRate, totalVolRate or massRate and must match one of the constraints
(an injector cannot be controlled by phaseVolRate).
During the simulation, the well constraints are checked against the current solution: if the well violates one of
its limits (for instance, the BHP of a rate-controlled producer drops below its MinimumBHPConstraint), the well
switches to that constraint, and the switch is reported in the log.
The well can also be opened and shut in time using statusTableName.
To summarize, the compositional multiphase flow solver assembles a set of equations, i.e.,
mass conservation equations and 1 volume constraint equation in each segment, plus 1 pressure relation at the interface between a segment and the next segment in the direction of the well head.
For the top segment, the pressure relation is replaced with the control equation.
Number of equations |
Equation type |
|---|---|
Mass conservation equations |
|
1 |
Pressure relation or control equation |
1 |
Volume constraint |
Primary variables
The well variable formulation is the same as that of the Compositional Multiphase Flow Solver.
In a well segment, in addition to the primary variables of the Compositional Multiphase Flow Solver, namely, one pressure,
, and
component densities,
, we also treat the total mass flux at the interface with the next segment, denoted by
, as a primary variable.
Number of primary variables |
Variable type |
|---|---|
1 |
Pressure |
1 |
Total mass flux at the interface with next segment |
Component densities |
Parameters
The following attributes are supported by the WellManager:
XML Element: WellManager
Name |
Type |
Default |
Description |
|---|---|---|---|
allowLocalCompDensityChopping |
integer |
1 |
Flag indicating whether local (cell-wise) chopping of negative compositions is allowed |
allowNonConvergedLinearSolverSolution |
integer |
1 |
Cut time step if linear solution fail without going until max nonlinear iterations. |
cflFactor |
real64 |
0.5 |
Factor to apply to the CFL condition when calculating the maximum allowable time step. Values should be in the interval (0,1] |
initialDt |
real64 |
1e+99 |
Initial time-step value required by the solver to the event manager. |
isThermal |
integer |
0 |
Flag indicating whether the problem is thermal or not. |
logLevel |
integer |
0 |
Sets the level of information to write in the standard output (the console typically).
Information output from lower logLevels is added with the desired log level
1
- Convergence information
- Linear solver information
- Output residual norm
- Solution information (scaling, maximum changes, quality check)
- Time step information
- Solver timers information
2
- The summary of declared fields and coupling
|
name |
groupName |
required |
A name is required for any non-unique nodes |
targetRegions |
groupNameRef_array |
required |
Allowable regions that the solver may be applied to. Note that this does not indicate that the solver will be applied to these regions, only that allocation will occur such that the solver may be applied to these regions. The decision about what regions this solver will beapplied to rests in the EventManager. |
timeStepFromTables |
integer |
0 |
Choose time step to honor rates/bhp tables time intervals |
useMass |
integer |
0 |
Use mass formulation instead of molar |
usePhysicsScaling |
integer |
1 |
Enable physics-based scaling of the linear system. Default: true. |
useTotalMassEquation |
integer |
1 |
Use total mass equation |
writeLinearSystem |
integer |
0 |
Write matrix, rhs, solution to screen ( = 1) or file ( = 2). |
writeStatistics |
geos_PhysicsSolverBase_StatsOutputType |
none |
When set to iteration, output iterations information to a csv
When set to convergence, output convergence information to a csv
When set to all output both convergence & iteration information to a csv.
|
CompositionalMultiphaseWell |
node |
||
LinearSolverParameters |
node |
unique |
|
NonlinearSolverParameters |
node |
unique |
|
SinglePhaseWell |
node |
The following attributes are supported by each CompositionalMultiphaseWell block:
XML Element: CompositionalMultiphaseWell
Name |
Type |
Default |
Description |
|---|---|---|---|
allowLocalCompDensityChopping |
integer |
1 |
Flag indicating whether local (cell-wise) chopping of negative compositions is allowed |
control |
geos_ConstraintTypeId |
required |
Well control. Valid options:
* BHP
* phaseVolRate
* totalVolRate
* massRate
* uninitialized
|
enableCrossflow |
integer |
1 |
Flag to enable crossflow. Currently only supported for injectors:
- If the flag is set to 1, both reservoir-to-well flow and well-to-reservoir flow are allowed at the perforations.
- If the flag is set to 0, we only allow well-to-reservoir flow at the perforations.
|
enableIsoThermalEstimator |
integer |
0 |
Flag to enable isothermal estimator prior to coupled reservoir and well solve. |
estimateWellSolution |
integer |
0 |
Flag to esitmate well solution prior to coupled reservoir and well solve. |
initialPressureCoefficient |
real64 |
0.1 |
Tuning coefficient for the initial well pressure of rate-controlled wells:
- Injector pressure at reference depth initialized as: (1+initialPressureCoefficient)*reservoirPressureAtClosestPerforation + density*g*( zRef - zPerf )
- Producer pressure at reference depth initialized as: (1-initialPressureCoefficient)*reservoirPressureAtClosestPerforation + density*g*( zRef - zPerf )
|
logLevel |
integer |
0 |
Sets the level of information to write in the standard output (the console typically).
Information output from lower logLevels is added with the desired log level
1
- Well control information
|
maxAbsolutePressureChange |
real64 |
-1 |
Maximum (absolute) pressure change in a Newton iteration |
maxAbsoluteTemperatureChange |
real64 |
-1 |
Maximum (absolute) temperature change in a Newton iteration |
maxCompFractionChange |
real64 |
1 |
Maximum (absolute) allowed change in the composition fraction of any component within a single time step, in a Newton iteration |
maxRelativeCompDensChange |
real64 |
1.79769e+208 |
Maximum (relative) change in a component density between two Newton iterations |
maxRelativePressureChange |
real64 |
1 |
Maximum (relative) change in pressure between two Newton iterations (recommended with rate control) |
maxRelativeTemperatureChange |
real64 |
1 |
Maximum (relative) change in temperature between two Newton iterations |
name |
groupName |
required |
A name is required for any non-unique nodes |
referenceReservoirRegion |
groupNameRef |
Name of reservoir region used for obtaining average region pressure used in volume rate constraint calculations.
Frequency of pressure update is set in SinglePhase/CompositionalMultiphaseStatistics definition.
Setting cycleFrequency=’1’ will update the pressure every timestep, note that is a lagged property in constraint propertiesNote the event associated with the statists task must be entered before the solver event.
|
|
statusTableName |
groupNameRef |
Name of the well status table when the status of the well is a time dependent function.
If the status function evaluates to a positive value at the current time, the well will be open otherwise the well will be shut.
|
|
surfacePressure |
real64 |
0 |
Surface pressure used to compute volumetric rates when surface conditions are used [Pa] |
surfaceTemperature |
real64 |
0 |
Surface temperature used to compute volumetric rates when surface conditions are used [K] |
timeStepFromTables |
integer |
0 |
Choose time step to honor rates/bhp tables time intervals |
type |
geos_WellControls_Type |
required |
Well type. Valid options:
* producer
* injector
|
useSurfaceConditions |
integer |
0 |
Flag to specify whether rates are checked at surface or reservoir conditions.
Equal to 1 for surface conditions, and to 0 for reservoir conditions.
See note on referenceReservoirRegion for reservoir condition options
|
useTotalMassEquation |
integer |
1 |
Use total mass equation |
writeCSV |
integer |
1 |
When set to 1, write the rates into a CSV file. |
InjectionMassRateConstraint |
node |
||
InjectionPhaseVolumeRateConstraint |
node |
||
InjectionVolumeRateConstraint |
node |
||
MaximumBHPConstraint |
node |
||
MinimumBHPConstraint |
node |
||
ProductionMassRateConstraint |
node |
||
ProductionPhaseVolumeRateConstraint |
node |
||
ProductionVolumeRateConstraint |
node |
||
WellNewtonSolver |
node |
The attributes of each constraint are listed in the Datastructure Index.
Example
The following example defines two producers and one injector. The first producer starts under BHP control, with a limit on its oil rate; the second producer starts under oil rate control, with a minimum BHP; the injector starts under total volumetric rate control, with a maximum BHP.
<WellManager
name="compositionalMultiphaseWell"
logLevel="1"
targetRegions="{ wellRegion1, wellRegion2, wellRegion3 }">
<CompositionalMultiphaseWell
name="wellControls1"
type="producer"
control="BHP">
<ProductionPhaseVolumeRateConstraint
name="maxoilprod"
phaseName="oil"
phaseRate="1e-3"/>
<MinimumBHPConstraint
name="minbhp"
targetBHP="4e6"
referenceElevation="0.5"/>
</CompositionalMultiphaseWell>
<CompositionalMultiphaseWell
name="wellControls2"
type="producer"
control="phaseVolRate">
<ProductionPhaseVolumeRateConstraint
name="maxoilprod"
phaseName="oil"
phaseRate="2.5e-7"/>
<MinimumBHPConstraint
name="minbhp"
targetBHP="2e6"
referenceElevation="0.5"/>
</CompositionalMultiphaseWell>
<CompositionalMultiphaseWell
name="wellControls3"
type="injector"
control="totalVolRate">
<MaximumBHPConstraint
name="maxbhp"
targetBHP="4e7"
referenceElevation="0.5"/>
<InjectionVolumeRateConstraint
name="maxvolrateinj"
volumeRate="5e-7"
injectionStream="{ 0.1, 0.1, 0.1, 0.7 }"
injectionTemperature="297.15"/>
</CompositionalMultiphaseWell>
</WellManager>