*2.4. Genetic Function Approximation (GFA)*

Genetic function approximation (GFA) is carried out through selection, crossover and mutation [23,24]. This algorithm is based on Darwin's theory of evolution and some viewpoints of genetics. Generally speaking, choosing an excellent father will lead to better offspring. In addition, the mutation operation accelerates the progress of the algorithm and does not fall into local optimum [25]. By applying this algorithm to the field of intelligence, the optimal selection method is obtained to improve the economic benefits. The structural process is shown in Figure 4.

**Figure 4.** Genetic function approximation chart.

The parallel method can improve the convergence speed under the premise of ensuring a certain fitness, so as to obtain more accurate results. The method extended by this method is the genetic function approximation method. This method has good performance, including high robustness, and can be used to improve fault tolerance.Therefore, this method has been widely used in practical applications.

The core idea of GFA is similar to that of GA (genetic algorithm), which encodes the region to be searched as one or more strings, each string representing a position in the search space, where each group of strings is called a population, and the evolution of the population makes it move towards the search target. At the beginning of the setting, the initial clock group is set to 100, and through 500 iterations, in the iterative process, there is a choice of crossover and mutation. The members through variation need to score; namely, the following fitness function is used to score (Formula (4)). In GFA, the evaluation criteria

of the model are related to the quality of data regression fitting. The fitness function used in this study was Friedman LOF function:

$$F = \frac{SSE}{M[1 - \lambda(\frac{C + dp}{M})]} \tag{4}$$

where *SSE* is the sum of squares of errors, *C* is the number of items in the model, which is not a constant, p is the total number of descriptors contained in all model items, *M* is the number of samples in the training set, *λ* is a safety factor, the value is 0.99, to ensure that the denominator of the expression does not become zero, and *d* is the scaling smoothing parameter; the following expression is associated with the specified scaling LOF smoothing parameter:

$$d = \mathfrak{a} \left(\frac{M - \mathbb{C}\_{\text{max}}}{\mathbb{C}\_{\text{max}}}\right) \tag{5}$$

*C*max means the maximum equation length.

Selection is not random; individuals with good adaptability are chosen. After the reproduction of the selected individuals, the new members need to be graded to determine whether they are the next selected object. Crossing process is the exchange of genetic information between parent chromosomes. The selection of genetic information in the cross process is random. When the cross selection is over, the new members need to be graded to determine whether they are remixed into the population to seek better results.

Parents:

$$\left| \mathbf{x}\_{1\prime}^{2} \,\mathbf{x}\_{2} \right| \mathbf{x}\_{4\prime} \mathbf{x}\_{3}^{2} \tag{6}$$

$$\left| \mathbf{x}\_{1\prime} \mathbf{x}\_{3} \right| \mathbf{x}\_{4\prime} \mathbf{x}\_{5}^{2} \tag{7}$$

Child:

$$\left| \mathbf{x}\_{1\prime}^{2} \,\mathbf{x}\_{2} \right| \mathbf{x}\_{4\prime} \mathbf{x}\_{5}^{2} \tag{8}$$

In order to make genetics more scientific, mutation operation is needed. What is reflected in the computer is the mutual transformation between 0 and 1 so as to find the optimal solution faster.

Finally, through a series of genetic operations, the offspring are optimized, and the mutation operation is used to prevent the calculation results from falling into local optimum, leading to wrong results. The optimal population obtained by this method was the optimal solution we found

### *2.5. Turbidity Point and HLB Value Test*

The cloud point of fluorinated polyether demulsifier was determined by Cintra 10e UV-Vis spectrometer (GBC Scientific Instruments Company, Melbourne, Australia). The HLB (hydrophilic–lipophilic balance) value of demulsifier was calculated according to the cloud point of surfactant and the empirical formula of HLB to obtain the corresponding HLB value. The empirical formula is as follows:

$$HLB = 0.0980 \text{X} + 4.02 \tag{9}$$

X is the cloud point value of 1wt% fluorinated polyether demulsifier.

### *2.6. Experiment on Demulsification and Water Removal of Demulsifier*

