PC-SAFT state equation solving method and related device

By combining inverse quadratic interpolation method, separating method and dichotomy mixed algorithm, the success rate and efficiency of PC-SAFT state equation are improved, the problem of low solution efficiency in the existing technology is solved, and efficient compression factor is achieved calculate.

CN119207594AActive Publication Date: 2024-12-27QINGDAO UNIV OF SCI & TECH

Patent Information

Application Number
CN202411206638.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2024-12-27
Estimated Expiration
2044-08-30

AI Technical Summary

Technical Problem

The existing PC-SAFT state equation solution method has low success rate and efficiency, making it difficult to meet the needs of chemical separation simulation calculation.

Method used

A mixed algorithm combining inverse quadratic interpolation method, separating method and dichotomy method is used to improve the resolution success rate and efficiency of PC-SAFT state equation by randomly taking values ​​and iteratively updating the fill number until it meets the iteration termination condition.

Benefits of technology

It improves the success rate and efficiency of solving PC-SAFT state equations, realizes efficient compression factor calculation, reduces the solution time, and has important practical value.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119207594A_ABST
    Figure CN119207594A_ABST
Patent Text Reader

Abstract

The invention discloses a PC-SAFT state equation solving method and a related device, and relates to the technical field of chemical separation simulation calculation, random valuing is carried out in an initial value range of a filling score of a target substance to obtain a first value of the filling score, a first compression factor is further calculated by using a PC-SAFT state equation, and a second value of the filling score is calculated by using a PC-SAFT state equation to obtain a second compression factor; calculating by utilizing a relational expression between the pressure and the compression factor to obtain a first calculation pressure, judging whether an iteration termination condition is met or not, if not, determining a second value of the filling score by combining an inverse quadratic interpolation method, a secant method and a dichotomy, updating the filling score until the iteration termination condition is met, determining the compression factor corresponding to the target substance, and determining the compression factor corresponding to the target substance; the combination of different solving algorithms can improve the success rate and efficiency of PC-SAFT state equation solving.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of chemical separation simulation calculation, and in particular to a method for solving a PC-SAFT state equation and a related device. Background Art

[0002] Chemical thermodynamics is the basis of research, development and design work in the chemical industry. The equation of state (EoS) is an analytical expression used to describe the relationship between P (pressure)-V (volume)-T (temperature) of a fluid (which is a general term for vapor and liquid) in an equilibrium state. It is widely used in simulation calculations in the chemical industry (such as chemical thermodynamics and chemical processes). For example, in the process of chemical separation simulation calculation, the condition for judging whether the simulation calculation is over is that the fugacity corresponding to the vapor phase composition is equal to the fugacity corresponding to the liquid phase composition. If the fugacity is to be calculated, the compression factor must be calculated first, and then the fugacity coefficient must be calculated based on the compression factor, and finally the fugacity must be calculated based on the fugacity coefficient. At present, the compression factor is often calculated by solving the PC-SAFT (Perturbed-Chain Statistical Associating Fluid Theory) state equation.

[0003] However, the solution of the PC-SAFT state equation requires an iterative calculation method. The existing solution methods have a low success rate and low solution efficiency. Therefore, a high success rate and efficient solution method is urgently needed to promote the widespread application of the PC-SAFT state equation. Summary of the invention

[0004] The purpose of this application is to provide a method and related device for solving the PC-SAFT state equation, which can improve the success rate and efficiency of solving the PC-SAFT state equation.

[0005] To achieve the above objectives, this application provides the following solutions:

[0006] In a first aspect, the present application provides a method for solving a PC-SAFT state equation, the method for solving a PC-SAFT state equation comprising:

[0007] Setting an initial value range of the filling fraction of the target substance; the composition of the target substance is a vapor phase composition or a liquid phase composition obtained by simulating the separation process of the substance to be separated;

[0008] Randomly select a value within the initial value range to obtain a first value of the filling fraction;

[0009] The first value is used as input, and a first compression factor is calculated using the PC-SAFT state equation; the model parameters of the PC-SAFT state equation are determined based on the components in the target substance;

[0010] Taking the first compression factor as input, a first calculated pressure is calculated using a relationship between pressure and compression factor;

[0011] Based on the first calculated pressure, determining whether an iteration termination condition is satisfied;

[0012] If yes, the iteration ends, and the first compression factor is used as the compression factor corresponding to the target substance;

[0013] If not, the second value of the filling fraction is determined by combining the inverse quadratic interpolation method, the secant method and the bisection method, and the initial value range is adjusted to obtain the adjusted value range. The second value is used as input and the second compression factor is calculated using the PC-SAFT state equation. The second compression factor is used as input and the second calculated pressure is calculated using the relationship between pressure and compression factor. The second value, the second compression factor and the second calculated pressure are used as the first value, the first compression factor and the first calculated pressure of the next iteration, and the step of "based on the first calculated pressure, determining whether the iteration termination condition is met" is returned.

[0014] In a second aspect, the present application provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-mentioned PC-SAFT state equation solving method.

[0015] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the above-mentioned method for solving the PC-SAFT state equation when executed by a processor.

[0016] In a fourth aspect, the present application provides a computer program product, including a computer program, which implements the above-mentioned PC-SAFT state equation solving method when executed by a processor.

[0017] In a fifth aspect, the present application provides a computer system, comprising:

