Modeling and simulation of paraf ﬁ n solubility in circular pipes in laminar regime ﬂ ow

The paraf ﬁ nic wax deposition of the crude oil reduces pipe ’ s ﬂ ow area, causing, consequently, larger costs for the oil industry. The solubilization of paraf ﬁ n using solvents is a viable solution, especially in pipes within treatment plants and oil processing, where use other methods has been restricted, such as the “ pig ” . This paper proposes a method to calculate the paraf ﬁ n wax solubility in solvent, based on solid – liquid thermodynamic approach for this was proposed a discredited mathematical model for heat and mass transfer. The simpli ﬁ ed model is able to successfully reproduce many of the known trends of the paraf ﬁ n solubility. These models were implemented in programming software, where it was possible to obtain results, as variations in the length of pipe, type of solvent and inlet temperature. The models produced adequate solutions, maintaining continuity of differential energy and mass balance equations, with a viable physical interpretation.


Introduction
The formations of paraffinic wax crystals can occur when paraffinic crude oil is subjected to changes in temperature. While the paraffin solubility is strongly dependent on temperature, the pressure does not significantly affect the solubilization in the pipe (Cabanillas, 2006). However, the operating pressure in a wellbore affects paraffinic wax solubility through its effects on solution gas. The gas in solution in the oil it acts to some degree as a solvent for paraffinic wax, the loss of solution gas raises the paraffinic wax crystallization temperature, decreasing the solubility of the paraffinic wax in the oil (Weingarten and Euchner, 1988). In an oil piping, where cooling takes place below the initial temperature of crystal formation, a temperature gradient is established in the radial direction of the pipe, initiating the paraffin crystallization process (Gomes, 2009).
The paraffin crystallization process is closely associated to thermodynamic equilibrium, and is a function of the composition of various fractions that oil make up. Paraffin crystallizes when it is deposited on the inner walls of pipes, reducing the flow area and sometimes resulting in total blockage of the pipe. This significantly increases costs in the oil industry due to production losses, damaged equipment, in addition to elevated operating risks in terms of human and material losses (Haddad et al., 2010). In treatment plants and oil processing with the pipes small length and small diameter, where use the PIG is restricted and unfeasible, the use of solvent is a viable solution.
In all situations, the most efficient way of dealing with this paraffin deposition problem is preventing its occurrence. This requires total control over all the variables involved in the crystallization process. However, given the difficulty in controlling them, the resolution of this problem is not easy. Thus, a number of researchers have investigated different methods and processes capable of inhibiting the deposition of these paraffins. The controlling of the paraffin deposition process involves consolidated operational methods such as when using chemical additives (which modify the shape of the crystals), thermal isolation, and mechanical and chemical solvent removal (Gomes, 2009).
The paraffin deposition mechanism is important for the understand of paraffinic crystal formation conditions and avoiding them in real processes. The deposition process of paraffin has been widely studied in recent decades by countless researchers (Burger et al., 1981;Hunt, 1962;Leiroz and Azevedo, 2005). A number of mechanisms describe the deposition phenomenon such as molecular diffusion, Brownian diffusion, shear dispersion mechanism and gravitational mechanism (Jung et al., 2014). Azevedo and Texeira (2003) conducted a literature review to assess the main models applied to describe paraffin deposition mechanisms. They observed that the molecular diffusion was predominant in most of the models studied, while the gravitational mechanism played no significant role in the paraffin deposition process.
Some deposition prediction models are simple, based on solubilization curves (Gustavo and Sergio, 2006;Ribeiro et al., 1997). In these models, the flow profile is considered parabolic, one-dimensional and under steady state, and only the molecular diffusion mechanism is present. Also using only the molecular diffusion model, Romero (2005) compared his models with experimental data obtained by Leiroz (2004), in which good agreement was observed when flow was in a permanent regime, although the same did not occur in the transient regime. Ramirez-Jaramillo et al. (2004) modeled the wax paraffin deposition in oil pipelines considering mathematical models with molecular diffusion mechanisms in radial coordinates and flowinduced shear removal.
Given that solubility process is the inverse deposition process, the aim of this study was to develop a calculation method that represents the paraffin solubility in paraffinic solvents, based on phenomenon of mass transfer, energy transfer and solid-liquid equilibrium, proposed for the deposition process. Furthermore, also were evaluated concentration, temperature and solubilization profiles through these models, as well as better flow and operating conditions in the solubilization process.

