A method for solving PC-SAFT equation of state and related device
By combining the inverse quadratic interpolation method, the secant method, and the bisection method, the problem of low success rate and efficiency in solving the PC-SAFT equation of state is solved, achieving efficient and accurate solutions. This method is suitable for predicting the thermodynamic properties of complex fluid systems and for chemical separation simulation calculations.
Patent Information
- Application Number
- CN202411206638.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-08-30
AI Technical Summary
The existing PC-SAFT equation of state solution method has low success rate and efficiency, making it difficult to meet the needs of chemical separation simulation calculations.
A hybrid algorithm is adopted, combining inverse quadratic interpolation, secant method and bisection method, and the filling fraction is updated iteratively to improve the success rate and efficiency of solving the PC-SAFT state equation.
It improves the success rate and efficiency of solving the PC-SAFT equation of state, is applicable to the prediction of thermodynamic properties of complex fluid systems, and promotes its application in chemical separation simulation calculations.
Smart Images

Figure CN119207594B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of chemical separation simulation calculation technology, and in particular to a PC-SAFT state equation solving method and related apparatus. Background Technology
[0002] Chemical thermodynamics is fundamental to research, development, and design in the chemical industry. The Equation of State (EoS) is an analytical expression used to describe the P (pressure), V (volume), and T (temperature) relationship of a fluid (a general term for both gas and liquid) in equilibrium. It is widely used in simulations in chemical engineering (such as chemical thermodynamics and chemical processes). For example, in chemical separation simulations, the condition for ending the simulation is that the fugacity corresponding to the vapor phase composition is equal to the fugacity corresponding to the liquid phase composition. To calculate fugacity, the compressibility factor must first be calculated, then the fugacity coefficient based on the compressibility factor, and finally the fugacity itself based on the fugacity coefficient. Currently, the compressibility factor is often calculated by solving the PC-SAFT (Perturbed-Chain Statistical Associating Fluid Theory) equation of state.
[0003] However, solving the PC-SAFT state equations requires iterative calculations, and existing methods have low success rates and low efficiency. Therefore, there is an urgent need for a solution method with high success rates and high efficiency, which would be beneficial to promoting the widespread application of the PC-SAFT state equations. Summary of the Invention
[0004] The purpose of this application is to provide a method and related apparatus for solving PC-SAFT state equations, which can improve the success rate and efficiency of solving PC-SAFT state equations.
[0005] To achieve the above objectives, this application provides the following solution:
[0006] Firstly, this application provides a method for solving PC-SAFT state equations, the method comprising:
[0007] Set an initial range for the filling fraction of the target substance; the composition of the target substance is obtained by simulating the separation process of the substance to be separated, resulting in either a vapor phase composition or a liquid phase composition.
[0008] Random values are selected within the initial value range to obtain the first value of the fill score;
[0009] Using the first value as input, the first compressibility factor is calculated using the PC-SAFT equation of state; the model parameters of the PC-SAFT equation of state are determined based on each component in the target substance.
[0010] Using the first compressibility factor as input, the first calculated pressure is obtained by using the relationship between pressure and compressibility factor;
[0011] Based on the first computational pressure, determine whether the iteration termination condition is met;
[0012] If so, the iteration ends, and the first compression factor is taken as the compression factor corresponding to the target substance;
[0013] If not, then 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. Using the second value as input, the second compression factor is calculated using the PC-SAFT state equation. Using the second compression factor as input, the second computational pressure is calculated using the relationship between pressure and compression factor. The second value, the second compression factor, and the second computational pressure are used as the first value, the first compression factor, and the first computational pressure for the next iteration, and the process returns to the step of "determining whether the iteration termination condition is met based on the first computational pressure".
[0014] Secondly, this application provides a computer device, 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 above.
[0015] Thirdly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described PC-SAFT state equation solving method.
[0016] Fourthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the PC-SAFT state equation solving method described above.
[0017] Fifthly, this application provides a computer system, comprising:
[0018] A jump interface, connected to simulation software, is used to input commands to continue simulation and simulation calculation conditions, or commands to stop simulation, and to obtain the vapor phase composition and liquid phase composition output by the simulation software. The simulation software stops the simulation calculation when it receives a command to stop simulation; when it receives a command to continue simulation, it performs simulation calculations on the separation process of the input substance to be separated based on the simulation calculation conditions, and outputs the vapor phase composition and liquid phase composition.
[0019] The processor, connected to the jump interface, is used to execute the PC-SAFT equation of state solution method described above, taking the vapor phase composition and liquid phase composition as the composition of the target substance, to obtain the compressibility factor corresponding to the vapor phase composition and the compressibility factor corresponding to the liquid phase composition; based on the compressibility 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 compressibility 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 calculated; it then determines whether the fugacity corresponding to the vapor phase composition and the fugacity corresponding to the liquid phase composition are equal; if so, it sends a stop simulation command to the jump interface; if not, it sends a continue simulation command to the jump interface.
[0020] According to the specific embodiments provided in this application, the following technical effects are disclosed:
[0021] This application provides a PC-SAFT equation of state solution method and related apparatus. The method involves randomly selecting a value from the initial range of the target material's fill fraction to obtain a first value for the fill fraction. A first compressibility factor is then calculated using the PC-SAFT equation of state, and a first calculated pressure is calculated using the relationship between pressure and compressibility factor. The method then determines whether the iteration termination condition is met. If not, a second value for the fill fraction is determined using inverse quadratic interpolation, the secant method, and the bisection method to update the fill fraction. This process continues until the iteration termination condition is met. At this point, the first compressibility factor is used as the compressibility factor corresponding to the target material. This application combines inverse quadratic interpolation, the secant method, and the bisection method to update the fill fraction during the compressibility factor calculation process. This allows for the integration of different solution algorithms, resulting in a high success rate and improved efficiency, thereby enhancing the success rate and efficiency of solving the PC-SAFT equation of state. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is an application environment diagram of a PC-SAFT state equation solving method provided in Embodiment 1 of this application.
[0024] Figure 2 This is a detailed flowchart illustrating a PC-SAFT state equation solving method provided in Embodiment 1 of this application.
[0025] Figure 3 This is a schematic diagram of the structure of a computer device provided in Embodiment 2 of this application. Detailed Implementation
[0026] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0027] Example 1
[0028] The PC-SAFT state equation solving method provided in this application can be applied to, for example... Figure 1The application environment shown depicts a scenario where the terminal communicates with the server via a network. The data storage system stores the data the server needs to process. This data storage system can be configured independently, integrated into the server, or located in the cloud or on another server. The terminal can send the target material to be processed to the server. After receiving the target material, the server sets an initial range for the filling fraction of the target material. Within this initial range, a random value is selected to obtain the first value of the filling fraction. Using this first value as input, the first compressibility factor is calculated using the PC-SAFT equation of state. Using the first compressibility factor as input, the first computational pressure is calculated using the relationship between pressure and compressibility factor. Based on the first computational pressure, it is determined whether the iteration termination condition is met. If yes, the iteration ends, and the first compressibility factor is used as the compressibility factor corresponding to the target material. If not, a second value of the filling fraction is determined using inverse quadratic interpolation, secant method, and bisection method, and the initial range is adjusted to obtain the adjusted range. Using the second value as input, the second compressibility factor is calculated using the PC-SAFT equation of state. Using the second compressibility factor as input, the second computational pressure is calculated using the relationship between pressure and compressibility factor. The second value, the second compressibility factor, and the second computational pressure are used as the first value, the first compressibility factor, and the first computational pressure for the next iteration, returning to the step "Based on the first computational pressure, determine whether the iteration termination condition is met". The server can feed back the compression factor corresponding to the target substance to the terminal.
[0029] In addition, in some embodiments, the PC-SAFT equation of state solution method can also be implemented 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 it.
[0030] The terminal can be, but is not limited to, various desktop computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. The server can be a standalone server or a server cluster composed of multiple servers, or it can be a cloud server.
[0031] like Figure 2 As shown, a PC-SAFT state equation solving method is provided. This method is executed by a computer device, specifically by a terminal or server alone, or by both a terminal and a server. In this embodiment, the method is applied to... Figure 1 Taking the server in the example, the PC-SAFT state equation solution method includes the following steps:
[0032] Step S1: Set the initial range of the filling fraction of the target substance; the composition of the target substance is obtained by simulating the separation process of the substance to be separated, which yields either a vapor phase composition or a liquid phase composition.
[0033] Step S2: Randomly select a value within the initial value range to obtain the first value of the fill fraction.
[0034] Step S3: Using the first value as input, calculate the first compressibility factor using the PC-SAFT equation of state; the model parameters of the PC-SAFT equation of state are determined based on each component in the target substance.
[0035] Step S4: Using the first compressibility factor as input, calculate the first calculated pressure using the relationship between pressure and compressibility factor.
[0036] Step S5: Based on the first computational pressure, determine whether the iteration termination condition is met.
[0037] Step S6: If yes, then end the iteration and use the first compression factor as the compression factor corresponding to the target substance.
[0038] Step S7: If not, then combine inverse quadratic interpolation, secant method and bisection method to determine the second value of the filling fraction, and adjust the initial value range to obtain the adjusted value range. Using the second value as input, calculate the second compression factor using the PC-SAFT state equation. Using the second compression factor as input, calculate the second computational pressure using the relationship between pressure and compression factor. Use the second value, the second compression factor and the second computational pressure as the first value, the first compression factor and the first computational pressure for the next iteration, and return to the step "Based on the first computational pressure, determine whether the iteration termination condition is met".
[0039] By implementing steps S1 to S7 above, this embodiment employs a hybrid algorithm to solve the PC-SAFT state equation, a nonlinear equation, to obtain the compression factor. In the process of solving the compression factor, when determining the second value of the fill fraction in each iteration, inverse quadratic interpolation is first used. If inverse quadratic interpolation fails, the secant method is used. If the secant method fails, the bisection method is used. That is, the second value of the fill fraction is determined by combining inverse quadratic interpolation, the secant method, and the bisection method to update the fill fraction. This application achieves a high success rate and strong robustness in solving the PC-SAFT state equation using a hybrid algorithm, which also improves solution efficiency and reduces solution time, thus possessing significant practical value.
[0040] The origins of equations of state can be traced back to 1873 when van der Waals proposed a cubic equation of state, but this was only applicable to simple gases. In 1949, Redlich and Kwong modified the attraction term of the Van der Waals equation of state, proposing the Redlich-Kwong (RK) equation of state, applicable to nonpolar symmetric molecular systems. In 1972, Soave introduced an eccentricity factor into the RK equation of state, proposing the Soave-Redlich-Kwong (SRK) equation of state, making it more widely applicable. In 1976, Peng and Robinson improved the attraction term of the RK equation of state, proposing the Peng-Robinson (PR) equation of state. The PR and SRK equations of state provide relatively accurate predictions of phase equilibrium and thermodynamic properties for nonpolar and weakly polar molecular systems. As the systems studied become increasingly complex, the classical cubic equation of state struggles to meet the accuracy requirements of thermodynamic predictions for polar, associated, and polymeric systems. In the 1980s, Wertheim proposed the statistical associating fluid theory, and Chapman proposed the SAFT (Statistical Associating Fluid Theory) model based on it. This model can more accurately describe 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 equation of state. The PC-SAFT equation of state is suitable for describing the thermodynamic properties of polymers and macromolecular systems, and is particularly widely used in the phase behavior and thermodynamic properties of complex fluid systems.
[0041] Solving the PC-SAFT equations of state requires iterative calculation methods. Efficient and accurate solution algorithms are beneficial for promoting the widespread application of the PC-SAFT equations of state. There are many methods for solving nonlinear equations, such as Newton's method, the bisection method, the golden section method, the trial-and-error method, and the inverse quadratic interpolation method. Among these, Newton's method, first proposed in the 17th century by the English mathematician John Newton, is widely used in computer science, mathematics, physics, and engineering. Over a long period of development, researchers have proposed a series of classic improved Newton's methods, including the midpoint Newton method, Newton's descent method, the secant method, and the parabolic method. Gross, Nichita, Solms, and others, the originators of PC-SAFT, used Newton's method to iteratively solve for the density roots of mixtures under a given pressure; Privat, Sánchez, and others used Newton's method to solve for the density roots of the PC-SAFT equations of state; and Xu Shenjun et al. used a simultaneous equation method to solve the PC-SAFT equations of state. However, existing solution methods have low success rates and low efficiency. This embodiment is based on Newton's algorithm and combines inverse quadratic interpolation, secant method and bisection method to establish a new hybrid algorithm to solve the PC-SAFT equation of state, a nonlinear equation. The solution capability of the hybrid algorithm is tested using different materials.
[0042] In S1, the initial range of values for the independent variable η, representing the filling fraction of the target substance, is first set [x]. min x max ], x min To find the minimum value, x max This represents the maximum possible value. The target substance can be determined according to user requirements. It can be a pure substance or a mixture. When applied in the field of chemical separation, the composition of the target substance can be obtained through simulation calculations of the separation process, either in the vapor phase or liquid phase. The composition includes specific components and the content of each component. The filling fraction represents the density of the target substance in the control zone. The initial range of the filling fraction can be determined based on the vapor phase or liquid phase state of the substance.
[0043] In S2, within the initial value range [x] min x max Within the range of values, a value is randomly selected as the initial value to obtain the first value of the filler score.
[0044] In S3, the first value is used 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 equation of state are determined based on each component in the target substance. The PC-SAFT equation of state is as follows:
[0046] Z = 1 + Z chain +Z disp +Z assoc (1)
[0047] In equation (1), Z is the compression factor; Z chain Z is the compression factor for hard chain terms; the superscript "chain" indicates a chain. disp Z is the dispersion term compression factor, with the superscript *disp* indicating dispersion; assoc This is the compression factor for the association term; the superscript assoc indicates association.
[0048] The formula for calculating the compressibility factor of hard-chain terms is:
[0049]
[0050] In equation (2), Z represents the average number of segments. hs The hard sphere term is the compressibility factor, where the superscript hs indicates a hard sphere; i represents molecule i in the target substance; x i The composition of molecule i; m i Let i be the number of segments in molecule i. ρ is the radial distribution function, which describes the strength of the interaction between molecules at a distance r and reflects the spatial distribution between molecules; ρ is the number density of the target substance.
[0051] The formula for calculating the compressibility factor of the hard ball term is:
[0052]
[0053] In equation (3), ξ0, ξ1, ξ2, and ξ3 are all functions of the number of segments and the diameter of the segments.
[0054] The formula for calculating the dispersion term compressibility factor is:
[0055]
[0056] In equation (4), η is the filling fraction of the target material; I1 and I2 are both soft repulsive 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 formula for calculating the constriction factor of association terms is:
[0058]
[0059] In the above formula, x i ρ represents the composition of molecule i; j represents molecule j in the target substance; j Let A be the molar density of molecule j; j Site A on molecule j; The occupancy fraction of site A on molecule i; A i For site A on molecule i; ρ i Let be the molar density of molecule i; N represents the occupancy fraction of site A on molecule j; AV B is Avogadro's constant; j Site B on molecule j; The occupancy fraction of site B on molecule j; Let be the association strength between site A on molecule i and site B on molecule j.
[0060] After the target material is determined, all parameters in the PC-SAFT equation of state except for the fill fraction are known. Therefore, the compressibility factor can be calculated using the PC-SAFT equation of state with the fill fraction as input. The iterative calculation process in this embodiment continuously updates the value of the fill fraction until the iteration termination condition is reached, and the compressibility factor corresponding to the target material is determined.
[0061] In S4, the first compressibility factor is used as input, and the first calculated pressure corresponding to the first compressibility factor is calculated using the relationship between pressure and compressibility factor.
[0062] The relationship between pressure and compressibility factor is:
[0063] P=ZkTρ(7)
[0064] In equation (7), P is the calculated pressure; Z is the compressibility factor of the target material; k is the Boltzmann constant; T is the temperature, which is a given value; and ρ is the number density of the target material.
[0065] The compressibility factor can be used as input, and the calculated pressure can be obtained using equation (7).
[0066] In S5, based on the first computational pressure, it is determined whether the iteration termination condition is met.
[0067] The iteration termination condition (also known as 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, i.e., |PP|. sys |<ε, where P is the calculated pressure, P sys Given a pressure, ε is the convergence tolerance.
[0068] Then, based on the first computational pressure, determining whether the iteration termination condition is met means determining whether the first computational pressure satisfies |PP. sys The condition for |<ε specifically includes: if the absolute value of the difference between the first calculated pressure and the given pressure is less than the convergence tolerance, then the iteration termination condition is met, and the calculation is stopped.
[0069] In S6, if the iteration termination condition is met, the iteration ends, and the first compression factor is used as the compression factor corresponding to the target substance.
[0070] In S7, if not, i.e., the iteration termination condition is not met, then 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. Using the second value as input, the second compression factor corresponding to the second value is calculated using the PC-SAFT state equation. Using the second compression factor as input, the second computational pressure corresponding to the second compression factor is calculated using the relationship between pressure and compression factor. Using the second value, the second compression factor, and the second computational pressure as the first value, the first compression factor, and the first computational pressure for the next iteration, the process returns to the step "Based on the first computational pressure, determine whether the iteration termination condition is met".
[0071] This embodiment combines the advantages of inverse quadratic interpolation, secant method, and bisection method to obtain a hybrid algorithm. First, inverse quadratic interpolation is used to calculate the first difference between the first calculated pressure and the given pressure. Then, the minimum difference between the minimum calculated pressure and the given pressure is calculated, corresponding to the minimum value within the initial value range. Finally, the maximum difference between the maximum calculated pressure and the given pressure is calculated, corresponding to the maximum value within the initial value range. If the first difference, minimum difference, and maximum difference are the same during the inverse quadratic interpolation calculation, the calculation fails, and the secant method is used. If the fill fraction updated by the secant method exceeds the value range of the fill fraction, the calculation fails, and the bisection method is used within the value range of the fill fraction until the iteration termination condition is reached.
[0072] In S7, the second value of the fill fraction is determined by combining inverse quadratic interpolation, secant method, and bisection method, specifically including:
[0073] (1) Using the maximum and minimum values of the initial value range as inputs, 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) Using the maximum compressibility factor and the minimum compressibility factor as inputs respectively, the maximum calculated pressure corresponding to the maximum compressibility factor and the minimum calculated pressure corresponding to the minimum compressibility factor are calculated using the relationship between pressure and compressibility 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, and obtain the first judgment result.
[0077] (5) If the first judgment result is yes, then the second value of the filling fraction is determined by inverse quadratic interpolation.
[0078] If f(x) min )≠f(x1)≠f(x max Then, the second value x2 is calculated using the inverse quadratic interpolation method, f(x) min ) represents the minimum difference, x min Let f(x1) be the minimum value within the initial range, x1 be the first value, and f(x1) be the first difference. max ) represents the maximum difference, x max This represents the maximum value within the initial range.
[0079] The second value of the fill fraction is determined using inverse quadratic interpolation, specifically by using the minimum value, the first value, the maximum value, the minimum difference, the first difference, and the maximum difference as inputs, and then using an interpolation formula to determine the second value of the fill fraction.
[0080] The interpolation formula is:
[0081]
[0082] In equation (8), x2 is the second value; f(x1) is the first difference; f(x max f(x) represents the maximum difference; min ) represents the minimum difference; x min x is the minimum value; x1 is the first value; x max This represents the maximum possible value.
[0083] (6) If the first judgment result is negative, the available values of the fill fraction are determined by the secant method, and it is determined whether the available values are within the range of the initial values to obtain the second judgment result.
[0084] The method of determining the available values of the fill fraction using the secant method includes: using the minimum value, minimum difference, maximum value, and maximum difference as input, and using the secant formula to determine the available values of the fill fraction.
[0085] The secant formula is:
[0086]
[0087] In equation (9), These are the available values.
[0088] judge Is it within the initial value range [x]? min x max Within ], the second judgment result is obtained.
[0089] (7) If the second judgment result is yes, then the available value is used as the second value of the fill fraction.
[0090] (8) If the second judgment result is negative, the second value of the filling fraction is determined by the dichotomy method.
[0091] The second value of the filler fraction is determined using the bisection 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 fill fraction.
[0094] The intermediate value is the midpoint of the initial value range.
[0095] 3) If not, the solution fails and the iteration ends.
[0096] This embodiment employs a hybrid algorithm to solve the PC-SAFT state equations. First, the inverse quadratic interpolation method is used for calculation. If the calculation fails, it automatically switches to the secant method. If the secant method fails, the bisection method is used directly. This hybrid algorithm achieves automatic connection between different solution algorithms, ensuring the success rate and computational efficiency of solving nonlinear equations. The above hybrid algorithm is used to solve the PC-SAFT state equations, solving the problem of finding the compression factor of the PC-SAFT state equations.
[0097] In S7, the initial value range is adjusted to obtain the adjusted value range, specifically including:
[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 the second product.
[0100] (3) If the first product is less than 0, the adjusted range of values is determined based on the minimum value and the first value. The minimum value of the adjusted range is the minimum value, and the maximum value of the adjusted range is the first value.
[0101] (4) If the second product is less than 0, the 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 are less than 0, the calculation fails.
[0103] The following embodiment uses experiments to demonstrate the effectiveness of the PC-SAFT state equation solution method of this embodiment:
[0104] The PC-SAFT equation of state solution method was selected for the study of certain substances. A hybrid algorithm, including inverse quadratic interpolation, secant method, and bisection method, was used to iteratively solve the PC-SAFT equation of state. Specifically, given an initial fill fraction, under set temperature, pressure, and material composition conditions, the compressibility factors of the hard sphere, hard chain, dispersion, and association terms were calculated. The computational pressure was calculated according to P = ZkTρ. The fill fraction was iteratively updated using the hybrid algorithm until the absolute value of the difference between the computational pressure and the given pressure was less than the convergence tolerance, i.e., when |PP| < ρ. sys |<10 -6 At this time, ε = 10 -6 If the convergence condition is met, the compression factor is obtained. By calculating different components, the success rate, computation time, and number of iterations of the hybrid algorithm are tested.
[0105] The experimental procedure specifically includes:
[0106] (1) Select 31 substances, including gases, hydrocarbons, alcohols, and amines, and collect the model parameters of the PC-SAFT equation of state corresponding to the 31 substances.
[0107] (2) Given an initial value for the fill fraction, the initial fill fraction for the liquid phase is set to η0 = 0.5, and the initial fill fraction for the vapor phase is set to η0 = 1 × 10 -10 .
[0108] (3) Using the fill fraction as input, calculate the compression factor Z using the PC-SAFT state equation.
[0109] (4) The calculated pressure is obtained according to P=ZkTρ.
[0110] (5) According to |PP sys |<10 -6 Determine if convergence has occurred. If convergence is satisfied, end the calculation and obtain the compression factor. Otherwise, use a hybrid algorithm to iteratively update the filling fraction η and return (3).
[0111] (6) Compare the number of iterations, computation time, and result accuracy of using a hybrid algorithm to update the filling fraction η with other algorithms.
[0112] (7) Iteration count test results.
[0113] The number of iterations was tested on the 31 selected substances, and the test results are shown in Table 1.
[0114] Table 1 shows the test results of the number of iterations required to solve for the compression factor Z.
[0115]
[0116] In Table 1, the unit for the number of iterations is times, / represents more than 3000 iterations; NAN represents a non-zero number appearing during the calculation; both / and NAN represent a failed solution.
[0117] As shown in Table 1, the secant method, bisection method, and trial-and-error method may fail to solve the problem due to more than 3000 iterations or the occurrence of non-zero numbers during the calculation process. The success rates of the three algorithms are 93.55%, 74.19%, and 74.19%, respectively. The 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 the other solution algorithms.
[0118] (8) Calculate the time test results.
[0119] The execution time of the selected 31 substances was tested. The QueryPerformanceFrequenc() and QueryPerformanceCounter() functions provided by 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 compressibility factor Z
[0121]
[0122] In Table 2, the unit of calculation time is seconds (s), / represents more than 3000 iterations; NAN represents the occurrence of a non-negative number during the calculation; both / and NAN represent solution failure.
[0123] As shown in Table 2, the bisection method and the trial-and-error method may fail due to non-zero values during the calculation process, while the secant method may fail due to stopping the calculation after more than 3000 iterations. Therefore, in this embodiment, the bisection method, the trial-and-error method, and the secant method are not stable enough. The total calculation time for all the above substances using the Newton's descent method, the inverse quadratic interpolation method, and the hybrid algorithm is 1.94 × 10⁻⁶. -3 s, 2.96×10 -4 s, 2.66×10 -4 Considering both the success rate and computation time, the hybrid algorithm is more suitable for solving the PC-SAFT state equations.
[0124] The PC-SAFT equation of state 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 can be performed to obtain the component content under different phase states. This 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 equation of state directly affect the feasibility of the simulation calculation and are fundamental to the simulation.
[0125] This application also provides an application scenario where the PC-SAFT equation of state solution method described above is applied. Specifically, the PC-SAFT equation of state solution method provided in this embodiment can be applied to a chemical separation simulation calculation scenario. The chemical separation simulation calculation scenario includes a simulation calculation stage, a compressibility factor calculation stage, and a simulation completion judgment stage. The simulation calculation stage is used to simulate the separation process of the substances to be separated, obtaining the vapor phase composition and liquid phase composition. The compressibility factor calculation stage is used to calculate the compressibility factor corresponding to the vapor phase composition and the compressibility factor corresponding to the liquid phase composition, respectively, using the vapor phase composition and the liquid phase composition as inputs. The simulation completion judgment stage 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 compressibility factors corresponding to the vapor phase composition and 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 coefficients corresponding to the vapor phase composition and the liquid phase composition. The simulation completion is determined based on whether the fugacity corresponding to the vapor phase composition and the fugacity corresponding to the liquid phase composition are equal. The PC-SAFT equation of state solution method provided in this embodiment belongs to the compressibility factor calculation stage.
[0126] The simulation calculation process for the chemical separation process is as follows:
[0127] (1) The separation process (specifically, flash evaporation calculation) is determined by simulation calculation of the substances to be separated using simulation software, and the new vapor phase composition and liquid phase composition obtained from the current simulation calculation are updated. In the first simulation calculation, the initial vapor phase composition and liquid phase composition are assumed based on the substances to be separated.
[0128] (2) The target material is determined based on the vapor phase composition and the liquid phase composition respectively. The compressibility factor corresponding to the vapor phase composition and the compressibility factor corresponding to the liquid phase composition are obtained by using the PC-SAFT equation of state solution method of this embodiment.
[0129] (3) Based on the compressibility 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 compressibility factor corresponding to the liquid phase composition, calculate the fugacity coefficient corresponding to the liquid phase composition. 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.
[0130] (4) If so, stop the simulation and use the vapor phase composition and liquid phase composition obtained from the current simulation calculation as the final simulation calculation result to obtain the content of components under different phase states.
[0131] (5) If not, continue the simulation and return to (1).
[0132] Example 2
[0133] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 3 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores data to be processed. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network. When executed by the processor, the computer program implements a PC-SAFT state equation solving method.
[0134] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0135] In one 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, the processor executing the computer program to implement the PC-SAFT state equation solving method described in Embodiment 1.
[0136] Example 3
[0137] This application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the PC-SAFT state equation solving method described in Embodiment 1.
[0138] Example 4
[0139] This application provides a computer program product, including a computer program that, when executed by a processor, implements the PC-SAFT state equation solving method described in Embodiment 1.
[0140] Example 5
[0141] This application provides a computer system, including:
[0142] A jump interface, connected to simulation software, is used to input commands to continue simulation and simulation calculation conditions, or commands to stop simulation, and to obtain the vapor phase composition and liquid phase composition output by the simulation software. The simulation software stops the simulation calculation when it receives a command to stop simulation; when it receives a command to continue simulation, it performs simulation calculations on the separation process of the input substance to be separated based on the simulation calculation conditions, and outputs the vapor phase composition and liquid phase composition.
[0143] The processor, connected to the jump interface, is used to execute the PC-SAFT equation of state solution method described in Example 1, taking the vapor phase composition and liquid phase composition as the composition of the target substance, to obtain the compressibility factor corresponding to the vapor phase composition and the compressibility factor corresponding to the liquid phase composition; based on the compressibility 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 compressibility 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; it determines whether the fugacity corresponding to the vapor phase composition and the fugacity corresponding to the liquid phase composition are equal; if so, it sends a stop simulation command to the jump interface; if not, it sends a continue simulation command 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, data stored, data displayed, 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 the relevant data must comply with relevant regulations.
[0145] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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 document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for solving PC-SAFT state equations, characterized in that, The PC-SAFT state equation solution method includes: Set an initial range for the filling fraction of the target substance; the composition of the target substance is obtained by simulating the separation process of the substance to be separated, resulting in either a vapor phase composition or a liquid phase composition. Random values are selected within the initial value range to obtain the first value of the fill score; Using the first value as input, the first compressibility factor is calculated using the PC-SAFT equation of state; the model parameters of the PC-SAFT equation of state are determined based on each component in the target substance. Using the first compressibility factor as input, the first calculated pressure is obtained by using the relationship between pressure and compressibility factor; Based on the first computational pressure, determine whether the iteration termination condition is met; If so, the iteration ends, and the first compression factor is taken as the compression factor corresponding to the target substance; If not, then 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. Using the second value as input, the second compression factor is calculated using the PC-SAFT state equation. Using the second compression factor as input, the second computational pressure is calculated using the relationship between pressure and compression factor. The second value, the second compression factor, and the second computational pressure are used as the first value, the first compression factor, and the first computational pressure for the next iteration, and the process returns to the step of "determining whether the iteration termination condition is met based on the first computational pressure".
2. The PC-SAFT state equation solution method 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 determined whether the iteration termination condition is met. Specifically, if the absolute value of the difference between the first calculated pressure and the given pressure is less than the convergence tolerance, then the iteration termination condition is met.
3. The PC-SAFT state equation solving method according to claim 1, characterized in that, The second value of the fill fraction is determined by combining inverse quadratic interpolation, secant method, and bisection method, specifically including: Using the maximum and minimum values of the initial value range as inputs, 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 equations. Using the maximum compressibility factor and the minimum compressibility factor as inputs, the maximum calculated pressure corresponding to the maximum compressibility factor and the minimum calculated pressure corresponding to the minimum compressibility factor are calculated using the relationship between pressure and compressibility factor. 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. 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, then the second value of the fill fraction is determined by inverse quadratic interpolation. If the first judgment result is negative, the available values of the fill fraction are determined using the secant method, and it is determined whether the available values are within the range of the initial values to obtain the second judgment result; If the second judgment result is yes, then the available value is used as the second value of the filler fraction; If the second judgment result is negative, then the second value of the fill fraction is determined using the binary search method.
4. The PC-SAFT state equation solution method according to claim 3, characterized in that, The method of determining the second value of the fill fraction using inverse quadratic interpolation specifically includes: using the minimum value, the first value, the maximum value, the minimum difference, the first difference, and the maximum difference as input, and using an interpolation formula to determine the second value of the fill fraction; The interpolation formula is: Where x2 is the second value; f(x1) is the first difference; f(x max f(x) represents the maximum difference; min ) represents the minimum difference; x min x is the minimum value; x1 is the first value; x max The maximum value; The method of determining the available values of the fill fraction using the secant method specifically includes: using the minimum value, the minimum difference, the maximum value, and the maximum difference as input, and using the secant formula to determine the available values of the fill fraction; The secant formula is: in, These are the available values.
5. The PC-SAFT state equation solution method according to claim 3, characterized in that, The second value of the filler fraction is determined using the bisection method, specifically including: Calculate the product of the maximum difference and the minimum difference, and determine whether the product is less than 0; If so, calculate the middle value of the initial value range, and use the middle value as the second value of the fill fraction; If not, the solution fails and the iteration ends.
6. The PC-SAFT state equation solution method according to claim 3, characterized in that, Adjusting the initial value range to obtain the adjusted value range specifically includes: Calculate the product of the minimum difference and the first difference to obtain the first product; Calculate the product of the first difference and the maximum difference to obtain the second product; If the first product is less than 0, then the 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. If the second product is less than 0, then the 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. If both the first product and the second product are greater than 0 or both are 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, characterized in that the processor executes the computer program to implement the PC-SAFT state equation solving method according to any one of claims 1-6.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the PC-SAFT state equation solving method as described in any one of claims 1-6.
9. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the PC-SAFT state equation solving method as described in any one of claims 1-6.
10. A computer system, characterized in that, include: A jump interface, connected to simulation software, is used to input commands to continue simulation and simulation calculation conditions, or commands to stop simulation, and to obtain the vapor phase composition and liquid phase composition output by the simulation software. The simulation software stops the simulation calculation when it receives a command to stop simulation; when it receives a command to continue simulation, it performs simulation calculations on the separation process of the input substance to be separated based on the simulation calculation conditions, and outputs the vapor phase composition and liquid phase composition. The processor, connected to the jump interface, is used to execute the PC-SAFT equation of state solution method according to any one of claims 1-6, with the vapor phase composition and liquid phase composition as the composition of the target substance, to obtain the compressibility factor corresponding to the vapor phase composition and the compressibility factor corresponding to the liquid phase composition; Based on the compressibility 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 compressibility 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 calculated. It is then determined whether the fugacity corresponding to the vapor phase composition and the fugacity corresponding to the liquid phase composition are equal. If they are equal, a command to stop the simulation is sent to the jump interface. If not, a command to continue the simulation is sent 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