Crude oil emulsion with water content of 17.02% was placed into constant-temperature water bath heated to 55 ◦C for 30 min and then put into a stirring motor for 8 min at a speed of 2000 r/min. After that, it was put into the stirring machine for 5 min. A total of 50 mL crude oil emulsion was poured into a calibrated test tube and put it into a water bath heated to 60 ◦C and kept at a constant temperature for 25 min. Care was taken to ensure the height of the water surface did not exceed the height of the crude oil in the test tube.

The demulsifier was added into the test tube with micropipeter, and the cork was tightened. The test tube was turned upside down and shaken 3–5 times, and the cork was loosened to let off air. The bottle was recorked, and the tube was shaken 150 times by hand to fully mix the demulsifier and crude oil emulsion. After the cork was capped, the bottle was placed in a water bath at 60 ◦C for settling. The volume of dehydration at different times was observed to obtain the dehydration volume V. The blank sample without demulsifier addition was set to obtain the dehydration amount Vb. Therefore, the dehydration amount after adding demulsifier was V<sup>d</sup> = V−Vb.

Demulsification efficiency is calculated as follows:

Efficiency (%) = (V<sup>O</sup> − Vd)/V<sup>O</sup> × 100

where V<sup>O</sup> is the volume of water (water content) in the crude oil emulsion and V<sup>d</sup> is the volume of water remaining in the oil phase after demulsifier addition.

### **3. Results and Discussion**

### *3.1. Molecular Dynamics Simulation Results*

The energy optimization trend and optimization steps of molecular dynamics simulation of some demulsifiers are shown in the Figures 5–18.

**Figure 5.** Demulsifier2 # oil–water interface geometric optimization steps.

**Figure 6.** Demulsifier2 # oil–water interface geometry optimization energy trend.

**Figure 7.** Demulsifier4 # oil–water interface geometric optimization steps.

**Figure 9.** Demulsifier6 # oil–water interface geometric optimization steps.

**Figure 11.** Demulsifier8 # oil–water interface geometric optimization steps.

**Figure 12.** Demulsifier8 # oil–water interface geometry optimization energy trend.

**Figure 13.** Demulsifier10# oil–water interface geometric optimization steps.

**Figure 15.** Demulsifier12# oil–water interface geometric optimization steps.

**Figure 17.** Demulsifier14# oil–water interface geometric optimization steps.

**Figure 18.** Demulsifier 14 # oil–water interface geometry optimization energy trend.

When the system was balanced, the free energy of the solution reached its minimum. Therefore, there was a chemical potential equilibrium relationship between surfactant monomer and micelle:

$$
\mu\_{\mathcal{S}}^0 + KT \ln X\_{\mathcal{S}} = \mathcal{g}(\mu\_l^0 + KT \ln X\_l) \tag{10}
$$

where *µ* 0 *l* is the standard chemical potential of surfactant monomer, *X<sup>l</sup>* is the molar composition of the surfactant monomer, *µ* 0 *g* is the standard chemical potential of micelles containing g surfactant monomers, and *X<sup>g</sup>* is the molar composition of surfactant micelles.

Surfactants are dispersed in water in a molecular state, and their hydrophobic ends are arranged at the water interface to form a glacier structure, which reduces the entropy of the system [26]. However, when the hydrophobic end of the surfactant leaves the water interface, the surfactant molecules associate and the glacier structure is destroyed; then, the water molecules are separated from the bondage, thereby increasing the entropy of the system [27]. The formation process of micelles is a spontaneous entropy-driven process. In this process, the chaos of the system increases, and the total formation energy becomes negative [28].

The interfacial generation energy (IFE) refers to the reduced energy of the system after the surfactant molecules enter the oil–water interfacial layer. The stability of the interface can be investigated, and its value is closely related to the interaction force between surfactant and water molecules, surfactant molecules, surfactant and oil molecules. The calculation formula is as follows:

$$IFE = \frac{E\_{\text{total}} - (n \times E + E\_{\text{ref}})}{n} \tag{11}$$

