Screening and Demulsification Mechanism of Fluorinated Demulsifier Based on Molecular Dynamics Simulation

In order to solve the problem of demulsification difficulties in Liaohe Oilfield, 24 kinds of demulsifiers were screened by using the interface generation energy (IFE) module in the molecular dynamics simulation software Materials Studio to determine the ability of demulsifier molecules to reduce the total energy of the oil–water interface after entering the oil–water interface. Neural network analysis (NNA) and genetic function approximation (GFA) were used as technical means to predict the demulsification effect of the Liaohe crude oil demulsifier. The simulation results show that the SDJ9927 demulsifier with ethylene oxide (EO) and propylene oxide (PO) values of 21 (EO) and 44 (PO) reduced the total energy and interfacial tension of the oil–water interface to the greatest extent, 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.41mL, 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 rate and the best demulsification effect. NNA and GFA had high correlation coefficients, and their R2s were 0.802 and 0.861, respectively. The higher R2 was, the more accurate the prediction accuracy was. Finally, the demulsification mechanism of the interfacial film breaking due to the collision of fluorinated polyether demulsifiers was studied. It was found that the carbon–fluorine chain had high surface activity and high stability, which could protect the carbon–carbon bond in the demulsifier molecules to ensure that there was no re-emulsion due to the stirring external force.


Introduction
Liaohe Oilfield in China mainly produces heavy oil and super heavy oil. It is very difficult to demulsify the oil emulsion because of its large asphaltene content and high viscosity [1]. Liaohe Oilfield has entered the middle and late stage of exploitation. Since water flooding cannot meet the demand of the oilfield production increase, alkali-surfactantpolymer (ASP) flooding technology can better meet the demand of the production increase in Liaohe Oilfield in the middle and later stages of production [2,3]. ASP flooding technology can greatly improve oil recovery, but the synergistic effect and emulsifying effect in the process of oil displacement make the emulsification of produced fluid very serious [4,5]. When the crude oil is produced by ASP flooding, a large number of surfactants, polymers and other chemicals are used, resulting in more complex produced fluid systems and more difficult demulsification [6]. Transportation and refining of this stable emulsion without treatment can cause serious problems, such as pipeline corrosion, scaling, increased equipment load and fuel consumption [7,8]. Conventional demulsification technology mainly includes physical demulsification, chemical demulsification and biological demulsification [9][10][11]. Chemical demulsification requires simpler equipment and has a lower cost and better demulsification effect. It can be used alone or combined with other demulsification methods to achieve efficient demulsification [12,13]. However, at present, many demulsifiers cannot meet the actual needs of Liaohe Oilfield or are difficult to apply due to cost, safety and other factors [14]. Therefore, the synthesis of a kind of demulsifier which is suitable for the development of Liaohe Oilfield and can efficiently and rapidly demulsify has become an urgent problem, which is of great significance to the good and efficient development of Liaohe Oilfield.
In recent years, molecular dynamics simulation technology has developed rapidly and is gradually applied to surfactants such as demulsifiers. Molecular dynamics simulation refers to the use of computer technology, discusses the interfacial structure and interfacial action of emulsion after adding the demulsifier at the molecular level in order to explain the role of demulsifiers through this technology, optimizes the selection of efficient demulsifiers and better serves oilfield production [15,16]. Using molecular dynamics simulation to guide experimental research not only makes the experimental data and their universal mechanism more visible, but also provides a new direction for future experimental research.
Marquez et al. [17] first studied the demulsification behavior of demulsifiers at the oil-water interfacial film of oil-in-water emulsion using an atomic model. They found that surfactants that can be used as demulsifiers must have the following characteristics: Firstly, the solubility of demulsifiers in the aqueous phase must be higher than that in the oil phase. Secondly, they must have certain diffusions and concentrations. Finally, the surface activity of demulsifiers must be higher than that of emulsifiers. The demulsifier with the above characteristics can reach the oil-water interface film and reduce the stability of the interface film to achieve demulsification.
Ballal et al. [18] used the improved iSAFT (interfacial statistical association fluid theory) to explore the influence of poly (ethylene oxide)-propylene oxide polyether on the interfacial film of water-toluene by studying the molecular weight, the ratio of EO to PO, branching degree and order degree, so as to understand the influence of demulsifier structure on the interfacial film at the molecular level and predict the performance of real demulsifiers. The results show that the interfacial tension decreased with the increase in molecular weight and the number of branched chains. When EO:PO = 1:1, the interfacial tension is at its minimum. Moreover, the surface activity of PEO-PPO-PEO is higher than that of PPO-PEO-PPO.
Zhang et al. [19] used a polyamide-amine dendrimer demulsifier to study the effect of the hydrophobic chain on interfacial properties and demulsification with molecular dynamics simulation technology. The results show that with the increase in the demulsifier concentration, the kinetic parameters n and t* obtained by characterizing the molecular diffusion rate decreased. At the same time, unlike the traditional demulsifier adsorption and diffusion behavior, with the increase in the hydrophobic chain length, the t* value decreased and the n value increased, showing a slow diffusion-adsorption process.
A machine model algorithm can predict and integrate new rules and development trends from a large number of data texts in multiple dimensions. In general, the process of using machine algorithm to simulate experimental data can be divided into two steps: inputting old data and simulating new trends. With the development and widespread application of computer algorithms, researchers often use the neural network algorithm and genetic algorithm to predict the mixed-phase pressure, and good prediction results have been achieved.
The purpose of this study was to provide efficient and economical fluorinated polyether demulsifiers for Liaohe Oilfield. Compared with general demulsifiers, the fluorine atoms contained in this demulsifier can partially or completely replace the hydrogen atoms on the hydrocarbon chain, so that the nonpolar groups in the demulsifier can form carbonfluorine bonds with stronger bond energy, and this carbon-fluorine chain with higher bond energy can show strong stability. Fluorinated polyether demulsifiers have better surface activity, chemical stability, thermal stability and compatibility than conventional demulsifiers. Fluorinated hydrocarbon groups are also hydrophobic, which can reduce pollution. The interfacial generation energy (IFE) in molecular dynamics was used to screen 24 kinds of demulsifiers. Neural network analysis (NNA) and genetic function approximation (GFA)were applied to predict demulsification, so as to look for the rules from the existing experimental data to obtain the corresponding prediction conclusions.

