A method and system for optimizing gas reservoir production allocation

By establishing a gas well optimization production allocation model and considering multiple constraints, the daily production allocation and annual production time of gas wells are optimized, which solves the problem of formation pressure imbalance in gas well optimization production allocation and improves the accuracy and efficiency of gas well production allocation.

CN118167249BActive Publication Date: 2024-09-24SOUTHWEST PETROLEUM UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410397046.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-03
Publication Date
2024-09-24
Estimated Expiration
2044-04-03

AI Technical Summary

Technical Problem

The existing methods for optimizing production of gas wells lack scientific basis, resulting in unbalanced gas reservoir formation pressures, low accuracy, and the problem of overexploitation in the middle of the gas reservoir while leaving the edges unused.

Method used

By establishing a gas reservoir optimization production allocation model, multiple constraints of gas well formation pressure, daily allocation production and annual production time are considered, and the daily allocation production and annual production time of gas wells are optimized to ensure that the gas well formation pressure and the average formation pressure of the gas reservoir are balanced. , forming a scientific gas well production allocation plan.

Benefits of technology

It achieves the uniformity of formation pressure in the gas reservoir, improves the final recovery degree of the gas reservoir, and improves the accuracy and efficiency of gas well production distribution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000
    Figure 00000000_0000
Patent Text Reader

Abstract

The present invention provides a method and system for optimizing production allocation of gas reservoirs, and relates to the technical field of gas reservoir exploitation. The method of the present invention comprises: taking the critical liquid-carrying flow rate of gas wells, the critical flow rate of edge and bottom water gas wells, the unobstructed flow rate of gas wells, the lower limit of annual effective production days, the upper limit of annual effective production days, the formation pressure of gas wells, the average formation pressure of gas reservoirs, and the annual planned gas production of gas reservoirs as constraint conditions, thereby determining the optimal solution of the annual production time of gas wells and the daily production allocation of gas wells. The present invention takes the formation pressure of gas wells into consideration, and optimizes the daily production allocation and annual production time of gas wells through multiple constraint conditions, so that the final gas reservoir production allocation plan can satisfy the production requirements while making the formation pressure of gas reservoirs tend to be uniform as a whole, thereby improving the final recovery degree of gas reservoirs and achieving the effect of optimizing production allocation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of gas reservoir exploitation, and in particular to a method and system for optimizing gas reservoir production allocation. Background Art

[0002] Gas well optimization is one of the core tasks in the early and middle stages of gas field development, and its purpose is to ensure that gas field development meets relevant management requirements. Gas well optimization requires comprehensive consideration of the balance between economic benefits, social benefits and resource benefits based on factors such as gas reservoir reserves, gas reservoir types and resource replacement capacity, and based on certain economic benefits, to meet the social demand for natural gas supply and maximize the extraction of underground natural gas resources.

[0003] The optimization of gas well production allocation begins with the acquisition of geological data. The main idea is to find the optimal production target under certain economic and technical constraints when the indicators such as gas well production capacity and dynamic reserves are basically clear. At present, gas well optimization production allocation is usually carried out with experience as the leading factor and science as the auxiliary. It is generally combined with geological knowledge and analogous to the allocation method of gas reservoirs with similar properties. Production is organized according to 1 / 6-1 / 3 of the absolute unobstructed flow. However, this allocation method often lacks a clear basis, resulting in an accuracy rate of only about 70%. In addition, there is a problem of excessive exploitation in the middle of the gas reservoir and too low pressure, and the exploitation of the edge of the gas reservoir is small and unused, resulting in uneven formation pressure of the entire gas reservoir. A scientific method for optimizing gas reservoir production allocation is urgently needed. Summary of the invention

[0004] The purpose of the present invention is to provide a method and system for optimizing gas reservoir production allocation to solve the problems raised in the above background technology.

[0005] To achieve the above object, the present invention provides the following technical solutions:

[0006] A method for optimizing gas reservoir production allocation comprises the following steps:

[0007] S1, establish a gas reservoir optimization production allocation model, input the lower limit of the annual production time of the gas well, and give the initial value of the daily production allocation of the gas well;

[0008] S2, generating the gas well formation pressure according to the lower limit of annual production time, the initial value of daily production allocation, the original formation pressure, the first deviation factor, the single well controlled reserves, and the second deviation factor;

[0009] S3, taking the initial value of daily production allocation not less than the critical liquid carrying flow rate of the gas well, the initial value of daily production allocation less than the critical flow rate of the edge and bottom water gas well, and the initial value of daily production allocation not greater than the open flow rate of the gas well as the first constraint condition, entering step S4 when the first constraint condition is met, and returning to step S1 and changing the initial value of daily production allocation according to the step size when the first constraint condition is not met;

[0010] S4, taking the lower limit of the annual production time being between the lower limit of the annual effective production days and the upper limit of the annual effective production days as the second constraint condition, entering step S5 when the second constraint condition is met, and returning to step S1 and increasing the lower limit of the annual production time by the step length when the second constraint condition is not met;

[0011] S5, calculate the absolute difference between the current gas well formation pressure and the average formation pressure of the gas reservoir, and take the absolute difference not greater than the first pressure difference threshold as the third constraint condition, calculate the difference between the gas well formation pressure at the end of the annual production time lower limit and the average formation pressure of the gas reservoir, and divide the difference by the average formation pressure of the gas reservoir at the end of the annual production time lower limit, and the result value is not greater than the second pressure difference threshold as the fourth constraint condition, calculate the difference between the current gas well formation pressure and the gas well formation pressure at the end of the annual production time lower limit, and divide the difference by the current gas well formation pressure, and the result value is not greater than the third pressure difference threshold as the fifth constraint condition, enter step S6 when the third constraint condition is satisfied and the fourth constraint condition is satisfied, and the third constraint condition is not satisfied and the fifth constraint condition is satisfied, and return to step S1 and change the initial value of the daily production allocation and the annual production time lower limit according to the step size when the third constraint condition is satisfied and the fourth constraint condition is not satisfied, and the third constraint condition is not satisfied and the fifth constraint condition is not satisfied;

[0012] S6, generating the annual gas production of the gas reservoir according to the lower limit of the annual production time and the initial value of the daily allocated production, calculating the difference between the annual gas production of the gas reservoir and the annual planned gas production of the gas reservoir, and dividing the difference by the annual planned gas production of the gas reservoir to obtain a value less than the first gas production difference threshold as the sixth constraint condition, calculating the difference between the annual planned gas production of the gas reservoir and the annual gas production of the gas reservoir, and dividing the difference by the annual planned gas production of the gas reservoir to obtain a value less than the second gas production difference threshold as the seventh constraint condition, entering step S7 when the sixth constraint condition is met, and returning to step S1 and increasing the initial value of the daily allocated production and the lower limit of the annual production time according to the step length when the sixth constraint condition is not met and the seventh constraint condition is met, and returning to step S1 and decreasing the initial value of the daily allocated production and the lower limit of the annual production time according to the step length when the sixth constraint condition is not met and the seventh constraint condition is not met;

