Introduction

Nowadays, human demand for energy is extremely increasing, especially in the industry. This issue demonstrates that there is no remedy but accepting more dependency on energy than the past. Although the renewable energy resources can supply a portion of these needs, hydrocarbon resources are still used as the main energy resource of the human being. Thus, it should be noted that the importance of the fossil fuels, particularly oil and gas, has enhanced in recent decades. A nonstop and secure production from oil and gas wells so-called flow assurance is always favorable, but some issues can occasionally affect these conditions. In this regard, one of the main problems is asphaltene deposition within the production wells and transportation pipelines. The concentration gradient along with temperature and pressure profiles, especially around the wellbore, can influence the stability of asphaltene colloidal particles in the tubing well and surface facilities and subsequently result in asphaltene precipitation (Hammami and Ratulowski 2007). Generally, conventional treatment such as injecting asphaltene inhibitor in oil wells will be carried out after the emergence of asphaltene precipitation (Soulgani and Rashtchian 2010). The remediation process is an expensive way to alleviate the problem associated with the deposition of asphaltene flocculates. Therefore, if the conditions of asphaltene precipitation are predicted, it can reduce the costs and diminish subsequent problems in production unit facilities. On the other hand in some cases, it is not possible to prevent asphaltene deposition. Thus, it is necessary to model the fluid flow behavior in order to find the optimum conditions where the blockage is less likely. In these cases, it should be noted how precipitated and suspended asphaltene particles behave in specific flow conditions within the crude oil (Allenson and Walsh 1997). There are several studies presented in the literature for asphaltene deposition modeling. Ramirez et al. (2006) proposed a model for deposition of asphaltene that is based on both molecular diffusion and shear removal as competing mechanisms during the deposition of asphaltene particles. They supposed that the particle concentration gradient is generated by the temperature gradient on the wall. This approach was derived from the theory of wax deposition. Soulgani et al. (2008) fitted the asphaltene deposition rate using a simple correlation. They assumed that the rate of deposition on the surface of the tubing is controlled by chemical reaction mechanisms. The exponential Arrhenius expression was used as the basis for this correlation, but it did not provide an acceptable justification about the physics of deposition. Vargas et al. (2010) presented a comprehensive model for single-phase flow consisting of sub-models. The sub-models described particle precipitation, aggregation, transmission and deposition on the wall; thus, it seems that this model is more extensive compared to the previous models. In this model, aggregation and deposition processes have been modeled using pseudo-first-order reactions. They considered a constant value for diffusivity coefficient of asphaltene particles in the stream. This coefficient can be empirically evaluated using toluene solution. In the model, infinitesimal aggregation (i.e., size of the micron) can stick to the walls and form a deposited layer. Vargas’ model ignores the possibility of large aggregation adherence. The model has some setting parameters being identified using laboratory data. They indicated their model can provide a detailed description of asphaltene deposition in the capillary tubes. Eskin et al. (2011) suggested a model based on data from experiments carried out using the Couette device. The developed model consists of two modules:

  1. (1)

    A sub-model to describe the evolution of the particle size distribution along a tube in the Couette device over time. The population balance model has been used for modeling the evolution of particle size.

  2. (2)

    A sub-model to measure the particle transmission to the wall.

In this model, only particles with the smaller size compared to the critical amount can be involved. The developed model includes three parameters, which should be empirically determined using the Couette device. Shirdel et al. (2012) modeled Friedlander and Johnston (1957), Beal (1970), Escobedo and Mansoori (1995a and b) and Cleaver and Yates (1975) models as an integrated form ignoring electrostatic forces and thermophoresis effects between the wall and particle. They compared the results of models with available experimental outcomes. The effects of thermodynamic, thermokinetic and hydrodynamic parameters on the deposition of the asphaltene particle have been investigated in their study. Paes et al. (2015) investigated the asphaltene deposition on well during turbulent flow. Their method is based on the fundamental concepts of mass transfer and particle deposition theories in turbulent flow. They studied available deposition models (Lin 1953; Friedlander and Johnston 1957; Beal 1970; El-Shobokshy and Ismail 1980; Papavergos and Hedley 1984; Escobedo and Mansoori 1995a, b) and validated them using four series of aerosol experimental data. In order to evaluate the main dominant parameters and mechanisms on asphaltene deposition, a sensitivity analysis has been conducted. In order to predict the asphaltene deposition in an oil well, Kor et al. (2017) used a commercial package of phase behavior to execute the equilibrium flash calculation for a solid model using field data. In the model, different depositional mechanisms have been utilized to predict the profile of asphaltene deposition in a well of Kuwait fields. In this paper, the behaviors of asphaltene precipitation and deposition at flow conditions of a well of one of the Iranian south oil fields (as a case study) are being modeled. For this purpose, a dynamics procedure shown in Fig. 1 has been developed. The optimum conditions of well production and completion have been investigated via making some sensitivity analysis on different parameters in the well.