[0018] A jump interface is connected to the simulation software, and is used to input a command to continue the simulation and the conditions for the simulation calculation, or an instruction to stop the simulation, to the simulation software, and to obtain the vapor phase composition and liquid phase composition output by the simulation software; the simulation software is used to stop the simulation calculation when receiving the instruction to stop the simulation; when receiving the instruction to continue the simulation, the separation process of the input substance to be separated is simulated and calculated based on the conditions for the simulation calculation, and the vapor phase composition and liquid phase composition are output;

[0019] A processor is connected to the jump interface and is used to use the vapor phase composition and the liquid phase composition as the composition of the target substance, execute the above-mentioned PC-SAFT state equation solving method, and obtain the compression factor corresponding to the vapor phase composition and the compression factor corresponding to the liquid phase composition; based on the compression factor corresponding to the vapor phase composition, calculate the fugacity coefficient corresponding to the vapor phase composition, based on the fugacity coefficient corresponding to the vapor phase composition, calculate the fugacity corresponding to the vapor phase composition, based on the compression factor corresponding to the liquid phase composition, calculate the fugacity coefficient corresponding to the liquid phase composition, and based on the fugacity coefficient corresponding to the liquid phase composition, calculate the fugacity corresponding to the liquid phase composition; determine whether the fugacity corresponding to the vapor phase composition and the fugacity corresponding to the liquid phase composition are equal; if so, send a command to stop the simulation to the jump interface; if not, send a command to continue the simulation to the jump interface.

[0020] According to the specific embodiments provided in this application, this application discloses the following technical effects:

[0021] The present application provides a method and related device for solving a PC-SAFT state equation, wherein a random value is taken within an initial value range of a filling fraction of a target substance to obtain a first value of the filling fraction, and a first compression factor is further calculated using the PC-SAFT state equation, and a first calculated pressure is calculated using a relationship between pressure and the compression factor to determine whether an iteration termination condition is met. If not, a second value of the filling fraction is determined by combining the inverse quadratic interpolation method, the secant method, and the bisection method to update the filling fraction until the iteration termination condition is met. At this time, the first compression factor is used as the compression factor corresponding to the target substance. In the process of solving the compression factor, the present application combines the inverse quadratic interpolation method, the secant method, and the bisection method to update the filling fraction, which can connect different solution algorithms, has a high solution success rate, and can improve the solution efficiency, thereby improving the success rate and efficiency of solving the PC-SAFT state equation. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0023] Figure 1 This is an application environment diagram of a PC-SAFT state equation solving method provided in Example 1 of the present application.

[0024] Figure 2 A detailed flow chart of a method for solving the PC-SAFT state equation provided in Example 1 of the present application.

[0025] Figure 3 A schematic diagram of the structure of a computer device provided in Example 2 of the present application. DETAILED DESCRIPTION

[0026] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0027] Example 1

[0028] The PC-SAFT state equation solving method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown, the terminal communicates with the server through the network. The data storage system can store the data that the server needs to process. The data storage system can be set up separately, integrated on the server, or placed on the cloud or other servers. The terminal can send the target substance to be processed to the server. After the server receives the target substance to be processed, the server sets an initial value range of the filling fraction of the target substance to be processed; randomly selects values ​​within the initial value range to obtain a first value of the filling fraction; uses the first value as input and uses the PC-SAFT state equation to calculate a first compression factor; uses the first compression factor as input and uses the relationship between pressure and compression factor to calculate a first calculated pressure; based on the first calculated pressure, it is determined whether the iteration termination condition is met; if so, the iteration is terminated and the first compression factor is used as the compression factor corresponding to the target substance; if not, the second value of the filling fraction is determined by combining the inverse quadratic interpolation method, the secant method and the bisection method, and the initial value range is adjusted to obtain an adjusted value range, uses the second value as input and uses the PC-SAFT state equation to calculate a second compression factor, uses the second compression factor as input and uses the relationship between pressure and compression factor to calculate a second calculated pressure, uses the second value, the second compression factor and the second calculated pressure as the first value, the first compression factor and the first calculated pressure of the next iteration, and returns to the step of "based on the first calculated pressure, determining whether the iteration termination condition is met". The server can feed back the obtained compression factor corresponding to the target substance to the terminal.

[0029] In addition, in some embodiments, the PC-SAFT state equation solving method can also be implemented independently by a server or a terminal. For example, the terminal can directly process the target substance to be processed, or the server can obtain the target substance to be processed from the data storage system and process the target substance to be processed.

[0030] The terminal may be, but is not limited to, various desktop computers, laptops, smart phones, tablet computers, IoT devices, and portable wearable devices. The server may be implemented as an independent server or a server cluster consisting of multiple servers, or may be a cloud server.

[0031] like Figure 2 As shown, a method for solving the PC-SAFT state equation is provided. The method is executed by a computer device, and can be executed by a computer device such as a terminal or a server alone, or can be executed by a terminal and a server together. In the embodiment of the present application, the method is applied to Figure 1 Taking the server in as an example, the PC-SAFT state equation solving method includes the following steps:

[0032] Step S1, setting an initial value range of the filling fraction of the target substance; the composition of the target substance is a vapor phase composition or a liquid phase composition obtained by simulating the separation process of the substance to be separated.