[0013] S7, output the initial value of daily production and the lower limit of annual production time of the gas well, and use it as the daily production and annual production time.

[0014] Furthermore, the lower limit of the annual production time is calibrated as t i , and the daily production is calibrated as Where i represents the number of different gas wells in the gas reservoir, and i = 1, 2, 3, ..., m, and m represents the total number of gas wells in the gas reservoir, and m∈N + .

[0015] Furthermore, the calculation formula of the gas well formation pressure is as follows:

[0016]

[0017] in, represents the lower limit of annual production time of the i-th gas well t i The annual gas production of the gas well at the end of represents the lower limit of annual production time of the i-th gas well t i The formation pressure at the end, P i represents the original formation pressure of the i-th gas well, Z i Indicates the original formation pressure P i and the first deviation factor at the corresponding formation temperature, G represents the controlled reserves of a single well, Z(t i ) represents the formation pressure P Ri (t i ) and the second deviation factor at the corresponding formation temperature.

[0018] Furthermore, the calculation logic of the critical liquid carrying flow rate of the gas well is as follows:

[0019] According to the liquid density, gas density, gas-liquid interfacial tension, and the angle between the inclined well section and the horizontal direction, the critical liquid-carrying flow rate of the vertical well section, the inclined well section, and the horizontal section of the gas well are calculated, and the maximum value is taken as the critical liquid-carrying flow rate of the gas well. The calculation formula is as follows:

[0020]

[0021] in, They represent the critical liquid-carrying flow rate of the vertical section, the critical liquid-carrying flow rate of the inclined section, and the critical liquid-carrying flow rate of the horizontal section of the i-th gas well, respectively. g (i) represents the critical liquid flow rate of the i-th gas well, ρ L , g , σ, and θ represent the liquid density, gas density, gas-liquid interfacial tension, and the angle between the inclined well section and the horizontal direction corresponding to the i-th gas well, respectively;

[0022] According to the critical liquid-carrying flow rate of the gas well, the wellhead tubing cross-sectional area, the wellhead pressure, the wellhead temperature, the wellhead gas compression coefficient, the bottom hole tubing cross-sectional area, the bottom hole pressure, the bottom hole temperature, and the bottom hole gas compression coefficient, the wellhead critical liquid-carrying flow rate and the bottom hole critical liquid-carrying flow rate are calculated, and the maximum value is taken as the critical liquid-carrying flow rate of the gas well. The calculation formula is as follows:

[0023]

[0024] in, They represent the critical liquid carrying rate at the wellhead and the critical liquid carrying rate at the bottom of the well, respectively, and q min(i) represents the critical liquid carrying rate of the i-th gas well, A wh 、p wh , T wh , Z wh , A wf 、p wf , T wf , Z wf They respectively represent the wellhead tubing cross-sectional area, wellhead pressure, wellhead temperature, wellhead gas compressibility coefficient, bottomhole tubing cross-sectional area, bottomhole pressure, bottomhole temperature, and bottomhole gas compressibility coefficient corresponding to the i-th gas well.

[0025] Furthermore, the calculation logic of the critical flow rate of the edge and bottom water gas well is as follows:

[0026] The critical flow rate of the edge and bottom water gas well is calculated based on the gas layer permeability, water vapor density difference, gas layer effective thickness, gas well perforation thickness, gas volume coefficient, gas viscosity, gas well discharge radius, gas well radius, and skin coefficient. The calculation formula is as follows:

[0027]

[0028] Among them, q' SC (i) represents the critical flow rate of the edge and bottom water gas well of the i-th gas well, K g , Δρ wg , h, b, B g , μ g 、r e 、r w , S represent the gas layer permeability, water vapor density difference, gas layer effective thickness, gas well perforation thickness, gas volume coefficient, gas viscosity, supply radius, bottom hole radius, and skin coefficient corresponding to the i-th gas well, respectively. π represents pi, and g represents the acceleration of gravity.

[0029] Furthermore, the calculation logic of the critical flow rate of the edge and bottom water gas well is as follows:

[0030]

[0031] Among them, q' SC (i) represents the critical flow rate of the edge and bottom water gas well of the i-th gas well, K g , μ w , K w , μ g , A, α, B g They respectively represent the gas layer permeability, liquid viscosity, liquid layer permeability, gas viscosity, tubing cross-sectional area, the angle between the gas well and the formation, and the gas volume coefficient corresponding to the i-th gas well.

[0032] Furthermore, the calculation formula for the annual gas production of the gas reservoir is as follows:

[0033]

[0034] Among them, G P (t i ) represents the lower limit of annual production time of gas reservoir t i Annual gas production of the gas reservoir at the end of the period.

[0035] Furthermore, step S2 further includes:

[0036] According to the formation pressure of the gas well and the initial value of daily production, the bottom hole flowing pressure of the gas well is calculated. The calculation formula is as follows:

[0037]

[0038] in, represents the lower limit of annual production time of the i-th gas well t i The bottom hole pressure at the end, T, K, h, r e 、r w , S, β, γ g They represent the formation gas viscosity, formation gas average deviation factor, gas reservoir temperature, formation effective permeability, gas effective thickness, supply radius, bottom hole radius, skin coefficient, velocity coefficient in porous media, and composite gas relative density corresponding to the i-th gas well, respectively. ln represents the logarithm with the natural constant e as the base;

[0039] According to the bottom flow pressure of the gas well and the initial value of daily production, the bottom pressure of the tubing is calculated using the following formula:

[0040]

[0041] in, represents the lower limit of annual production time of the i-th gas well t i The bottom pressure of the oil pipe at the end, H 1 , d 1 , μ g They represent the depth from the middle of the reservoir to the bottom of the tubing, the average temperature from the middle of the reservoir to the bottom of the tubing, the casing radius, and the gas viscosity corresponding to the i-th gas well, respectively; e represents a natural constant; and lg represents a logarithm with a base of 10;

[0042] According to the bottom pressure of the tubing and the initial value of daily production, the wellhead pressure is calculated using the following formula:

[0043]

[0044] in, represents the lower limit of annual production time of the i-th gas well t i Wellhead pressure at the end, H2 represents the tubing depth corresponding to the i-th gas well;

[0045] Step S5 also includes:

