A phase portrait mapping method, device, system, and storage medium
By analyzing the initial molar percentages and property parameters of methane and decane, calculating the fugacity, and iteratively obtaining the target gas phase molar percentage, the problem of long time consumption and low accuracy in phase diagram drawing in the prior art is solved, and fast and accurate phase diagram drawing is achieved.
Patent Information
- Application Number
- CN202310584174.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-23
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2043-05-23
AI Technical Summary
Existing technologies, especially near critical points, require a large amount of computation and are time-consuming when drawing phase diagrams, making it difficult to quickly distinguish phases. Furthermore, when the composition is complex, the phase diagram drawing is slow, affecting phase judgment.
By analyzing the initial molar percentages, property parameters, and environmental parameters of methane and decane, the fugacity is calculated and the target gas phase molar percentage is obtained through iteration, and a phase diagram is plotted.
It improves the accuracy and speed of phase diagram drawing, solves the problem of poor convergence in calculation, and simplifies the phase determination of complex components.
Smart Images

Figure CN117092284B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application mainly relates to the technical field of oil and gas development, and particularly relates to a phase state diagram drawing method, device, system and storage medium. BACKGROUND
[0002] The phase state diagram is a comprehensive diagram used to represent the state and temperature, pressure and composition relationship of phases in equilibrium state. For a multi-phase system, the temperature and pressure at which the phases are converted to each other can be directly observed from the phase state diagram, and the phase state change of the mixed system can be determined and controlled by real-time monitoring of the pressure and temperature, thereby providing guidance for the separation and transportation of natural gas.
[0003] In the conventional phase state diagram drawing method, the critical temperature is determined by calculating all points in the pressure and temperature range for a sufficient time, and the precision requirement is extremely high. Especially near the phase state critical point, the calculation amount is large and the time is long, it is difficult to quickly distinguish the phase state and it is not easy to implement. When the components in the mixed system are complex, the phase state diagram is drawn slowly, and even the curve is abnormal, which affects the phase state judgment. SUMMARY
[0004] The present application mainly relates to the technical field of oil and gas development, and particularly relates to a phase state diagram drawing method, device, system and storage medium.
[0005] The technical scheme for solving the above technical problems is as follows: a phase state diagram drawing method, comprising the following steps:
[0006] S1: obtaining initial methane molar percentage and initial decane molar percentage from a fluid component sample, and importing methane property parameters, decane property parameters and environmental parameters;
[0007] S2: analyzing gas-liquid coexistence of the initial methane molar percentage, the initial decane molar percentage, the methane property parameters, the decane property parameters and the environmental parameters, and obtaining a to-be-processed molar percentage parameter according to the analysis result;
[0008] S3: calculating the fugacity of the to-be-processed molar percentage parameter, the methane property parameters, the decane property parameters and the environmental parameters, and obtaining a target gas phase molar percentage according to the calculation result, returning to S1 until a preset iteration number is reached, thereby obtaining a plurality of target gas phase molar percentages;
[0009] S4: drawing a plurality of the target gas phase molar percentages according to a plurality of the environmental parameters to obtain a target phase state diagram.
[0010] Another technical scheme for solving the above technical problems is as follows: a phase state diagram drawing device, comprising:
[0011] a parameter obtaining module, configured to obtain an initial methane mole percentage and an initial decane mole percentage from a fluid component sample, and import a methane property parameter, a decane property parameter, and an environmental parameter;
[0012] an analysis module, configured to perform gas-liquid coexistence analysis on the initial methane mole percentage, the initial decane mole percentage, the methane property parameter, the decane property parameter, and the environmental parameter, and obtain a to-be-processed mole percentage parameter according to an analysis result;
[0013] a calculation module, configured to calculate fugacity of the to-be-processed mole percentage parameter, the methane property parameter, the decane property parameter, and the environmental parameter, and obtain a target gas phase mole percentage according to a calculation result, return to the parameter obtaining module until a preset iteration number is reached, so as to obtain a plurality of target gas phase mole percentages;
[0014] a phase diagram obtaining module, configured to plot the plurality of target gas phase mole percentages according to the plurality of environmental parameters, and obtain a target phase diagram.
[0015] Based on the above-mentioned phase diagram plotting method, the application further provides a phase diagram plotting system.
[0016] Another technical solution of the application to solve the above-mentioned technical problem is as follows: a phase diagram plotting system, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, when the processor executes the computer program, a phase diagram plotting method as described above is realized.
[0017] Based on the above-mentioned phase diagram plotting method, the application further provides a computer readable storage medium.
[0018] Another technical solution of the application to solve the above-mentioned technical problem is as follows: a computer readable storage medium, the computer readable storage medium stores a computer program, when the computer program is executed by a processor, a phase diagram plotting method as described above is realized.
[0019] The application has the following beneficial effects: through gas-liquid coexistence analysis on the initial methane mole percentage, the initial decane mole percentage, the methane property parameter, the decane property parameter, and the environmental parameter, and obtaining a to-be-processed mole percentage parameter according to an analysis result, calculating fugacity of the to-be-processed mole percentage parameter, the methane property parameter, the decane property parameter, and the environmental parameter, and obtaining a plurality of target gas phase mole percentages according to a calculation result, plotting the plurality of target gas phase mole percentages according to a plurality of environmental parameters to obtain a target phase diagram, the precision of plotting is improved, the difficulty of plotting is reduced, the time of plotting is saved, and the problem of not easy convergence in calculating critical parameters is solved. Attached Figure Description
[0020] Figure 1 This is a flowchart illustrating a phase diagram drawing method provided in an embodiment of the present invention.
[0021] Figure 2 A schematic diagram illustrating the calculation results of the gas phase molar percentage provided in an embodiment of the present invention;
[0022] Figure 3 This is a schematic diagram of the phase diagram calculation results provided in an embodiment of the present invention;
[0023] Figure 4 This is a block diagram of a phase diagram drawing device provided in an embodiment of the present invention. Detailed Implementation
[0024] The principles and features of the present invention are described below with reference to the accompanying drawings. The examples given are only for explaining the present invention and are not intended to limit the scope of the present invention.
[0025] Figure 1 This is a flowchart illustrating a phase diagram drawing method provided in an embodiment of the present invention.
[0026] like Figure 1 As shown, a method for drawing a phase diagram includes the following steps:
[0027] S1: Obtain the initial molar percentage of methane and the initial molar percentage of decane from the fluid component sample, and import the methane property parameters, decane property parameters, and environmental parameters;
[0028] S2: Analyze the initial methane molar percentage, the initial decane molar percentage, the methane property parameters, the decane property parameters, and the environmental parameters to be processed in a gas-liquid coexistence manner, and obtain the molar percentage parameters to be processed based on the analysis results;
[0029] S3: Calculate the fugacity of the mole percentage parameter to be processed, the methane property parameter, the decane property parameter, and the environmental parameter, and obtain the target gas phase mole percentage based on the calculation results. Return to S1 until the preset number of iterations is reached, thereby obtaining multiple target gas phase mole percentages.
[0030] S4: Plot the target gas phase molar percentages based on the multiple environmental parameters to obtain a target phase diagram.
[0031] It should be understood that the feed composition is obtained by sampling the components of the produced fluid from the wellbore, thus yielding the molar percentages z of various hydrocarbon components. i (i.e., the initial molar percentage of methane and the initial molar percentage of decane).
[0032] In the above embodiment, the initial methane molar percentage, the initial decane molar percentage, the methane property parameter, the decane property parameter, and the environment parameter are analyzed in gas-liquid coexistence, and the to-be-processed molar percentage parameter is obtained according to the analysis result; the fugacity of the to-be-processed molar percentage parameter, the methane property parameter, the decane property parameter, and the environment parameter is calculated, and a plurality of target gas phase molar percentages are obtained according to the calculation result; the plurality of target gas phase molar percentages are plotted according to the plurality of environment parameters to obtain a target phase diagram, which improves the plotting accuracy, reduces the plotting difficulty, saves the plotting time, and solves the problem of non-convergence in calculating the critical parameter.
[0033] Optionally, as an embodiment of the present application, the methane property parameter includes a methane eccentricity factor, a methane critical temperature, a binary interaction coefficient, and a methane critical pressure; the decane property parameter includes a decane eccentricity factor, a decane critical temperature, and a decane critical pressure; and the environment parameter includes an environment pressure and an environment temperature.
[0034] The process of S2 includes:
[0035] S21: calculating an initial equilibrium constant value of the methane eccentricity factor, the methane critical temperature, the environment pressure, the environment temperature, and the methane critical pressure by a first formula to obtain an initial methane equilibrium constant value, the first formula being:
[0036]
[0037] wherein K1 is the initial methane equilibrium constant value, p is the methane critical pressure, p is the environment pressure, ω1 is the methane eccentricity factor, T is the methane critical temperature, and T is the environment temperature. c1 c1
[0038] S22: calculating an initial equilibrium constant value of the decane eccentricity factor, the decane critical temperature, the environment pressure, the environment temperature, and the decane critical pressure by a second formula to obtain an initial decane equilibrium constant value, the second formula being:
[0039]
[0040] wherein K2 is the initial decane equilibrium constant value, p is the decane critical pressure, p is the environment pressure, ω2 is the decane eccentricity factor, T is the decane critical temperature, and T is the environment temperature. c2 c2
[0041] S23: judging whether the initial methane equilibrium constant, the initial methane mole percentage, the initial decane equilibrium constant and the initial decane mole percentage satisfy the third formula and satisfy the fourth formula, if not, returning to S1; if yes, executing S24, the third formula is:
[0042] K1z1+K2z2>1,
[0043] The fourth formula is:
[0044]
[0045] Wherein, K1 is the initial methane equilibrium constant, z1 is the initial methane mole percentage, K2 is the initial decane equilibrium constant, and z2 is the initial decane mole percentage;
[0046] S24: calculating the gas-liquid phase mole percentage of the initial methane equilibrium constant, the initial methane mole percentage, the initial decane equilibrium constant and the initial decane mole percentage, to obtain the initial liquid phase mole percentage, the initial gas phase mole percentage, the to-be-processed methane liquid phase mole percentage, the to-be-processed methane gas phase mole percentage, the to-be-processed decane gas phase mole percentage and the to-be-processed decane liquid phase mole percentage;
[0047] The to-be-processed mole percentage parameters include the initial liquid phase mole percentage, the initial gas phase mole percentage, the to-be-processed methane liquid phase mole percentage, the to-be-processed methane gas phase mole percentage, the to-be-processed decane gas phase mole percentage and the to-be-processed decane liquid phase mole percentage.
[0048] It should be understood that the basic property parameters of the hydrocarbon components required for calculation include the eccentric factor ω i (i.e. the methane eccentric factor and the decane eccentric factor), the critical temperature T ci (i.e. the methane critical temperature and the decane critical temperature), the critical pressure p ci (i.e. the decane critical pressure and the methane critical pressure), the binary interaction coefficient k ij .
[0049] It should be understood that the given system environment parameters are the system pressure p (i.e. the environment pressure) and the temperature T (i.e. the environment temperature).
[0050] Specifically, the initial equilibrium constant is set according to the Wilson equation, and the formula is:
[0051]
[0052] According to the initial equilibrium constant K i(i.e. the initial methane equilibrium constant and the initial decane equilibrium constant), whether the system is gas-liquid coexistence. If it is not gas-liquid coexistence, it is gas single phase or liquid single phase, and no subsequent calculation is performed, and the data parameters need to be obtained again. The determination condition is:
[0053] and
[0054] In the above embodiment, the initial methane molar percentage, the initial decane molar percentage, the methane property parameters, the decane property parameters and the environmental parameters are analyzed for gas-liquid coexistence, and the to-be-processed molar percentage parameters are obtained according to the analysis results, which lays a foundation for subsequent data processing, improves the drawing accuracy and reduces the drawing difficulty, and has great significance for improving the stability of the complex component gas-liquid phase equilibrium calculation algorithm and accurately determining the fluid phase state.
[0055] Optionally, as an embodiment of the present application, the process of S24 comprises:
[0056] The initial liquid molar percentage, the initial gas molar percentage, the to-be-processed methane liquid molar percentage, the to-be-processed methane gas molar percentage, the to-be-processed decane gas molar percentage and the to-be-processed decane liquid molar percentage are obtained by calculating the initial methane equilibrium constant, the initial methane molar percentage, the initial decane equilibrium constant and the initial decane molar percentage of the gas-liquid phase molar percentage through the first equation group, and the first equation group is:
[0057]
[0058] Wherein, V is the initial gas molar percentage, L is the initial liquid molar percentage, x1 is the to-be-processed methane liquid molar percentage, y1 is the to-be-processed methane gas molar percentage, z1 is the initial methane molar percentage, x2 is the to-be-processed decane liquid molar percentage, y2 is the to-be-processed decane gas molar percentage, z2 is the initial decane molar percentage, K1 is the initial methane equilibrium constant, and K2 is the initial decane equilibrium constant.
[0059] It should be understood that the liquid molar percentage L (i.e. the initial liquid molar percentage), the gas molar percentage V (i.e. the initial gas molar percentage), the i component molar percentage x i (i.e. the to-be-processed methane liquid molar percentage or the to-be-processed decane liquid molar percentage), and the i component molar percentage y i (i.e. the to-be-processed methane gas molar percentage or the to-be-processed decane gas molar percentage) can be obtained by calculation.
[0060] Specifically, according to the material conservation, the following formula is obtained:
[0061] V+L=1
[0062] Vy i +Lx i =z i
[0063]
[0064] The equilibrium constant is defined as follows:
[0065]
[0066] In the above embodiment, the initial liquid phase mole percentage, the initial gas phase mole percentage, the to-be-processed methane liquid phase mole percentage, the to-be-processed methane gas phase mole percentage, the to-be-processed decane gas phase mole percentage, and the to-be-processed decane liquid phase mole percentage are obtained by calculating the gas-liquid phase mole percentages of the initial methane equilibrium constant, the initial methane mole percentage, the initial decane equilibrium constant, and the initial decane mole percentage through the first equation set, which lays a foundation for subsequent data processing, improves the drawing accuracy, reduces the drawing difficulty, and has great significance for improving the stability of the complex component gas-liquid phase equilibrium calculation algorithm and accurately determining the fluid phase state.
[0067] Optionally, as an embodiment of the present application, in S3, the fugacity of the to-be-processed mole percentage parameter, the methane property parameter, the decane property parameter, and the environment parameter is calculated, and the process of obtaining the target gas phase mole percentage according to the calculation result includes:
[0068] S31: calculating the fugacity of the methane eccentricity factor, the methane critical temperature, the methane critical pressure, the decane eccentricity factor, the decane critical temperature, the decane critical pressure, the environment pressure, the environment temperature, the to-be-processed methane liquid phase mole percentage, the to-be-processed methane gas phase mole percentage, the to-be-processed decane gas phase mole percentage, and the to-be-processed decane liquid phase mole percentage to obtain the methane liquid phase fugacity, the methane gas phase fugacity, the decane liquid phase fugacity, and the decane gas phase fugacity;
[0069] S32: judging whether the methane liquid phase fugacity, the methane gas phase fugacity, the decane liquid phase fugacity, and the decane gas phase fugacity satisfy the fifth formula, if not, executing S33; if yes, taking the initial gas phase mole percentage as the target gas phase mole percentage, and the fifth formula is:
[0070]
[0071] wherein, f1 V is the methane gas phase fugacity, f2 V is the methane liquid phase fugacity, f1 L is the decane gas phase fugacity, is the methane gas phase fugacity;
[0072] S33: determining whether a preset fugacity calculation number is reached, if not, performing S34 to S35; if yes, taking the first preset value as the target gas phase mole percentage;
[0073] S34: updating the equilibrium constant initial value of the methane liquid phase fugacity and the methane gas phase fugacity by a sixth formula, to obtain an updated methane equilibrium constant initial value, the sixth formula is:
[0074]
[0075] wherein K'1 is the updated methane equilibrium constant initial value, is a methane gas phase fugacity coefficient, is a methane liquid phase fugacity coefficient;
[0076] S35: updating the equilibrium constant initial value of the decane liquid phase fugacity and the decane gas phase fugacity by a seventh formula, to obtain an updated decane equilibrium constant initial value, and returning to S23, the seventh formula is:
[0077]
[0078] wherein K'2 is the updated decane equilibrium constant initial value, is a decane gas phase fugacity coefficient, is a decane liquid phase fugacity coefficient.
[0079] Preferably, the first preset value can be 0.
[0080] It should be understood that whether the convergence condition is met is determined by the fugacity coefficients of each component in the gas phase and the liquid phase. Given a proper accuracy, the convergence condition is set according to the fugacity equality equation, as follows:
[0081]
[0082] If the condition is met, the calculation is completed, at which time the correct gas phase mole percentage V (i.e. the target gas phase mole percentage) can be obtained, otherwise, K i is updated (i.e. the updated methane equilibrium constant initial value and the updated decane equilibrium constant initial value), and the gas-liquid coexistence determination is performed again, and the calculation is repeated until the fugacity equality condition is met.
[0083] Specifically, K i (i.e. the updated methane equilibrium constant initial value and the updated decane equilibrium constant initial value) is recalculated as follows:
[0084]
[0085] In the above embodiment, the fugacity of the to-be-processed mole percentage parameter, the methane property parameter, the decane property parameter and the environment parameter is calculated, and the target gas-phase mole percentage is obtained according to the calculation result, so that the phase state diagram is drawn more simply and accurately, and the algorithm stability is improved, the phase state quantity is judged, and the critical parameter of the complex component is determined, which has important significance.
[0086] Optionally, as an embodiment of the present application, the process of S31 comprises:
[0087] The eighth formula to the seventeenth formula constitute a second equation group, and the fugacity of the methane eccentricity factor, the methane critical temperature, the methane critical pressure, the decane eccentricity factor, the decane critical temperature, the decane critical pressure, the environment pressure, the environment temperature, the to-be-processed methane liquid-phase mole percentage, the to-be-processed methane gas-phase mole percentage, the to-be-processed decane gas-phase mole percentage and the to-be-processed decane liquid-phase mole percentage is calculated through the second equation group to obtain the methane liquid-phase fugacity, the methane gas-phase fugacity, the decane liquid-phase fugacity and the decane gas-phase fugacity, the eighth formula is:
[0088]
[0089] The ninth formula is:
[0090]
[0091] The tenth formula is:
[0092]
[0093] The eleventh formula is:
[0094]
[0095] The twelfth formula is:
[0096]
[0097] The thirteenth formula is:
[0098]
[0099] The fourteenth formula is:
[0100]
[0101] The fifteenth formula is:
[0102]
[0103] The sixteenth formula is:
[0104]
[0105] The seventeenth formula is:
[0106]
[0107] wherein,
[0108] wherein, f1 V is the methane gas phase fugacity, f2 V is the decane gas phase fugacity, f1 L is the methane liquid phase fugacity, is the decane liquid phase fugacity, is the methane gas phase fugacity coefficient, is the decane gas phase fugacity coefficient, is the methane liquid phase fugacity coefficient, is the decane liquid phase fugacity coefficient, x1 is the mole percentage of the liquid phase methane to be treated, y1 is the mole percentage of the gas phase methane to be treated, x2 is the mole percentage of the liquid phase decane to be treated, y2 is the mole percentage of the gas phase decane to be treated, p c2 is the decane critical pressure, p is the environmental pressure, ω2 is the decane eccentric factor, T c2 is the decane critical temperature, T is the environmental temperature, p c1 is the methane critical pressure, ω1 is the methane eccentric factor, T c1 is the methane critical temperature, R is a constant, Z V is the gas phase compression factor, Z L is the liquid phase compression factor, A V is the mixed gas, A L is the mixed liquid, k 12 is the binary interaction coefficient, m1 is the methane deviation factor function, m2 is the decane deviation factor function.
[0109] Specifically, the gas-liquid phase equilibrium is calculated by using the compression factor and the fugacity coefficient, and the expression of the compression factor is:
[0110] Z 3 +(B-1)Z 2 +(A-3B 2 -2B)Z-(AB-B 2 -B 3 )=0
[0111] The expression of the gas phase or liquid phase fugacity coefficient is:
[0112]
[0113] wherein,
[0114] R = 8.314
[0115]
[0116] For the gas phase the following applies:
[0117]
[0118]
[0119] For the liquid phase the following applies:
[0120]
[0121]
[0122] where V represents the gas phase mole fraction; L represents the liquid phase mole fraction; z i represents the mole fraction of component i in the total system; y i represents the mole fraction of component i in the gas phase (gas phase fraction); x i represents the mole fraction of component i in the liquid phase (liquid phase fraction); represents the fugacity coefficient; f i represents the fugacity; ω i represents the acentric factor; T ci represents the critical temperature, K; p ci represents the critical pressure, MPa; k ij represents the binary interaction coefficient; R represents the ideal gas constant, J / (mol-K); subscript i represents a component in the fluid.
[0123] It is understood that the gas-liquid equilibrium condition (fugacity equality) is as follows:
[0124] f i V = f i L
[0125] The gas and liquid phase fugacities are defined as:
[0126]
[0127] In the above embodiment, the fugacity of the methane liquid phase, the methane gas phase, the decane liquid phase and the decane gas phase is obtained by calculating the methane eccentricity factor, the methane critical temperature, the methane critical pressure, the decane eccentricity factor, the decane critical temperature, the decane critical pressure, the environmental pressure, the environmental temperature, the to-be-processed methane liquid phase molar percentage, the to-be-processed methane gas phase molar percentage, the to-be-processed decane gas phase molar percentage and the to-be-processed decane liquid phase molar percentage through the second equation set, so that the drawing precision is improved, the drawing difficulty is reduced, and the stability of the complex component gas-liquid phase equilibrium calculation algorithm and the accurate determination of the fluid phase state have great significance.
[0128] Optionally, as an embodiment of the present application, the environmental parameter includes the environmental pressure and the environmental temperature, and the process of S4 includes:
[0129] S41: graphically drawing all the environmental pressures, the environmental temperatures and all the target gas phase molar percentages with the environmental temperature as the horizontal coordinate and the environmental pressure as the vertical coordinate to obtain an initial phase state diagram;
[0130] S42: judging the target gas phase molar percentage of each column in the initial phase state diagram, judging whether all the target gas phase molar percentages of the previous column in the initial phase state diagram are concave with the environmental pressure, if not, judging all the target gas phase molar percentages of the next column in the initial phase state diagram, if yes, taking the environmental temperature corresponding to all the target gas phase molar percentages of the previous column in the initial phase state diagram as a target critical temperature, and performing S43;
[0131] S43: screening the maximum value of all the environmental pressures corresponding to the target critical temperature, and taking the screened maximum environmental pressure as a target critical pressure;
[0132] S44: respectively judging the environmental temperature and the environmental pressure corresponding to each target gas phase molar percentage, judging whether the environmental temperature is less than the target critical temperature and the environmental pressure is greater than the target critical pressure, if yes, taking a first preset value as an updated target gas phase molar percentage, if not, taking a second preset value as the updated target gas phase molar percentage;
[0133] S45: updating the initial phase state diagram according to all the updated target gas phase molar percentages to obtain a target phase state diagram.
[0134] Preferably, the first preset value can be 0, and the second preset value can be 1.
[0135] It should be understood that the critical temperature (i.e., the target critical temperature) is determined according to the change rule of the gas phase mole percentage distribution, the phase state diagram of the gas-liquid mixed fluid is drawn, and the fluid phase state is judged.
[0136] Specifically, according to the calculated gas phase mole percentage result distribution, each result is sequentially judged, and first, the pressure value and the temperature value are continuously adjusted to obtain the gas phase mole percentage V data distribution under the corresponding pressure and temperature range. For the pressure and temperature control region of the pure gas phase or the pure liquid phase, the calculation result diverges (no real solution), and the gas phase mole percentage (i.e., the target gas phase mole percentage) can be temporarily assigned as 0. At this time, the non-zero region (convergent calculation result) is the gas-liquid two-phase region.
[0137] According to the change characteristics of the gas phase mole percentage: when the pressure and temperature conditions are close to the pure gas phase, the gas phase mole percentage increases, and vice versa, the critical temperature point can be determined according to this rule. The points in the two-phase region are judged, and the judgment order is from low to high temperature. At a certain temperature, the change rule of the gas phase mole percentage with the pressure is judged, and if the gas phase mole percentage always decreases with the increase of the pressure (the value continuously decreases from top to bottom), the number sequence corresponding to the next temperature is judged, and the step is repeated. When the gas phase mole percentage increases after decreasing with the increase of the pressure (the value increases in the process of decreasing from top to bottom), the step is stopped, and at this time, the temperature is the critical temperature of the mixed system (i.e., the target critical temperature), and the maximum pressure point in the two-phase region at this temperature is the critical point (i.e., the target critical pressure). If the gas phase mole percentage decreases and then increases with the increase of the pressure at the lowest temperature in the given temperature range, the two-phase region is outside the gas phase.
[0138] The gas phase mole percentage value is filled in the single-phase region, and outside the two-phase region, below the critical temperature and above the critical point pressure range, it is a liquid single phase. The gas phase mole percentage in this region is 0, and the remaining regions are gas single phases, and the gas phase mole percentage is 1. Thus, the complete gas phase mole percentage distribution in the pressure and temperature range can be obtained, and the complete phase state diagram is drawn to realize the phase state judgment and provide guidance for the separation and transportation of natural gas.
[0139] In the above embodiment, the target phase state diagram is drawn according to a plurality of environmental parameters and a plurality of target gas phase mole percentages, the phase state judgment is realized, and guidance is provided for the separation and transportation of natural gas.
[0140] Alternatively, as another embodiment of the present application, the present application comprises the following steps:
[0141] S1: obtain the feed composition by fluid component sampling, collect the basic parameters required for calculation, including system pressure, temperature, eccentric factor, critical temperature, critical pressure, binary interaction coefficient; S2: based on the PR state equation, and combined with the basic parameters, establish a gas-liquid phase equilibrium calculation model and calculate the gas mole percentage; S3: determine the critical temperature according to the gas mole percentage distribution change rule, realize the drawing of the phase state diagram of the gas-liquid mixed fluid, and judge the fluid phase state. Through the establishment of the gas-liquid phase equilibrium calculation method, the change rule of the gas mole percentage under different pressure and temperature range conditions is judged, the critical temperature is determined, and the phase state diagram is drawn, which solves the non-convergence problem that easily occurs when the critical temperature is calculated in the past. It has great significance for improving the stability of the complex component gas-liquid phase equilibrium calculation algorithm and accurately determining the fluid phase state.
[0142] Optionally, as another embodiment of the application, the application determines the critical temperature according to the change rule of the gas mole percentage in the gas-liquid two-phase region based on the gas-liquid phase equilibrium calculation model, so as to draw a complete phase state diagram. Only the numerical change rule in the two-phase region is used to determine the position of the critical point, which solves the non-convergence problem that occurs when the critical parameter is calculated in the past. The critical temperature is directly determined from the two-phase region, and then the phase state diagram is drawn, which is a more simple, accurate method, and has important significance for improving the stability of the algorithm, judging the number of phases, and determining the critical parameter of the complex component.
[0143] Optionally, as another embodiment of the application, the application determines the critical temperature of the mixed component by performing gas-liquid phase equilibrium calculation, combining the change rule of the gas mole percentage in the two-phase region, and filling the numerical value of 0 or 1 in the gas or liquid single-phase region, and then draws a complete phase state diagram. The method is simple and accurate, and avoids the non-convergence problem caused by iterative calculation, which provides a basis for understanding the change of the component phase state.
[0144] Optionally, as another embodiment of the application, the application mainly includes but is not limited to the following two aspects of application:
[0145] Firstly, the critical temperature of the mixed component is determined, which provides a basis for the PVT parameter calculation of the mixture.
[0146] Secondly, a complete phase state diagram is drawn and the number of phases is judged.
[0147] Optionally, as another embodiment of the application, as shown in Figure 2 and 3 , the steps of the application are as follows:
[0148] As shown in Table 1 and Table 2, the basic parameters are collected, Table 1 is a component parameter table, and Table 2 is a binary interaction coefficient table:
[0149]
[0150] Table 1
[0151]
[0152] Table 2
[0153] 2. Calculate the critical temperature and draw the phase diagram
[0154] According to the change rule of the gas phase mole percentage in the two-phase region, as shown in Figure 2 and 3 , when the temperature is higher than 295℃, the gas mole percentage gradually increases to 1 with the increase of pressure in the gas-liquid mixed phase region, so it can be known that the critical temperature is 295℃, and then the phase diagram can be used to determine that the mixture is pure gas phase, pure liquid phase or gas-liquid mixed phase under any pressure and temperature.
[0155] Figure 4 A module block diagram of a phase diagram drawing device provided for an embodiment of the present application.
[0156] Optionally, as another embodiment of the present application, as shown in Figure 4 , a phase diagram drawing device comprises:
[0157] A parameter obtaining module is configured to obtain initial methane mole percentage and initial decane mole percentage from a fluid component sample, and import methane property parameters, decane property parameters and environmental parameters;
[0158] An analysis module is configured to analyze gas-liquid coexistence of the initial methane mole percentage, the initial decane mole percentage, the methane property parameters, the decane property parameters and the environmental parameters, and obtain a to-be-processed mole percentage parameter according to an analysis result;
[0159] A calculation module is configured to calculate fugacity of the to-be-processed mole percentage parameter, the methane property parameters, the decane property parameters and the environmental parameters, and obtain a target gas phase mole percentage according to a calculation result, return to the parameter obtaining module until a preset iteration number is reached, so as to obtain a plurality of target gas phase mole percentages;
[0160] A phase diagram obtaining module is configured to draw a plurality of the target gas phase mole percentages according to a plurality of the environmental parameters, and obtain a target phase diagram.
[0161] Optionally, as an embodiment of the present application, the methane property parameters comprise a methane eccentricity factor, a methane critical temperature, a binary interaction coefficient and a methane critical pressure, the decane property parameters comprise a decane eccentricity factor, a decane critical temperature and a decane critical pressure, and the environmental parameters comprise an environmental pressure and an environmental temperature,
[0162] The analysis module is specifically configured to:
[0163] S21: calculating an initial equilibrium constant of methane by a first formula, the initial equilibrium constant of methane being obtained by the first formula, the first formula being:
[0164]
[0165] wherein K1 is the initial equilibrium constant of methane, p c1 is the critical pressure of methane, p is the environmental pressure, ω1 is the eccentric factor of methane, T c1 is the critical temperature of methane, and T is the environmental temperature;
[0166] S22: calculating an initial equilibrium constant of decane by a second formula, the initial equilibrium constant of decane being obtained by the second formula, the second formula being:
[0167]
[0168] wherein K2 is the initial equilibrium constant of decane, p c2 is the critical pressure of decane, p is the environmental pressure, ω2 is the eccentric factor of decane, T c2 is the critical temperature of decane, and T is the environmental temperature;
[0169] S23: judging whether the initial equilibrium constant of methane, the initial mole percentage of methane, the initial equilibrium constant of decane and the initial mole percentage of decane satisfy a third formula and satisfy a fourth formula, if not, returning to the parameter obtaining module; if yes, executing S24, the third formula being:
[0170] K1z1+K2z2>1,
[0171] the fourth formula being:
[0172]
[0173] wherein K1 is the initial equilibrium constant of methane, z1 is the initial mole percentage of methane, K2 is the initial equilibrium constant of decane, and z2 is the initial mole percentage of decane;
[0174] S24: calculating the gas-liquid phase mole percentage of the initial equilibrium constant of methane, the initial mole percentage of methane, the initial equilibrium constant of decane and the initial mole percentage of decane, to obtain the initial liquid phase mole percentage, the initial gas phase mole percentage, the to-be-processed methane liquid phase mole percentage, the to-be-processed methane gas phase mole percentage, the to-be-processed decane gas phase mole percentage and the to-be-processed decane liquid phase mole percentage;
[0175] The to-be-processed mole percent parameters include the initial liquid phase mole percent, the initial gas phase mole percent, the to-be-processed methane liquid phase mole percent, the to-be-processed methane gas phase mole percent, the to-be-processed decane gas phase mole percent, and the to-be-processed decane liquid phase mole percent.
[0176] Optionally, another embodiment of the present application provides a phase state mapping system, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, a phase state mapping method as described above is implemented. The system can be a computer or the like.
[0177] Optionally, another embodiment of the present application provides a computer readable storage medium, which stores a computer program, and when the computer program is executed by a processor, a phase state mapping method as described above is implemented.
[0178] It should be noted that, in this document, the terms such as first and second are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "contain" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed or inherent to such a process, method, article or device.
[0179] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device and unit can refer to the corresponding process in the foregoing method embodiments, which will not be described here.
[0180] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0181] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., they can be located in one place, or can be distributed on a plurality of network units. According to actual needs, part or all of the units can be selected to achieve the purpose of the embodiment of the present application.
[0182] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0183] If the integrated unit is realized in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application, essentially or in the form of a contribution to the prior art, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in each embodiment of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0184] The above description is only the preferred embodiment of the present application, and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A phase portrait mapping method characterized by, The method comprises the following steps: S1: obtaining initial methane molar percentage and initial decane molar percentage from a fluid component sample, and importing methane property parameters, decane property parameters and environmental parameters; S2: analyzing gas-liquid coexistence of the initial methane molar percentage, the initial decane molar percentage, the methane property parameters, the decane property parameters and the environmental parameters, and obtaining a to-be-processed molar percentage parameter according to an analysis result; S3: calculating fugacity of the to-be-processed molar percentage parameter, the methane property parameters, the decane property parameters and the environmental parameters, setting a convergence condition according to a fugacity equality equation, and obtaining a target gas phase molar percentage according to a calculation result, returning to S1 until a preset iteration number is reached, so as to obtain a plurality of target gas phase molar percentages; S4: plotting the plurality of target gas phase molar percentages according to the plurality of environmental parameters to obtain a target phase state diagram; The environmental parameters comprise environmental pressure and environmental temperature, and the process of S4 comprises: S41: performing graphical plotting on all the environmental pressures, the environmental temperatures and all the target gas phase molar percentages with the environmental temperature as an abscissa and the environmental pressure as an ordinate to obtain an initial phase state diagram; S42: judging target gas phase molar percentages in each column of the initial phase state diagram, judging whether all the target gas phase molar percentages in a current column of the initial phase state diagram are concave with respect to the environmental pressure, if not, judging all the target gas phase molar percentages in a next column of the initial phase state diagram, if yes, taking environmental temperatures corresponding to all the target gas phase molar percentages in the current column of the initial phase state diagram as target critical temperatures, and performing S43; S43: screening a maximum value of all the environmental pressures corresponding to the target critical temperatures, and taking the screened maximum environmental pressure as a target critical pressure; S44: respectively judging environmental temperatures and environmental pressures corresponding to each target gas phase molar percentage, judging whether the environmental temperature is less than the target critical temperature and the environmental pressure is greater than the target critical pressure, if yes, taking a first preset value as an updated target gas phase molar percentage, if not, taking a second preset value as the updated target gas phase molar percentage; S45: updating the initial phase state diagram according to all the updated target gas phase molar percentages to obtain a target phase state diagram.
2. A phase portrait mapping method according to claim 1, wherein, The methane property parameters comprise a methane eccentricity factor, a methane critical temperature, a binary interaction coefficient and a methane critical pressure, the decane property parameters comprise a decane eccentricity factor, a decane critical temperature and a decane critical pressure, and the environmental parameters comprise environmental pressure and environmental temperature, The process of S2 comprises: S21: calculating an initial equilibrium constant of the methane eccentricity factor, the methane critical temperature, the environmental pressure, the environmental temperature and the methane critical pressure by a first formula to obtain an initial methane equilibrium constant, the first formula being: , wherein, is a methane equilibrium constant initial value, is a methane critical pressure, is an ambient pressure, is a methane eccentricity factor, is a methane critical temperature, is an ambient temperature; S22: calculating an initial decane equilibrium constant by a second formula, the initial decane equilibrium constant being calculated according to the decane eccentricity factor, the decane critical temperature, the environmental pressure, the environmental temperature and the decane critical pressure, the second formula being: , wherein, Kc is the initial value of the equilibrium constant for decane, Pc is the critical pressure for decane, P is the ambient pressure, Ec is the eccentricity factor for decane, Tc is the critical temperature for decane, T is the ambient temperature; S23: judging whether the initial methane equilibrium constant, the initial methane molar percentage, the initial decane equilibrium constant and the initial decane molar percentage satisfy a third formula and satisfy a fourth formula, if not, returning to S1, if yes, executing S24, the third formula being: , The fourth formula being: , wherein, K0is an initial value for the methane equilibrium constant, X0is an initial mole percent of methane, K0is an initial value for the decane equilibrium constant, X0is an initial mole percent of decane; S24: calculating the gas-liquid phase molar percentages of the initial methane equilibrium constant, the initial methane molar percentage, the initial decane equilibrium constant and the initial decane molar percentage, to obtain initial liquid molar percentage, initial gas molar percentage, to-be-processed methane liquid molar percentage, to-be-processed methane gas molar percentage, to-be-processed decane gas molar percentage and to-be-processed decane liquid molar percentage; The to-be-processed molar percentage parameters include the initial liquid molar percentage, the initial gas molar percentage, the to-be-processed methane liquid molar percentage, to-be-processed methane gas molar percentage, the to-be-processed decane gas molar percentage and the to-be-processed decane liquid molar percentage.
3. A phase portrait mapping method according to claim 2, wherein, The process of S24 includes: calculating the gas-liquid phase molar percentages of the initial methane equilibrium constant, the initial methane molar percentage, the initial decane equilibrium constant and the initial decane molar percentage by a first equation set, to obtain initial liquid molar percentage, initial gas molar percentage, to-be-processed methane liquid molar percentage, to-be-processed methane gas molar percentage, to-be-processed decane gas molar percentage and to-be-processed decane liquid molar percentage, the first equation set being: , wherein, is the initial gas phase mole percent, is the initial liquid phase mole percent, is the liquid phase mole percent of methane to be treated, is the gas phase mole percent of methane to be treated, is the initial mole percent of methane, is the liquid phase mole percent of decane to be treated, is the gas phase mole percent of decane to be treated, is the initial mole percent of decane, is the initial value of the methane equilibrium constant, is the initial value of the decane equilibrium constant.
4. The phase portrait mapping method of claim 2, wherein, In S3, the process of calculating the fugacity of the to-be-processed molar percentage parameters, the methane property parameters, the decane property parameters and the environmental parameters and obtaining the target gas molar percentage according to the calculation result includes: S31: calculating the fugacity of the methane eccentricity factor, the methane critical temperature, the methane critical pressure, the decane eccentricity factor, the decane critical temperature, the decane critical pressure, the environmental pressure, the environmental temperature, the to-be-processed methane liquid molar percentage, the to-be-processed methane gas molar percentage, the to-be-processed decane gas molar percentage and the to-be-processed decane liquid molar percentage, to obtain methane liquid fugacity, methane gas fugacity, decane liquid fugacity and decane gas fugacity; S32: judging whether the methane liquid fugacity, the methane gas fugacity, the decane liquid fugacity and the decane gas fugacity satisfy a fifth formula, if not, executing S33, if yes, taking the initial gas molar percentage as the target gas molar percentage, the fifth formula being: , wherein, is the methane gas phase fugacity, is the methane liquid phase fugacity, is the decane gas phase fugacity, is the decane liquid phase fugacity; S33: judging whether a preset fugacity calculation number is reached, if not, executing S34 to S35, if yes, taking a first preset value as the target gas molar percentage; S34: updating the initial value of the equilibrium constant of the methane liquid fugacity and the methane gas fugacity by a sixth formula, to obtain an updated initial value of the methane equilibrium constant, the sixth formula being: , wherein, is the updated initial value of the methane equilibrium constant, is the methane gas phase fugacity coefficient, is the methane liquid phase fugacity coefficient; S35: updating the initial value of the equilibrium constant of the decane liquid fugacity and the decane gas fugacity by a seventh formula, to obtain an updated initial value of the decane equilibrium constant, and returning to S23, the seventh formula being: , wherein, is the updated decane equilibrium constant initial value, is the decane gas phase fugacity coefficient, is the decane liquid phase fugacity coefficient.
5. A phase portrait mapping method according to claim 4, wherein, The process of S31 comprises: comprising a second equation group by eighth formula to seventeenth formula, calculating the fugacity of the methane eccentric factor, the methane critical temperature, the methane critical pressure, the decane eccentric factor, the decane critical temperature, the decane critical pressure, the environment pressure, the environment temperature, the to-be-processed methane liquid mole percentage, the to-be-processed methane gas mole percentage, the to-be-processed decane gas mole percentage and the to-be-processed decane liquid mole percentage by the second equation group, to obtain the methane liquid fugacity, the methane gas fugacity, the decane liquid fugacity and the decane gas fugacity, the eighth formula being: , The ninth formula being: , The tenth formula being: , The eleventh formula being: , The twelfth formula being: , The thirteenth formula being: , The fourteenth formula being: , The fifteenth formula being: , The sixteenth formula being: , The seventeenth formula being: , wherein , , , , wherein, is the methane gas phase fugacity, is the decane gas phase fugacity, is the methane liquid phase fugacity, is the decane liquid phase fugacity, is the methane gas phase fugacity coefficient, is the decane gas phase fugacity coefficient, is the methane liquid phase fugacity coefficient, is the decane liquid phase fugacity coefficient, is the methane liquid phase mole fraction to be treated, is the methane gas phase mole fraction to be treated, is the decane liquid phase mole fraction to be treated, is the decane gas phase mole fraction to be treated, is the decane critical pressure, is the ambient pressure, is the decane acentric factor, is the decane critical temperature, is the ambient temperature, is the methane critical pressure, is the methane acentric factor, is the methane critical temperature, is a constant, is the gas phase compressibility factor, is the liquid phase compressibility factor, is the mixture gas, is the mixture liquid, is the binary interaction coefficient, is the methane deviation factor function, is the decane deviation factor function.
6. A phase portrait mapping device characterized by, comprising: a parameter obtaining module, configured to obtain initial methane mole percentage and initial decane mole percentage from a fluid component sample, and import methane property parameters, decane property parameters and environment parameters; an analysis module, configured to analyze the initial methane mole percentage, the initial decane mole percentage, the methane property parameters, the decane property parameters and the environment parameters for gas-liquid coexistence, and obtain to-be-processed mole percentage parameters according to an analysis result; a calculation module, configured to calculate the fugacity of the to-be-processed mole percentage parameters, the methane property parameters, the decane property parameters and the environment parameters, set a convergence condition according to a fugacity equality, and obtain target gas mole percentages according to a calculation result, return to the parameter obtaining module until a preset iteration number is reached, so as to obtain a plurality of target gas mole percentages; a phase diagram obtaining module, configured to plot the plurality of target gas mole percentages according to a plurality of the environment parameters, to obtain a target phase diagram; The environment parameters comprise environment pressure and environment temperature, and the phase diagram obtaining module is specifically configured to: S41: plot all the environment pressures, the environment temperatures and all the target gas mole percentages by taking the environment temperature as the horizontal coordinate and the environment pressure as the vertical coordinate, to obtain an initial phase diagram; S42: judge the target gas mole percentages of each column in the initial phase diagram, judge whether all the target gas mole percentages of a current column in the initial phase diagram are concave with the environment pressure, if not, judge all the target gas mole percentages of a next column in the initial phase diagram, if yes, take the environment temperature corresponding to all the target gas mole percentages of the current column in the initial phase diagram as a target critical temperature, and execute S43; S43: screen out the maximum value of all the environmental pressures corresponding to the target critical temperature, and take the screened maximum environmental pressure as a target critical pressure; S44: respectively judge the environmental temperature and the environmental pressure corresponding to each of the target gas phase mole percentages, judge whether the environmental temperature is less than the target critical temperature and the environmental pressure is greater than the target critical pressure, if yes, take a first preset value as an updated target gas phase mole percentage; if not, take a second preset value as the updated target gas phase mole percentage; S45: update the initial phase diagram according to all the updated target gas phase mole percentages, to obtain a target phase diagram.
7. A phase portrait plotting device according to claim 6, wherein, The methane property parameters include a methane eccentricity factor, a methane critical temperature, a binary interaction coefficient and a methane critical pressure, the decane property parameters include a decane eccentricity factor, a decane critical temperature and a decane critical pressure, and the environmental parameters include an environmental pressure and an environmental temperature, The analysis module is specifically used for: S21: calculating an initial equilibrium constant value of the methane eccentricity factor, the methane critical temperature, the environmental pressure, the environmental temperature and the methane critical pressure by a first formula, to obtain a methane initial equilibrium constant value, the first formula being: , wherein, is the initial value of the methane equilibrium constant, is the methane critical pressure, is the ambient pressure, is the methane eccentricity factor, is the methane critical temperature, is the ambient temperature; S22: calculating an initial equilibrium constant value of the decane eccentricity factor, the decane critical temperature, the environmental pressure, the environmental temperature and the decane critical pressure by a second formula, to obtain a decane initial equilibrium constant value, the second formula being: , wherein, Kd is the initial value of the decane equilibrium constant, Pc is the critical pressure of decane, P is the ambient pressure, Ec is the eccentricity factor of decane, Tc is the critical temperature of decane, T is the ambient temperature; S23: judging whether the methane initial equilibrium constant value, the initial methane mole percentage, the decane initial equilibrium constant value and the initial decane mole percentage satisfy a third formula and satisfy a fourth formula, if not, returning to the parameter obtaining module; if yes, executing S24, the third formula being: , The fourth formula being: , wherein, K0 is an initial value for the methane equilibrium constant, X0 is an initial mole percent of methane, K0 is an initial value for the decane equilibrium constant, X0 is an initial mole percent of decane; S24: calculating the gas-liquid phase mole percentages of the methane initial equilibrium constant value, the initial methane mole percentage, the decane initial equilibrium constant value and the initial decane mole percentage, to obtain an initial liquid phase mole percentage, an initial gas phase mole percentage, a to-be-processed methane liquid phase mole percentage, a to-be-processed methane gas phase mole percentage, a to-be-processed decane gas phase mole percentage and a to-be-processed decane liquid phase mole percentage; The to-be-processed mole percentage parameters include the initial liquid phase mole percentage, the initial gas phase mole percentage, the to-be-processed methane liquid phase mole percentage, the to-be-processed methane gas phase mole percentage, the to-be-processed decane gas phase mole percentage and the to-be-processed decane liquid phase mole percentage.
8. A phase portrait plotting system comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, a phase diagram drawing method as claimed in any one of claims 1 to 5 is implemented.
9. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 8. When the computer program is executed by the processor, a phase diagram drawing method as claimed in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Method for predicting solubility of CO2 in NaCl aqueous solution based on CPA state equation
CN113539387A
Crude oil phase diagram fitting method and system based on trust region method
CN114818520A