Introduction

Waterflooding is carried out in many reservoirs to maintain pressure (Ahmadi and Moosavi 2018). Salt deposits are observed at all stages of field development due to the increased water cut of the products (Azizi et al. 2019). The accumulation of salt deposits in the strings, downhole equipment, and the in-field collection and treatment of oil leads not only to enormous material costs in the process of their removal but also to significant losses in oil production (Mpelwa and Tang 2019). Salts can also form in the pores of rocks, reducing their permeability and causing formation damage (Lakatos et al. 2010, 2013, 2018; Tang et al. 2015; Dorman et al. 2015; Khormali et al. 2018a). In addition, salt precipitation contributes to equipment wear and flow restriction, which leads to a decrease in the oil production rate. As a rule, deposits of pure salts in production wells are rare. Usually, they are a mixture of one or more basic inorganic components with corrosion products and sand particles (Moghadasi et al. 2004).

Barium sulfate (BaSO4) is the most problematic scale in the petroleum industry (BinMerdhah et al. 2010; Lu et al. 2019). It is primarily due to its extremely low solubility and the difficulty of dissolution to remove from production equipment. In general, there is a slight increase in the solubility of barite by increasing pressure, especially pronounced in solutions with a mineralization of less than 30–50 g/L (BinMerdhah and Yassin 2007; BinMerdhah 2012; Geri et al. 2017). With an increase in salinity, the effect of pressure on barium sulfate formation will be insignificant. The formation of crystals and their aggregates in solution occurs in such a way that they can no longer be retained in solution, and a solid phase appears. Therefore, solid suspended particles are almost always formed during salt precipitation (Jordan et al. 2006; Bijani and Khamehchi 2019). The most crucial cause of BaSO4 precipitation is the mixing of different types of water containing sulfate and barium ions due to the water injection process into the reservoir (BinMerdhah 2012; Lu et al. 2019).

The formation of salts in the process of oil production is influenced by pressure and temperature changes, the mixing of incompatible waters, the presence of CO2 in the water, the pH of the environment, and many other factors (Kamal et al. 2018; Khormali et al. 2018b; Fernandes et al. 2020). It is necessary to conduct a predictive assessment of salt deposits and determine the influence of pressure and temperature on the likely possibility of salt deposits. Based on scale prediction, one can estimate the statistical likelihood of insoluble salts forming and the tendency of water to form salts (De Motte et al. 2018; Shabani et al. 2020; Dai et al. 2021). The forecasting methods that consider all the parameters that affect the formation of salt deposits are identical, and most of them are focused on a specific type of salt precipitation. These methods are based on the equilibrium state of the reservoir fluids (Li et al. 2017; Tomaszewska and Tyszer 2017; Khormali et al. 2018a). In addition, all methods for predicting the conditions of salt precipitation are based on the knowledge of the chemical composition of formation and injection waters, and the reservoir pressure and temperature (Ghasemian et al. 2019; Abbasi et al. 2020).

The choice of a method for dealing with salt deposits is determined mainly by the oil reservoir conditions, material availability, and technical means (Hasson et al. 2011; Kumar et al. 2018; Yuan and Wood 2018). The use of scale inhibitors is one of the effective methods to control scale in reservoir conditions. The mechanism of action of scale inhibitors is based on adsorption processes. By adsorbing scale inhibitors on the centers of the nucleoli of the salt compound, they inhibit the growth of the crystals, modify their shape and size, prevent sticking to each other, and worsen the adhesion of the crystals to metal surfaces (surface of production equipment) (Popov et al. 2019; Zhang et al. 2020; Sun et al. 2022). DTPMP (diethylenetriamine penta (methylene phosphonic acid)) is a phosphonic acid that is used to inhibit the deposition of various salts in oilfield conditions (Zhang et al. 2011; Kiaei and Haghtalab 2014; Zhao et al. 2021). Lu et al. (2019) studied the barium sulfate deposition under dynamic conditions with and without the use of DTPMP and PPCA (poly-phosphino carboxylic acid) (Lu et al. 2019). They reported that the prevention mechanism of these inhibitors is different, and both reagents are sufficiently effective in inhibiting BaSO4 precipitation. The authors concluded that with a higher temperature, the formation rate of BaSO4 decreased, while the prevention performance improved due to a higher solubility of this salt.