[0046] Calculate the difference between the formation pressure and the bottom hole flow pressure at the end of the lower limit of the annual production time and use it as the first pressure drop, the difference between the bottom hole flow pressure and the bottom pressure of the tubing and use it as the second pressure drop, the difference between the bottom pressure of the tubing and the wellhead pressure and use it as the third pressure drop, and take the first pressure drop in the first pressure drop interval, the second pressure drop in the second pressure drop interval, and the third pressure drop in the third pressure drop interval as the eighth constraint condition. When the eighth constraint condition is met, start to judge whether the third constraint condition is met, and when the eighth constraint condition is not met, return to step S1 and change the initial value of the daily production allocation and the lower limit of the annual production time according to the step size.

[0047] A system for optimizing production allocation of gas reservoirs, used in the above-mentioned method for optimizing production allocation of gas reservoirs, comprises:

[0048] The data input module is used to establish a gas reservoir optimization production allocation model, input the lower limit of the annual production time of the gas well, and give the initial value of the daily production allocation of the gas well;

[0049] The formation pressure calculation module is used to generate the gas well formation pressure according to the lower limit of annual production time, the initial value of daily production allocation, the original formation pressure, the first deviation factor, the single well controlled reserves, and the second deviation factor;

[0050] A first constraint module is used to take the initial value of daily production allocation not less than the critical liquid carrying flow rate of the gas well, the initial value of daily production allocation less than the critical flow rate of the edge and bottom water gas well, and the initial value of daily production allocation not greater than the open flow rate of the gas well as the first constraint condition, enter step S4 when the first constraint condition is met, and return to step S1 and change the initial value of daily production allocation according to the step size when the first constraint condition is not met;

[0051] A second constraint module, used to take the annual production time lower limit value between the annual effective production days lower limit value and the annual effective production days upper limit value as a second constraint condition, enter step S5 when the second constraint condition is met, and return to step S1 and increase the annual production time lower limit value according to the step length when the second constraint condition is not met;

[0052] The third constraint module is used to calculate the absolute difference between the current gas well formation pressure and the average formation pressure of the gas reservoir, and take the absolute difference not greater than the first pressure difference threshold as the third constraint condition, calculate the difference between the gas well formation pressure at the end of the annual production time lower limit and the average formation pressure of the gas reservoir, and divide the difference by the average formation pressure of the gas reservoir at the end of the annual production time lower limit. The result value is not greater than the second pressure difference threshold as the fourth constraint condition, calculate the difference between the current gas well formation pressure and the gas well formation pressure at the end of the annual production time lower limit, and divide the difference by the current gas well formation pressure. The result value is not greater than the third pressure difference threshold as the fifth constraint condition, enter step S6 when the third constraint condition is satisfied and the fourth constraint condition is satisfied, and the third constraint condition is not satisfied and the fifth constraint condition is satisfied, and return to step S1 and change the initial value of the daily production allocation and the annual production time lower limit according to the step size when the third constraint condition is satisfied and the fourth constraint condition is not satisfied, and the third constraint condition is not satisfied and the fifth constraint condition is not satisfied;

[0053] The fourth constraint module is used to generate the annual gas production of the gas reservoir according to the lower limit of the annual production time and the initial value of the daily allocated production, calculate the difference between the annual gas production of the gas reservoir and the annual planned gas production of the gas reservoir, and divide the difference by the annual planned gas production of the gas reservoir to obtain a value less than the first gas production difference threshold as the sixth constraint condition, calculate the difference between the annual planned gas production of the gas reservoir and the annual gas production of the gas reservoir, and divide the difference by the annual planned gas production of the gas reservoir to obtain a value less than the second gas production difference threshold as the seventh constraint condition, enter step S7 when the sixth constraint condition is met, and return to step S1 and increase the initial value of the daily allocated production and the lower limit of the annual production time according to the step length when the sixth constraint condition is not met and the seventh constraint condition is met, and return to step S1 and reduce the initial value of the daily allocated production and the lower limit of the annual production time according to the step length when the sixth constraint condition is not met and the seventh constraint condition is not met;

[0054] The data output module is used to output the initial value of the daily production of the gas well and the lower limit of the annual production time, and use it as the daily production and annual production time.

[0055] Compared with the prior art, the present invention has the following beneficial effects:

[0056] The method and system for optimizing production allocation of gas reservoirs of the present invention take the formation pressure of the gas wells into consideration when allocating production to each gas well in the gas reservoir, and optimize the daily production allocation and annual production time of the gas wells through multiple constraints, so that the final gas reservoir production allocation plan can meet production needs while making the overall formation pressure of the gas reservoir tend to be uniform, thereby improving the final recovery rate of the gas reservoir and achieving the optimized production allocation effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 A flow chart of the method for optimizing production allocation of gas reservoirs in the present invention;

[0058] Figure 2 A system module diagram for optimizing production allocation of gas reservoirs in the present invention;

[0059] Figure 3 It is a schematic diagram of gas reservoir formation pressure when production allocation is not optimized in the present invention;

[0060] Figure 4 It is a schematic diagram of the gas reservoir formation pressure after the optimized production allocation in the present invention. DETAILED DESCRIPTION

[0061] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific embodiments.

[0062] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0063] Embodiment 1:

[0064] See also Figure 1 , 3 -4. The present invention provides a method for optimizing gas reservoir production allocation according to an embodiment, comprising the following steps:

[0065] S1, establish a gas reservoir optimization production allocation model, input the lower limit of the annual production time of the gas well, and give the initial value of the daily production allocation of the gas well;

[0066] It should be noted that the lower limit of annual production time is calibrated as t i , and the daily output is calibrated as Where i represents the number of different gas wells in the gas reservoir, and i = 1, 2, 3, ..., m, and m represents the total number of gas wells in the gas reservoir, and m∈N + .

[0067] S2, based on the lower limit of annual production time, initial value of daily production, original formation pressure, first deviation factor, single well controlled reserves, and second deviation factor, generates gas well formation pressure. The calculation formula is as follows:

[0068]

[0069] It should be noted that represents the lower limit of annual production time of the i-th gas well t i The annual gas production of the gas well at the end of represents the lower limit of annual production time of the i-th gas well t i The formation pressure at the end, P i represents the original formation pressure of the i-th gas well, Z i Indicates the original formation pressure P i and the first deviation factor at the corresponding formation temperature, G represents the controlled reserves of a single well, Z(t i ) represents the formation pressure P Ri (t i ) and the second deviation factor at the corresponding formation temperature, the original formation pressure P i It can be obtained according to the existing technical equipment, the first deviation factor Z i According to the original formation pressure P i The single well controlled reserves G can be obtained from the gas well production data table. The second deviation factor Z(t i ) and formation pressure It is calculated by combining the above calculation formula and the formation pressure-deviation factor comparison table.

