Introduction

Acidizing technology is widely applied in the petroleum industry. It plays an important role in increase either oil and gas well production or the injection amount of a water injection well (Hassan et al. 2014; Carpenter 2014; Stolyarov and Alam 2013). Acidizing is a broad field that was gradually expanded through scientific perception and empirical experience. Because of the complication and uncertainty of applying an appropriate acidizing process in different cases and scenarios, a significant amount of gathered information does not necessarily lead to an accurate quantitative measurement. This strongly obstructs precise analysis via classic mathematical methods. Instead, the process relies on the relatively subjective experience and knowledge of acidizing experts (Enelamah et al. 2003; Retnanto et al. 2013; Saputelli et al. 2007; Blackburn et al. 1990; Van Domelen et al. 1992). Developments in innovative artificial intelligence technique (AIT) have led to rapid developments in expert system (ES), a crucial subfield of AIT. Currently, ES has been applied in many process designs in the petroleum industry, including well drilling, well completion, log analysis, well test interpretation, numerical simulation, diagnosis to formation damage, rod pumping, well production stimulation, oil extraction rate, heavy oil exploitation, well repair, sand prevention, water plugging, oil quantity metering, oil production and management, and so on (Blackburn et al. 1990; Van Domelen et al. 1992; Braunschweig 1990; Peveraro and Lee 1988; Bergen and Hutter 1986; Ali et al. 2003, 2004; Haitham et al. 2002; Chiu et al. 1992; Ebrahim et al. 2014). ES has effectively resolved the difficulties between production and theory.

In the early 1990s, some researchers studied ES for acidizing technology (Blackburn et al. 1990; Van Domelen et al. 1992; Chavane and Perthuis 1992; Sumotarto et al. 1995; Sumotarto 1995; Xiong 1992; Mininni et al. 1994). However, the developed ES was not able to carry out numerical simulations or predict the acidizing result. Only qualitative analyses were conducted on the ES applications to determine the acid fluid formulation, optimization, and the choice and concentration of additives. Because acidizing sandstone involves many factors, including formation damage diagnosis, acidizing wells selection, acid system and additives selection, optimization of the acidizing process, process parameters design, and evaluation of the acidizing effect, a comprehensive acidizing process should be designed based on both qualitative analyses and reliable numerical simulation. Therefore, the current ES for acidizing and optimization simulation software are insufficient. Based on the theories of expert system (ES) and decision support system (DSS), this work proposes a new system, the expert decision support system (EDSS), by integrating ES and DSS and applying it to the design the acidizing process. The new system conducts qualitative analysis based on knowledge inference and quantitative analyses from numerical simulation. The integrated EDSS is applicable to a much wider range of problems.

Design of AcidizingEDSS

Design philosophy of AcidizingEDSS

To acidize a sandstone reservoir, several aspects must be considered, such as formation damage diagnosis, well layer selection, acid fluid, additive selection, optimization of the acidizing process, operation parameters, field tests, and evaluation. These require a significant amount of information, knowledge, and experience. Thus, the AcidizingEDSS adopts the distributed model. The overall design principle is as follows:

  1. 1.

    The subsystems work independently but are also connected The system is comprised of loosely coupled subsystems. The individual subsystems are connected to and controlled by the master module. Among the subsystems, the parameters are passed through and the information is shared, which facilitates cooperative inference for the design of the AcidizingEDSS. At the same time, according to the choice of the user, every subsystem can work as a completely independent system.

  2. 2.

    Distributed knowledge base Because the AcidizingEDSS decides multiple processes from multiple levels, the distributed knowledge base is designed so that the decision knowledge base for each individual process is relatively independent of each other, but still centralized. Each knowledge base only deals with the respective technical process, which simplifies the knowledge gathering, collation, refinement, and application.

  3. 3.

    The integration of qualitative analysis and quantitative simulation The analysis result of the field and the experience of the acidizing expert, database, and knowledge base are established based on the geological well data. Quantitative simulation is conducted by establishing simulation models and the model library. The ultimate integration is achieved by the coordination of the inference engine to the database, knowledge base and model base.

  4. 4.

    Data sharing and integration The system uses the only database and the same sets of data for inference management. The interface between the database and the high-level language is utilized to achieve selective transmission and data call; as a result, the data sharing and integration efficiency is significantly improved.

  5. 5.

    Software programming language and environment The system adopts Windows as its unified operating system, which corresponds to the object-oriented knowledge representation method, and also analyses the object-oriented software design technique.

The basic structure design of AcidizingEDSS