Dynamic tube blocking test (DTBT) is one of the methods for assessing prevention efficiency and the possibility of scale precipitation under dynamic conditions. In DTBT, if a reagent effectively inhibits scale precipitation, there is no pressure drop in the tube over time (Ramzi et al. 2016; Khormali et al. 2017). The pressure drop in the absence of the scale inhibitor (a blank case) is rapidly increased due to salt precipitation in the tube. The pressure drop in DTBT can be affected by various parameters, including ion type, inhibitor concentration, injection rate, temperature, and the injection/formation water mixing ratio (Sanni et al. 2019). Senthilmurugan et al. (2011) analyzed the formation of scale deposits and their inhibition by maleic acid copolymers through DTBT (Senthilmurugan et al. 2011). They completed the tests based on NACE standards. The authors mentioned that the increase in pressure drop indicates the scale deposition and blockage of the coil tube. It was observed that a constant low level of pressure drop could be achieved at MIC (minimum inhibition concentration) of 15 ppm. After conducting jar, DTBT, and visualization tests for precipitation and inhibition of calcium carbonate scale formation, Sanni et al. (2019) concluded that DTBT could provide a detailed insight into salt crystal growth kinetics compared to other tests (Sanni et al. 2019). In work (Al Helal et al. 2019), the authors could determine the worst scenario (mixing ratio) for scale precipitation by performing DTBT. The results agreed with the predicted results of salt precipitation by simulations. Wang et al. (2018) reported that the tube blocking rate in DTBT is increased by increasing the ion concentration of the injection solution (Wang et al. 2018). They could prevent the pressure drop in the tube by using scale inhibitors and enhanced oil recovery (EOR) chemicals. The compatibility of the used inhibitor and EOR agents was confirmed by DTBT.

By modeling the salt precipitation in DTBT, the possibility of scale deposition can be predicted. Statistical simulation is performed using various techniques, the best known of which is Monte Carlo simulation and response surface methodology (RSM) (Biniaz et al. 2016; Ahmadi et al. 2022). RSM, a proven set of statistical and mathematical methods, is commonly used to optimize and evaluate complex experimental process factors and their interactions. In addition, RSM requires less experimental testing and labor than other optimization approaches (Akkaya 2022). With RSM based on analysis of variance (ANOVA) using the minimum experimental data, a model can be developed to predict pressure drop due to scaling in DTBT. In this case, it is possible to evaluate which parameters mainly influence the pressure drop (Singh and Kumar 2020). There are no studies in the literature on modeling pressure drop in DTBT by RSM-based ANOVA. This methodology has been used by many researchers in other fields as follows. Onukwuli et al. (2021) used RSM to examine the interactive effect of operating parameters on corrosion control performance (Onukwuli et al. 2021). The authors determined the main parameters that affect the study of corrosion. Moreover, Ridzuan and Al-Mahfadi (2017) analyzed the wax deposition conditions using RSM and central composite design (CCD) (Ridzuan and Al-Mahfadi 2017). They obtained a new model for predicting the content of the wax deposits, which had high accuracy. On this basis, the authors could determine the wax deposition rate at various temperatures and stirring rates.

A review of the literature has shown that the prediction of salt precipitation is an essential step for scale detection and inhibition. The scale prediction under dynamic conditions can simulate the reservoir fluid conditions for scaling analysis. The development of a model for predicting pressure drop during dynamic tube blocking experiments has not been reported in the literature. The novelty of this work lies in developing a new model for predicting pressure drop due to barium sulfate precipitation at various injection rates and injection times. The proposed model has high accuracy for scale prediction.

According to the above literature, scale prediction by DTBT is one of the main methods of salt control in the petroleum industry. For this, the possibility of barium sulfate precipitation is evaluated using the OLI Studio program by determining the saturation index and the amount of precipitated salts. The worst case of salt precipitation is then determined in terms of pressure, temperature, and mixing ratio of the injection and formation water. By conducting DTBT, the pressure drop due to barium sulfate precipitation is measured at various injection rates and times under worst-case scenario conditions. The response surface methodology is applied to analyze the experimental data of pressure drop in DTBT to develop a new model. The accuracy of the proposed model is analyzed using ANOVA to ensure that the data obtained by the model are significant and in good agreement with the laboratory values. Finally, BaSO4 inhibition under dynamic conditions is carried out with DTPMP and PPCA scale inhibitors in DTBT.

Material and methods

Used synthetic waters and scale inhibitors

In this work, the synthetic injection (No.1) and formation (No. 2) waters were prepared to conduct the dynamic tube blocking tests. The total dissolved solids (TDS) of the used formation and injection waters were 119.7 and 35.8 g/L, respectively. The ionic composition of the waters used in this study is presented in Table 1. Waters No. 1 and No. 2 have a high enough concentration of sulfate and barium ions, respectively, to precipitate barite particles.