[0070] S3, taking the initial value of daily production allocation not less than the critical liquid carrying flow rate of the gas well, the initial value of daily production allocation less than the critical flow rate of the edge and bottom water gas well, and the initial value of daily production allocation not greater than the open flow rate of the gas well as the first constraint condition, entering step S4 when the first constraint condition is met, and returning to step S1 and changing the initial value of daily production allocation according to the step size when the first constraint condition is not met;

[0071] It should be noted that changing the initial value of daily allocation output and the lower limit of annual production time by step length includes increasing the initial value of daily allocation output and the lower limit of annual production time by step length, and decreasing the initial value of daily allocation output and the lower limit of annual production time by step length, which is a conventional technology of the calculation model and will not be elaborated here;

[0072] The calculation logic of the critical liquid carrying rate of a gas well is as follows:

[0073] According to the liquid density, gas density, gas-liquid interfacial tension, and the angle between the inclined well section and the horizontal direction, the critical liquid-carrying flow rate of the vertical well section, the inclined well section, and the horizontal section of the gas well are calculated, and the maximum value is taken as the critical liquid-carrying flow rate of the gas well. The calculation formula is as follows:

[0074]

[0075] It should be noted that They represent the critical liquid-carrying flow rate of the vertical section, the critical liquid-carrying flow rate of the inclined section, and the critical liquid-carrying flow rate of the horizontal section of the i-th gas well, respectively. g (i) represents the critical liquid flow rate of the i-th gas well, ρ L , g , σ, and θ represent the liquid density, gas density, gas-liquid interfacial tension, and the angle between the inclined well section and the horizontal direction corresponding to the i-th gas well, respectively, and the liquid density ρ L , gas density ρ g , gas-liquid interface tension σ, and the angle θ between the inclined well section and the horizontal direction can all be acquired and collected by existing technical equipment. This is the existing technology and will not be described in detail here. g represents the acceleration of gravity, which can be taken as 9.807m / s 2 ;

[0076] According to the critical liquid-carrying flow rate of the gas well, the wellhead tubing cross-sectional area, the wellhead pressure, the wellhead temperature, the wellhead gas compression coefficient, the bottom hole tubing cross-sectional area, the bottom hole pressure, the bottom hole temperature, and the bottom hole gas compression coefficient, the wellhead critical liquid-carrying flow rate and the bottom hole critical liquid-carrying flow rate are calculated, and the maximum value is taken as the critical liquid-carrying flow rate of the gas well. The calculation formula is as follows:

[0077]

[0078] It should be noted that They represent the critical liquid carrying rate at the wellhead and the critical liquid carrying rate at the bottom of the well, respectively, and q min (i) represents the critical liquid carrying rate of the i-th gas well, A wh 、p wh , T wh , Z wh , A wf 、p wf , T wf , Z wf represent the wellhead tubing cross-sectional area, wellhead pressure, wellhead temperature, wellhead gas compressibility coefficient, bottomhole tubing cross-sectional area, bottomhole pressure, bottomhole temperature, and bottomhole gas compressibility coefficient corresponding to the i-th gas well, respectively, and the wellhead pressure p wh , wellhead temperature T wh , bottom hole pressure p wf , and the bottom hole temperature p wf All can be acquired through existing equipment. The cross-sectional area of ​​the wellhead oil pipe is A wh , cross-sectional area of ​​bottom hole tubing A wf The wellhead gas compression coefficient Z can be obtained by first obtaining the inner diameter of the tubing and then calculating the tubing cross-sectional area based on the tubing radius. wh The wellhead pressure p wh , wellhead temperature Twh Look up the table to obtain the bottom hole gas compression coefficient Z wf The bottom hole pressure p wf , bottom hole temperature p wf Look up the table to obtain, which will not be described in detail here;

[0079] As an implementation method, some calculation parameters of the critical liquid carrying flow rate of a gas well of a gas reservoir well are shown in Table 1 below:

[0080] Table 1

[0081]

[0082] Substitute the calculation parameters of the critical liquid carrying flow rate of the gas well of the gas reservoir into the calculation formula to obtain the critical liquid carrying flow rate of the gas well. The calculation results are shown in Table 2 below:

[0083] Table 2

[0084]

[0085]

[0086] Among them, the calculation logic of the critical flow rate of edge and bottom water gas wells is as follows:

[0087] The critical flow rate of the edge and bottom water gas well is calculated based on the gas layer permeability, water vapor density difference, gas layer effective thickness, gas well perforation thickness, gas volume coefficient, gas viscosity, gas well discharge radius, gas well radius, and skin coefficient. The calculation formula is as follows:

[0088]

[0089] It should be noted that q' SC (i) represents the critical flow rate of the edge and bottom water gas well of the i-th gas well, K g , Δρ wg , h, b, B g , μ g 、r e 、r w , S represent the gas layer permeability, water vapor density difference, gas layer effective thickness, gas well perforation thickness, gas volume coefficient, gas viscosity, supply radius, bottom hole radius, and skin coefficient corresponding to the i-th gas well, and the gas layer permeability K g , effective thickness of gas layer h, gas well perforation thickness b, gas volume coefficient B g 、Gas viscosity μ g , supply radius r e 、R w , and the skin coefficient S can be obtained and collected by existing technical equipment. This is the existing technology and will not be described here. The water vapor density difference Δρ wg, from the liquid density ρ L and gas density ρ g Subtract them to get: π represents the circumference of a circle, which can be 3.1415926; g represents the acceleration due to gravity, which can be 9.807 m / s 2 ;

[0090] As an implementation method, the critical flow rate of the edge and bottom water gas well and its calculation parameters are shown in Table 3 below:

[0091] Table 3

[0092]

[0093]

[0094] Furthermore, for the edge and bottom water gas wells inclined to the formation, affected by the inclination angle, the gas-water interface moves toward the bottom of the well. At this time, the gas-water interface cannot maintain the original horizontal state, but becomes a curved surface, thus forming a complex movement space, causing the edge water to advance non-uniformly into the gas reservoir. The calculation formula for the critical flow of the edge and bottom water gas well is as follows:

[0095]

[0096] It should be noted that q' SC (i) represents the critical flow rate of the edge and bottom water gas well of the i-th gas well, K g , μ w , K w , μ g , A, α, B g represent the gas layer permeability, liquid viscosity, liquid layer permeability, gas viscosity, tubing cross-sectional area, angle between the gas well and the formation, and gas volume coefficient corresponding to the i-th gas well, and the gas layer permeability K g 、Liquid viscosity μ w , liquid layer permeability K w 、Gas viscosity μ g , the cross-sectional area of ​​the oil pipe A, the angle α between the gas well and the formation, and the gas volume coefficient B g All of them can be acquired and collected through existing technical equipment. This is an existing technology and will not be described in detail here. g represents the acceleration of gravity, which can be taken as 9.807m / s 2 ;