where *Etotal* is the total energy of the surfactant system after equilibrium at the oil–water interface, Kcal/mol. *E*ref is the energy of oil–water interface system without the demulsifier, Kcal/mol (−42933.07). *N* is the number of demulsifier molecules in the system. E is the potential energy of the demulsifier molecule, Kcal/mol.

Table 2 shows that IFE value was negative, indicating that the energy of the whole system decreased. Therefore, after analyzing the absolute value of IFE, it was determined 6# demulsifier had the best effect.

**Table 2.** Interfacial generation energy of demulsifier.


### *3.2. NNA and GFA Prediction Results*

The prediction results of 24 demulsifiers are shown in Table 3. NNA and GFA were used to predict the demulsification effect of 24 demulsifiers, and the results are shown in Table 4. As shown in Table 3, where X and Y are PO and EO values, demulsification dehydration represents a demulsification effect.

**Table 3.** Cloud point and HLB value off fluorinated polyether demulsifiers.


**Table 4.** The actual water removal amount of demulsifiers (120 min, 100 ppm).


Firstly, demulsification experiments were carried out for 24 kinds of demulsifiers to obtain the actual demulsification effect, and the results are shown in Table 3. Then, NNA and GFA were used to predict the demulsification effect of 24 demulsifiers, respectively, and the results are shown in Table 4. As shown in Table 3, X and Y are the values of PO and

EO, and the amount of water removal represents the demulsification effect. Figure 19 is the molecular structure of fluorinated demulsifier.

**Figure 19.** Molecular structure of fluorinated demulsifier.

The calculation results for the HLB value are shown in Table 3.

The values of x and y in R<sup>3</sup> are given in Table 4.

It can be seen from Figures 20 and 21 that GFA had a slightly higher correlation coefficient, but from Table 5, it can be found that the correlation coefficients of both were lower than 0.9, and both were above 0.8. In general, these two methods can predict the demulsification effect of this type of demulsifier. The square value of the correlation coefficient (R<sup>2</sup> , coefficient of determination) reflects that the greater the R<sup>2</sup> , the stronger the predictive ability.

**Figure 20.** Comparison of predicted and actual values by NAA (r<sup>2</sup> = 0.802).

**Figure 21.** Comparison of predicted and actual values by GFA (r<sup>2</sup> = 0.861).


The GFA prediction formula can be edited into:

Water removal amount = 0.626504940 × RAMP (65.555188173 − X) + 0.069567811 × RAMP(78.604247624 − Y) − 0.012461417 × [RAMP (74.580034129-X)]<sup>2</sup> <sup>−</sup> 0.001476625 <sup>×</sup> [RAMP (70.127414082 <sup>−</sup> Y)]<sup>2</sup> <sup>+</sup> 5.110992651 (12)

X and Y are the number of EOs and POs in the experiment, RAMP is the slope function. With this prediction function, such molecules can be predicted through the formula, and the values of different proportions of X and Y and their dehydration rates can be roughly known, which can greatly save time.

### *3.3. Demulsification Mechanism*

Substances that ensure oil–water phase dispersion and do not interfere with each other are called oil–water interfacial films [27]. The formation mechanism of an oil–water interface film is mainly as follows: Natural emulsifiers such as asphaltene and colloid in crude oil emulsion are stably adsorbed on the surface of water droplets, forming an interfacial film with low surface tension and interfacial free energy [28]. The demulsification mechanism of fluorinated polyether demulsifier in this study was the main mechanism of breaking the interface film. With the large-scale use of polymer demulsifiers, the mechanism of breaking interfacial film is increasingly recognized by a large number of researchers [29]. This kind of polymer surfactant has been favored by many oil fields because of its economy. When it is applied to specific crude oil demulsification, the dosage is very small, and the demulsification is very high [30].