Table 1 Ionic composition of the prepared waters

In the last step of this work, the prevention of barite precipitation under dynamic conditions was investigated using two well-known scale inhibitors of DTPMP and PPCA. According to previous studies (Khormali et al. 2018a, 2022), these reagents were used at concentrations of 25 (DTPMP) and 30 (PPCA) ppm. The chemical structure of these scale inhibitors is shown in Fig. 1.

Fig. 1
figure 1

Chemical structure of scale inhibitors DTPMP and PPCA used to inhibit barium sulfate precipitation

Prediction of salt precipitation

The initial prediction of barite formation and precipitation for the mixture of waters No.1 and No. 2 was performed using the OLI Studio program (version 9.3.2) at various mixing ratios. At this stage, two different scenarios for pressure and temperature conditions were applied, as follows: I) 101.3 kPa and 25 °C; II) 25 MPa and 75 °C. Two different pressure and temperature values (reservoir conditions—high values; room conditions—low values) were used for scale prediction using OLI Studio in order to determine the worst case of barium sulfate formation (the greatest amount of salt precipitation). As mentioned in the introduction, the solubility and precipitation of barium sulfate depend on pressure and temperature. In each scenario, the content (percentage) of injection water (No. 1) in the mixture was varied from 0 to 100% to determine the worst case for barium sulfate precipitation (the maximum amount of barite formation). The determined worst scenario was used for the dynamic tube blocking experiments (in DTBT). Input data for predicting barite formation using the OLI Studio were the ionic composition of waters (according to Table 1), pressure, temperature, and mixing ratio. The output data were scaling tendency (ST) and barite concentration. Using predicted ST data, the saturation index (SI) of BaSO4 was calculated as follows: SI = log(ST). The salt is formed if SI is greater than zero (or ST is more than one). The results of the prediction of barite formation are presented by SI and barium sulfate concentration depending on the percentage of injection water in the mixture (Section "Determination of worst-case scenario for barium sulfate scale formation using the OLI Studio program").

Dynamic tube blocking experiment

Dynamic tube blocking test (DTBT) is used to assess scale formation and precipitation under dynamic conditions, to determine the effectiveness of scale inhibitors in preventing inorganic scale precipitation, and also to examine the minimum working concentration of scale inhibitors. In this study, DTBT was completed using an apparatus, in which the mixture of waters No. 1 and No. 2 was injected into a long tube with a small diameter. The schematic diagram of this apparatus is shown in Fig. 2. A mixing ratio of 3:2 (60:40) water No.1 to water No. 2 was applied to inject the mixture into the tubing since this ratio had the highest probability of barite formation (the worst-case scenario for barite precipitation according to predicted results presented in Section "Determination of worst-case scenario for barium sulfate scale formation using the OLI Studio program"). In the tests, the pressure drop due to barite precipitation in the tubing was measured over time at different injection rates. The tests were carried out at injection rates of 1, 2, 3, 4, and 5 mL/min with and without adding the scale inhibitors to the mixture. When the pressure drop reached a high value, the injection process was stopped. A high pressure drop means that the salt is deposited. The experimental results of pressure drop due to salt precipitation in the absence of scale inhibitors at various injection rates over time were used for RSM and ANOVA to develop a new model for evaluating barite scale formation. DTBT was then repeated in the presence of DTPMP and PPCA to prevent scale formation and reduce pressure drop. DTPMP and PPCA were added to the working mixture at optimal concentrations of 25 and 30 ppm for DTPMP and PPCA, respectively (Khormali et al. 2018a, 2022).

Fig. 2
figure 2

Schematic diagram of the used setup for DTBT

Experimental design

In this study, the Design-Expert program was used to plan the experiments and analyze the results. The purpose of the analysis of laboratory data is to create a statistical model with high accuracy to detect and predict the effect of various parameters on the response function and to identify the optimal values of the parameters. In this work, the pressure drop caused by salt deposition in the tube in DTBT was designed, modeled, and optimized using RSM. The following factors were investigated in this research: time (A) and injection rate (B). The independent variables and their change levels in the experimental design are presented in Table 2. Scale precipitation is affected by many parameters, the most important of which are injection rate, injection time, ion concentration in water, temperature, and mixing ratio. The results of the prediction of barium sulfate precipitation using the OLI Studio showed that the greatest amount of scale formation occurred at a temperature of 25 °C and a mixing ratio of 3:2 injection water to formation water. Thus, this study analyzed barium sulfate precipitation under worst-case conditions (at 25 °C and 3:2 mixing ratio) at various injection times and injection rates. However, RSM model development taking into account the four factors of the concentration of ions in water (barium and sulfate ions), temperature, injection rate, and injection time, is the topic of our future work.

