Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a gas reservoir state parameter while-drilling numerical inversion analysis method, which can effectively solve the problems in the prior art.
In order to realize the purpose, the technical scheme adopted by the invention is as follows:
a gas reservoir state parameter while-drilling numerical inversion analysis method comprises the following steps:
1) establishing a control equation, comprising the following steps:
11) establishing a single liquid phase shaft pressure field model; the formula is as follows:
in the formula:
is total pressure gradient, Pa/m;
Zvis vertical depth, m;
the friction resistance pressure gradient of the single liquid phase drilling fluid is Pa/m;
calculating the friction resistance pressure gradient of the liquid drilling fluid by adopting a Herschel-Bulkley rheological model;
12) the method for establishing the single-liquid-phase shaft heat exchange model comprises the following steps:
121) establishing drilling fluid model in drill string
122) Building drill stem pipe body model
123) Establishing an annulus drilling fluid model
124) Establishing a stratigraphic model
125) Establishing a well wall and stratum interface model
13) The method for establishing the gas-liquid two-phase flow heat exchange model comprises the following steps:
131) establishing a conservation of mass equation comprises:
establishing a drilling fluid mass conservation equation:
establishing a free gas mass conservation equation:
establishing a dissolved gas mass conservation equation:
132) establishing a conservation of momentum equation as follows:
133) establishing an energy conservation equation comprising:
establishing an energy conservation equation in the drill string:
establishing an annular energy conservation equation:
establishing a wellbore/formation interface energy conservation equation:
wherein f (t) is a dimensionless instantaneous heat loss function;
14) establishing a gas reservoir seepage model, comprising the following steps:
141) establishing a low-pressure gas non-Darcy unstable seepage model:
142) establishing a high-pressure gas non-Darcy unstable seepage relation model:
15) establishing a natural gas PVT model, wherein the formula is as follows:
wherein:
ρr=0.27pr/(Z·Tr),pr=p/pc,Tr=T/Tc,Z=pv/(RT),ρ=1/v
other parameters are as follows:
A1=0.3265,A2=-1.0700,A3=-0.5339,A4=0.01569
A5=-0.05165,A6=0.5475,A7=-0.7361,A8=0.1844
A9=0.1056,A10=0.6134,A11=0.7210;
step 16) establishing a natural gas viscosity model, wherein the formula is as follows:
R1:0<ρg≤0.26g/cm3,0.7≤Tr≤3.4,16≤Mw≤72.2
μ=5.6563271×10-2ρg+4.9374602×10-3Tr+4.1949307×10-5Mw+2.93978342×10-3
R2:0.26<ρg≤0.46g/cm3,0.88≤Tr≤3.4,16≤Mw≤72.2
μ=1.3707401×10-1ρg+2.72296913×10-3Tr+7.64990184×10-6Mw+4.050623771×10-3
R3:0.46<ρg≤0.595g/cm3,0.645≤Tr≤1.5,21.6≤Mw≤119
μ=4.8834347×10-1ρg+4.437225271×10-2Tr+6.5756117×10-4Mw-2.002744453×10-1
R4:0.595<ρg≤0.76g/cm3,0.5≤Tr≤1.4,35≤Mw≤119
μ=1.500143567ρg+9.84848797×10-2Tr+1.407003797×10-3Mw-8.257944449×10-1
(16)
17) establishing a dissolution rate model, wherein the formula is as follows:
in the formula:
to take into account the saturated solubility of the three main components;
cbulbis the average solubility;
k is the mass transfer coefficient, in laminar flow: k is 0.026Re
0.8Sc
1/3D/(d
out-d
inner) And when in turbulent flow:
18) establishing a gas-liquid two-phase flow velocity model, wherein the formula is as follows:
vg=C0vm+v∞ (18)
in the formula:
C0-a velocity profile factor; the ratio of the velocity at the center of the two-phase flow to the average flow velocity depends on the flow pattern, which includes: bubbly flow, slug flow, churn flow, annular flow;
vm-average velocity of the gas-liquid two-phase flow mixture;
v∞the relative liquid phase slip velocity of the gas phase depends on the flow pattern;
2) solving the division and node arrangement of the domain grid, and arranging the positions of temperature and pressure speed nodes by using a staggered grid technology, wherein the temperature nodes are positioned in the center of the grid, and the pressure and speed items are arranged at the boundary of the grid, so that discrete variables are ensured to strictly meet the continuity of a control equation and solution variables;
the axial coordinate points to the well bottom from the well head, the number of the axial grid is gradually increased from the well head to the well bottom, the number of the well head node is 1, the well bottom is added with a virtual node N +1 with the grid axial length of 0, the grid axial positions of the same node number in each discrete area are the same, and the change part of the flow area is arranged at the grid boundary;
in the oil gas diffusion migration simulation process, in a new time step length, the gas phase migration distance is not allowed to exceed the grid length, otherwise, the problem of calculation non-convergence is caused, namely the step length of the new time step is satisfied:
3) and (3) discretizing a control equation, comprising the following steps:
31) discretization of conservation of mass equation
Discrete mass conservation equations 7, 8 and 9 result:
liquid phase:
free gas phase:
dissolving a gas phase:
tn-1time-of-day trellis parameter and upstream i +1 node tnThe time parameter is known, so the solution of the mass conservation discrete equation is substantially tnSolving mass transmission items of liquid phase, dissolved gas and free gas at the downstream boundary of the time grid; the annular air cells are divided into three grid cells according to the components of the internal fluid phase:
firstly, mixing a gas phase and a liquid phase to form a grid unit;
a gas phase front edge grid, wherein one part of the grid is a gas phase and a liquid phase, and the other part of the grid is a pure liquid phase;
③ pure liquid phase grid; the grid on the upper part of the grid on which the gas phase front edge is positioned is a pure liquid phase grid;
311) gas-liquid two-phase grid downstream boundary mass transport
The mass of three substances flowing out of the boundary of the gas-liquid two-phase grid can be calculated according to the time step, the volume gas content of the last time step, the density of the last time step and the speed of the current time;
312) pure liquid phase mesh downstream boundary mass transport
Only the liquid phase which does not contain dissolved gas flows out of the boundary of the pure liquid phase grid and can be obtained by calculation according to the time step length and the speed of the current time;
313) gas phase leading edge mesh downstream boundary mass transport
t
n-1Time t
nThe gas phase velocity at the downstream boundary of the time is
A liquid phase velocity of
The pure liquid phase does not contain dissolved gas;
t
n-1the length of the gas-liquid two-phase part at the time node i is L
gPure liquid phase fraction length Δ Z
i-L
gThe volume gas fraction of the gas-liquid two-phase portion is
Density of liquid phase of
Density of gas phase of
Pure liquid phase density of rho
l;
Passing of gas phase front
Then reaches the downstream boundary of the grid i, and the pure liquid phase velocity in the delta t moment is the grid gas-liquid two-phase average velocity, namely
ΔtnThe time period gas phase front does not exceed the downstream boundary, in which case only pure liquid phase is discharged, the mass discharged being:
liquid phase:
②Δtn>at Δ t
ΔtnThe gas phase front exceeds the downstream boundary in the time interval, and the mass of the discharged substances is determined according to whether the discharged substances contain dissolved gas or not;
Δtnthe volume of liquid phase discharged in the time period is not more than tn-1The pure liquid phase volume in the grid does not discharge dissolved gas at the moment;
liquid phase:
Δtnthe volume of liquid phase discharged in time period is more than tn-1The pure liquid phase volume in the time grid and the discharged liquid phase contain dissolved gas;
in the formula
Density of liquid phase containing dissolved gas at time of i grid tn-1, p
LDensity of liquid phase without dissolved gas;
314) quality determination of grid dissolved gas
A dissolved gas mass calculation region in a delta t time period is from the upstream boundary of the grid to the gas phase front edge, the dissolution rate is calculated according to the material composition and the flow characteristics from the upstream boundary of the grid to the gas phase front edge region of the grid at the n-1 moment, and the dissolved gas generated by the gas invaded by the stratum in the time period is ignored;
the mass of dissolved gas in the stationary grid after Δ t time is:
the equation is a scalar nonlinear equation and is solved by iteration
And then, obtaining the grid dissolved gas mass increment in the delta t time period as follows:
32) discrete equation of conservation of momentum
The annular drilling fluid flows upwards, the direction of an axis coordinate is increased from top to bottom, the directions of the axis coordinate and the axis coordinate are opposite, and a velocity term is positive during dispersion, so that a momentum conservation equation in a discrete format is obtained:
in the grid containing the gas phase front edge, respectively calculating friction resistance pressure drop of a single liquid phase area and a gas-liquid two-phase area, and obtaining the total pressure drop of the grid through weighting summation;
33) energy conservation equation discretization
And (3) applying a specific enthalpy derivative thermodynamic theory to eliminate the temperature of a shaft/stratum interface to obtain an annulus node temperature calculation discrete equation represented by thermal resistance:
4) the gas reservoir parameter value inversion algorithm comprises the following steps:
41) partitioning a grid
Dividing grids according to a well structure and a drilling tool structure, and setting node arrays pNode [ N ] and pNodeNew [ N ]; storing last time point grid data in the pNode, and storing new time point data in the pNodeNew;
42) calculating grid vertical coordinates, and updating the pNode node array;
calculating the vertical coordinate of the center of the grid and the vertical length of the grid according to the well track;
43) analyzing the temperature field according to the single liquid phase flow and updating the pNode node array
44) Calculating the grid flow parameters and pressure according to the single liquid phase; the method comprises the steps of assigning 0 to the mass of a liquid phase, the outflow mass flow, the density of the liquid phase, the flow velocity of the liquid phase, the pressure gradient, the pressure, the gas content of a cross section, 0 to the flow velocity of a gas phase, 0 to the outflow mass of the gas phase, 0 to the mass of dissolved gas and 0 to the outflow mass of the dissolved gas, and updating a pNode node array;
45) determining gas-invaded node number M
Traversing the grid, comparing the axial position of the grid node with the depth of the gas layer, and determining the number M of the gas invasion node;
46) initial condition application of diffusion migration simulation
Diffusion migration simulation time t is 0, gas phase leading edge grid index
Gas phase length in gas phase front grid
Point gas invasion treatment;
synchronizing the grid variable pNodeNew [ N ] into a value of pNode [ N ];
47) determining a time step dt according to the grid length and the grid gas phase speed;
48) the time advances, t-t + dt,
49) gas cut upstream node pressure initialization
The gas cut upstream node pressure adjustment value pDiff is 0,
410) determining the pressure of the gas invasion upstream node,
411) according to the gas layer parameters, drilling parameters and
calculating gas invasion
412) Computing grid parameters based on grid type
Traversing the grids from bottom to top, determining the grid type according to the grid index number i, and calculating grid flow parameters;
in the grid, single liquid phase flow is adopted
Gas phase front grid updating
And
gas-liquid two-phase flow grid
413) Comparing the pressure of the well mouth node with the atmospheric pressure, and calculating the relative error epsilonpDetermining a bottom boundary pressure adjustment value
414) If epsilonp>10-3Go to step 410), repeat until εp<10-3The grid parameter calculation at the new time point is finished;
415) analyzing a new temperature field according to the grid flow parameters and the pressure at the new moment;
416) updating all annulus mesh data pNode to pNodeNew;
417) if the time reaches the analysis time, the analysis is finished, otherwise, the step 47) is carried out repeatedly.
Further, a gas reservoir state parameter analysis simulator is compiled by applying a gas reservoir state parameter while-drilling numerical inversion interpretation method, and comprises the following functional modules:
ReadKickData
ReadKickData is a data input function of an analysis simulator, and completes the input of all data of a simulated well, including a well body structure, a drilling tool structure, a well track, the vertical temperature distribution of a stratum and reservoir parameters: temperature, pressure, porosity, permeability, depth, supply radius, thermophysical parameters of crude oil and natural gas, thermophysical parameters of cement, formation, drill string, etc., drilling parameters: discharge capacity, rate of penetration, torque, drill bit nozzle, simulation parameters: axial grid dimension, simulation period, whether crushed gas is considered or not, and whether a heat source is considered or not;
KickFlowBehavior
the KickFlowBehavior function is a general function module of the simulator, and other functions are assembled according to a program flow chart to finish the functions of drilling oil gas diffusion and migration simulation analysis and data storage;
TemperatureAnalysis
performing temperature field analysis on the drilling shaft by the TemperatureAnalysis function according to the grid flow parameters, and updating the temperature calculation result into a grid node array pNodeNew;
KickSimulating
performing well drilling oil gas diffusion and migration simulation analysis according to the grid node temperature and the boundary conditions of the bottom hole and the wellhead by the KickSimuling function, and updating the calculation result of the flow parameter into a grid node array pNodeNew;
GridGeneration
the GridGeneration function carries out axial segmentation and grid division on a temperature and pressure field solving domain according to a well structure and a drill string structure, and stores axial geometric information of grid nodes and geometric and medium information of a radial heat exchange object;
NormalTPNode
the normalTPnode function analyzes grid flow parameters according to a grid flow parameter calculation method that an inlet and an outlet are both gas-liquid two-phase flow;
GasFrontNode
the GasFrontNode function analyzes grid flow parameters according to a gas phase leading edge grid algorithm and updates a gas phase leading edge grid index and gas phase zone length data;
VerticalCoordinate
calculating the vertical coordinate of the center of the grid and the vertical length of the grid according to the well track; the function requires calling a DirectionParaCal function to calculate the vertical depth according to the well depth and the well inclination angle;
TOriginGeneration
the torrginggeneration function interpolates the vertical temperature distribution data of the formation to generate the original temperature at the vertical depth of the node;
Ini
applying initial conditions to solving intra-domain grid node variables by using an Ini function, and assigning initial values;
HeatResistanceSA
calculating heat exchange resistance between drilling fluid in the drill bit and annular drilling fluid; the function is realized by calling HPipe and HANnu functions to calculate the forced convection heat transfer coefficient of the liquid phase in the drill main and the gas-liquid two-phase flow in the annular space;
HeatResistanceAE
calculating heat exchange resistance between the annular gas-liquid two-phase flow drilling fluid and the stratum; the function is realized by calling a HANnu function to calculate the forced convection heat transfer coefficient of gas-liquid two-phase flow in the annulus and an instantaneous formation heat loss function to calculate the heat transfer thermal resistance from the shaft to the formation;
HPipe
the function of the HPipe function is to calculate the pipe flow forced convection heat transfer coefficient of the drilling fluid in the drill bit and the inner wall of the drill column;
HAnnu
the function of the HANnu function is to calculate the forced convection heat transfer coefficient of the annular flow of the annular gas-liquid two-phase flow drilling fluid and the well wall;
PPTP
calculating a total integration function of thermodynamic properties of the medium at a given temperature and pressure according to the type of the medium, wherein crude oil, water and natural gas are required to be used according to specific types of the medium; calling a thermophysical property calculation function of a corresponding medium to complete the function of the medium;
DPDZ_TwoPhase
calculating the flow parameters and pressure drop gradient of the gas-liquid two-phase flow according to the gas-liquid two-phase flow mechanism model, wherein the flow parameters of the gas-liquid two-phase flow comprise: gas phase velocity, liquid phase velocity, cross section gas content, gas phase density and flow pattern;
TInDrillstem
the TInDrillstem function iteratively calculates the node temperature of the drilling fluid in the drill bit according to a single liquid phase energy conservation equation;
TAnnulus
the TANNILUUS function iteratively calculates the node temperature of the annular drilling fluid according to the energy conservation equation of the gas-liquid two-phase flow;
calculating the constant pressure specific heat of the natural gas by using CpGas;
CpOil, calculating the constant pressure specific heat of the crude oil;
CpWater, calculating the constant pressure specific heat of formation water;
DenGas, calculating the natural gas density;
DenOilSatured, calculating the saturated crude oil density;
DenOilUnsated, calculating the density of the unsaturated crude oil;
RsStanding, calculating the dissolved gas-oil ratio of the crude oil;
surface tension, calculating the oil-water interfacial tension;
thcon gas, calculating the natural gas thermal conductivity;
thcon oil, calculating crude oil thermal conductivity;
ThconWater, calculating formation water thermal conductivity;
ViscGas, calculating natural gas viscosity;
ViscOil, calculate crude oil viscosity;
ViscWater, calculate the formation water viscosity.
Further, setting boundary conditions and initial conditions of the gas reservoir state parameter while-drilling numerical inversion interpretation method:
boundary condition
At the drill string inlet:
Qm=C (45-1)
T1(z=0)=TE (45-2)
wherein T isEIs the drilling fluid inlet temperature, QmThe drilling fluid discharge capacity;
② the annular outlet:
p=patm (46)
(iii) the junction of the drill string at the bottom of the well and the annulus, the temperature of the drilling fluid is the same, there are
Initial conditions
The initial condition of the temperature field is the calculated wellbore temperature under the condition of single liquid phase, namely:
Ti(z,0)=Ti,st(z) (48)
the initial condition of the pressure field is calculated wellbore pressure under the condition of single liquid phase, namely:
pi(z,0)=pi,st(z) (49)
and thirdly, when gas invasion starts, no gas phase exists in each mesh of the annulus:
αi(z,0)=0 (50)。
compared with the prior art, the invention has the advantages that:
1. the gas reservoir state parameters under the condition of uninterrupted drilling operation are accurately analyzed in real time while drilling, and the gas well development benefit is improved. The method integrates 18 control equations, comprehensively considers the seepage of the gas reservoir to the shaft, the gas-liquid two-phase flow and heat exchange in the shaft, the dissolution of the gas phase in the drilling fluid and the influence of temperature and pressure on the thermophysical properties of the gas phase, and can obtain the gas reservoir state parameter along the well depth profile by inversion according to the ground gas measurement parameter by applying the method, so that the gas reservoir state parameter is finer.
2. The well kick risk is identified in time, the physical property and flow state parameter distribution of gas phase along the shaft can be obtained according to the ground gas measurement parameters, and the well bottom gas invasion amount can be obtained, so that the well kick degree and the well kick risk can be identified accurately, and the method has important significance for preventing the well blowout risk and ensuring the safety of drilling operation.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and examples.
A gas reservoir state parameter while-drilling numerical inversion analysis method comprises the following parts:
controlling equation
1) Single liquid phase shaft pressure field model
In the formula:
is total pressure gradient, Pa/m;
Zvis vertical depth, m;
the pressure gradient is a single liquid phase drilling fluid friction resistance pressure gradient, Pa/m.
And calculating the friction resistance pressure gradient of the liquid drilling fluid by adopting a Herschel-Bulkley rheological model.
2) Single liquid phase shaft heat exchange model
Drilling fluid in drill string
Drill string pipe body
Annular drilling fluid
Stratum
Well wall and formation interface
3) Gas-liquid two-phase flow heat exchange model
Equation of conservation of mass
Drilling fluid mass conservation equation:
free gas mass conservation equation:
solution gas mass conservation equation:
equation of conservation of momentum
Equation of conservation of energy
Conservation of energy in the drill string equation:
annulus energy conservation equation:
wellbore/formation interface energy conservation equation:
where f (t) is a dimensionless instantaneous heat loss function.
4) Gas reservoir seepage model
Low-pressure gas non-darcy unstable seepage model:
high-pressure gas non-Darcy unstable seepage relation model:
5) natural gas PVT model:
wherein:
ρr=0.27pr/(Z·Tr),pr=p/pc,Tr=T/Tc,Z=pv/(RT),ρ=1/v
other parameters are as follows:
A1=0.3265,A2=-1.0700,A3=-0.5339,A4=0.01569
A5=-0.05165,A6=0.5475,A7=-0.7361,A8=0.1844
A9=0.1056,A10=0.6134,A11=0.7210
6) natural gas viscosity model:
R1:0<ρg≤0.26g/cm3,0.7≤Tr≤3.4,16≤Mw≤72.2
μ=5.6563271×10-2ρg+4.9374602×10-3Tr+4.1949307×10-5Mw+2.93978342×10-3
R2:0.26<ρg≤0.46g/cm3,0.88≤Tr≤3.4,16≤Mw≤72.2
μ=1.3707401×10-1ρg+2.72296913×10-3Tr+7.64990184×10-6Mw+4.050623771×10-3
R3:0.46<ρg≤0.595g/cm3,0.645≤Tr≤1.5,21.6≤Mw≤119
μ=4.8834347×10-1ρg+4.437225271×10-2Tr+6.5756117×10-4Mw-2.002744453×10-1
R4:0.595<ρg≤0.76g/cm3,0.5≤Tr≤1.4,35≤Mw≤119
μ=1.500143567ρg+9.84848797×10-2Tr+1.407003797×10-3Mw-8.257944449×10-1 (16)
7) dissolution rate model
In the formula:
to take into account the saturated solubility of the three main components;
cbulbis the average solubility;
k is the mass transfer coefficientAnd when laminar flow is carried out: k is 0.026Re
0.8Sc
13D/(d
out-d
inner) And when in turbulent flow:
8) gas-liquid two-phase flow velocity model
vg=C0vm+v∞ (18)
In the formula:
C0-velocity profile factor. The ratio of the velocity at the center of the two-phase flow to the average flow velocity depends on the flow pattern (bubbly, slug, churn, annular);
vm-average velocity of the gas-liquid two-phase flow mixture;
v∞the relative liquid phase slip velocity of the gas phase depends on the flow pattern.
Second, solving the domain grid division and node arrangement
The invention uses the finite volume method to disperse the mass conservation equation and the energy conservation equation, and uses the staggered grid technology to arrange the positions of the temperature node and the pressure speed node, wherein the temperature node is positioned in the center of the grid, and the pressure and speed items are arranged at the boundary of the grid, thereby ensuring that the discrete variables strictly meet the continuity of the control equation and the solved variables.
The axial coordinate points to the well bottom from the well head, the number of the axial grid is gradually increased from the well head to the well bottom, the number of the well head node is 1, the well bottom is added with a virtual node N +1 with the grid axial length being 0, the grid axial positions of the same node number in each discrete area are the same, and the change part of the flow area is arranged at the grid boundary. The meshing is shown in fig. 1.
In the oil gas diffusion migration simulation process, in a new time step length, the gas phase migration distance is not allowed to exceed the grid length, otherwise, the problem of calculation non-convergence is caused, namely the step length of the new time step is satisfied:
three, control equation discretization
Taking the annular node i as an example, the control equation is subjected to time and space dispersion. The control equation relates to physical quantities: p, T, p
m、ρ
g、v
m、v
g、α、
f
1. In the annular space, the drilling fluid flows from bottom to top, the node i parameter is influenced by the node i +1 parameter, and the annular space node i and the node i +1 grid parameter are arranged as shown in fig. 2. The pressure may be considered to be linearly distributed in the grid. And performing control equation discretization according to the control equation.
1) Discretization of conservation of mass equation
Discrete mass conservation equations (7), (8), and (9) yield:
liquid phase:
free gas phase:
dissolving a gas phase:
tn-1time of day trellis parameter and upstream (i +1) node tnThe time parameter is known, so the solution of the mass conservation discrete equation is substantially tnAnd solving mass transfer terms of liquid phase, dissolved gas and free gas at the downstream boundary of the time grid. The annular air cells are divided into three grid cells according to the components of the internal fluid phase:
firstly, mixing a gas phase and a liquid phase to form a grid unit;
a gas phase front edge grid, wherein one part of the grid is a gas phase and a liquid phase, and the other part of the grid is a pure liquid phase;
③ pure liquid phase grid. The grid above the grid on which the gas phase front edge is located is a pure liquid phase grid.
(1) Gas-liquid two-phase grid downstream boundary mass transport
The mass of three substances flowing out of the boundary of the gas-liquid two-phase grid can be calculated according to the time step, the volume gas content of the last time step, the density of the last time step and the speed of the current time.
(2) pure liquid phase mesh downstream boundary mass transport
Only the liquid phase without dissolved gas flows out of the boundary of the pure liquid phase grid, and the liquid phase can be calculated according to the time step and the speed of the current time.
(3) gas phase leading edge mesh downstream boundary mass transport
A schematic diagram of mass transport of the gas phase front grid liquid phase, dissolved gas, and free gas is shown in fig. 3.
t
n-1Time t
nThe gas phase velocity at the downstream boundary of the time is
A liquid phase velocity of
The pure liquid phase contains no dissolved gas.
t
n-1The length of the gas-liquid two-phase part at the time node i is L
gPure liquid phase fraction length of (Δ Z)
i-L
g) The volume gas fraction of the gas-liquid two-phase portion is
Density of liquid phase of
Density of gas phase of
Pure liquid phase density of rho
l。
Passing of gas phase front
Then reaches the downstream boundary of the grid i, and the pure liquid phase velocity in the delta t moment is the grid gas-liquid two-phase average velocity, namely
ΔtnThe time period gas phase front does not exceed the downstream boundary, in which case only pure liquid phase is discharged, the mass discharged being:
liquid phase:
②Δtn>at Δ t
ΔtnThe time period gas phase front exceeds the downstream boundary, and the mass of the discharged substance is determined according to whether the discharged substance contains dissolved gas or not.
ΔtnThe volume of liquid phase discharged in the time period is not more than tn-1The pure liquid phase volume in the grid at the moment does not discharge the dissolved gas.
Liquid phase:
Δtnthe volume of liquid phase discharged in time period is more than tn-1The volume of pure liquid phase in the time grid, the exhaust liquid phase, contains dissolved gas.
in the formula
Density of liquid phase containing dissolved gas at time of i grid tn-1, p
LIs the density of the liquid phase without dissolved gas.
(4) Quality determination of grid dissolved gas
And (3) obtaining a dissolved gas mass obtaining area from the upstream boundary of the grid to the gas phase front edge in the delta t time period, obtaining the dissolution rate according to the material composition and flow characteristics from the upstream boundary of the grid to the gas phase front edge area of the grid at the n-1 moment, and neglecting the dissolved gas generated by the gas invaded from the stratum in the time period.
The mass of dissolved gas in the stationary grid after Δ t time is:
the equation is a scalar nonlinear equation and is solved by iteration
And then, obtaining the grid dissolved gas mass increment in the delta t time period as follows:
2) discrete equation of conservation of momentum
The annular drilling fluid flows upwards, the direction of an axis coordinate is increased from top to bottom, the directions of the axis coordinate and the axis coordinate are opposite, and a velocity term is positive during dispersion, so that a momentum conservation equation in a discrete format is obtained:
in the grid containing the gas phase front edge, the friction resistance pressure drop is respectively calculated for a single liquid phase area and a gas-liquid phase area, and the total pressure drop of the grid is obtained through weighting summation.
3) Energy conservation equation discretization
And (3) applying a specific enthalpy derivative thermodynamic theory to eliminate the temperature of a shaft/stratum interface to obtain an annulus node temperature calculation discrete equation represented by thermal resistance:
in the formula (I), the compound is shown in the specification,
the total thermal resistance of the annulus drilling fluid to the formation.
Gas phase leading edge mesh tracking
The following variables will be used for the gas phase front grid tracking task.
Ig-a grid comprising a gas front;
Lgthe position of the gas front relative to the grid IgThe upstream edge of (a).
By moving the leading edge and the downstream velocity, these variables are updated as follows:
For a mesh containing a gas front, it is assumed that both free and dissolved gases are uniformly distributed behind the gas front, otherwise it is assumed that the gases are uniformly distributed throughout the mesh. The velocity of the drilling fluid will change as the gas front passes a grid boundary in a time step, since the velocity of the mixture is considered constant in a time step. So that the time step is split, with v before the gas phase front passesm=vMAnd followed by vm=(vM-αvg)/(1-α)。
Fifthly, boundary conditions and initial conditions
1) Boundary condition
At the drill string inlet:
Qm=C (45-1)
T1(z=0)=TE (45-2)
wherein T isEIs the drilling fluid inlet temperature, QmIs the drilling fluid displacement.
② the annular outlet:
p=patm (46)
(iii) the junction of the drill string at the bottom of the well and the annulus, the temperature of the drilling fluid is the same, there are
2) Initial conditions
(1) The initial conditions of the temperature field are the wellbore temperatures that have been calculated under single liquid phase conditions, i.e.:
Ti(z,0)=Ti,st(z) (48)
(2) the initial conditions of the pressure field are the wellbore pressures that have been calculated under single liquid phase conditions, i.e.:
pi(z,0)=pi,st(z) (49)
(3) when gas invasion begins, no gas phase exists in each grid of the annulus:
αi(z,0)=0 (50)
sixth, algorithm
When the numerical inversion analysis of the gas reservoir parameters is carried out, firstly, the gas reservoir parameters are assumed, the ground monitoring parameters are calculated according to the following algorithm, if the error between the calculated value and the monitoring value is large, the gas reservoir parameters are adjusted, the numerical simulation is repeated until the ground calculated value and the monitoring value meet the convergence condition, and the real gas reservoir state parameters are obtained. The numerical simulation algorithm assuming the gas reservoir parameters is as follows.
Because the temperature, the pressure field, the temperature and the pressure data of the gas reservoir and the like of the annular gas-liquid two-phase flow are mutually dependent, the annular gas-liquid two-phase flow needs to be advanced according to the time step from the initial value until the analysis time is reached. Each time step needs to start from the value of the last time point, and each convergence solution is obtained through iterative calculation.
(1) Partitioning a grid
And dividing grids according to the well structure and the drilling tool structure, and setting node arrays pNode [ N ] and pNodeNew [ N ]. The pNode stores last time point grid data, and the pNodeNew stores new time point data.
(2) Calculating grid vertical coordinates, and updating the pNode node array;
the vertical coordinate of the center of the grid and the vertical length of the grid are calculated from the wellbore trajectory.
(3) Analyzing the temperature field according to the single liquid phase flow and updating the pNode node array
(4) And calculating the grid flow parameters and pressure according to the single liquid phase. The method comprises the steps of assigning 0 to the mass of a liquid phase, the outflow mass flow, the density of the liquid phase, the flow velocity of the liquid phase, the pressure gradient, the pressure, the gas content of a cross section, 0 to the flow velocity of a gas phase, 0 to the outflow mass of the gas phase, 0 to the mass of dissolved gas and 0 to the outflow mass of the dissolved gas, and updating the pNode node array.
(5) Determining gas-invaded node number M
And traversing the grid, comparing the axial position of the grid node with the depth of the gas layer, and determining the number M of the gas invasion node.
(6) Initial condition application of diffusion migration simulation
Diffusion migration simulation time t is 0, gas phase leading edge grid index
Gas phase length in gas phase front grid
(Point gas invasion treatment).
The grid variable pNodeNew [ N ] is synchronized to the value of pNode [ N ].
(7) Determining a time step dt according to the grid length and the grid gas phase speed;
(8) the time advances, t-t + dt,
(9) gas cut upstream node pressure initialization
The gas cut upstream node pressure adjustment value pDiff is 0,
(10) determining the pressure of the gas invasion upstream node,
(11) according to the gas layer parameters, drilling parameters and
calculating gas invasion
(12) Computing grid parameters based on grid type
And traversing the grids from bottom to top, determining the grid type according to the grid index number i, and calculating the grid flow parameters.
In the grid, single liquid phase flow is adopted
Gas phase front grid updating
And
gas-liquid two-phase flow grid
(13) Comparing the pressure of the well mouth node with the atmospheric pressure, and calculating the relative error epsilonpDetermining a bottom boundary pressure adjustment value
(14) If epsilonp>10-3Turning to the step (10), and repeatedly executing until epsilonp<10-3The grid parameter calculation at the new time point is finished;
(15) analyzing a new temperature field according to the grid flow parameters and the pressure at the new moment;
(16) updating all annulus mesh data pNode to pNodeNew;
(17) if the time reaches the analysis time, the analysis is finished, otherwise, the step (7) is carried out repeatedly.
Seventh, program module
The gas reservoir state parameter analysis simulator GasRevoruirAnalyzis compiled by the method and consists of 63 functions, and the main module structure is shown in FIG. 4. Its main functional blocks (functions) are as follows.
(1)ReadKickData
The ReadKickData is a data input function of an analysis simulator, completes the input of all data of a simulated well, and mainly comprises a well body structure, a drilling tool structure, a well track, the vertical temperature distribution of a stratum and reservoir parameters: temperature, pressure, porosity, permeability, depth, supply radius, thermophysical parameters of crude oil and natural gas, thermophysical parameters of cement, formation, drill string, etc., drilling parameters: discharge capacity, rate of penetration, torque, drill bit nozzle, simulation parameters: axial grid dimensions, simulation period, whether crushed gas is considered, whether heat source is considered.
(2)KickFlowBehavior
The KickFlowBehavior function is a general function module of the simulator, and other functions are assembled according to a program flow chart to finish the functions of drilling oil gas diffusion and migration simulation analysis and data storage.
(3)TemperatureAnalysis
And the TemperatureAnalysis function analyzes the temperature field of the well drilling shaft according to the grid flow parameters, and updates the temperature calculation result to a grid node array pNodeNew.
(4)KickSimulating
And (3) performing well drilling oil gas diffusion and migration simulation analysis according to the grid node temperature and the boundary conditions of the bottom hole and the well head by using the KickSimuling function, and updating the calculation result of the flow parameter into a grid node array pNodeNew.
(5)GridGeneration
The GridGeneration function carries out axial segmentation and grid division on a temperature and pressure field solving domain according to a well body structure and a drill string structure, and stores axial geometric information of grid nodes and geometric and medium information of a radial heat exchange object (media in a grid control body comprise 6 medium types such as single-liquid-phase drilling fluid, gas-liquid two-phase drilling fluid, steel, cement, stratum, packer fluid and the like, and each medium has corresponding thermodynamic physical properties).
(6)NormalTPNode
And analyzing the grid flow parameters by the normalTPnode function according to a grid flow parameter calculation method that the inlet and the outlet are both gas-liquid two-phase flows.
(7)GasFrontNode
The GasFrontNode function analyzes the grid flow parameters according to the gas phase leading edge grid algorithm and updates the gas phase leading edge grid index and the gas phase zone length data.
(8)VerticalCoordinate
The vertical coordinate of the center of the grid and the vertical length of the grid are calculated from the wellbore trajectory. The function calls for the DirectionParaCal function to calculate the sag from the well depth and the angle of the well.
(9)TOriginGeneration
The torrginggeneration function interpolates from the vertical temperature distribution data of the formation to produce the original temperature at the vertical depth of the node.
(10)Ini
And applying initial conditions to the variables of the grid nodes in the solution domain by the Ini function, and assigning initial values.
(11)HeatResistanceSA
And calculating the heat exchange thermal resistance between the drilling fluid in the drill bit main and the annular drilling fluid. The function is realized by calling HPipe and HANnu functions to calculate the forced convection heat transfer coefficient of the liquid phase in the drill main and the gas-liquid two-phase flow in the annular space.
(12)HeatResistanceAE
And calculating the heat exchange thermal resistance between the annular gas-liquid two-phase flow drilling fluid and the stratum. The function is realized by calling a HANnu function to calculate the forced convection heat transfer coefficient of gas-liquid two-phase flow in the annulus and an instantaneous formation heat loss function to calculate the heat transfer thermal resistance from the shaft to the formation.
(13)HPipe
The function of the HPipe function is to calculate the pipe flow forced convection heat transfer coefficient of the drilling fluid in the drill main and the inner wall of the drill string.
(14)HAnnu
The function of the HANnu function is to calculate the forced convection heat transfer coefficient of the annular flow of the annular gas-liquid two-phase flow drilling fluid and the well wall.
(15)PPTP
The method comprises the steps of calculating a total integrated function of thermodynamic properties of a medium at a given temperature and pressure according to the type of the medium, and calling a thermophysical property calculation function of the corresponding medium according to the specific type of the medium (crude oil, water and natural gas) to complete the function of the medium.
(16)DPDZ_TwoPhase
And calculating the flow parameters (gas phase velocity, liquid phase velocity, section gas content, gas phase density and flow pattern) and pressure drop gradient of the gas-liquid two-phase flow according to the gas-liquid two-phase flow mechanism model.
(17)TInDrillstem
And the TInDrillstem function iteratively calculates the drilling fluid node temperature in the drill bit according to a single liquid phase energy conservation equation.
(18)TAnnulus
And the TANNILUUS function iteratively calculates the node temperature of the annular drilling fluid according to the energy conservation equation of the gas-liquid two-phase flow.
(19) CpGas. And calculating the specific heat of the natural gas at constant pressure.
(20) CpOil. And calculating the constant pressure specific heat of the crude oil.
(21) CpWater. And calculating the constant pressure specific heat of the formation water.
(22) DenGas. And calculating the natural air density.
(23) DenOilSatured. The saturated crude density was calculated.
(24) DenOilUnsated. And calculating the density of the unsaturated crude oil.
(25) RsStanding. And calculating the dissolved gas-oil ratio of the crude oil.
(26) Surface tension. And calculating the oil-water interfacial tension.
(27) ThconGas. And calculating the thermal conductivity of the natural gas.
(28) Thcon oil. And calculating the thermal conductivity of the crude oil.
(29) Thcon water. And calculating the formation water thermal conductivity.
(30) ViscGas. The natural gas viscosity is calculated.
(31) ViscOil. The crude oil viscosity was calculated.
(32) ViscWater. The formation water viscosity is calculated.
It will be appreciated by those of ordinary skill in the art that the examples described herein are intended to assist the reader in understanding the manner in which the invention is practiced, and it is to be understood that the scope of the invention is not limited to such specifically recited statements and examples. Those skilled in the art can make various other specific changes and combinations based on the teachings of the present invention without departing from the spirit of the invention, and these changes and combinations are within the scope of the invention.