Figure 1 shows the basic structure of the AcidizingEDSS. The major structure is based on the design principle of multi databases: establishing system database, knowledge base, and model base. The inference engine realizes the coordination and its inference among the bases.

Fig. 1
figure 1

The basic structure of AcidizingEDSS

The functional module design for AcidizingEDSS

As shown in Fig. 2, the system is comprised of five major subsystems: formation damage diagnosis, well layer selection, acid fluid formulation, acidizing process design, and evaluation of acidizing.

Fig. 2
figure 2

The functional modules of the AcidizingEDSS

  1. 1.

    Functional module for formation damage diagnosis Diagnosis is conducted on the formation damage based on the information of well/layer geological conditions, rock composition, fluid dynamics, drilling parameters, well completion, well tests, and laboratory test results. Preliminary advice will be provided.

  2. 2.

    Functional module for well layer selection A feasible acidizing method is suggested based on the information of the well layer damage type, oil/gas properties, oil and water distribution, cementing quality, production history, etc. In the case of multiple candidate wells, fuzzy mathematics is applied to sequence the wells according to priorities.

  3. 3.

    Functional module for acid fluid formulation The formula of the proper acid system is suggested based on geological conditions, lithology, formation damage conditions, and laboratory testing results. It includes the choice of additives, acid concentration, and additive concentration.

  4. 4.

    Functional module for acidizing process design Feasible advice on the design of the acidizing process, distribution of the acid solution, and liquid release is suggested based on the well geological conditions and well completion.

  5. 5.

    Functional module for acidizing evaluation Real-time monitoring is conducted to evaluate the acidizing and economic effects.

Multi-bases system

Database

A large amount of laboratory experiments and field data are required to make acidizing decision. This data is gathered from different departments, so they involve a wide range of areas and are usually in different formats, including numerical data and non-numerical data. Inputting this raw data from the software interface is time consuming and tedious. Therefore, the system must establish a unified database to consistently resolve raw data, intermediate data, and results of the AcidizingEDSS to improve efficiency, data integrity, share ability, and user-friendliness.

Table 1 lists the database components. It provides data for using internal programs, and for end user reference. The data are used in three ways:

Table 1 Database components
  1. 1.

    The system automatically loads the data for inference.

  2. 2.

    Users can get data from the system as references.

  3. 3.

    Users can edit, modify, and search data from the system.

Knowledge base

The decision for acidizing is made from multi levels. Table 2 summarizes the distributed knowledge base.

Table 2 Knowledge base components

Model base

Table 3 tabulates the model base components. Some models are designed specifically for a particular function or decision. Additionally, the model base includes the commonly used simulation model and data processing model. These models are relatively independent and can be directly migrated to the model base to improve the system (Table 4).

Table 3 The model base components
Table 4 Summarizes the key parameters

Knowledge representation of acidizing expert

Method of knowledge representation

ES is a system for knowledge processing in which knowledge representation is most important. Knowledge representation refers to the elaboration of knowledge or an agreement. It is a data structure that describes knowledge and is accepted by computers. The major methods of knowledge interpretation include first-order predicate logic, production representation, frame representation, semantic network representation, and object-oriented representation. Among these, production presentation is most commonly used (Giarratano and Riley 1998). This method uses the form of ‘if…then…’ to mimic human problem-solving capabilities. Compared to other methods, this method is simple, straightforward, and it easily refines and formalizes knowledge. The problem-solving process is in good accordance with human cognition and thinking. Thus, it can be adopted by a computer relatively easily. The production representation is usually presented as: if A is valid, then B is valid; it is simplified as A◊B, where A is the prerequisite and B is the conclusion.

The Backus-Naur Form (BNF) of the production representation is described as follows:

figure a

In BNF, we first define predicates and actions, and then define premise and conclusion using a combination of predicate and action elements. Predicates include predicate names and variables. Actions include action names and variables. The definition of production is that if the premise is established, the conclusion is established, and the production knowledge is the production.

In general, the different production representations are connected; the prerequisite of a certain production interpretation is the conclusion of another production interpretation. If certain conclusions generated from the knowledge base are used as the connection points, the prerequisites and the conclusions can be expanded as a so-called inference tree (decision tree), which connects all rules in the knowledge base. The tree width reflects the range of the real problem, while the tree length indicates the difficulty level of the problem.

Decision trees for sandstone acidizing

The knowledge is interpreted by the production interpretation method in the present work. The decision tree is established to consolidate information in the respective areas including diagnosis to the formation damage, selection of well/formation, modification for production stimulation, acid fluid formulation, temporary plugging agent, streaming process, residual acid solution recycling, etc. The decision tree in Fig. 3 covers the knowledge for more than 50 formulation systems used in various wells of different components and conditions.