Table 2 Investigated parameters for pressure drop due to scaling

The design of experiments in this study was performed through RSM-UDD (User-Defined Design) as follows:

  • User-Defined Design was selected to design the experiments with two numeric (type) factors of Time (A) and Injection rate (B). Time (A) was selected as a Discrete (subtype) factor at 10 levels from 0 to 45 min, and Injection rate (B) at 5 levels from 1 to 5 mL/min. Consequently, 50 experiments (observations) were designed.

  • On the other hand, in this study, it was considered that a pressure drop of 400 kPa indicates complete precipitation of salts in the tubing, and further injection of the solution is not required. Thus, the pumping of the solution at each injection rate continued until the pressure drop did not exceed 400 kPa. However, it was observed that in six of the tests (experiments), the pressure drop exceeded 400 kPa, and as a result, the process was stopped. For this reason, the number of initial observations (50 runs) when analyzing laboratory results was reduced from 50 to 44 to develop the model.

  • Ten levels for injection time (0, 5, 10, 15, 20, 25, 30, 35, 40, and 45 min) and five levels for injection rate (1, 2, 3, 4, and 5 mL/min) were selected in the design of experiments (as shown in Table 2).

  • The experiments were repeated twice. For each case, the arithmetic mean of the two tests was used.

  • The confidence level was 95%.

The design of experiments with RSM and the obtained results are shown in Table 3. A total of 44 tests have been designed and performed. Runs No. 3, 7, 27, and 36 refer to the case of “0 min” injection. Thus, in these runs, the injection of the working solution into the tubing did not start (time = 0 min, the lowest level), the mixing of the injection water and formation water was not yet carried out, and the pressure drop was zero. These runs were proposed by the Design-Expert program during the experimental design stage.

Table 3 Design of experiments with RSM and the obtained results of pressure drop without using scale inhibitor

Our previous results (Khormali et al. 2018b, 2022) on barium sulfate precipitation showed the worst case of scale formation at a mixing ratio of 60:40. However, as a rule, the mixing ratio of injection water and formation water for the worst case of salt precipitation is dependent on the ion content of water. The model development as a function of mixing ratio and concentration of ions is a topic for future work.

Results and discussion

Determination of worst-case scenario for barium sulfate scale formation using the OLI Studio program

The results of the prediction of barite scale formation and its concentration are depicted in Fig. 3. As shown in this figure, the effect of pressure, temperature, and content of injection water in the mixture with formation water on barite concentration and saturation index was studied. As presented in this figure, the saturation index was greater than zero for all contents of injection water in the mixture, except for 100% injection water. Moreover, barium sulfate precipitation occurs at all mixing ratios, except 100% injection water. Figure 3 demonstrates that the highest values of saturation index and barite concentration are observed at a mixing ratio of 60:40 (3:2) waters No. 1 to No. 2 under both reservoir and room conditions. In addition, more barite precipitated at lower pressure and temperature. These changes can be related to the dependence of solubility changes of barite on pressure and temperature. It should be noted that the solubility of barium sulfate does not depend on pressure (Khormali et al. 2018b). Also, the solubility of barite is decreased by decreasing temperature (Shi et al. 2012; Geri et al. 2017). Thus, pressure drop measurement in dynamic tube tests is carried out at a mixing ratio of injection and formation water of 3:2 at 25 °C and 101.3 kPa since the greatest formation of barite scale occurs under these conditions.

Fig. 3
figure 3

Dependence of saturation index a and barite concentration b on the mixing ratio of waters No.1 to No. 2 at two various values of pressure and temperature

Experimental results of DTBT without the use of scale inhibitor