[0033] Step S2, randomly selecting a value within the initial value range to obtain a first value of the filling fraction.

[0034] Step S3, using the first value as input, and using the PC-SAFT state equation to calculate a first compression factor; the model parameters of the PC-SAFT state equation are determined based on the components in the target substance.

[0035] Step S4: taking the first compression factor as input, and calculating a first calculated pressure using a relationship between pressure and compression factor.

[0036] Step S5: based on the first calculated pressure, determine whether an iteration termination condition is met.

[0037] Step S6: If yes, then the iteration ends and the first compression factor is used as the compression factor corresponding to the target substance.

[0038] Step S7, if not, determine the second value of the filling fraction by combining the inverse quadratic interpolation method, the secant method and the bisection method, and adjust the initial value range to obtain the adjusted value range, use the second value as input, and use the PC-SAFT state equation to calculate the second compression factor, use the second compression factor as input, and use the relationship between pressure and compression factor to calculate the second calculated pressure, use the second value, the second compression factor and the second calculated pressure as the first value, the first compression factor and the first calculated pressure of the next iteration, and return to the step of "based on the first calculated pressure, determine whether the iteration termination condition is met".

[0039] Implement the above steps S1 to S7. This embodiment uses a hybrid algorithm to solve the PC-SAFT state equation, a nonlinear equation, to obtain a compression factor. In the process of solving the compression factor, each time the second value of the filling fraction is determined in an iteration, the inverse quadratic interpolation method is first used for calculation. If the inverse quadratic interpolation method fails, the secant method is used for calculation. If the secant method fails, the bisection method is used for calculation, that is, the inverse quadratic interpolation method, the secant method and the bisection method are combined to determine the second value of the filling fraction to update the filling fraction. This application has a high success rate in solving the PC-SAFT state equation through a hybrid algorithm, strong robustness, and can improve the solution efficiency and reduce the solution time, and has important practical value.

[0040] The origin of the state equation can be traced back to 1873, when Van der Waals proposed the cubic state equation, but this cubic state equation is only applicable to simple gases. In 1949, Redlich and Kwong modified the gravitational term of the VDW (Van Der Waals) state equation and proposed the RK (Redlich-Kwong) state equation applicable to non-polar symmetrical molecular systems. In 1972, Soave introduced the eccentricity factor on the basis of the RK state equation and proposed the SRK (Soave-Redlich-Kwong) state equation, making the SRK state equation more widely applicable. In 1976, Peng and Robinson improved the gravitational term of the RK state equation and proposed the PR (Peng-Robinson) state equation. The PR state equation and the SRK state equation have relatively accurate prediction results for the phase equilibrium and thermodynamic properties of non-polar and weakly polar molecular systems. As the research system becomes more and more complex, the classical cubic state equation is difficult to meet the requirements of polar, associative, polymer and other systems for the accuracy of thermodynamic prediction results. In the 1980s, Wertheim proposed the statistical associating fluid theory, and Chapman proposed the SAFT (Statistical Associating Fluid Theory) model based on the statistical associating fluid theory, which can more accurately describe the interaction of intermolecular forces, such as hydrogen bonds and ionic bonds. The SAFT model is suitable for describing and predicting the physical properties of liquid mixtures, such as density, compressibility factor and chemical potential. In 2001, Gross proposed the PC-SAFT state equation, which is suitable for describing the thermodynamic properties of polymers and macromolecular systems, and is widely used in the phase behavior and thermodynamic properties of complex fluid systems.

[0041] Iterative calculation methods are required to solve the PC-SAFT state equation. Efficient and accurate solution algorithms are conducive to promoting the widespread application of the PC-SAFT state equation. There are many methods for solving nonlinear equations, such as Newton iteration method, bisection method, golden section method, trial position method, inverse quadratic interpolation method, etc. Among them, the Newton iteration method was first proposed by British mathematician John Newton in the 17th century. This method is widely used in computer science, mathematics, physics and engineering. After a long period of development, researchers have proposed a series of classic improved Newton methods, including midpoint Newton method, Newton downhill method, secant method, parabola method, etc. The proposers of PC-SAFT, Gross, Nichita, Solms, etc., used the Newton iteration method to iteratively solve the density root of the mixture under a given pressure; Privat, Sánchez, etc. used the Newton iteration method to solve the density root of the PC-SAFT state equation; Xu Shenjun, etc. used the method of simultaneous equations to solve the PC-SAFT state equation. However, the existing solution methods have a low success rate and low solution efficiency. This embodiment is based on the Newton algorithm, combined with the inverse quadratic interpolation method, the secant method and the bisection method, to establish a new hybrid algorithm to solve the nonlinear equation of the PC-SAFT state equation, and use different materials to test the solution ability of the hybrid algorithm.

[0042] In S1, the initial value range of the independent variable, the filling fraction η of the target substance, is first set [x min , x max ], x min is the minimum value, x max is the maximum value. The target substance can be determined according to user needs. The target substance can be a pure substance or a mixture. When applied to the field of chemical separation, the composition of the target substance can be the vapor phase composition or liquid phase composition obtained by simulating the separation process of the substance to be separated. The composition includes specific components and the content of each component. The filling fraction is the density of the contrast segment of the target substance. The initial value range of the filling fraction can be determined according to the vapor phase state or liquid phase state of the substance.