[0097] Among them, the unobstructed flow rate of the gas well is selected from the theoretical maximum daily production of the gas well. The theoretical maximum daily production of the gas well can be obtained through the preliminary investigation and evaluation documents of the gas well, which will not be elaborated here.

[0098] S4, taking the lower limit of the annual production time being between the lower limit of the annual effective production days and the upper limit of the annual effective production days as the second constraint condition, entering step S5 when the second constraint condition is met, and returning to step S1 and increasing the lower limit of the annual production time by the step length when the second constraint condition is not met;

[0099] It should be noted that the lower limit and upper limit of the annual effective production days can be obtained through the historical annual effective production days of the gas reservoir wells, or can be selected and determined by experts in the field, and are not limited here.

[0100] S5, calculate the absolute difference between the current gas well formation pressure and the average formation pressure of the gas reservoir, and take the absolute difference not greater than the first pressure difference threshold as the third constraint condition, calculate the difference between the gas well formation pressure at the end of the annual production time lower limit and the average formation pressure of the gas reservoir, and divide the difference by the average formation pressure of the gas reservoir at the end of the annual production time lower limit, and the result value is not greater than the second pressure difference threshold as the fourth constraint condition, calculate the difference between the current gas well formation pressure and the gas well formation pressure at the end of the annual production time lower limit, and divide the difference by the current gas well formation pressure, and the result value is not greater than the third pressure difference threshold as the fifth constraint condition, enter step S6 when the third constraint condition is satisfied and the fourth constraint condition is satisfied, and the third constraint condition is not satisfied and the fifth constraint condition is satisfied, and return to step S1 and change the initial value of the daily production allocation and the annual production time lower limit according to the step size when the third constraint condition is satisfied and the fourth constraint condition is not satisfied, and the third constraint condition is not satisfied and the fifth constraint condition is not satisfied;

[0101] As an implementation mode, the first pressure difference threshold is 4 MPa, and the second pressure difference threshold and the third pressure difference threshold may be in the range of 1%-5%;

[0102] It should be noted that the average formation pressure of a gas reservoir is the average value of the formation pressures of each gas well in the gas reservoir.

[0103] S6, generating the annual gas production of the gas reservoir according to the lower limit of the annual production time and the initial value of the daily allocated production, calculating the difference between the annual gas production of the gas reservoir and the annual planned gas production of the gas reservoir, and dividing the difference by the annual planned gas production of the gas reservoir to obtain a value less than the first gas production difference threshold as the sixth constraint condition, calculating the difference between the annual planned gas production of the gas reservoir and the annual gas production of the gas reservoir, and dividing the difference by the annual planned gas production of the gas reservoir to obtain a value less than the second gas production difference threshold as the seventh constraint condition, entering step S7 when the sixth constraint condition is met, and returning to step S1 and increasing the initial value of the daily allocated production and the lower limit of the annual production time according to the step length when the sixth constraint condition is not met and the seventh constraint condition is met, and returning to step S1 and decreasing the initial value of the daily allocated production and the lower limit of the annual production time according to the step length when the sixth constraint condition is not met and the seventh constraint condition is not met;

[0104] The calculation formula for the annual gas production of the gas reservoir is as follows:

[0105]

[0106] It should be noted that G P (t i ) represents the lower limit of annual production time of gas reservoir t i The annual gas production of the gas reservoir at the end of the period. The annual planned gas production of the gas reservoir shall be determined by the company to which the gas reservoir belongs according to the production plan and is not limited here;

[0107] As an implementation manner, the value range of the first gas production difference threshold and the second gas production difference threshold may be 1%-5%.

[0108] S7, output the initial value of daily production and the lower limit of annual production time of the gas well, and use it as the daily production and annual production time.

[0109] As an implementation method, the GWO algorithm searches for the global optimal solution with a relatively small number of operations, and has the characteristics of easy search and strong local search capabilities. Therefore, the GWO algorithm can be used as the solution algorithm for the gas reservoir optimization production allocation model. The optimal solution is regarded as τ1 wolf, the second best solution is regarded as τ2 wolf, the third best solution is regarded as τ3 wolf, and other candidate solutions are regarded as τ4 wolf. The optimization process is guided by τ1, τ2, and τ3, and τ4 updates its position around τ1, τ2, and τ3, as follows:

[0110] The distance between the initial value of daily production allocation, the lower limit of annual production time and the optimal solution is expressed as:

[0111]

[0112] The formula for each search position update is:

[0113]

[0114] It should be noted that λ represents the current number of iterations. is the coefficient vector, is the position vector of the optimal daily output and production time, is the position vector of the current best search value;

[0115] The calculation formula is as follows:

[0116]

[0117]

[0118] in, is the convergence factor, A random number modulo [0,1];

[0119] In the process of searching for the optimal solution of daily output and production time, it is assumed that τ1, τ2, and τ3 are closer to the optimal solution and are the top three optimal solutions. τ4 gradually approaches the optimal solution through the positions of τ1, τ2, and τ3. The step size and direction of τ4 in the approximation process are:

[0120]

[0121] in, Respectively represent the distances between the solutions of τ1, τ2, and τ3 and other solutions, are the positions of τ1, τ2, and τ3, is a random vector.

[0122] Then the final value of the optimal daily output initial value and the lower limit of annual production time is:

[0123]

[0124] Some results of using the above algorithm to obtain the optimal daily output and annual production time are shown in Table 4 below:

[0125] Table 4

[0126]

[0127] According to the above production allocation plan, the annual gas production of the generated gas reservoir is shown in Table 5 below:

[0128] Table 5

[0129]

[0130] Combined with the gas reservoir formation pressure map before optimizing production allocation ( Figure 3 ) and the gas reservoir formation pressure diagram after optimized production allocation ( Figure 4 ) It can be seen that after the optimized production allocation, the formation pressure of the gas reservoir tends to be uniform, so that the final recovery rate of the gas reservoir is improved while the production allocation result is in line with expectations, thus achieving the optimized production allocation effect of the gas reservoir.

[0131] Embodiment 2:

[0132] Embodiment 2 optimizes steps S2 and S5 based on embodiment 1, as follows:

[0133] Step S2 also includes:

[0134] According to the formation pressure of the gas well and the initial value of daily production, the bottom hole flowing pressure of the gas well is calculated. The calculation formula is as follows:

[0135]