Mathematical modeling
Modeling of the paraffin solubility process consists of three phenomena: energy and mass transfer, solid-liquid equilibrium. Based on works by Araújo (2008), Ramirez-Jaramillo et al. (2004) and Singh et al. (2000), the following assumptions were made: (i) velocity profile developed at each time interval which assumes the solid-liquid interface moves slowly over time analyzed, consequently the mass and energy balance could be considered as a quasi-stationary model in the paraffin solubility process; (ii) in a laminar regime, the shear removal rate was disregarded using only molecular diffusion; (iii) supposing the quasi-stationary regime, heat transfer in the axial direction occurs almost instantaneously,      can be disregarded for paraffin deposition.

Theoretical and numerical models of energy and mass balance
Modeling heat and mass flow was based on the hypothesis that the mathematical problem was discretized by dividing the pipe into cells. Taking a cylindrical surface as control volume, energy and mass balance in the pipe system are calculated using Eqs.
where ρ is the density of the fluid, c p is the heat capacity of the solvent at constant pressure, V r is the radial velocity, r is the radius, θ V is the tangential velocity, r is radius, V z is the axial velocity, k is the thermal conductivity of the liquid, T is the temperature, μ is the viscosity, ∅ v is the dissipation function, C w is the paraffin concentration, D Cw is the mass diffusivity of the paraffin and R A is the chemical rate (Bird et al., 2004).
To represent energy and mass balance in the paraffin solubility process, a number of aspects and simplifications were assumed, as follows: (i) the fluid Flow has a laminar regime, parabolic profile, non-isothermal, without energy generation and chemical reaction; (ii) viscous dissipation, due to frictional effects on the duct wall, which can be disregarded given the low Reynolds number flow; (iii) the effect of dissolved paraffin was not considered in the rheology of solvent (Dantas Neto et al., 2000); (iv) since the system does not have large velocity gradients, function μ∅ v of Eq. (1) can be disregarded (Bird et al., 2004); (iv) constant heat flow on the inner wall of the tube, considering the entire wall at same temperature; (v) thermal and mass diffusion only in the radial direction, supposing that axial diffusion is negligible, using convectiondiffusion analysis; (vi) solvent with paraffin concentration at the inlet of the system equal to zero. Using these simplifications, Eqs.
where V max is the maximum velocity in the velocity profile, R is the pipe radius. Rewriting Eqs. (3) and (4) in function of nondimensional variables, one obtains Eqs. (5) and (6)  where T 0 is the temperature of the solvent at the inlet of the pipe, T p the pipe wall temperature, l is the length, L the total pipe length and r i is the inner radius of the pipe with paraffin deposition. D w can be obtained using Eq. (7), correlation proposed by Hayduk and Minhas (Poling et al., 2001).
where μ is the solvent viscosity, V A is the molar volume of the paraffin, MW is the molecular weight and γ is the a function of molar volume of the paraffin. Given that the theoretical models of mass and energy balance resulted in parabolic equations, the finite differences method was used to obtain numerical solution. It was only possible to obtain temperature and the mole fraction at the radial axis for each axial point by replacing the partial derivatives for its approximations by finite differences in the mass and energy balance equation, thereby obtaining a system of algebraic equations.
where i and j respectively correspond to the discrete points along the δ (axial) and ε (radial) coordinates.

Liquid-solid equilibrium
There are several of thermodynamic models (ideal solution model, UNIQUAC, UNIFAC, Wilson equation and NRTL) that can be used to obtain the solid-liquid equilibrium constants of the components present in the oil (Coutinho, 1999). This study used the ideal solution model to calculate the first approximate mole fraction (Eq. (12)), and the UNIFAC model to calculate the activity coefficients (Araújo, 2008). Assuming ideality of the solid phase proposed by Pan et al. (1997) together with activity coefficient value obtained by UNIFAC model, a new mole fraction was finding using Eq. (13), also being neglected the presence of occluded oil in the deposit; therefore S i (paraffin fraction in the solid phase) was replaced by 1  melting temperature. Melting enthalpy values, heat capacity and melting temperature was determined using Eqs. (14), (15) and (16) respectively and heat and temperature of phase transitions were determined using Eqs. (17), (18), respectively and total heat of melting using Eq. (19). The correlation used for the paraffins heat and temperature of phase transitions and melting was based on the data by (Coutinho et al., 2001)   where ∆H tot w , [kJ/mol] is total heat of melting, C ni is the number of carbon atoms in n-alkane i. These equations are valid from pentane to n-alkanes larger than nC 100 H 202 for the melting temperatures and total heat of melting. The solid phase transitions occur for n-alkanes between nC 9 H 20 and nC 41 H 84 inclusive (Coutinho et al., 2001).