[0043] In S2, in the initial value range [x min , x max ] and randomly selects a value within the initial value range as the initial value to obtain the first value of the filling score.

[0044] In S3, the first value is taken as input and the first compression factor corresponding to the first value is calculated using the PC-SAFT state equation.

[0045] The model parameters of the PC-SAFT state equation are determined based on the components in the target substance. The PC-SAFT state equation is specifically:

[0046] Z=1+Z chain +Z disp +Z assoc (1)

[0047] In formula (1), Z is the compression factor; Z chain is the compression factor of the hard chain term, the superscript chain represents the chain; Z disp is the dispersion term compression factor, the superscript disp represents dispersion; Z assoc is the compression factor of the association term. The superscript assoc means association.

[0048] The calculation formula of the hard chain item compression factor is:

[0049]

[0050] In formula (2), is the average number of segments; Z hs is the hard sphere compression factor, the superscript hs represents hard sphere; i is the molecule i in the target substance; x i is the composition of molecule i; m i is the number of segments of molecule i; is the radial distribution function, which is a function that describes the interaction strength between molecules at a distance r and reflects the spatial distribution between molecules; ρ is the number density of the target substance.

[0051] The hard ball compression factor is calculated as:

[0052]

[0053] In formula (3), ξ0, ξ1, ξ2, ξ3 are all functions of the number of segments and the segment diameter.

[0054] The calculation formula of the dispersion term compression factor is:

[0055]

[0056] In formula (4), η is the filling fraction of the target material; I1 and I2 are both soft repulsion forces, which are functions of temperature; m is the number of segments; ε is the segment energy; σ is the segment diameter; C1 and C2 are functions related to the number of segments and the filling fraction.

[0057] The calculation formula of the association term compression factor is:

[0058]

[0059] In the above formula, x i is the composition of molecule i; j is molecule j in the target substance; ρ j is the molar density of molecule j; A j is site A on molecule j; is the occupancy fraction of site A on molecule i; A i is site A on molecule i; ρ i is the molar density of molecule i; is the occupancy fraction of site A on molecule j; N AV is Avogadro's constant; B j is site B on molecule j; is the occupancy fraction of site B on molecule j; is the association strength between site A on molecule i and site B on molecule j.

[0060] After the target substance is determined, all parameters except the filling fraction in the above PC-SAFT state equation are known. Then, the compression factor can be calculated using the PC-SAFT state equation with the filling fraction as input. The iterative calculation process of this embodiment continuously updates the value of the filling fraction until the iteration termination condition is reached to determine the compression factor corresponding to the target substance.

[0061] In S4, the first compression factor is used as input, and a first calculated pressure corresponding to the first compression factor is calculated using a relationship between pressure and compression factor.

[0062] The relationship between pressure and compressibility factor is:

[0063] P=ZkTρ(7)

[0064] In formula (7), P is the calculated pressure; Z is the compressibility factor corresponding to the target substance; k is the Boltzmann constant; T is the temperature, which is a given value; and ρ is the number density of the target substance.

[0065] With the compressibility factor as input, the calculated pressure can be calculated using formula (7).

[0066] In S5, based on the first calculated pressure, it is determined whether an iteration termination condition is satisfied.

[0067] The iteration termination condition (also called the convergence condition) is that the absolute value of the difference between the calculated pressure and the given pressure is less than the convergence tolerance, that is, |PP sys |<ε, where P is the calculated pressure, P sys is the given pressure and ε is the convergence tolerance.

[0068] Based on the first calculated pressure, judging whether the iteration termination condition is met is to judge whether the first calculated pressure satisfies |PP sys |<ε, specifically including: if the absolute value of the difference between the first calculated pressure and the given pressure is less than the convergence tolerance, the iteration termination condition is met and the calculation is stopped at this time.

[0069] In S6, if yes, that is, the iteration termination condition is satisfied, the iteration is terminated and the first compression factor is used as the compression factor corresponding to the target substance.

[0070] In S7, if not, that is, the iteration termination condition is not met, the second value of the filling fraction is determined by combining the inverse quadratic interpolation method, the secant method and the bisection method, and the initial value range is adjusted to obtain the adjusted value range. The second value is used as input, and the second compression factor corresponding to the second value is calculated using the PC-SAFT state equation. The second compression factor is used as input, and the second calculated pressure corresponding to the second compression factor is calculated using the relationship between pressure and compression factor. The second value, the second compression factor and the second calculated pressure are used as the first value, the first compression factor and the first calculated pressure of the next iteration, and the step of "determining whether the iteration termination condition is met based on the first calculated pressure" is returned.

[0071] This embodiment combines the advantages of the inverse quadratic interpolation method, the secant method and the bisection method to obtain a hybrid algorithm. The inverse quadratic interpolation method is first used to calculate, and the first difference between the first calculated pressure and the given pressure is calculated, and the minimum difference between the minimum calculated pressure corresponding to the minimum value of the initial value range and the given pressure is calculated. The maximum difference between the maximum calculated pressure corresponding to the maximum value of the initial value range and the given pressure is calculated. If the first difference, the minimum difference and the maximum difference are the same during the calculation process of the inverse quadratic interpolation method, the calculation fails and the secant method is used for calculation. If the filling score updated by the secant method exceeds the value range of the filling score, the calculation fails and the bisection method is used for calculation within the value range of the filling score until the iteration termination condition is reached.

