Skip to main content
Log in

Computationally Efficient 3D Fully Coupled Reactive Transport Model for Wormhole Propagation in Carbonate Formation

  • Published:
Transport in Porous Media Aims and scope Submit manuscript

Abstract

Matrix acidizing is one of carbonate reservoirs' most efficient and widely implemented stimulation techniques. It improves productivity and flow capacity by creating new conductive flow channels called wormholes. The propagation of these channels has been a topic of interest as many researchers tried to investigate this phenomenon experimentally, theoretically, and numerically. Among various models, the two-scale continuum (TSC) model is the most common and reliable model due to its ability to predict better results as it combines Darcy and pore scales to capture the phenomenon. However, the main disadvantage of using the TSC model is its high computational cost. This highlights the need for a computationally efficient model that reduces that cost while maintaining solution accuracy. Also, examining wormhole propagation in 3D perforation is untouched yet. In this paper, we developed a numerical model in-house using MATLAB® software to simulate the wormhole generation considering the perforation in three-dimensional space based on the two-scale continuum mathematical model. The model performance is optimized to be a time-efficient simulation model that considers thermal energy transfer beside flowing and reactive mass transfer. Computation efficiency is achieved using the Darcy equation, vectorizing code operations, and implementing a proposed iterative algorithm that is based on the GMRES method. The associated tuning parameters and a proper preconditioner are obtained, which improved the model efficiency by more than 90%. The model used typical data reported in experimental acidizing work.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14

Similar content being viewed by others

Notes

  1. Other complex effective acid diffusion expressions are provided in the literature (Xue et al. 2018).

References

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Murtada Saleh Aljawad.

Ethics declarations

Conflict of interest

The authors have not disclosed any conflict of interest.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Appendices

Appendix

The following steps were taken to reduce the computational time:

Minimize coefficient matrix construction time

Typically, a loop is required to perform computations per each dimension. Thus, a three-level nested loop is common for the conventional 3D problem. Apart from the matrix inversion time, the time required to execute code commands and perform all calculations is optimized through two investigation steps: changing nested loops' order and vectorizing the computations. Usually, field values are indexed in (row, column, and page) order where i, j, and k are the corresponding indices, as shown in Fig. 

Fig. 15
figure 15

Possible looping direction ordering nested loops

15.

A simple code that performs a single computation is written to reach a conclusion for this question alternating both the order of nested loops and the number of elements in each direction. Figure 

Fig. 16
figure 16

Execution time while varying nest loop order and matrix size

16 shows that the execution time could vary significantly upon changing the order and size; however, the trend is quite difficult to be captured and generalized apart from avoiding looping along the first dimension in the innermost loop. When the code is vectorized, all loops and nested loops that circle calculations in 3D arrays are removed and replaced by element wise-operations. It is important to figure out the relationships that control indexing inside loops for a proper replacement. Vectorizing reduced the required time to perform loops’ calculations significantly.

Minimize coefficient matrix inversion time

Even though the model was optimized to enhance its execution time, solving the system of linear equations is the major time consumer. Therefore, several methods are investigated to speed up finding the solution of \(\mathbf{A}\overrightarrow{\mathrm{x}}=\overrightarrow{\mathrm{b}}\). Some methods are related to filling patterns and elements’ order within the coefficient matrix, while others are connected to solution-obtaining methods.

Actions related to elements’ order

For large sparse matrices like those we have in all three models, it is crucial to predefine the coefficient matrices as sparse matrices. This saves computation costs in terms of memory and time. The sparsity bandwidth showed a critical effect on solution speed. Therefore, the TRF model is equipped with a function that dynamically minimizes the bandwidth of the coefficient matrix upon mesh size. Furthermore, different matrix reordering algorithms were applied to the coefficient matrices to select the one that speeds up the solution. These algorithms are listed in Table

Table 6 Reordering methods for coefficient matrices

6. Unfortunately, none of them could speed up solving the system of linear equations in all sub-models within the TRF model.

Actions Related to Solution Methods

5.1 Direct Methods

Finding coefficient matrix inversion is not a wise option. Instead, the solution of a linear system of equations could be obtained directly using Gaussian elimination after performing LU, QR, or Cholesky factorization. The speed of solving a linear system with a direct method strongly depends on the density and fill pattern of the coefficient matrix. Based on that, the most suitable direct method is automatically selected when using the backslash command or mldivide built-in MATLAB® function. These practices are satisfactory when solving the system of linear equations in the flow model in both 2D and 3D. This is attributed to the features of the coefficient matrix, such as having a very low condition number and being symmetric and positive definite. In contrast, they consume an increasingly huge amount of time in thermal and reactive models. This increase with mesh size is nonlinear and may behave exponentially when obtaining, for instance, the concentration distribution in 3D.