Fig. 1
figure 1

Developed procedure for comprehensive asphaltene study

Asphaltene and facilities performance modeling

Asphaltene precipitation thermodynamic modeling

Any change in thermodynamic conditions would result in alteration of asphaltene equilibrium into the oil phase. This change can increase asphaltene concentration in the oil phase, and as a result, asphaltene aggregations precipitate. The most important parameters affecting asphaltene precipitation are the composition of crude oil, temperature and pressure (Soulgani et al. 2008). In order to predict the phase behavior of asphaltene in crude oil and determine the conditions of precipitation, it is essential to model the asphaltene behavior as a function of composition, temperature and pressure. In this regard, the complexity of the system and asphaltene stability mechanisms have resulted in different thermodynamic models (Leontaritis and Mansoori 1987). In this study, the solid-state thermodynamic model (SSTM) has been used for asphaltene precipitation modeling. Nghiem et al. (1993) proposed this model and assumed the precipitated asphaltene as a pure condensed phase. This model is known as the simplest model and considered asphaltene as a single solid phase in the system. Liquid and gas phases are modeled using state equation (Nghiem et al. 1993). The heaviest fraction of the crude oil is divided into two parts: (a) precipitating component and (b) non-precipitating component. In SSTM, the precipitating component is known as asphaltene. The amount of asphaltene precipitation can be calculated using the fugacity equation of asphaltene component in liquid and solid phases. The equation of the fugacity of each component in the solid phase is obtained by the following equation:

$$\ln f_{s} = \ln f_{s}^{*} + \frac{{V_{s} (P_{1} - P_{0} )}}{{RT_{0} }} + \frac{{C_{\text{ps}} }}{{R\left[ {1 - \frac{{T_{0} }}{{T_{1} }} + \ln \left( {\frac{{T_{0} }}{{T_{1} }}} \right)} \right]}} + \frac{{\Delta H_{\text{f}} }}{{R\left[ {\frac{1}{{T_{1} }} - \left( {\frac{1}{{T_{0} }}} \right)} \right]}}$$
(1)

where f s is the solid fugacity in P 1 and T 1 and f *s is the reference solid fugacity in P 0 and T 0. Gas and liquid phases have been modeled via the Ping–Robinson equation of state considering volume change parameters. Table 1 shows the results of the SARA test. The composition of crude oil and properties of C 12+ fraction are given in Tables 2 and 3, respectively. Figure 2 shows the results of asphaltene precipitation simulation at different pressures and temperatures of 220 °F. It is observed that the simulation outcomes and experimental data indicate the same results. As shown in Fig. 2, the asphaltene precipitation process starts at a pressure of 1024 psi and eventually ends at a pressure of 9638 psi, so-called lower and upper onset (precipitation) pressures, respectively. Asphaltene precipitation reaches its maximum value at a pressure of 2954 psi that is the bubble point pressure (BPP) at 220 °F. It should be noticed that at a constant temperature and above BPP, as the pressure increases, precipitation decreases, whereas, at conditions of lower BPP, the pressure and the amount of precipitation are directly proportional. Figure 3 demonstrates asphaltene precipitation at different temperatures in terms of pressure obtained from the thermodynamic model used in this study. As the temperature increases, precipitation enhances too. As shown in Fig. 3, at 267 °F, all asphaltene content dissolved in the fluid has been precipitated.

Table 1 SARA test results
Table 2 Composition of crude oil
Table 3 C12+ specification
Fig. 2
figure 2

Comparison of solid model results with experimental data of asphaltene precipitation at 220 °F

Fig. 3
figure 3