Materials
Tetraethylenepentaamine was purchased from Beijing Tianyu Kanghong Chemical Technology Co., Ltd. (Beijing, China). P-trifluoromethyl phenol was purchased from Shanghai Sahn Chemical Technology Co., Ltd. (Shanghai, China). Formaldehyde was purchased from Shanghai Macklin Biochemical Technology Co., Ltd. (Shanghai, China). Xylene and toluene were ordered from Shanghai Jizhi Biochemical Technology Co., Ltd. (Shanghai, China). Potassium hydroxide was purchased from Shanghai Sibaiquan Chemical Co., Ltd. (Shanghai, China). Potassium hydroxide was purchased from Shanghai Sibaiquan Chemical Co., Ltd. Ethylene oxide (EO) and propylene oxide (PO) were purchased from Zibo Shandong Zixiang Sales Chemical Co., Ltd. (Zibo, China). The tested oil sample was produced from fluid from a block in Liaohe Oilfield. Fluorinated demulsifiers were synthesized by using trifluoromethyl phenol, formaldehyde and other raw materials as initiators and then synthesized through polymerization reaction with propylene oxide and ethylene oxide [20]. The physiochemical characteristics are shown in Table 1.

Molecular Optimization and Model Construction
All the simulations were performed on the molecular dynamics software Materials Studio2018. The interaction parameters of surfactants came from the condensed-state optimized molecular force field-COMPASS force field.
Firstly, the 3D model structures of n-decane and demulsifier molecules were built by using the Visualizer module in the program, and the geometric optimization of the structures of the three surfactant molecules was carried out by using the Smart method through the COMPASS force field of the Dmol3 module, so that the surface molecular system could achieve the minimum energy, and the optimized molecular structure of the optimal molecular conformation was obtained, as shown in Figure 1.
Then, the crude oil system model and demulsifier system model were established at 278 K by using the construction tool under AC module, COMPASS force field and Periodic Cell periodic boundary conditions. Based on the position reference of the rectangular coordinate system, the size of the system box was set. With the origin as the center, the lengths in x, y and z directions were 4 nm × 4 nm × 12 nm, respectively. The system model is shown in Figure 2. The simulation systems with different EO/PO ratios were composed of 2000 n-sunane molecules and 500 water molecules.
Finally, the Dynamics tool under the Forcite module was used. The simulation level was MEDIUM, and the simulation system ensemble was NVT ensemble, keeping the system at a constant temperature of 298 K. AtomBased was used to represent van der Waals interaction and electrostatic interaction. Andersen method was selected for parameter control of ensemble, namely temperature control. In addition, Berendsen method was used for pressure change. A 3000-step process was established and the last nanosecond result was obtained by statistical analysis.