5.2 Preconditioning the Coefficient Matrix

Preconditioning a matrix is a process in which the conditional number of a matrix is changed by multiplying it by a proper matrix targeting its conditionality improvement. MATLAB® has a function that does such a job. It is called equilibrate. It was used to precondition the coefficient matrices in both thermal and reactive models and exhibited no or minimal improvement in speeding up the solution in the best scenarios. Other preconditioning matrices are the partially computed LU and Cholesky factorizations which performed worse than the direct methods when tested. These preconditioning methods, listed in Table

Table 7 Preconditioning Methods

7, did not improve the solution speed. Apart from that, using the transpose of the coefficient matrix as a preconditioner has only speeded up the solution of the reaction model which is the incomparably most expensive model.

5.3 Indirect Methods

Although the fill pattern of the coefficient matrix does not affect solution speed, solving a linear system with iterative methods typically requires tuning parameters for each specific problem. This explains why direct methods are usually faster and more generally applicable than indirect methods.

Convergence and accuracy are always concerning points when dealing with iterative methods. Hence, the last option is to approximate the solution iteratively if speed enhancement compensates well for the precession loss. Unfortunately, all tested iterative algorithms, listed in Table

Table 8 Indirect methods

8, failed to converge using their default and typical tuning parameters values.

The generic iterative algorithm starts with an initial guess for the solution vector, \(\overrightarrow{{\mathrm{x}}_{0}}\), followed by:

  1. 1.

    Computing the residual norm \(\mathrm{res}=\mathrm{norm}(\mathrm{A}\overrightarrow{{\mathrm{x}}_{0}}-\overrightarrow{\mathrm{b}})\) and comparing it against a specified tolerance. Return the solution \(\overrightarrow{{\mathrm{x}}_{0}}\) if its residual is within the tolerance.

  2. 2.

    Updating the magnitude and direction of the vector \(\overrightarrow{{\mathrm{x}}_{0}}\) based on the value of the residual and other calculated quantities if its value is not accepted.

  3. 3.

    Repeating steps 1 and 2 until the tolerance is satisfied or a maximum number of iterations is reached.

The iterative methods differ in updating step (step 2), and some have slightly different convergence criteria in step 1. In TRF model, an additional step is added that cleans the solution and adjusts the tolerance accordingly for further accuracy.

5.4 Combine Iterative Methods with Preconditioning

A window to efficient computation, in terms of memory and time, in wormhole modeling is opened by this idea. The preconditioning procedure is repeated, and the tuning parameters of all iterative methods are varied by ten equal steps per order of magnitude. Consequently, forty distinct values per numerical tuning parameter per iterative method are tested. Other options that control the convergence of each iterative method are operated too. The action is repeated for all models at different mesh sizes and time steps. These time-consuming efforts led to an inexpensive solution to the system of linear equations, mainly in reaction and thermal models.

Fast Algorithm Used in TRF Model

TRF model enhanced the computation speed in two stages. In the construction stage, all calculations are vectorized, the constructed coefficient matrices are defined as sparse matrices, and their sparsity bandwidth is minimized. In the solution stage, the flow model is solved directly while both the reaction and the thermal models are first preconditioned and then solved iteratively using the generalized minimum residuals method according to the following algorithm:

  • Calculate a preconditioner using incomplete LU decomposition: Control partial filling by drop tolerance of \(3.0\times {10}^{-2}\) in the reaction model and \(3.0\times {10}^{-1}\) in the thermal model.

  • Use the generalized minimum residual iterative method: Set the maximum number of iterations to be 200 and the tolerance to be \(1.0\times {10}^{-12}\) and \(1.0\times {10}^{-14}\) in reaction and thermal models, respectively.

  • Clean the solution and adjust the tolerance for further accuracy: Remove negative, less than a threshold, or extreme values.

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Aboluhom, H., Aljawad, M.S. Computationally Efficient 3D Fully Coupled Reactive Transport Model for Wormhole Propagation in Carbonate Formation. Transp Porous Med 150, 229–256 (2023). https://doi.org/10.1007/s11242-023-02007-2

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11242-023-02007-2

Keywords

Navigation