Comparison of asphaltene precipitation curves at different temperatures

Reservoir performance modeling

Reservoir performance is known as reservoir deliverability. It is necessary to predict the relation between flow rate and pressure drop in the reservoir in order to optimize continuous production. For this purpose, the results of the main inflow performance relations (IPR), i.e., Vogel (1968), Standing (1971) and Fetkovich (1973), have been compared with field data and the Vogel equation (i.e., correlation 2) eventually resulted in the best match, used as the IPR relationship.

$$q = q_{\hbox{max} } \left( {1 - 0.2\left( {\frac{{P_{\text{wf}} }}{{\bar{P}}}} \right) - 0.8\left( {\frac{{P_{\text{wf}} }}{{\bar{p}}}} \right)^{2} } \right)$$
(2)

where \(\bar{P}\) is average reservoir pressure and P wf is bottom hole pressure. Figure 4 depicts the IPR curve of the well.

Fig. 4
figure 4

Inflow performance relation curve

Wellbore performance hydrodynamic modeling

There are many empirical correlations presented to calculate pressure drop in two-phase flow. Among them, three correlations are more appropriate and capable of estimating the pressure drop in the vertical flow system as follows: (a) Fancher and Brown (1963); (b) Hagedorn and Brown (1965); and (c) Beggs and Brill (1973, 1991). In order to determine the most accurate correlation, gradient matching has been used. Tables 4 and 5 show the reservoir and well specification, respectively. The properties of the crude oil are given in Table 6. Table 7 indicates the input parameters for correlations. The results of different correlations are illustrated in Fig. 5. As can be seen, the Beggs and Brill correlation leads to the best match with the field data.

Table 4 Reservoir data
Table 5 Well field data
Table 6 Properties of stock tank crude oil
Table 7 Input parameters of two-phase correlation matching
Fig. 5
figure 5

Results of two-phase flow empirical correlations in wellbore

Fluid properties modeling

Thermodynamic properties of the well fluid are needed to investigate the process of asphaltene deposition. As the first step, the fluid properties model of the well should be made. In order to determine the best relation to predict: (a) the formation volume factor, bubble point pressure and solution gas oil ratio (among different relations such as Standing 1971; Lasater 1958; Vazquez and Beggs 1980; Glaso 1980; Petrosky et al. 1993; Al-Marhoun 1992) and (b) oil viscosity (between relations such as Beal (1946); Vazquez and Beggs 1980; Petrosky et al. 1993; Bergman and Sutton 2007), some regression operations have been done using experimental data given in Table 8. The regression operations have been carried out using prosper software from the Integrated Production Modelling software (IPM group). It revealed that Glaso (1980) and Beal (1946) resulted in the minimum standard deviation compared to other relations. Figure 6 shows the results of regression operation. The density and viscosity of the well fluid, which are important parameters to survey the deposition process, can be obtained using Glaso (1980) and Beal (1946) correlations. Figures 7 and 8 demonstrate density and viscosity profiles of the well fluid, respectively.

Table 8 Input parameters of regression operation
Fig. 6
figure 6

Results of Glaso (1980) and Beal (1946) correlations and experimental data

Fig. 7
figure 7

Fluid density profile in the well for choke size of 44/64 inches

Fig. 8
figure 8

Fluid viscosity profile in the well for choke size of 44/64 inches

Choke performance modeling

The flow capacity through tubing and perforations should be higher than that of reservoir inflow performance. Generally, in order to eliminate the effects of upstream fluctuations on downstream, choke is mounted on the stream. For this purpose, fluid flow through the choke should be in critical condition (Sachdeva et al. 1986). In this paper, the outcomes of Shellhardt and Rawlins (1936), Gilbert (1954), Ros (1960) and Poettmann and Beck (1963) models have been compared with field data in order to predict the choke performance (the current choke size of the well was 44/64). Ros’ model showed an appropriate match with the real data, and thus, it has been used to predict the future choke performance. A nodal analysis using the reservoir, wellbore and choke performances has been performed, and its outcomes are given in Table 9. In addition, pressure and temperature profiles in the well are plotted in Figs. 9 and 10, respectively.

Table 9 Results of nodal analysis simulation
Fig. 9
figure 9

Pressure profile in the well for choke size of 44/64 inches