[0072] Then, in S7, the second value of the filling fraction is determined by combining the inverse quadratic interpolation method, the secant method and the bisection method, which specifically includes:

[0073] (1) The maximum value and the minimum value of the initial value range are taken as input respectively, and the maximum compression factor corresponding to the maximum value and the minimum compression factor corresponding to the minimum value are calculated using the PC-SAFT state equation.

[0074] (2) The maximum compression factor and the minimum compression factor are respectively used as inputs, and the relationship between pressure and compression factor is used to calculate the maximum calculated pressure corresponding to the maximum compression factor and the minimum calculated pressure corresponding to the minimum compression factor.

[0075] (3) Calculate the difference between the minimum calculated pressure and the given pressure to obtain the minimum difference; calculate the difference between the first calculated pressure and the given pressure to obtain the first difference; calculate the difference between the maximum calculated pressure and the given pressure to obtain the maximum difference.

[0076] (4) Determine whether the minimum difference, the first difference, and the maximum difference are all unequal to obtain a first determination result.

[0077] (5) If the first judgment result is yes, the second value of the filling fraction is determined using the inverse quadratic interpolation method.

[0078] If f(x min )≠f(x1)≠f(x max ), then the second value x2 is calculated by inverse quadratic interpolation, f(x min ) is the minimum difference, x min is the minimum value of the initial value range, f(x1) is the first difference, x1 is the first value, f(x max ) is the maximum difference, x max The maximum value in the initial value range.

[0079] The second value of the filling fraction is determined by inverse quadratic interpolation, specifically including: taking the minimum value, the first value, the maximum value, the minimum difference, the first difference and the maximum difference as input, and determining the second value of the filling fraction by using an interpolation formula.

[0080] The interpolation formula is:

[0081]

[0082] In formula (8), x2 is the second value; f(x1) is the first difference; f(x max ) is the maximum difference; f(x min ) is the minimum difference; x min is the minimum value; x1 is the first value; x max The maximum value.

[0083] (6) If the first judgment result is no, the available values ​​of the filling score are determined using the secant method, and it is determined whether the available values ​​are within the initial value range to obtain a second judgment result.

[0084] The available values ​​of the filling fraction are determined by using the secant method, specifically including: taking the minimum value, the minimum difference, the maximum value and the maximum difference as inputs, and using the secant formula to determine the available values ​​of the filling fraction.

[0085] The secant line formula is:

[0086]

[0087] In formula (9), Available values.

[0088] judge Is it within the initial value range [x min , x max ] to obtain the second judgment result.

[0089] (7) If the second judgment result is yes, the available value is used as the second value of the filling score.

[0090] (8) If the second judgment result is no, the second value of the filling score is determined by using the binary search method.

[0091] The second value of the filling fraction is determined by using the dichotomy method, specifically including:

[0092] 1) Calculate the product of the maximum difference and the minimum difference, and determine whether the product is less than 0.

[0093] 2) If so, calculate the middle value of the initial value range and use the middle value as the second value of the filling score.

[0094] The middle value is the midpoint of the initial value range.

[0095] 3) If not, the solution fails and the iteration ends.

[0096] This embodiment adopts a hybrid algorithm to solve the PC-SAFT state equation. The inverse quadratic interpolation method is used for calculation first. If the calculation fails, the secant method is automatically used for calculation. If the secant method fails, the binary method is directly used for calculation. The hybrid algorithm realizes the automatic connection of different solution algorithms, ensures the success rate and calculation efficiency of solving nonlinear equations, and uses the above hybrid algorithm to solve the PC-SAFT state equation to solve the problem of solving the compression factor of the PC-SAFT state equation.

[0097] In S7, the initial value range is adjusted to obtain an adjusted value range, which specifically includes:

[0098] (1) Calculate the product of the minimum difference and the first difference to obtain the first product.

[0099] (2) Calculate the product of the first difference and the maximum difference to obtain a second product.

[0100] (3) If the first product is less than 0, an adjusted value range is determined based on the minimum value and the first value, the minimum value of the adjusted value range is the minimum value, and the maximum value of the adjusted value range is the first value.

[0101] (4) If the second product is less than 0, an adjusted value range is determined based on the first value and the maximum value, the minimum value of the adjusted value range is the first value, and the maximum value of the adjusted value range is the maximum value.

[0102] (5) If the first product and the second product are both greater than 0 or both less than 0, the calculation fails.

[0103] Hereinafter, this embodiment uses experiments to verify the good effect of the PC-SAFT state equation solving method of this embodiment:

[0104] The type of material to be studied using the PC-SAFT state equation solution method is selected, and the PC-SAFT state equation is iteratively solved using a hybrid algorithm including the inverse quadratic interpolation method, the secant method, and the bisection method. Specifically, by giving an initial value of the filling fraction, under the set conditions of temperature, pressure, and material composition, the hard sphere term compression factor, the hard chain term compression factor, the dispersion term compression factor, and the association term compression factor are calculated respectively. According to P=ZkTρ, the calculated pressure is calculated, and the filling fraction is iteratively updated by the hybrid algorithm until the absolute value of the difference between the calculated pressure and the given pressure is less than the convergence tolerance, that is, when |PP sys |<10 -6 At this time, ε=10 -6 , meet the convergence conditions, get the compression factor, and verify the success rate, calculation time, and number of iterations of the hybrid algorithm by calculating different components.