DTBT is applied to determine the salt precipitation possibility and to evaluate the effectiveness of scale inhibitors that prevent the formation of mineral salt deposits (Ferreira et al. 2022). The test allows determining the minimum inhibitor concentration (MIC) required to prevent salt deposition, and performing comparative tests with different inhibitors under the same conditions (Velloso Alves de Souza et al. 2019). The principle of operation of the system is based on the tube blockage under dynamic flow conditions at a constant temperature. In this case, the effectiveness of the scale inhibitor is determined by the rate of increase in the pressure drop in the tube due to scale precipitation. In dynamic tube blocking tests, the pressure drop is increased due to salt precipitation in the absence of scale inhibitors or at their lower concentrations (Kelland et al. 2018). In the case of salt precipitation, the pressure drop after a short-term injection of water increases sharply. The results of pressure drop due to barite deposition in the absence of inhibitors at different injection rates are demonstrated in Fig. 4. As can be seen from this figure, at all injection rates, the pressure drop increased significantly. It is due to the precipitation of salts as a result of water mixing without using scale inhibitors. In general, the maximum injection time varied for each injection rate because the dynamic tube blocking test for each case continues until a large pressure drop is observed (Kumar et al. 2010; Kartnaller et al. 2018; Khormali et al. 2018a; Wang et al. 2018). In this work, the injection time (A) was selected from 0 to 45 min (at 10 levels) for all injection rates (from 1 to 5 mL/min) during the design of experiments (DOE). However, it should be noted that in this study, when the pressure drop reached 400 kPa, the tests were stopped. As the injection rate affected the salt precipitation and pressure drop, the end of the test varied depending on the injection rate, since the level of 400 kPa was observed at different times for various injection rates. For example, at injection rates of 1, 2, and 3 mL/min, after 30, 35, and 40 min, respectively, the pressure drop exceeded 400 kPa. Consequently, these tests in which the pressure drop was above 400 kPa have automatically been excluded from the statistical data analysis. Therefore, at first, it may seem that the tests were measured at different times, while, in fact, the reason for that was the stoppage of the tests due to the high-pressure drop. Furthermore, the injection rate affected the precipitation time of barite in the tube. As the injection rate increased, salt deposition occurred later. This behavior can be associated with a decrease in the probability of contact of ions in waters at higher flow rates (Senthilmurugan et al. 2011).

Fig. 4
figure 4

Changes in pressure drop due to barite precipitation in the tube at various injection rates over time without using scale inhibitors

A box plot can provide general information about response variation (in this study: pressure drop) due to changes in influential factors (in this study: time and injection rate) before modeling and data interpretation. As shown in Fig. 5, at low values of the injection time, the interval of pressure drop changes was short. Besides that, throughout this time frame, the pressure drop is likewise low, which indicates the insignificant deposition of salt in the tube. This result indicates that the effect of injection rate on pressure drop is not significant at low values of injection time. In 25–40 min, the effect of the injection rate on the pressure drop is very noticeable, and most changes are observed after 30 min of injection. In the longest time (more than 30 min), the pressure drop was high at all injection rates. As shown in Fig. 5, the amount of pressure drop varies between 57 and 263 kPa at 1–5 ml per minute. This long distance shows the vital role of injection rate at higher times. Other statistical parameters, including quartiles for this amount of injection time, are shown in the figure.

Fig. 5
figure 5

Box diagram of pressure drop changes in different values of injection time without using scale inhibitor

Analysis of variance and development of a new model to predict pressure drop due to barium sulfate precipitation

Analysis of variance (ANOVA) takes the data from multiple experiments and uses statistical analysis to determine if there is a significant difference between them. The F-value is then used to measure the strength of the correlation between the independent variables and the dependent variable, while P values are used to determine if the differences observed are statistically significant. With ANOVA, F-value, and P value, we have a powerful toolset for assessing the significance of models and individual experimental factors. It should be noted that if the P value of a model is less than 0.05 and the F value is high, it is considered very significant in statistics. In addition, the terms of the model are also considered significant when the P value is less than 0.05. Also, it is not significant when the P value is greater than 0.1. Thus, based on the obtained results in the experiments and using ANOVA, a new quadratic model for predicting the pressure drop in DTBT due to barium sulfate precipitation was obtained as follows:

$$\left( {{\text{PD}} + 0.{6}} \right)^{{0.{5}}} = {7}.{18}0 + {9}.{\text{369 A}} - {1}.{\text{955 B}} - {1}.{\text{927 AB}} + {3}.{\text{392 A}}^{{2}} + 0.{\text{874 B}}^{{2}}$$