Fig. 10
figure 10

Temperature profile in the well for choke size of 44/64 inches

Coupling of the asphaltene precipitation model with wellbore model

The profile of asphaltene precipitation weight percentage versus depth should be plotted in order to detect intervals in the well where asphaltene can precipitate and also to estimate the amount of total deposition. Figure 11 depicts the profile of precipitation weight percentage (wt%) in terms of depth. This profile has obtained from coupling the asphaltene precipitation thermodynamic model and the hydrodynamic model of wellbore performance. According to Fig. 11, as oil is flowing from the deeper to the shallower, asphaltene precipitation starts in a depth of 6000 ft (i.e., the point of maximum value of precipitation 3.75 wt%) and its profile shows a decreasing trend, as it reaches its minimum value at a depth of 2000 ft. These two depths indicate the upper and lower onset (precipitation) pressures, respectively. This indicates that all the asphaltene content of the oil phase has been precipitated during this interval.

Fig. 11
figure 11

Asphaltene precipitation profile in the well for choke size of 44/64 inches

Asphaltene deposition modeling in the well

During the deposition process, solid particles precipitated on the well surface create a layer on the surface being in contact with the fluid as a source of particles and can gradually increase the thickness of the deposited layer. This process is influenced by hydrodynamic flow, heat and mass transfer and solid–liquid and surface-solid interactions. Thermodynamic variables have no impact on the deposition process (Zhao 2011). Asphaltene deposition involves two main processes. The first process is particle transmission to the surface controlled by one or a combination of the three main mechanisms of Brownian diffusion, turbulent diffusion (eddy diffusion) and the effect of particle momentum (inertia effect). The particle size has a significant effect on the dominant mechanism; for example, small particles are governed by the Brownian and Eddy diffusion, but large particles are controlled by the effect of the momentum. The second process is the particle sticking to the surface and, as a result, forming the deposited layer (Escobedo and Mansoori 1995a, b). Over the past decades, many researchers have proposed models for the deposition of solid particles on the pipe walls (Lin 1953; Friedlander and Johnston 1957; Beal 1970; Cleaver and Yates 1975; El-Shobokshy and Ismail 1980; Davis 1983; Papavergos and Hedley 1984; Escobedo and Mansoori 1995a, b; Guha 1997; Vargas et al. 2010). The most important classic models are based on the concept of turbulent flow and eddy diffusion (Eskin et al. 2011). In this paper, among different models presented for the deposition of solid particles, Shirdel’s approach has been utilized to model asphaltene deposition (Shirdel et al. 2012). This model is the most comprehensive one to simulate the process of solid deposition. It is worth mentioning that this model consists of two important parameters affecting asphaltene deposition modeling such as transport coefficient and relaxation time. The transport coefficient (k t ) is one of the parameters having a consequential effect on the deposition rate. This parameter is similar to particle velocity toward the wall. It considers both the macroscopic (convection) and microscopic (molecular diffusion) mechanisms. k t can be obtained by the following correlation:

$$k_{t} = \frac{N}{{C_{\text{avg}} - C_{\text{s}} }}$$
(3)

where N is mass flux and the denominator term indicates the difference between average asphaltene concentration in bulk flow (C avg) and surface (C s). k t can be written in a dimensionless form (k + t ) divided by the average friction velocity fluid as follows:

$$k_{t}^{ + } = \frac{{k_{t} }}{{V_{\text{avg}} \sqrt {\frac{f}{2}} }}$$
(4)

where V avg is the average friction velocity and f is friction factor. Relaxation time as a function of particle size is one of the main concepts in deposition modeling. It is defined as the required time for stopping a particle with initial velocity V p moving through a viscous fluid. Relaxation time can be calculated by the following correlations:

$$t_{\text{p}} = \frac{{\rho_{\text{p}} d_{\text{p}}^{2} }}{18\mu }$$
(5)
$$t_{\text{p}} = \frac{{S_{\text{p}} }}{{V_{\text{p}} }}$$
(6)

where S p is the Stokes stopping distance (SSD) (m) and V p is initial velocity (m/s). V p depends on the position of the particle in the flow path. t p can be converted to a dimensionless form (t +p ) by the following correlation:

$$t_{\text{p}} = \frac{{\rho_{\text{p}} d_{\text{p}}^{2} }}{18\mu } \times \frac{{\frac{f}{{2V_{\text{ave}}^{2} }}}}{\upsilon }$$
(7)

Friedlander and Johnston (1957) recommended a correlation for SSD parameter using the Laffer data. SSD is the distance where the particle is stopped due to the stokes drag force. SSD can be calculated as follows:

$$S_{\text{p}} = V_{\text{p}} \frac{{\rho_{\text{p}} d_{\text{p}}^{2} }}{18\mu }$$
(8)

The deposition profile would be obtained using the deposition model and temperature and fluid properties profiles in the well. Input parameters for the deposition profile are given in Table 10. Figure 12 illustrates the deposition coefficient profile in the well column. In order to calculate the mass flux profile of deposited asphaltene, the profile of the deposition coefficient should be multiplied by the precipitation weight percentage profile if the asphaltene precipitation concentration around the wellbore is inconsiderable. Figure 13 indicates the mass flux profile of deposited asphaltene. According to Fig. 13, the maximum asphaltene mass flux in the flow path from the reservoir to the surface is deposited in a depth of 12,000 ft where the fluid is being produced. Thus, the maximum reduction in tubing diameter caused by the asphaltene deposition occurred at the tubing inlet. To calculate asphaltene deposition thickness, the following equation can be used:

$$dD = \frac{{\dot{m}_{\text{d}} }}{{\rho_{\text{p}} }} \times {\text{Day}} \times 8 6 , 4 0 0$$
(9)

where \(\dot{m}_{\text{d}}\) is mass flux (kg/m2 s), \(\rho_{\text{p}}\) is particle density (kg/m3) and dD represents the changes in tubing diameter during any desired period of production. The model has been run for 1000 days, and the results are shown in Figs. 14 and 15. It should be noticed that in this model, the tubing curvature is disregarded while calculating the deposition thickness. Figure 14 shows the thickness of deposited asphaltene in a depth of 12,000 ft after 1000 days. The thickness is about 0.65 inches. Wellbore and deposited asphaltene on the tubing surface are schematically shown in Fig. 15 after 1000 days.

Table 10 Input parameters of asphaltene deposition simulation
Fig. 12
figure 12

Asphaltene deposition coefficient profile

Fig. 13
figure 13

Profile of asphaltene mass deposition flux

Fig. 14
figure 14

Thickness of deposited asphaltene on tubing surface in depth of 12,000 ft

Fig. 15
figure 15

Thickness of deposited asphaltene on tubing surface in the well after 1000 days

Sensitivity analysis on the main parameters affecting the asphaltene precipitation process

The main parameters affecting the precipitation process can be recognized by investigating the governing equation of the system and making sensitivity analysis on each of them. In this study, parameters which have a considerable impact on the amount of asphaltene precipitation are:

  1. (1)

    Production rate.

  2. (2)

    Tubing size.

  3. (3)

    Choke size.

Effect of production rate

Any change in this parameter can alter bottom hole pressure. At a constant well head pressure of 800 psi and for tubing performance relationships (TPR) calculation, the effect of different production rates on bottom hole pressure has been investigated and is tabulated in Table 11. The results show that as the production rate increases, bottom hole pressure increases too. Coupling the results with the asphaltene precipitation model would result in the precipitation profile. Figure 16 indicates the precipitation profile in the well. As it is shown in Fig. 16, if production rate is increased, the depth of precipitation process will be reduced. Besides, it is observed that a lower rate diminishes the precipitation weight percentage at a constant depth. It is not favorable to decrease the production rate in order to reduce asphaltene precipitation. On the other hand, a higher production rate of 7000 STB/day has no remarkable effect on increasing the precipitation.

Table 11 Effect of different production rates on bottom hole pressure
Fig. 16
figure 16

Sensitivity analysis; effect of production rate on precipitation profile

Effect of tubing size

It should be noted that similar to production rate, tubing size can influence bottom hole pressure. At a constant production rate of 5000 STB/day, well head pressure of 800 psi and for TPR calculation, the effect of different tubing sizes has been surveyed. The results are given in Table 12. According to the results in Table 12, changes in tubing size can result in a considerable alteration in bottom hole pressure. Figures 17 and 18 demonstrate the pressure and temperature gradient in the well, respectively. Precipitation profiles for different tubing sizes are shown in Fig. 19. As shown in Fig. 19, as the tubing diameter increases from 3 to 7 inches, the precipitation interval reduces about 2500 ft. In addition, a greater increase in the tubing size results in more depth of precipitation initialization.