[0136] It should be noted that represents the lower limit of annual production time of the i-th gas well t i The bottom hole pressure at the end, T, K, h, r e 、r w , S, β, γ g Respectively represent the formation gas viscosity, formation gas average deviation factor, gas reservoir temperature, formation effective permeability, gas effective thickness, supply radius, bottom hole radius, skin coefficient, velocity coefficient in porous medium, and composite gas relative density corresponding to the i-th gas well, and the formation gas viscosity, formation gas average deviation factor, gas reservoir temperature, formation effective permeability, gas effective thickness, supply radius, bottom hole radius, skin coefficient, velocity coefficient in porous medium, and composite gas relative density can be collected and obtained by existing technical equipment, and will not be repeated here, ln represents the logarithm with the natural constant e as the base;

[0137] According to the bottom flow pressure of the gas well and the initial value of daily production, the bottom pressure of the tubing is calculated using the following formula:

[0138]

[0139] It should be noted that represents the lower limit of annual production time of the i-th gas well t i The bottom pressure of the oil pipe at the end, H 1 , d 1 , μ g They respectively represent the depth from the middle of the reservoir to the bottom of the oil pipe, the average temperature from the middle of the reservoir to the bottom of the oil pipe, the casing radius, and the gas viscosity corresponding to the i-th gas well, and the depth from the middle of the reservoir to the bottom of the oil pipe, the average temperature from the middle of the reservoir to the bottom of the oil pipe, the casing radius, and the gas viscosity can all be collected and obtained by existing technical equipment, and will not be repeated here. e represents a natural constant, which can be 2.71828, and lg represents a logarithm with a base of 10;

[0140] According to the bottom pressure of the tubing and the initial value of daily production, the wellhead pressure is calculated using the following formula:

[0141]

[0142] It should be noted that represents the lower limit of annual production time of the i-th gas well t i Wellhead pressure at the end, H 2 represents the oil pipe depth corresponding to the i-th gas well, and the oil pipe depth can be acquired by collecting through existing technical equipment, which will not be described in detail here;

[0143] Step S5 also includes:

[0144] Calculate the difference between the formation pressure and the bottom hole flow pressure at the end of the lower limit of the annual production time as the first pressure drop, the difference between the bottom hole flow pressure and the bottom pressure of the tubing as the second pressure drop, and the difference between the bottom pressure of the tubing and the wellhead pressure as the third pressure drop, and take the first pressure drop in the first pressure drop interval, the second pressure drop in the second pressure drop interval, and the third pressure drop in the third pressure drop interval as the eighth constraint condition, and start to judge whether the third constraint condition is met when the eighth constraint condition is met, and return to step S1 and change the initial value of the daily production allocation and the lower limit of the annual production time according to the step size when the eighth constraint condition is not met, so as to take the first pressure drop, the second pressure drop, and the third pressure drop into consideration factors, and avoid the first pressure drop, the second pressure drop, and the third pressure drop of the gas well deviating from the normal value at the end of the lower limit of the annual production time, which will cause adverse problems to the subsequent production of the gas well;

[0145] It should be noted that the first pressure drop interval, the second pressure drop interval, and the third pressure drop interval can be specifically determined according to the standards and specifications for ensuring normal production of the gas well, and are not limited here.

[0146] Embodiment 3

[0147] See also Figure 2 The present invention provides a system for optimizing gas reservoir production allocation in one embodiment, which is used in the method for optimizing gas reservoir production allocation in embodiment 1, comprising:

[0148] The data input module is used to establish a gas reservoir optimization production allocation model, input the lower limit of the annual production time of the gas well, and give the initial value of the daily production allocation of the gas well;

[0149] The formation pressure calculation module is used to generate the gas well formation pressure according to the lower limit of annual production time, the initial value of daily production allocation, the original formation pressure, the first deviation factor, the single well controlled reserves, and the second deviation factor;

[0150] A first constraint module is used to take the initial value of daily production allocation not less than the critical liquid carrying flow rate of the gas well, the initial value of daily production allocation less than the critical flow rate of the edge and bottom water gas well, and the initial value of daily production allocation not greater than the open flow rate of the gas well as the first constraint condition, enter step S4 when the first constraint condition is met, and return to step S1 and change the initial value of daily production allocation according to the step size when the first constraint condition is not met;

[0151] A second constraint module, used to take the annual production time lower limit value between the annual effective production days lower limit value and the annual effective production days upper limit value as a second constraint condition, enter step S5 when the second constraint condition is met, and return to step S1 and increase the annual production time lower limit value according to the step length when the second constraint condition is not met;

[0152] The third constraint module is used to calculate the absolute difference between the current gas well formation pressure and the average formation pressure of the gas reservoir, and take the absolute difference not greater than the first pressure difference threshold as the third constraint condition, calculate the difference between the gas well formation pressure at the end of the annual production time lower limit and the average formation pressure of the gas reservoir, and divide the difference by the average formation pressure of the gas reservoir at the end of the annual production time lower limit. The result value is not greater than the second pressure difference threshold as the fourth constraint condition, calculate the difference between the current gas well formation pressure and the gas well formation pressure at the end of the annual production time lower limit, and divide the difference by the current gas well formation pressure. The result value is not greater than the third pressure difference threshold as the fifth constraint condition, enter step S6 when the third constraint condition is satisfied and the fourth constraint condition is satisfied, and the third constraint condition is not satisfied and the fifth constraint condition is satisfied, and return to step S1 and change the initial value of the daily production allocation and the annual production time lower limit according to the step size when the third constraint condition is satisfied and the fourth constraint condition is not satisfied, and the third constraint condition is not satisfied and the fifth constraint condition is not satisfied;

[0153] The fourth constraint module is used to generate the annual gas production of the gas reservoir according to the lower limit of the annual production time and the initial value of the daily allocated production, calculate the difference between the annual gas production of the gas reservoir and the annual planned gas production of the gas reservoir, and divide the difference by the annual planned gas production of the gas reservoir to obtain a value less than the first gas production difference threshold as the sixth constraint condition, calculate the difference between the annual planned gas production of the gas reservoir and the annual gas production of the gas reservoir, and divide the difference by the annual planned gas production of the gas reservoir to obtain a value less than the second gas production difference threshold as the seventh constraint condition, enter step S7 when the sixth constraint condition is met, and return to step S1 and increase the initial value of the daily allocated production and the lower limit of the annual production time according to the step length when the sixth constraint condition is not met and the seventh constraint condition is met, and return to step S1 and reduce the initial value of the daily allocated production and the lower limit of the annual production time according to the step length when the sixth constraint condition is not met and the seventh constraint condition is not met;

[0154] The data output module is used to output the initial value of the daily production of the gas well and the lower limit of the annual production time, and use it as the daily production and annual production time.

[0155] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.