Mass transfer and paraffin solubility in the pipe
To analyze the mass transfer of paraffin, it was assumed that the dominant mechanism in the solubilization process was molecular diffusion according to Fick's Law, where mass transfer flow at a determinate position z occurs in a radial direction r, as in Eq. were obtained by concentration distribution as a function of temperature and temperature distribution as a function of the radius, respectively. After the determination of the mass flow, the total mass of solubilized paraffin and the decrease in its thickness inside the pipe can be calculated for a given point (z) at a given time (t). Thus, the total mass of solubilized paraffin is the sum of all the solubilized paraffin along the pipe and time. By Eq. (21) With total mass solubilized, it was possible to calculate the new useful radius of the pipe over time. Then, the variation in radius in terms of z for a determinate time can be defined by Eq. (22).
where r w is the new radius of pipe in the time t, r 0 is the radius of the pipe in the time (t À 1), m is the mass of solubilized paraffin in the time t and z is the length of pipe.

Computational algorithmic implementation of the solubilization process
The solubilization system is a moving boundary problem, since conditions such as temperature, concentration, pipe radius and other parameters change over time and with pipe length. As such, a synchronization process was proposed based on heat and mass transfer models defined for paraffin solubility (Eqs. (8)-(11), (13), (21) and (22)). Since will occur the solubility of the paraffin deposited the system geometry is also changed. Thus, it is assumed that the velocity profile, pipe diameter, temperature and concentration must be calculated at each time interval. Fig. 1 represents this algorithm.

Validation of implemented computational algorithms
To assess computational implementation and the models used in the study, simulations were conducted in different operating conditions (temperature, diameter and pipe length). The simulations were applied and compared with commercial simulators and experimental data. Where the mole fraction at equilibrium, activity coefficients and operating temperature were considered as factors for comparison.
Experimental data obtained by Barbosa Junior et al. (2007) were used to validate the routine of the model used to calculate the mole faction at equilibrium, where synthetic systems of paraffin/solvent were considered.
The routine of the UNIFAC model implemented in the study to determine activity coefficients was validated by comparing the values obtained with the results presented by the UNIFAC simulator (Activity Coefficient Calculator), developed by Bruce Choy and Danny D. Reible from the Department of Chemical Engineering, University of Sidney, Australia and Louisiana State University, USA, respectively.
The proposed routine for calculating operating temperature was

Analysis of paraffin solubilization process parameters
The models were implemented in programming software and the developed routines were called through a graphical interface, where simulations of paraffin solubility can be carried out.
In order to evaluate the paraffin solubility process in circular pipes, simulations were performed varying three parameters: pipe length, type of solvent and solvent inlet temperature (T i ). These parameters are important when analyzing time and quantity of solvent to be used in the complete solubility of paraffin. This analysis also allows assessment of the temperature profile and the paraffin solubility profile along the entire pipe. Table 1 show the different parameters used in the simulations.
The physicochemical properties of the solvents considered in simulations are in Table 2.
In simulations were used paraffinic wax data obtained by Gomes (2009), according (Dirand et al., 2002), the paraffin has molecular weight 394 g/mol, 28 carbon atoms and melting point of 333.15 K.
An average molecular formula (C 13 H 28 ) was used for conductivity values and heat capacity of kerosene, since this solvent is composed of a complex mixture of hydrocarbons (Szklo and Uller, 2008).

Mole fraction of paraffin at equilibrium
Simulations were carried with hexane, decane and dodecane, in the range temperature ( T f solvent , to 330.35 K). The paraffin used in the simulation has been the same structure employed by Barbosa Junior et al. (2007). Two models were considered: Eqs. (12) and (13). The results are presented in Fig. 2.
Both models has exhibited similar behavior to experimental data by Barbosa Junior et al. (2007), see Fig. 2. Model of Eq. (13) is useful, because it can represent paraffinic solvents systems as well as no-paraffinic solvents systems (Gomes, 2009).

Activity coefficient
To validate the routine of activity coefficient were used molecular weight of 394 g/mol to paraffinic wax. The mole fraction was fixed at 0.6806 and 0.1242 to solvent in the temperature of 318.15 K and 325.15 K, respectively. The results are presented in Table 3.
The results in Table 3 showed that the routine used to calculate activity coefficients corroborated with the results obtained in the commercial simulator with few divergence values in order of 0.02%, and such difference may be attributed the of software sensibility.

Operating temperature
The algorithm of calculation operation temperature was validated by four simulation, two with 18% and two with 40% of the cross sectional area filled with wax paraffin. The solvent used in simulation was hexane. The simulations were performed as described in Table 4. The results are exhibited in Fig. 3.
The results presented in Fig. 3, show that the values found by the model differ less than 1.5%, in relation to the values obtained with the commercial simulator, showing that the proposed routine can be used to calculate the temperatures inside the pipe.