Fig. 3
figure 3figure 3

a Decision tree of acid fluid system for sandstone. b Decision tree of acid fluid system for sandstone (Continued from Fig. 3a)

Decision support models

In the acidizing process, non-numerical problems cannot be solved by the classical mathematical methods or models. Thus, the decision has to be made based on qualitative analysis from extensive experiences. However, these numerical problems can be analyzed via quantitative evaluation, which better presents acidizing design. Acidizing effects and changes that occur during acidizing can be predicted by precise and feasible simulation models. As a result, controllable parameters (e.g. operation condition) and non-controllable parameters (e.g. geological condition) can be optimized. These methods and methodologies worked together to operate different functional modules for inference from both knowledge and calculation (Power et al. 2015; Fick and Sprague 2013).

Fuzzy matter-element analysis model for selecting the well and layer for acidizing

The current method for selecting a well and layer involves expert experience, which may neglect some factors. These factors, such as reservoir oiliness, and recoverable reserves, are a fuzzy set (Jing et al. 2013; Zhao et al. 2012). Thus, this paper’s system adopts a fuzzy matter-element analysis model. Figure 4 shows the flow chart for this model.

Fig. 4
figure 4

Algorithm of fuzzy matter-element method for selecting a well/layer

The fuzzy matter-element analysis model of selecting acidizing target well and layer enters the evaluation parameters of the sample well through the user interface, such as: permeability, effective porosity, and skin factor. The software performs fuzzy source analysis based on the input data, and finally selects the well with the highest correlation value as the acidizing well.

Model for formation damage diagnosis

The formation damage type and degree should be diagnosed prior to blockage removal so that the proposal for acidizing can be optimized accordingly. In the traditional method, the diagnosis is carried out by a field test at the well. The damage degree is then evaluated based on the results from the pressure test. However, this method is not sufficient to tell the damage radius, degree, and impact of each cause (Xiong and Holditch 1995; Xiong et al. 2001). Since these factors determine acidizing parameters such as acid fluid concentration, formula, and applicable range, the developed system adopts a quantitative method to simulate the permeability and damage radius via modeling, which greatly accelerates the precise diagnosis process and provides reliable support to the design of acidizing. In addition, the effect of each damage cause can be separately investigated. Figure 5 summarizes the analysis flow for a quantitative diagnosis process.

Fig. 5
figure 5

Flow scheme for diagnosing reservoir formation damages

The formation damage diagnosis model selects the well type through the user interface and inputs various types of data, such as: basic parameters of the well, formation physical parameters, properties of the formation crude oil, the pH of the injected water, the quality of the injected water and drilling fluid properties. Using these data to diagnose the formation damage, and finally get the diagnosis of the potential damage type of the formation.

Parameter optimization for the design of sandstone acidizing

The acidizing design is optimized based on calculation results derived from the reservoir parameters. A comprehensive design model includes models for the wellbore temperature profile, formation temperature profile, acidity and minerals distribution, porosity and permeability distribution, and productivity increment after acidizing. Figure 6 shows the algorithm for these models.

Fig. 6
figure 6

Flow scheme for optimizing acidizing design

Parameter optimization design model of sandstone acidizing inputs oil well parameters, formation parameters, liquid parameters and friction coefficient through the user interface to obtain the optimal results of the acid concentration and mineral concentration figures at different acid injection times, and different acid concentration curves at different times.

Real-time monitoring model of acidizing sandstone

Acidizing is monitored by the real-time measurement of the acid fluid injection rate and injection pressure. Based on the results, the instantaneous change of the skin factors are determined and used to evaluate the acidizing effects. This has been an effective supplementary technique to assure operational safety and optimize the acidizing process. This system integrates the McLeod and Coulter (1969), Paccaloni (1979a, b), Prouvost and Economides models (1987, 1989), as well as inverse injectivity diagnostic plot method (Hill and Zhu 1996). Figure 7 shows the algorithm.

Fig. 7
figure 7

Flow scheme for optimizing the real-time monitoring model

Real-time monitoring model of sandstone acidizing selects different real-time monitoring and evaluation methods, the liquid injection method, the tube type, and inputs construction basic parameters, the monitoring points through the user interface. Then you will get the pump pressure–time graph, displacement–time graph, skin factor-time scatter plot and detailed simulation data for each monitoring point.

Inference control strategies