Table 12 Effect of different tubing sizes on bottom hole pressure
Fig. 17
figure 17

Pressure profile in the well for different tubing sizes

Fig. 18
figure 18

Temperature profile in the well for different tubing sizes

Fig. 19
figure 19

Sensitivity analysis; effect of tubing size on precipitation profile

Effect of choke size

The effect of choke size on the precipitation process can be evaluated using reservoir, wellbore and choke performance relationships. These relations would result in a new pressure and temperature profile. It is worth mentioning that making a sensitivity analysis on choke size can actually indicate the effects of production rate and also well head pressure on the asphaltene precipitation process. Generally, an increase in choke size is directly proportional to the production rate and well head temperature and adversely proportional to well head pressure. Table 13 indicates the effect of choke size on these parameters. Figures 20 and 21 indicate the asphaltene precipitation weight percentage profile and the maximum thickness of asphaltene deposition on the tubing surface in a depth of 12,000 ft for choke sizes of 22/64, 32/64 and 54/64 inches, respectively. As shown in Fig. 20, a larger choke size leads to asphaltene precipitation in lower depths and longer intervals (highlighted by dashed lines). It is observed from Fig. 21 that the maximum thickness of the deposited asphaltene for a choke size of 22/65, 32/64 and 54/64 is 0.8, 0.94 and 0.53, respectively.

Table 13 Effect of different choke sizes on production rate, pressure and temperature
Fig. 20
figure 20

Sensitivity analysis; effect of choke size on precipitation profile

Fig. 21
figure 21

Sensitivity analysis; effect of choke size on thickness of deposited asphaltene

Cumulative oil production under asphaltene precipitation condition for different choke sizes

In order to investigate the effect of asphaltene precipitation on oil production, cumulative oil production of the well should be evaluated for a period of time. Figure 22 shows well cumulative production for choke sizes of 22/64, 32/64, 44/64 and 54/64 inches during a period of 1000 days. According to Fig. 22, ultimate cumulative production of the well for a choke size of 32/64 is the same for 22/64 inches. It should be noticed that for these sizes of choke, even though a larger choke size results in more cumulative production, the deposition rate in a larger choke is greater than that of the smaller one. Cumulative oil production of the well after 1000 days with the current choke size (i.e., 44/64 inches) is about 3.8 million barrels, and it is almost 4.75 million barrels for a choke size of 54/64 inches.

Fig. 22
figure 22

Sensitivity analysis; effect of choke size on cumulative production after 1000 days

Optimization operation

The purpose of this study is to determine the optimum operating conditions for well completion (production tubing size) and production (surface choke size and as result flow rate and well head pressure) in order to optimize cumulative production during 1000 days. The optimization is expressed in the following general form:

$$\begin{array}{lllll} {\text{Max}}\quad Q{ = }\sum\limits_{i = 1}^{10} {q_{i} } ; \hfill \\ {\text{Subject}}\;{\text{to:}} \hfill \\ P_{{{\text{Wh}}_{i} }} \ge 500\;{\text{psi;}} \hfill \\ 3 \le D_{{{\text{Tubing}}_{i} }} \le 7\;{\text{inch;}} \hfill \\ 3 2\le {\text{S}}_{i} \le 64\;{\text{inch}}\quad i{ = 1,}\; 2 ,\; 3\ldots , 1 0.\hfill \\ \end{array}$$
(10)

Well head pressure cannot be less than 500 psi due to surface facilities, upstream and downstream equipment. Figure 23 depicts the flowchart used for calculation of cumulative oil production. The particle swarm optimization (PSO) algorithm which is one of the most important intelligent optimization algorithms and is classified in the swarm intelligence field has been used to solve the problem (Kaveh 2014 and Olsson 2011). This algorithm was first introduced by Eberhart and Kennedy (1995). PSO algorithm was inspired by the movement of flocking birds and their interactions with their neighbors in the group. In order to describe the PSO algorithm, consider a swarm of particles flying through the parameter space and searching for an optimum path. The position (x i ) and velocity (v i ) of each particle in the swarm are random in the n-dimensional search space. In the search space, x i,j indicates the location of particle index i in the jth dimension. Accordingly, positions in the space resulted in the best outcomes can represent candidate solutions as particles flying through the virtual space, and as a result, candidate solutions are optimized. The PSO equations performed at each step of the algorithm are as follows (Hamedi et al. 2011):