As shown in Table 4, the F value of the model is equal to 246.22, representing that the proposed model is significant. There is approximately a 0.01% chance that an F value of this magnitude is due to noise. Meanwhile, a P value less than 0.05 indicates that the terms of the model are significant, while values greater than 0.1 indicate that the terms are considered non-significant. As depicted in the table, in the obtained model, terms A, B, AB, A2, and B2 are significant with F values of 1072.14, 71.06, 22.49, 53.96, and 6.43, respectively. Therefore, meaningful terms have the order A > B > A2 > AB > B2. In addition, as can be seen, injection time (A) has the most significant effect on pressure drop due to barium sulfate precipitation compared to other factors due to its high F value (1072.14).

Table 4 ANOVA results for the obtained PD-model to predict the pressure drop due to scale precipitation

Model fitting

In this study, the main R2 statistics, including R2 (coefficient of determination), adjusted R2, and predicted R2, were used to study how well the model matches the experimental amounts of the pressure drop. A model with an R2 value greater than 80% is usually considered significant. As shown in Table 5, the value of R2 is equal to 0.9701, which in turn emphasizes that 97.01% of the response variance can be explained by the suggested model. In addition, the adjusted R2 improves the R2 by considering the sample size and the model conditions. The adjusted R2 value is equal to 0.9661. As can be seen, the values of R2 and adjusted R2 are very high and comparable, indicating that the obtained quadratic model for predicting the pressure drop due to barium sulfate precipitation provides enough information to describe the experimental data adequately. Furthermore, the predicted R2 value is 0.9536. Accordingly, as can be seen, the predicted R2 value for the model is in good agreement with the corresponding adjusted R2 value, as the difference between them is less than 0.2. It suggests that the model can be used to interpret data with a high degree of predictive ability accurately. Based on these observations, it can be concluded that the proposed model is in good agreement with the laboratory data and can be used to predict salt deposition under dynamic conditions. Also, Adeq precision (AP) was used as a valuable measure to evaluate the signal-to-noise (S/N) ratio. A ratio of more than four can be considered favorable. The value of AP for the presented model is equal to 49.7624.

Table 5 Statistical parameters of the developed model

Validation of the model developed to predict the pressure drop in the absence of scale inhibitors

Diagnostic plots are graphical representations of data, which are used to validate the performance of a predictive model. Using diagnostic plots, we can compare the performance of different models, assess the quality of a model’s fit, and detect outliers or other anomalies in our data. Diagnostic plots can also be used to identify trends or patterns in our data that could be indicative of underlying problems with our model. Therefore, diagnostic plots provide detailed insight into the accuracy and reliability of the model and help identify any potential issues that may arise during its implementation. In this work, different types of diagnostic plots, including normal probability plot, plot of residuals versus runs, and plot of predicted values actual, were used for validating the performance of the model.

Figure 6 provides a normal probability plot versus studentized residuals for the proposed model to predict pressure drop due to barium sulfate precipitation. This chart is used to determine the normality of assumptions. In other words, they must determine whether the difference between the actual and predicted results follows a normal distribution. As can be seen, Fig. 6 shows that the model has a normal distribution because the residuals follow a diagonal straight line. Besides, as shown in this plot, no outliers are observed.

Fig. 6
figure 6

Plot of normal probability versus studentized residuals of the proposed model for predicting salt precipitation without using scale inhibitors

Figure 7 demonstrates the plot of the residuals against the test run number. Plotting the residuals against the run number is a useful way to identify patterns in data. It helps to identify any underlying trends that may not be visible with other types of analysis. By plotting the residuals against the run number, it is possible to determine if there are any systematic errors in the data and if there are any outliers that need to be addressed. It should be emphasized that a random distribution of data points without any trend or pattern within the confidence limits should be identified. As can be seen from the figure, the residuals are randomly distributed between the confidence intervals. No data exceeded the interval, indicating no residual outliers for the model.

Fig. 7
figure 7

Plot of residuals versus the number of test runs for the proposed model for predicting salt precipitation without using scale inhibitors

Figure 8 shows the diagnostic diagram to compare the predicted values against the actual values of pressure drop caused by barium sulfate precipitation in dynamic conditions. This chart is considered the most essential among the diagnostic charts because it compares the data predicted by the model with the laboratory data. A model can predict laboratory results when the data predicted by the model and the actual data are close to each other and are randomly distributed around a diagonal line. As shown in Fig. 8, the data points are randomly scattered, and there is also a high level of agreement between the values predicted by the model and the corresponding experimental values. The results obtained from the diagnostic charts confirm the high validity and accuracy of the developed model and also show that it is very suitable for predicting the pressure drop due to barium sulfate salt deposition under dynamic conditions.

Fig. 8
figure 8

Predicted values versus actual values of the pressure drop due to BaSO4 precipitation in dynamic conditions without using scale inhibitor