[0156] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented by software, the above embodiments may be implemented in whole or in part in the form of a computer program product. Those skilled in the art may appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein may be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed by hardware or software methods depends on the specific application and design constraints of the technical solution.

[0157] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0158] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. A method for optimizing gas reservoir production allocation, characterized in that: The steps include: S1, establish a gas reservoir optimization production allocation model, input the lower limit of the annual production time of the gas well, and give the initial value of the daily production allocation of the gas well; S2, generating the gas well formation pressure according to the lower limit of annual production time, the initial value of daily production allocation, the original formation pressure, the first deviation factor, the single well controlled reserves, and the second deviation factor; S3, taking the initial value of daily production allocation not less than the critical liquid carrying flow rate of the gas well, the initial value of daily production allocation less than the critical flow rate of the edge and bottom water gas well, and the initial value of daily production allocation not greater than the open flow rate of the gas well as the first constraint condition, entering step S4 when the first constraint condition is met, and returning to step S1 and changing the initial value of daily production allocation according to the step size when the first constraint condition is not met; S4, taking the lower limit of the annual production time being between the lower limit of the annual effective production days and the upper limit of the annual effective production days as the second constraint condition, entering step S5 when the second constraint condition is met, and returning to step S1 and increasing the lower limit of the annual production time by the step length when the second constraint condition is not met; S5, calculate the absolute difference between the current gas well formation pressure and the average formation pressure of the gas reservoir, and take the absolute difference not greater than the first pressure difference threshold as the third constraint condition, calculate the difference between the gas well formation pressure at the end of the annual production time lower limit and the average formation pressure of the gas reservoir, and divide the difference by the average formation pressure of the gas reservoir at the end of the annual production time lower limit, and the result value is not greater than the second pressure difference threshold as the fourth constraint condition, calculate the difference between the current gas well formation pressure and the gas well formation pressure at the end of the annual production time lower limit, and divide the difference by the current gas well formation pressure, and the result value is not greater than the third pressure difference threshold as the fifth constraint condition, enter step S6 when the third constraint condition is satisfied and the fourth constraint condition is satisfied, and the third constraint condition is not satisfied and the fifth constraint condition is satisfied, and return to step S1 and change the initial value of the daily production allocation and the annual production time lower limit according to the step size when the third constraint condition is satisfied and the fourth constraint condition is not satisfied, and the third constraint condition is not satisfied and the fifth constraint condition is not satisfied; S6, generating the annual gas production of the gas reservoir according to the lower limit of the annual production time and the initial value of the daily allocated production, calculating the difference between the annual gas production of the gas reservoir and the annual planned gas production of the gas reservoir, and dividing the difference by the annual planned gas production of the gas reservoir to obtain a value less than the first gas production difference threshold as the sixth constraint condition, calculating the difference between the annual planned gas production of the gas reservoir and the annual gas production of the gas reservoir, and dividing the difference by the annual planned gas production of the gas reservoir to obtain a value less than the second gas production difference threshold as the seventh constraint condition, entering step S7 when the sixth constraint condition is met, and returning to step S1 and increasing the initial value of the daily allocated production and the lower limit of the annual production time according to the step length when the sixth constraint condition is not met and the seventh constraint condition is met, and returning to step S1 and decreasing the initial value of the daily allocated production and the lower limit of the annual production time according to the step length when the sixth constraint condition is not met and the seventh constraint condition is not met; S7, the initial value of the daily production and the lower limit of the annual production time of the output gas well, and use it as the daily production and annual production time; The lower limit of the annual production time is calibrated as t i , and the daily production is calibrated as Where i represents the number of different gas wells in the gas reservoir, and i = 1, 2, 3, ..., m, and m represents the total number of gas wells in the gas reservoir, and m∈N + ; The calculation formula of the gas well formation pressure is as follows: in, represents the lower limit of annual production time of the i-th gas well t i The annual gas production of the gas well at the end of represents the lower limit of annual production time of the i-th gas well t i The formation pressure at the end, P i represents the original formation pressure of the i-th gas well, Z i Indicates the original formation pressure P i and the first deviation factor at the corresponding formation temperature, G represents the controlled reserves of a single well, Z(t i ) represents the formation pressure P Ri (t i ) and the second deviation factor at the corresponding formation temperature; The calculation logic of the critical liquid carrying flow rate of the gas well is as follows: According to the liquid density, gas density, gas-liquid interfacial tension, and the angle between the inclined well section and the horizontal direction, the critical liquid-carrying flow rate of the vertical well section, the inclined well section, and the horizontal section of the gas well are calculated, and the maximum value is taken as the critical liquid-carrying flow rate of the gas well. The calculation formula is as follows: in, They represent the critical liquid-carrying flow rate of the vertical section, the critical liquid-carrying flow rate of the inclined section, and the critical liquid-carrying flow rate of the horizontal section of the i-th gas well, respectively. g (i) represents the critical liquid flow rate of the i-th gas well, ρ L , g , σ, and θ represent the liquid density, gas density, gas-liquid interfacial tension, and the angle between the inclined well section and the horizontal direction corresponding to the i-th gas well, respectively; According to the critical liquid-carrying flow rate of the gas well, the wellhead tubing cross-sectional area, the wellhead pressure, the wellhead temperature, the wellhead gas compression coefficient, the bottom hole tubing cross-sectional area, the bottom hole pressure, the bottom hole temperature, and the bottom hole gas compression coefficient, the wellhead critical liquid-carrying flow rate and the bottom hole critical liquid-carrying flow rate are calculated, and the maximum value is taken as the critical liquid-carrying flow rate of the gas well. The calculation formula is as follows: in, They represent the critical liquid carrying rate at the wellhead and the critical liquid carrying rate at the bottom of the well, respectively, and q min (i) represents the critical liquid carrying rate of the i-th gas well, A wh 、p wh , T wh , Z wh , A wf 、p wf , T wf , Z wf Respectively represent the wellhead tubing cross-sectional area, wellhead pressure, wellhead temperature, wellhead gas compressibility coefficient, bottomhole tubing cross-sectional area, bottomhole pressure, bottomhole temperature, and bottomhole gas compressibility coefficient corresponding to the i-th gas well; The calculation logic of the critical flow rate of the edge and bottom water gas well is as follows: The critical flow rate of the edge and bottom water gas well is calculated based on the gas layer permeability, water vapor density difference, gas layer effective thickness, gas well perforation thickness, gas volume coefficient, gas viscosity, gas well discharge radius, gas well radius, and skin coefficient. The calculation formula is as follows: Among them, q' SC (i) represents the critical flow rate of the edge and bottom water gas well of the i-th gas well, K g , Δρ wg , h, b, B g , μ g 、r e 、r w and S represent the gas layer permeability, water vapor density difference, gas layer effective thickness, gas well perforation thickness, gas volume coefficient, gas viscosity, supply radius, bottom hole radius, and skin coefficient corresponding to the i-th gas well, respectively. π represents pi, and g represents the acceleration of gravity.