$$v_{i,j} (t + 1) = \alpha v_{i,j} (t) + c_{1} Rand()(x^{*}_{i,j} (t) - x_{i,j} (t)) + c_{2} \cdot Rand() \cdot (x^{*}_{{i^{\prime},j}} (t) - x_{i,j} (t))$$
(11)
$$x_{i,j} (t + 1) = x_{i,j} (t) + v_{i,j} (t + 1)$$
(12)

where α is the inertia weight regulating the exploration and exploitation of the search space, Rand() is a random number between 0 and 1, x * i, j is the position of particle with its highest performance, in a neighborhood, i ʹ indicates the particle, which achieved the best overall position, and c 1 and c 2 are the weight given to the attraction to the previous best location of the current particle and the particle neighborhood, respectively. The optimized results using the PSO algorithm are given in Table 14. In order to design the operation condition, the standard values approaching the optimization results should be considered. Figure 24 shows the deposited asphaltene on tubing surface with a diameter of 4.25 inches in a depth of 12,000 ft. In this condition, the choke size is 48/64 inches. Figure 25 indicates cumulative oil production under optimum conditions of well completion and production. As shown in Fig. 25, cumulative production under optimum conditions is about 5.6 million. According to the results, cumulative production shows almost a linear trend, which means the reduction in the oil production due to asphaltene deposition would be negligible.

Fig. 23
figure 23

Flowchart of cumulative production calculation

Table 14 Results of asphaltene deposition simulation
Fig. 24
figure 24

Thickness of deposited asphaltene under optimum conditions of production in depth of 12,000 ft

Fig. 25
figure 25

Result of PSO algorithm for cumulative production under optimum conditions of production

Conclusions

In this study, for the first time, an integrated thermodynamic–hydrodynamic model of the precipitation–deposition behavior of asphaltene in a well of one of the Iranian south oil fields has been introduced. Besides, a novel dynamic procedure for comprehensive investigation of the precipitation–deposition behavior of asphaltene has been presented here. The procedure is based on asphaltene precipitation thermodynamics and asphaltene deposition modeling with the nodal analysis in the production system. Based on the results of this study, the following conclusions can be drawn:

  1. (1)

    Among parameters affecting asphaltene precipitation, production rate, tubing and choke sizes have the most impact on precipitation process. As production rate increases from 4000 to 7000 STB/day, the length of tubing covered by asphaltene deposition enhances about 40%; however, a decrease in the production rate to reduce this interval is not desirable. Tubing size has an inverse effect on precipitation length. As a matter of fact, in this case, as the tubing diameter increases from 3 to 7 inches, the precipitation interval reduces about 2500 ft. In addition, a greater increase in the tubing size results in more depth of precipitation initiation. The choke size results in the same effect on the depth of precipitation initiation as the production rate does because generally, an increase in choke size is directly proportional to the production rate.

  2. (2)

    The dynamic model has been applied to the well, and it was found that the thickness of deposited asphaltene on the tubing surface was 0.65 inches at the end of total time period (i.e., 1000 days). The results showed that an increase in the choke size could reduce the asphaltene thickness to 0.53 inches. Besides, during a period of 1000 days, an increase in choke size to 54/64 could result in 25% more cumulative oil production compared to the current condition (choke size of 44/64).

  3. (3)

    The optimum conditions for completion and production have been determined by defining the cumulative production as the objective function in the optimization process. In this regard, particle swarm optimization is used as an optimization technique. The results indicate that cumulative oil production and thickness of deposited asphaltene under the optimum conditions would reach 5.6 million barrels and 0.33 inches, respectively. According to the outcomes of optimization, tubing size and surface choke bean size are 4.25 and 47.9 inches, respectively. In addition, the oil production rate has been determined as 5972 STB/days. In these conditions, well head pressure and temperature should be considered as 1336 psi and 160 °F, respectively.