The inference system controls the solution process of the whole problem. It is responsible for matching the conditional part of the rule with the database content. If the matching successful, inference system will modify the database according to the requirements of the rule, then the new rule will be triggered to make the problem go to the next state. So repeatedly get the answer to the question. In the inference module, there is a conflict resolution strategy. In the problem solving process, when the preconditions of multiple rules match the knowledge, the inference engine will use a certain strategy to select one, so that the solution path of the whole problem is the shortest. This mechanism solves the uncertainty output problem.

Experts establish inference. This system usually adopts the two inference modes as follows:

  1. 1.

    Rule-based reasoning

    The rule-based reasoning is based on production rules and applied to express heuristic knowledge.

  2. 2.

    Case-based reasoning

    This mode is based on real cases. The previous successful cases are saved in a case base. When a new problem is encountered, the case base will be searched for similar cases. With analogic reasoning, the new problem will be eventually solved with some modifications to the existing case solutions.

The two inference modes are illustrated through a case study. The design for acidizing a sandstone well is taken as the example.

In the EDSS for acidizing sandstone, the inference for acidizing design can be divided into two relatively independent steps: the first step is to estimate the type and properties of the acid fluid based on the conditions of the reservoir and expert opinion; the second step is developed from the first step—it derives the acid fluid formula with the knowledge of chemical agent dosage. The first step is completed automatically, while the formula design in the second step involves three scenarios, as follows:

  1. (a)

    If the designers know a significant amount about the chemical agent dosage, they can choose the formula automatically generated by the system from the ES;

  2. (b)

    If the designers have limited knowledge on formula dosage/compositions, they can manually search for the suitable formula in the case, or design a formula based on the results from the first step;

  3. (c)

    If the target well has been involved in the acidizing of the neighboring well and the production performance has been significantly improved, the designer may refer to the formula for the neighboring well.

For case-based reasoning, if there is incomplete knowledge for formula dosage/compositions in the ES, the designer can search for the best fit from the case based on the known information on the acid fluid and carry out relevant modifications to obtain the ultimate formula. Figure 8 summarizes the algorithm for the inference process.

Fig. 8
figure 8

Algorithm for the inference via case-based reasoning

For rule-based reasoning, the acid fluid will be formulated by combining the information from the ES database and the characteristics, properties, and fluid dynamics in the target reservoir. Figure 9 shows the algorithm.

Fig. 9
figure 9

Algorithm for the inference via rule-based reasoning

Case study

The AcidizingEDSS developed in this work is applied to the field site.

AcidizingEDSS successfully proposes the design for acidizing for the real case in the oil field. The details are shown in Table 5. The design developed based on expert knowledge and model simulation covers all areas, including diagnosis to formation damage, acidizing formulation, acidizing technology, operation parameters, fluid discharge, yield increase ratio, and so on. The well was acidized according to the proposal; it achieved excellent performance. Prior to acidizing, the daily liquid production and oil production rates were 12.5 and 7.8 m3/day, respectively. The water content was about 37.6%. After the acidizing operation was stabilized, the respective daily production rate for liquid and oil increased to 24.7 and 18.2 m3/day, respectively, and the water content fell to 26.3%. The production rate corresponded to 2 and 2.3 times, respectively. In addition, because of the use of the oil-soluble temporary plugging agent, the water concentration was controlled to some extent. These favorable results exceeded expectations. Software operation results are shown in Figs. 10, 11, 12, 13 and 14.

Table 5 Summary of treatment recommendation from AcidizingEDSS
Fig. 10
figure 10

Basic parameters input interface for sandstone acidification optimization design

Fig. 11
figure 11

Sandstone acidification optimization design result output interface

Fig. 12
figure 12

Sandstone acidification economic effect evaluation parameter input interface 1

Fig. 13
figure 13

Sandstone acidification economic effect evaluation parameter input interface 2

Fig. 14
figure 14

Sandstone acidification economic effect evaluation parameter output interface

Conclusions

The expert decision support system for sandstone acidizing design is mainly used to assist the sandstone formation acidification optimization design decision. The software is a collection of sandstone acidification expert system and decision support system. For those non-numeric problems in the acidification process that cannot be dealt with by classical or accurate mathematical methods, expert systems are used for qualitative analysis to give reasonable decisions and recommendations. For the problem that can be quantitatively calculated, by establishing an accurate and reasonable calculation model, the various parameters of the acidification process are simulated and predicted, and the acidification effect is predicted, so that the controllable parameters and the uncontrollable parameters are optimally combined to guide the acidification construction design. The combination of qualitative analysis and quantitative calculation makes the system’s effect and application range greatly improved.