[0105] The experimental process specifically includes:

[0106] (1) 31 substances including gases, hydrocarbons, alcohols, and amines were selected, and the model parameters of the PC-SAFT state equation corresponding to the 31 substances were collected.

[0107] (2) Given the initial filling fraction value, the initial filling fraction value of the liquid phase is η0 = 0.5, and the initial filling fraction value of the vapor phase is η0 = 1 × 10 -10 .

[0108] (3) Taking the filling fraction as input, the compression factor Z is calculated using the PC-SAFT state equation.

[0109] (4) According to P = ZkTρ, the calculated pressure is obtained.

[0110] (5) According to |PP sys |<10 -6 , determine whether it converges. If the convergence condition is met, end the calculation and get the compression factor. Otherwise, use the hybrid algorithm to iteratively update the filling fraction η and return to (3).

[0111] (6) Compare the number of iterations, calculation time, and result accuracy of using the hybrid algorithm to update the filling fraction η and using other algorithms to update the filling fraction η.

[0112] (7) Iteration number test results.

[0113] The number of iterations was tested for the selected 31 substances, and the test results are shown in Table 1.

[0114] Table 1 Test results of the number of iterations when solving the compression factor Z

[0115]

[0116] In Table 1, the unit of the number of iterations is times, / represents that the number of iterations exceeds 3000 times; NAN represents that a non-number occurs during the calculation process; / and NAN both represent solution failure.

[0117] As shown in Table 1, the secant method, bisection method and trial position method may have more than 3000 iterations or non-numbers in the calculation process, resulting in solution failure. The solution success rates of the three algorithms are 93.55%, 74.19% and 74.19% respectively. The solution success rates of Newton's downhill method, inverse quadratic interpolation method and the newly developed hybrid algorithm are all 100%, but the hybrid algorithm has fewer iterations and higher solution efficiency, which is better than other solution algorithms.

[0118] (8) Calculate the time test results.

[0119] The calculation time of the selected 31 substances was tested. The QueryPerformanceFrequenc() and QueryPerformanceCounter() functions provided in the Windows API were used to record the execution time of the code segment. The test results are shown in Table 2.

[0120] Table 2 Test results of calculation time when calculating compression factor Z

[0121]

[0122] In Table 2, the unit of calculation time is s, / represents the number of iterations exceeding 3000; NAN represents a non-number in the calculation process; / and NAN both represent solution failure.

[0123] As shown in Table 2, the binary method and the trial position method may fail to solve due to non-number in the calculation process, and the secant method may stop calculating when the number of iterations exceeds 3000, resulting in failure to solve. Therefore, in this embodiment, the stability of the binary method, the trial position method and the secant method is insufficient; the total calculation time of the Newton downhill method, the inverse quadratic interpolation method and the hybrid algorithm for all the above substances is 1.94×10 -3 s, 2.96×10 -4 s, 2.66×10 -4 s. Considering the solution success rate and calculation time comprehensively, the hybrid algorithm is more suitable for solving the PC-SAFT state equation.

[0124] The PC-SAFT state equation can be used to calculate thermodynamic properties such as fugacity coefficient, compressibility factor, volume, residual enthalpy, and residual entropy. Through the calculation of the fugacity coefficient, further phase equilibrium calculations are performed to obtain the content of components in different phases, which can be used for simulation calculations of petrochemical unit modules and processes, such as flash tanks. The success rate and speed of solving the PC-SAFT state equation directly affect the feasibility of simulation calculations and are the basis of simulation calculations.

[0125] The embodiment of the present application also provides an application scenario, which applies the above-mentioned PC-SAFT state equation solution method. Specifically, the PC-SAFT state equation solution method provided in this embodiment can be applied in a chemical separation simulation calculation scenario. The chemical separation simulation calculation scenario includes a simulation calculation link, a compression factor calculation link, and a simulation end judgment link. The simulation calculation link is used to simulate the separation process of the substance to be separated to obtain the vapor phase composition and the liquid phase composition. The compression factor calculation link is used to use the vapor phase composition and the liquid phase composition as inputs, respectively, to calculate the compression factor corresponding to the vapor phase composition and the compression factor corresponding to the liquid phase composition. The simulation end judgment link is used to further calculate the fugacity coefficient corresponding to the vapor phase composition and the fugacity coefficient corresponding to the liquid phase composition based on the compression factor corresponding to the vapor phase composition and the compression factor corresponding to the liquid phase composition, and then further calculate the fugacity corresponding to the vapor phase composition and the fugacity corresponding to the liquid phase composition based on the fugacity coefficient corresponding to the vapor phase composition and the fugacity coefficient corresponding to the liquid phase composition. The fugacity corresponding to the vapor phase composition and the fugacity corresponding to the liquid phase composition are determined based on whether the fugacity corresponding to the vapor phase composition and the fugacity corresponding to the liquid phase composition are equal to determine whether the simulation is completed. The PC-SAFT state equation solution method provided in this embodiment belongs to the compression factor calculation link.

[0126] The simulation calculation process of the chemical separation process is as follows:

[0127] (1) The separation process is determined by simulation software (specifically, flash evaporation is used) to simulate the substances to be separated, and the new vapor phase composition and liquid phase composition obtained by the current simulation are updated. During the first simulation, the initial vapor phase composition and liquid phase composition are assumed based on the substances to be separated.

[0128] (2) The target substance is determined based on the vapor phase composition and the liquid phase composition, respectively, and the compression factor corresponding to the vapor phase composition and the compression factor corresponding to the liquid phase composition are obtained using the PC-SAFT state equation solving method of this embodiment.

[0129] (3) Based on the compression factor corresponding to the vapor phase composition, the fugacity coefficient corresponding to the vapor phase composition is calculated, based on the fugacity coefficient corresponding to the vapor phase composition, the fugacity corresponding to the vapor phase composition is further calculated, based on the compression factor corresponding to the liquid phase composition, the fugacity coefficient corresponding to the liquid phase composition is calculated, based on the fugacity coefficient corresponding to the liquid phase composition, the fugacity corresponding to the liquid phase composition is further calculated; determine whether the fugacity corresponding to the vapor phase composition and the fugacity corresponding to the liquid phase composition are equal.

[0130] (4) If yes, the simulation is stopped, and the vapor phase composition and liquid phase composition obtained by the current simulation calculation are used as the final simulation calculation results to obtain the content of the components in different phases.

[0131] (5) If not, continue the simulation and return to (1).

[0132] Example 2

[0133] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data to be processed. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a PC-SAFT state equation solving method is implemented.

[0134] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0135] In an exemplary embodiment, a computer device is also provided, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the PC-SAFT state equation solving method described in Example 1.

[0136] Example 3

[0137] An embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for solving the PC-SAFT state equation described in Embodiment 1 is implemented.

[0138] Example 4

[0139] An embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the PC-SAFT state equation solving method described in Embodiment 1.

[0140] Example 5

[0141] The present application provides a computer system, including:

[0142] A jump interface is connected to the simulation software, and is used to input a command to continue the simulation and the conditions for the simulation calculation, or an instruction to stop the simulation, to the simulation software, and to obtain the vapor phase composition and liquid phase composition output by the simulation software; the simulation software is used to stop the simulation calculation when receiving the instruction to stop the simulation; when receiving the instruction to continue the simulation, the separation process of the input substance to be separated is simulated and calculated based on the conditions for the simulation calculation, and the vapor phase composition and liquid phase composition are output;

[0143] A processor is connected to the jump interface and is used to use the vapor phase composition and the liquid phase composition as the composition of the target substance, execute the PC-SAFT state equation solving method described in Example 1, and obtain the compression factor corresponding to the vapor phase composition and the compression factor corresponding to the liquid phase composition; based on the compression factor corresponding to the vapor phase composition, calculate the fugacity coefficient corresponding to the vapor phase composition, based on the fugacity coefficient corresponding to the vapor phase composition, further calculate the fugacity corresponding to the vapor phase composition, based on the compression factor corresponding to the liquid phase composition, calculate the fugacity coefficient corresponding to the liquid phase composition, and based on the fugacity coefficient corresponding to the liquid phase composition, further calculate the fugacity corresponding to the liquid phase composition; determine whether the fugacity corresponding to the vapor phase composition and the fugacity corresponding to the liquid phase composition are equal; if so, send a command to stop the simulation to the jump interface; if not, send a command to continue the simulation to the jump interface.

[0144] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0145] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0146] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.

Claims

1. A method for solving the PC-SAFT state equation, characterized in that: The PC-SAFT state equation solving method comprises: Setting an initial value range of the filling fraction of the target substance; the composition of the target substance is a vapor phase composition or a liquid phase composition obtained by simulating the separation process of the substance to be separated; Randomly select a value within the initial value range to obtain a first value of the filling fraction; The first value is used as input, and a first compression factor is calculated using the PC-SAFT state equation; the model parameters of the PC-SAFT state equation are determined based on the components in the target substance; Taking the first compression factor as input, a first calculated pressure is calculated using a relationship between pressure and compression factor; Based on the first calculated pressure, determining whether an iteration termination condition is satisfied; If yes, the iteration ends, and the first compression factor is used as the compression factor corresponding to the target substance; If not, the second value of the filling fraction is determined by combining the inverse quadratic interpolation method, the secant method and the bisection method, and the initial value range is adjusted to obtain the adjusted value range. The second value is used as input and the second compression factor is calculated using the PC-SAFT state equation. The second compression factor is used as input and the second calculated pressure is calculated using the relationship between pressure and compression factor. The second value, the second compression factor and the second calculated pressure are used as the first value, the first compression factor and the first calculated pressure of the next iteration, and the step of "based on the first calculated pressure, determining whether the iteration termination condition is met" is returned.

2. The method for solving the PC-SAFT state equation according to claim 1, characterized in that: The iteration termination condition is that the absolute value of the difference between the calculated pressure and the given pressure is less than the convergence tolerance. Based on the first calculated pressure, it is judged whether the iteration termination condition is met, specifically including: if the absolute value of the difference between the first calculated pressure and the given pressure is less than the convergence tolerance, the iteration termination condition is met.