The fluorinated polyether demulsifier developed in this paper is a nonpolar surfactant, which introduces a fluorine atom instead of a hydrogen atom to a hydrocarbon chain. The bond energy of the C-F bond is higher than that of the C-H bond, but the polarity is lower than that of the C-H bond [31,32]. Due to the characteristics of the fluorocarbon chain, compared with ordinary demulsifiers, it can reduce the oil–water interfacial tension more rapidly, accelerate the aggregation of water droplets and has better demulsification effect. The demulsification mechanism is essentially that surfactant molecules replace and break the interfacial film to release captured oil particles. Surfactants are added to the emulsion, and because of its higher interfacial activity, they replace the natural emulsifier molecules, such as asphaltene and colloid, adsorbed on the oil–water interfacial film and rearrange the oil–water interface, resulting in the rapid coalescence of water droplets and the realization of oil–water separation. The hydrophilicity of the hydrophilic block (PEO) of the block polyether demulsifier is higher than that of asphaltene molecules in oil. Therefore, the hydrophilic block (PEO) of the block polyether demulsifier can rapidly replace asphaltene molecules at the oil–water interface. When subjected to heating or shaking, the Brownian motion of macromolecules in the emulsion is intensified, and the number of collisions between macromolecules is increased. Therefore, the unstable interfacial film formed by demulsifier molecules is broken. Demulsifier molecules have higher stability because of the high bond energy of the C-F bond and the shielding property of the C-C, which ensures that there is no re-emulsion due to excessive stirring and other factors. Figure 22 depicts a diagram of the demulsification mechanism of the demulsifier.

**Figure 22.** Demulsification mechanism of demulsifier.

### **4. Conclusions**

In this paper, based on the physical parameters of Liaohe crude oil emulsion, 24 kinds of demulsifiers were screened by using the interface generation energy (IFE) module in the molecular dynamics simulation software Materials Studio, and neural network analysis (NNA) and genetic function approximation (GFA) were applied to predict demulsification. The simulation results show that the SDJ9927 demulsifier 6# had the largest reduction in the total energy of the oil–water interface and the strongest reduction in oil–water interfacial tension, and the interfacial formation energy reached −640.48 Kcal/mol. NNA predicted that the water removal amount of the SDJ9927 demulsifier was 7.21 mL, with an overall error of less than 1.83. GFA predicted that the water removal amount of the SDJ9927 demulsifier was 7.41 mL, with an overall error of less than 0.9. The predicted results are consistent with the experimental screening results. SDJ9927 had the highest water removal amount and the best demulsification effect. NNA and GFA had high correlation coefficients, and their R<sup>2</sup> s were 0.802 and 0.861, respectively. The higher R<sup>2</sup> was, the more accurate the prediction accuracy was. Finally, the demulsification mechanism of the fluorinated polyether demulsifier was the following: The demulsifier molecules with high interfacial activity replace the natural emulsifier on the oil–water interfacial film and form a new unstable interfacial film. When subjected to heating or shaking, the interfacial film collides with other macromolecules, and the interfacial film breaks, and the water droplets gather to complete the oil–water separation. The demulsification mechanism of the interfacial film was broken by the collision of the fluorinated polyether demulsifier. It was found that when subjected to heating or shaking, the macromolecules in the emulsion exhibited irregular Brownian motion and collided with other macromolecules, resulting in the rupture of the interfacial film. The water in the internal phase broke through the interfacial film and entered the external phase to aggregate, so as to achieve the purpose of oil–water separation.

**Author Contributions:** Conceptualization, L.W.; methodology, C.L. and L.W.; software, X.G. and H.G.; validation, X.J.; formal analysis, X.G.; investigation, C.S.; resources, Y.C.; data curation, L.H.; writing—original draft, X.G.; writing—review and editing, L.Z. and X.J. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research was funded by the Natural Science Foundation of Shandong Province for Youth, grant number ZR2020QE111, key projects of the Shandong Natural Science Fund, grant number ZR2020KE041 and Postdoctoral Science Foundation of China, grant number 2020M681073.

**Institutional Review Board Statement:** Not applicable for studies not involving humans or animals.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** All data, models, and code generated or used during the study appear in the submitted article.

**Acknowledgments:** The authors are grateful for the reviewers' instructive suggestions and careful proofreading.

**Conflicts of Interest:** The authors declare no conflict of interest.

**Sample Availability:** Samples of the compounds are available from the authors.

### **References**