Neural Network Analysis (NNA)
Neural network analysis (NNA) refers to the method of machine learning and data processing that controls various parameters and layers based on the way in which neurons in the brain of organisms transmit information [21,22]. NNA was first proposed by McCulloch and Pitts in 1943 as a way to simulate the analysis of neurons in the brain. Although it makes too many assumptions and simplifications than real brain neurons, it still contributes considerable intelligence in research. Therefore, NNA has considerable research and application value. Since then, NNA has been greatly developed, and hundreds of models have been proposed. Figure 3 is a complete typical three-layer neural network structure, which is divided into three parts: multinode input layer, single-node output layer and hidden layer. A three-layer BP neural network can solve almost all the prediction problems near exact precision, so only one hidden layer was used in this study. Neurons refer to nodes, which are the most basic structure of neural networks. Each node is an information-processing element. In addition to the input layer, each node uses the transformed linear combination of node output from the lower layer as its input: In the expression, I i is the input to the i node, X j is the output of the j node in the previous layer, j is the summation of all nodes in the previous layer, w ij is the connection weight between nodes, and θ i is the offset value. It is worth noting that the nodes between each layer are not fixed, which needs to be set according to the actual situation. When exploring MMP, the nodes in the input layer are designed as multiple variables that affect MMP, and the output is the corresponding MMP value. The number of hidden layers and the number of nodes in each layer can be defined by users themselves, so as to make the output results closer to the real value.
The transfer function needs to be realized through the transfer function between the input layer and the hidden layer and between the hidden layer and the output layer. In addition, the conversion information is realized by setting the weights and bias values. In this way, the data between the input layer and the output layer can be connected and their relationship can be directly reflected. The study uses a transfer function called Sigmoid transfer function (Formula (2)), which allows for easy differentiation and has a smooth function to achieve data output in a narrow range.
After setting the above information, training should be started and the neural network should be learned independently. The training minimizes the error and makes the final prediction more accurate. Here, BFGS algorithm is used to find the minimum value of the error, and the error function (3) is used to determine the matching degree between the calculated output and the expected output: where C i is the parameter value of the proportion of results. In this study, the item is 1, y i and y i represent the true value and the predicted value, respectively. Q is the penalty factor set for the missing value, x j is the missing data value of the system guess, x j is the average value of each input data, P represents the penalty factor of connection weight, and w k,l represents the connection weight. The first item is the main item of the error, which is the sum of squares of the difference between the predicted value and the actual output value of the model. The second item represents the error caused by filling the missing data. In addition, the average connection weight is added to the error function to prevent the collapse or error caused by excessive weight. In this way, the learning cycle iteration of the neural network can be carried out until the error drops to a certain level, and finally a trained neural network can be obtained.

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. 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: 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: 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: Child: 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

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: X is the cloud point value of 1wt% fluorinated polyether demulsifier.

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 V b . Therefore, the dehydration amount after adding demulsifier was V d = V−V b .
Demulsification efficiency is calculated as follows: where V O is the volume of water (water content) in the crude oil emulsion and V d is the volume of water remaining in the oil phase after demulsifier addition.

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.              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: µ 0 g + KT ln X g = g(µ 0 l + KT ln X l ) (10) where µ 0 l is the standard chemical potential of surfactant monomer, X l is the molar composition of the surfactant monomer, µ 0 g is the standard chemical potential of micelles containing g surfactant monomers, and X g 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: where E total 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.

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. 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. The calculation results for the HLB value are shown in Table 3. The values of x and y in R 3 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 2 , coefficient of determination) reflects that the greater the R 2 , the stronger the predictive ability.
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.

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.

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 2 s were 0.802 and 0.861, respectively. The higher R 2 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. Data Availability Statement: All data, models, and code generated or used during the study appear in the submitted article.