3. The method for solving the PC-SAFT state equation according to claim 1, characterized in that: The second value of the filling fraction is determined by combining the inverse quadratic interpolation method, the secant method and the bisection method, specifically including: Taking the maximum value and the minimum value of the initial value range as input respectively, the maximum compression factor corresponding to the maximum value and the minimum compression factor corresponding to the minimum value are calculated using the PC-SAFT state equation; Taking the maximum compression factor and the minimum compression factor as inputs respectively, and using the relationship between pressure and compression factor to calculate the maximum calculated pressure corresponding to the maximum compression factor and the minimum calculated pressure corresponding to the minimum compression factor; Calculating the difference between the minimum calculated pressure and the given pressure to obtain a minimum difference; calculating the difference between the first calculated pressure and the given pressure to obtain a first difference; calculating the difference between the maximum calculated pressure and the given pressure to obtain a maximum difference; Determine whether the minimum difference, the first difference, and the maximum difference are all unequal to obtain a first determination result; If the first judgment result is yes, determining a second value of the filling fraction by using an inverse quadratic interpolation method; If the first judgment result is no, then using the secant method to determine the available values ​​of the filling fraction, and judging whether the available values ​​are within the initial value range, to obtain a second judgment result; If the second judgment result is yes, taking the available value as the second value of the filling score; If the second judgment result is no, a second value of the filling score is determined by using a binary search method.

4. The method for solving the PC-SAFT state equation according to claim 3, characterized in that: Determining a second value of the filling fraction by using an inverse quadratic interpolation method specifically includes: taking the minimum value, the first value, the maximum value, the minimum difference, the first difference, and the maximum difference as inputs, and determining a second value of the filling fraction by using an interpolation formula; The interpolation formula is: Where x2 is the second value; f(x1) is the first difference; f(x max ) is the maximum difference; f(x min ) is the minimum difference; x min is the minimum value; x1 is the first value; x max is the maximum value; Determining available values ​​of the filling fraction using the secant method specifically includes: taking the minimum value, the minimum difference, the maximum value and the maximum difference as inputs, and determining available values ​​of the filling fraction using the secant formula; The secant formula is: in, Available values.

5. The method for solving the PC-SAFT state equation according to claim 3, characterized in that: The second value of the filling fraction is determined by using the dichotomy method, specifically including: Calculate the product of the maximum difference and the minimum difference, and determine whether the product is less than 0; If yes, then calculate the middle value of the initial value range, and use the middle value as the second value of the filling fraction; If not, the solution fails and the iteration ends.

6. The method for solving the PC-SAFT state equation according to claim 3, characterized in that: Adjusting the initial value range to obtain an adjusted value range specifically includes: Calculate the product of the minimum difference and the first difference to obtain a first product; Calculate the product of the first difference and the maximum difference to obtain a second product; If the first product is less than 0, determining an adjusted value range based on the minimum value and the first value; the minimum value of the adjusted value range is the minimum value, and the maximum value of the adjusted value range is the first value; If the second product is less than 0, determining an adjusted value range based on the first value and the maximum value; the minimum value of the adjusted value range is the first value, and the maximum value of the adjusted value range is the maximum value; If the first product and the second product are both greater than 0 or both less than 0, the calculation fails.

7. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the PC-SAFT state equation solving method according to any one of claims 1 to 6.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the PC-SAFT state equation solving method described in any one of claims 1 to 6 is implemented.

9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the PC-SAFT state equation solving method described in any one of claims 1 to 6 is implemented.

10. A computer system, characterized in that: include: A jump interface is connected to the simulation software, and is used to input a command to continue the simulation and the conditions for the simulation calculation, or an instruction to stop the simulation, to the simulation software, and to obtain the vapor phase composition and liquid phase composition output by the simulation software; the simulation software is used to stop the simulation calculation when receiving the instruction to stop the simulation; when receiving the instruction to continue the simulation, the separation process of the input substance to be separated is simulated and calculated based on the conditions for the simulation calculation, and the vapor phase composition and liquid phase composition are output; A processor connected to the jump interface, and configured to use the vapor phase composition and the liquid phase composition as the composition of the target substance, execute the PC-SAFT state equation solving method described in any one of claims 1 to 6, and obtain a compression factor corresponding to the vapor phase composition and a compression factor corresponding to the liquid phase composition; Based on the compression factor corresponding to the vapor phase composition, the fugacity coefficient corresponding to the vapor phase composition is calculated, based on the fugacity coefficient corresponding to the vapor phase composition, the fugacity corresponding to the vapor phase composition is calculated, based on the compression factor corresponding to the liquid phase composition, the fugacity coefficient corresponding to the liquid phase composition is calculated, and based on the fugacity coefficient corresponding to the liquid phase composition, the fugacity corresponding to the liquid phase composition is calculated; determine whether the fugacity corresponding to the vapor phase composition and the fugacity corresponding to the liquid phase composition are equal; if so, send a command to stop the simulation to the jump interface; if not, send a command to continue the simulation to the jump interface.

Citation Information

Patent Citations

  • Partial filling of a pulse detonation combustor in a pulse detonation combustor based hybrid engine

    CA2696290A1

  • Method and device for analyzing stability of fluid phase in porous medium

    CN116265942A

  • Multi-element thermal fluid thermal recovery oil reservoir numerical simulation method

    WO2021180189A1

Cited By

  • Optimization calculation method and system for gas-liquid phase root of PC-SAFT equation and medium

    CN121838900A