Variation in pipe length
As the length of the pipe increasing, it is expected that the temperature of the solvent flowing in the pipe decreases because the solvent temperature is higher than the outside pipe temperature, inducing heat exchange and consequently less solubilization of the paraffin.
To assess the effect of the length in solubilization process, two simulations were conducted, one with a 10-m pipe and other with 50-m pipe. The data described in Tables 1 and 2 were used to obtain the two profiles of temperature presented in Fig. 4 for different times.
The temperature profiles represented by Fig. 4, shows that a larger pipe length, causes a greater solvent cooling. This is expected, because a larger pipe, allows more heat loss, thereby decreasing the solvent temperature.
The paraffin thickness profiles in the pipes are exhibited in Fig. 5. Since the interface temperature (paraffin/solvent) drops along the pipe, the paraffin fraction at equilibrium, will also decline, hindering its solubilization. Fig. 5a shows the complete paraffin solubility after 3000 min. However in the larger pipe, (b), it would be necessary a larger time simulation, to get a complete paraffin solubility. It is possible to observe that in the final lengths of the pipe, a lower solubility occurred, because the solvent is cooler in this region.

Variations in solvent type
The type of solvent used in the solubilization process, has a direct effect on the diffusivity of paraffin. This occurs because the diffusivity of paraffin is proportional to the molecular weight of the solvent used, that is, solvents of the high molecular weight hinder the solubilization, due to their long nonpolar chain.
To assess this parameter in the solubilization process, two simulations were carried out, considering hexane and kerosene as solvents, in a 10-m pipe. Fig. 6 shows the thickness profile of paraffin deposited in pipes at different times, with the use of these solvents.
The paraffins is more easily solubilized by hexane, than kerosene, as can be observed in Fig. 6. One of the causes is the molecular weight of the solvent. The solvent with larger carbon chain provides a smaller solubility of the paraffin. In this case, the effect is observed in the steric hindrance, that kerosene molecules exert on paraffin, impeding its solubilization.
Another factor that influences paraffin solubility is the carboncarbon relationship of the compounds (paraffin and solvent), which has a direct effect on the polarity of carbon chains. The nonpolar chain of the kerosene is longer than that of the hexane, causing a greater repulsion in the nonpolar chain of the paraffin.
The effect of the temperature along the pipe length can be observed in Fig. 7 for each section of the pipe in each time interval. The simulations shows the total variation of the temperature within the pipe with hexane was greater (4.3) than in kerosene (2.9). This fact is related to the higher paraffin solubility in hexane, Fig. 6, which causes a reduction in the thickness, thereby increasing heat loss of the solvent to the environment.

Inlet temperature variation of the solvent (T e )
According to Gomes (2009), the amount of paraffin solubilized in the solvent is strongly influenced by the temperature of the medium: the higher the temperature at the solid-liquid interface, larger is the mole fraction of paraffin at equilibrium in the solvent. This effect favors a higher mass flow rate of paraffin present on the pipe wall to the solvent.
Two simulations were performed to assess this parameter in the solubilization process, with solvent inlet temperatures of 428.15 K and 318.15 K. The Kerosene was used in these simulations, given that for a temperature of 428.15 K, hexane is already in its gas form, precluding its use as a solubilizing agent. Fig. 8 shows the paraffin thickness profiles along pipe. The higher inlet temperature (T i ¼428.15 K) promoted greater paraffin solubility and as the thickness of paraffin deposited in the pipe decreases, so does the time to remove it. This is expected because temperature is a parameter that increases paraffin solubility in the solvent.
The temperature behavior along the pipe for values of 428.15 and 318.15 K is shown in Fig. 9. Figs. 8 and 9 indicate that the thickness of the paraffin layer in the pipe declines faster in the higher temperature than at smaller temperature. A larger solubility at high temperature causes a larger thermal exchange and greater cooling, as can be seen in Fig. 9a-d. All paraffins in the pipe can be solubilized after an operating time of 4500 min, to inlet temperature of 428.15 K (Fig. 9a-b).

Conclusions
The mathematical models and calculation routines used in the study were validated, allowing predictive assessment of the paraffin solubility process. the models were implemented in programming software, the variables that influence the solubilization process, such as pipe length, type of solvent, and solvent inlet temperature, were evaluated.
It was observed that the longer the pipe, the greater the solvent heat loss to the environment, such that the temperature at the paraffin/solvent interface declines along the pipe, hindering the solubilization process and requiring more solvent. With respect to solvent type, the size of the carbon chain has an influence on the process, since the larger the paraffinic chain, less paraffin is solubilized. Moreover, the higher the inlet temperature, more paraffin is solubilized.
This study demonstrated that a simulator can be developed to predict solubilization of paraffin deposited in oil pipe, where satisfactory results were obtained, demonstrating the validity of the proposed model. Thus, the data presented in the simulation shows that it is possible obtain better solubilization conditions to apply in the industry.