It should be noted that the experimental data were fitted to various polynomials, as presented in Table 6. Among them, the quadratic polynomial (sqrt (PD + k), where k is a constant) showed the highest accuracy through the P value as well as R2-statistics. It is focused on the model maximizing the Adjusted R2 and the Predicted R2. Thus, the quadratic polynomial model was utilized for model development.

Table 6 Comparison of different statistical models for predicting pressure drop

The effect of injection time and rate on PD without using inhibitors

In this section, the obtained model was used to investigate the effect of parameters on pressure drop in the absence of scale inhibitors through one-factor, contour, and three-dimensional diagrams. Figure 9 shows the effect of the test time on the pressure drop caused by barium sulfate precipitation under dynamic conditions. In this figure, the changes in pressure drop in the tube were plotted over time from 0 to 45 min at a constant injection rate of 3 mL/min (a mean value). As presented in Fig. 9, the pressure drop due to salt deposition increases continuously with time in the experiment. In addition, as shown in the figure, the increase in pressure drop is low in the first 10 min, moderate in the second 10 min, and strong after that. Therefore, the formation and precipitation of salt are entirely dependent on the time of water ion collision, which can be prevented by timely prediction and the use of suitable scale inhibitors.

Fig. 9
figure 9

The effect of test time on the pressure drop due to salt precipitation under dynamic conditions at an injection rate of 3 mL/min without using scale inhibitors

The injection rate can affect salt formation under dynamic conditions. This parameter can affect the pressure drop, both in the presence and absence of salt inhibitors in the test solution. Therefore, the effect of this operating parameter on the pressure drop in the absence of scale inhibitors was investigated. For this purpose, the values of pressure drop (PD) obtained from the model were analyzed in the range of injection rate from 1 to 5 mL/min after 22.5 min (a mean value of test time). Figure 10 depicts the influence of flow conditions on PD at different injection rates. This figure shows that PD decreased by increasing the injection rate. This dependence can be related to the fact that at high flow rates, the water contact time decreases; as a result, sulfate and barium ions do not have enough time to form an ionic bond.

Fig. 10
figure 10

The effect of the injection rate on the pressure drop due to barium sulfate precipitation after 22.5 min in the absence of scale inhibitors

Figures 11, 12, and 13 show the effect of parameter interaction on the values of pressure drop caused by BaSO4 obtained from the model in DTBT without using scale inhibitors in different graphs. In these graphs, the pressure drop changes are shown as a function of two studied parameters. As depicted in Fig. 11, at all values of the injection rate, increasing the time results in more salt precipitation as more ions enter the tube from the water mixture over time. By comparing the pressure drop caused by barium sulfate precipitation at the injection rate of 1 and 5 mL/min, it can be concluded that the fluid flow conditions have a significant effect on the formation of salt and its precipitation. High flow rates have less chance of salt precipitation. Over the entire test time from 0 to 45 min, the pressure drop increased faster at the lower injection rate (1 mL/min) than at the higher injection rate (5 mL/min). It was also observed that the predicted values of pressure drop due to salt precipitation by the model at the injection rate of 5 mL/min were lower than at 1 mL/min. After 45 min, at an injection rate of 1 ml/min, the pressure drop was about 580 kPa, while at an injection rate of 5 ml/min, the pressure drop was about 200 kPa lower.

Fig. 11
figure 11

Interaction effect of parameters on the pressure drop caused by BaSO4 without using scale inhibitors

Fig. 12
figure 12

Interaction effect of parameters on the pressure drop caused by barium sulfate precipitation by a contour diagram without using scale inhibitors

Fig.13
figure 13

Three-dimensional diagram of the effect of the interaction between test time and injection rate on the pressure drop caused by barium sulfate precipitation in DTBT without using scale inhibitors

Figure 12 shows the effect of the interaction of parameters on the pressure drop caused by salt precipitation in the tube without using the scale inhibitor by a contour diagram. As the figure presents, the influence of the parameters on the pressure drop at short injection times (0–20 min) at any injection rate is feeble. This behavior is related to the low concentration of ions in the small volume of the mixture of injection and formation waters. Increasing the injection rate and decreasing the time can continuously reduce the pressure drop. Figure 12 shows that the highest pressure drop and salt precipitation occurred at injection times of more than 40 min at all studied injection rates.