2. The method for optimizing gas reservoir production allocation according to claim 1, characterized in that: The calculation logic of the critical flow rate of the edge and bottom water gas well is as follows: Among them, q' SC (i) represents the critical flow rate of the edge and bottom water gas well of the i-th gas well, K g , μ w , K w , μ g , A, α, B g They respectively represent the gas layer permeability, liquid viscosity, liquid layer permeability, gas viscosity, tubing cross-sectional area, the angle between the gas well and the formation, and the gas volume coefficient corresponding to the i-th gas well.

3. The method for optimizing gas reservoir production allocation according to claim 1, characterized in that: The calculation formula for the annual gas production of the gas reservoir is as follows: Among them, G P (t i ) represents the lower limit of annual production time of gas reservoir t i Annual gas production of the gas reservoir at the end of the period.

4. The method for optimizing gas reservoir production allocation according to claim 1, characterized in that: Step S2 also includes: According to the formation pressure of the gas well and the initial value of daily production, the bottom hole flowing pressure of the gas well is calculated. The calculation formula is as follows: in, represents the lower limit of annual production time of the i-th gas well t i The bottom hole pressure at the end, T, K, h, r e 、r w , S, β, γ g They represent the formation gas viscosity, formation gas average deviation factor, gas reservoir temperature, formation effective permeability, gas effective thickness, supply radius, bottom hole radius, skin coefficient, velocity coefficient in porous media, and composite gas relative density corresponding to the i-th gas well, respectively. ln represents the logarithm with the natural constant e as the base; According to the bottom flow pressure of the gas well and the initial value of daily production, the bottom pressure of the tubing is calculated using the following formula: Among them, P1 i (t i ) represents the lower limit of annual production time of the i-th gas well t i The bottom pressure of the oil pipe at the end, H1, d1, μ g They represent the depth from the middle of the reservoir to the bottom of the tubing, the average temperature from the middle of the reservoir to the bottom of the tubing, the casing radius, and the gas viscosity corresponding to the i-th gas well, respectively; e represents a natural constant; and lg represents a logarithm with a base of 10; According to the bottom pressure of the tubing and the initial value of daily production, the wellhead pressure is calculated using the following formula: in, represents the lower limit of annual production time of the i-th gas well t i The wellhead pressure at the end, H2 represents the tubing depth corresponding to the i-th gas well; Step S5 also includes: Calculate the difference between the formation pressure and the bottom hole flow pressure at the end of the lower limit of the annual production time and use it as the first pressure drop, the difference between the bottom hole flow pressure and the bottom pressure of the tubing and use it as the second pressure drop, the difference between the bottom pressure of the tubing and the wellhead pressure and use it as the third pressure drop, and take the first pressure drop in the first pressure drop interval, the second pressure drop in the second pressure drop interval, and the third pressure drop in the third pressure drop interval as the eighth constraint condition. When the eighth constraint condition is met, start to judge whether the third constraint condition is met, and when the eighth constraint condition is not met, return to step S1 and change the initial value of the daily production allocation and the lower limit of the annual production time according to the step size.

5. A system for optimizing gas reservoir production allocation, used in the method for optimizing gas reservoir production allocation as claimed in any one of claims 1 to 4, characterized in that: include: The data input module is used to establish a gas reservoir optimization production allocation model, input the lower limit of the annual production time of the gas well, and give the initial value of the daily production allocation of the gas well; The formation pressure calculation module is used to generate the gas well formation pressure according to the lower limit of annual production time, the initial value of daily production allocation, the original formation pressure, the first deviation factor, the single well controlled reserves, and the second deviation factor; A first constraint module is used to take the initial value of daily production allocation not less than the critical liquid carrying flow rate of the gas well, the initial value of daily production allocation less than the critical flow rate of the edge and bottom water gas well, and the initial value of daily production allocation not greater than the open flow rate of the gas well as the first constraint condition, enter step S4 when the first constraint condition is met, and return to step S1 and change the initial value of daily production allocation according to the step size when the first constraint condition is not met; A second constraint module, used to take the annual production time lower limit value between the annual effective production days lower limit value and the annual effective production days upper limit value as a second constraint condition, enter step S5 when the second constraint condition is met, and return to step S1 and increase the annual production time lower limit value according to the step length when the second constraint condition is not met; The third constraint module is used to calculate the absolute difference between the current gas well formation pressure and the average formation pressure of the gas reservoir, and take the absolute difference not greater than the first pressure difference threshold as the third constraint condition, calculate the difference between the gas well formation pressure at the end of the annual production time lower limit and the average formation pressure of the gas reservoir, and divide the difference by the average formation pressure of the gas reservoir at the end of the annual production time lower limit. The result value is not greater than the second pressure difference threshold as the fourth constraint condition, calculate the difference between the current gas well formation pressure and the gas well formation pressure at the end of the annual production time lower limit, and divide the difference by the current gas well formation pressure. The result value is not greater than the third pressure difference threshold as the fifth constraint condition, enter step S6 when the third constraint condition is satisfied and the fourth constraint condition is satisfied, and the third constraint condition is not satisfied and the fifth constraint condition is satisfied, and return to step S1 and change the initial value of the daily production allocation and the annual production time lower limit according to the step size when the third constraint condition is satisfied and the fourth constraint condition is not satisfied, and the third constraint condition is not satisfied and the fifth constraint condition is not satisfied; The fourth constraint module is used to generate the annual gas production of the gas reservoir according to the lower limit of the annual production time and the initial value of the daily allocated production, calculate the difference between the annual gas production of the gas reservoir and the annual planned gas production of the gas reservoir, and divide the difference by the annual planned gas production of the gas reservoir to obtain a value less than the first gas production difference threshold as the sixth constraint condition, calculate the difference between the annual planned gas production of the gas reservoir and the annual gas production of the gas reservoir, and divide the difference by the annual planned gas production of the gas reservoir to obtain a value less than the second gas production difference threshold as the seventh constraint condition, enter step S7 when the sixth constraint condition is met, and return to step S1 and increase the initial value of the daily allocated production and the lower limit of the annual production time according to the step length when the sixth constraint condition is not met and the seventh constraint condition is met, and return to step S1 and reduce the initial value of the daily allocated production and the lower limit of the annual production time according to the step length when the sixth constraint condition is not met and the seventh constraint condition is not met; The data output module is used to output the initial value of the daily production of the gas well and the lower limit of the annual production time, and use it as the daily production and annual production time.