Figure 13 shows the three-dimensional plot of the interaction between test time and injection rate on the pressure drop caused by salt precipitation. As can be seen from this three-dimensional diagram, the greatest interaction of parameters on the pressure drop (due to salt precipitation) was observed at the low level of injection rate (1 mL/min) and at the high level of test time (45 min). In this case, the pressure drop reached over 550 kPa. Furthermore, as the 3D graph shows, although increasing the injection rate from 1 to 5 mL/min at the high test time level (45 min) resulted in a decrease of about 300 kPa in the PD, the pressure drop value is still very high (marked with a flag, PD = 287.011 kPa). These results confirm the importance of time compared to the injection rate in predicting salt precipitation under reservoir conditions. This conclusion can also be verified from the table of ANOVA, where the time factor has the highest F-value (1072.14).

Therefore, after a careful analysis of the data, it appears that if the inhibitor is not used, the pressure drop after a certain time at any injection rate will eventually exceed the acceptable limit. Consequently, it is strongly recommended to use scale inhibitors to prevent this from happening. Therefore, this importance has been studied in the next section.

Results of DTBT in the presence of scale inhibitors

The results obtained in the previous sections showed that at any injection rate, the pressure drop in the coiled tubing increased significantly due to barite deposition in the absence of scale inhibitors in the working solution. It confirms that a mixture of formation and injection waters can lead to formation damage and failure of production equipment due to salt precipitation under flow conditions. Moreover, the results showed that salt precipitation is a function of fluid flow rate. At lower injection rates, the pressure drop increased faster than at higher injection rates. As mentioned above, it may be due to the greater likelihood of bond formation between water ions at lower rates due to the longer time. Therefore, to solve this problem, the inhibition of scale precipitation is vital. Figure 14 depicts the variation of pressure drop in the tubing without and with the use of DTPMP (25 ppm) and PPCA (30 ppm) in the working solution. As shown in the figure, the pressure drop remained constant with the use of inhibitors during the injection. This figure demonstrates that DTPMP and PPCA inhibitors could prevent barite precipitation in the tube at all injection rates. Thus, at the optimal inhibitor concentration, the pressure drop was independent of the injection rate. The inhibition efficiency of both reagents was approximately the same. These results were observed at 25 ppm of DTPMP and 30 ppm of PPCA. Thus, it can be concluded that DTPMP at a lower concentration can provide these inhibitory results compared to PPCA.

Fig. 14
figure 14

Changes in the pressure drop during mixture injection into the tube with and without using scale inhibitors

Conclusions

In this study, the possibility of barium sulfate salt formation and precipitation under dynamic conditions without the use of scale inhibitors was evaluated by performing dynamic tube blocking tests. The following conclusions are drawn from this study:

  1. 1.

    The results of initial modeling using the OLI Studio showed that at low pressure and temperature (room conditions) and a mixing ratio of 3:2 of injection water to formation water, the highest amount of barium sulfate salt precipitates.

  2. 2.

    The experimental pressure drop data were evaluated by the RSM through ANOVA to develop a new RSM-based model for predicting the pressure drop (PD) depending on the time (A) and injection rate (B). The accuracy and adequacy of the obtained model were confirmed by using R2 statistics (R2 = 97.01%, adjusted R2 = 96.61%, and predicted R2 = 95.36%), adequate precision (AP = 49.76), and diagnostic charts.

  3. 3.

    Injection time (A) has the most significant effect on pressure drop due to its high F-value (1072.14). The influence of the parameters on the pressure drop at short injection times (0–20 min) at any injection rate is feeble. In addition, comparing the pressure drop at the injection rate of 1 and 5 mL/min indicated that high flow rates have less chance of salt precipitation.

  4. 4.

    The greatest interaction of parameters on the pressure drop was observed at the low level of injection rate (1 mL/min) and at the high level of test time (45 min). In this case, the pressure drop reached over 580 kPa. It was also observed that although increasing the injection rate from 1 to 5 mL/min at the high test time level (45 min) resulted in a decrease of about 300 kPa in the PD, the pressure drop value was still very high, which indicates that the PD after a certain time at any injection rate will eventually exceed the acceptable limit, which in turn indicates the need to use scale inhibitors to prevent this from happening.

  5. 5.

    The problem of barium sulfate precipitation under dynamic conditions was controlled using scale inhibitors of diethylenetriamine penta (methylene phosphonic acid) (DTPMP) and poly-phosphino carboxylic acid (PPCA). Both reagents significantly reduced the pressure drop in the tube. The efficiency of these two inhibitors was high under all flow conditions. DTPMP prevented salt precipitation at a lower concentration than PPCA.