1 Introduction

Acid fracturing is a technique to enhance the oil and natural gas production in carbonate reservoirs (Liu et al. 2014; Hou et al. 2019). The acid fluid would be injected into the wellbore as the fracturing fluid, which would increase the pressure in the wellbore and form artificial fractures. During this process, the acid would react with the rock around the fractures, reducing the rock strength and making it easy for propagation (Guo et al. 2014; Hou et al. 2021). Many researches have proven that acid fracturing in carbonate reservoirs is a multi-physics process. Several physical parameters, including fluid pressure, temperature, and acid concentration, would interact with each other (Khoei et al. 2012; Fan et al. 2019; Xu et al. 2021).

There are many studies for thermal–hydraulic–mechanical–chemical (THMC) coupling problems, including gas hydrate-bearing sediment (Gupta et al. 2017), methane hydrate formation and dissociation (Chong et al. 2016), and so on. Fei et al. (2023) studied the near-wellbore nucleation and propagation of hydraulic fractures in Enhanced geothermal systems. Poulet et al. (2012) studied the shear heating and damage based on ESCRIPTRT and ABAQUS. The resulting THMC code was built on the two existing codes. Wu et al. (2023) built the THMC coupling model for carbon dioxide fracturing based on the COMSOL-MATLAB-PHREEQC (CMP) coupling framework. Ogata et al. (2018) built the THMC model to predict the permeability changes. The simulation result was compared with the flow-through experiments result. There are many related studies that deal with multiple physics phenomena and exceed classical hydraulic fracturing simulations (Min et al. 2023; Miehe et al. 2015c, a; Miehe and Mauthe 2016; Lee et al. 2016a, 2018a, 2017b). Different groups developed their own numerical models with different approaches. The interactions between multi-physical parameters are big challenges for the THMC coupling models, which often result in nonstationary, nonlinear systems (Wick 2020).

Multi-physics fracture propagation is one of the research focuses in the petroleum industry. Luo et al. (2020) studied acid fracture propagation in fractured-vuggy carbonate reservoirs based on the extended finite elements. This approach includes mechanical, hydro, and acid–rock reaction modules. Yu et al. (2019) took the heterogeneity and anisotropy of the reservoir into their model to study the fluid pressure-driven fracture. Khoei et al. (2012) used an enhanced function to describe the physical quantities on both sides of the fractures in a stress-seepage-temperature coupling fracture propagation model. There are different approaches for fracture propagation simulation, including level-set methods (Peirce and Detournay 2008), boundary element methods (Castonguay et al. 2013), partition-of-unity methods (Schrefler and Secchi 2012; Adachi et al. 2007; Gupta and Duarte 2014), variational/phase-field approaches (Francfort and Marigo 1998; Bourdin et al. 2000; Kuhn and Müller 2010; Miehe et al. 2010) and so on (Ghidelli et al. 2017; Gupta and Duarte 2016; Rabczuk et al. 2010; Takabi and Tai 2019; Lee et al. 2018b). These methods can be distinguished into the interface-tracking and interface-capturing methods (Wick 2020). In the interface-tracking method, the mesh would move with the fracture propagation and need to be updated every timestep, which brings difficulties in re-meshing and simulation. In the interface-capturing method, which phase-field methods belong to, the mesh is fixed and the fracture is described by additional functions, which solve the mesh degeneration problem and make it be implemented easily to simulate fracture nucleation, propagation, kinking, curvilinear path, branching, and joining. There are several summaries and overview monographs about the conclusions (Bourdin et al. 2008; Ambati et al. 2015; Wu et al. 2020; Bourdin and Francfort 2019; Diehl et al. 2022; Wick 2020).

There are many related research achievements for phase-field fractures in porous media (Chukwudozie et al. 2019; Miehe and Mauthe 2016; Wilson and Landis 2016; Mikelić et al. 2015; Miehe et al. 2015b; Zhou et al. 2019, 2018; Aldakheel et al. 2021; Heider and Markert 2017; Santillan et al. 2017; Bourdin et al. 2012; Wheeler et al. 2014; Mikelić et al. 2015; Lee et al. 2016c; Heider 2021; Lee et al. 2016b; Shiozawa et al. 2019). In many of these studies, the phase-field variable is used as an indicator function to distinguish between the surrounding medium and the fracture zone. Wheeler et al. (2020) built an integrated phase-field simulator for fluid-driven fracture propagation (IPACS), which coupled to reservoir simulators of phase-field models (Wick et al. 2016; Yoshioka and Bourdin 2016). Noii and Wick (2019) introduced a phase-field description for non-isothermal propagating fractures with a fixed temperature difference. Recent further extensions to THM (thermo-hydraulic-mechanical) phase-field in poro-elasticity are by Heider et al. (2018); Nguyen et al. (2023); Suh and Sun (2021) and Wang et al. (2023). Nguyen et al. (2023) provided an up-to-date overview of the current state-of-the-art ( in Sect. 1.2 ).

In this work, we further extend our approach to THMC phase-field fracture, which, for the first time, combines mechanics, phase-field, pressure, temperature (THM), and chemical modules. The acid–rock reaction is the major topic in acid fracturing. Several studies have proven that acid–rock reaction would change rock strength and porosity over time (Hou et al. 2019; Guo et al. 2014; Luo et al. 2020). It offers challenges to the coupling system and other equations. We consider a prototype chemical equation combined with diffusion, transport and reaction terms and take the acid etching result into other equations. The overall algorithm is of iterative coupling type. From the engineering and numerical point of view, the acid area and fracture area are both important regions that need the small mesh size during the simulation. An effective way to satisfy local precision and global computation cost is adaptive mesh refinement of predictor–corrector type (Heister et al. 2015). In this work, it is extended by considering phase-field and acid concentration together in the mesh refinement indicators.

The outline of this paper is as follows: The governing equations are stated in Sect. 2. We take the interactions between multi-physical parameters into consideration. The energy functional and the related Euler–Lagrange equations were analyzed. The main algorithm is presented in Sect. 3. The adaptive predictor–corrector mesh refinement method is adopted and extended in this study. Several numerical examples are shown in Sect. 4 to prove the potential of this model for treating practical engineering. In Sect. 5. a difference function is defined based on the idea of the phase-field method, which can evaluate the accuracy and rightness of numerical simulation quantitatively. We believe that this THMC coupling model can help engineers understand the process of acid fracturing better.

2 Modeling of acid fractures

Let \(\Lambda \in \mathbb {R}^2\) be a smooth open and bounded computational domain with boundary \(\partial \Lambda\). The computational time interval is \(t \in [0, T]\) with the final time \(T>0\). First, we define the fracture f as a lower dimensional object which is contained compactly in \(\Lambda\) as shown in Fig. 1 (left). However, to consider a fracture f as a higher dimensional domain, we consider the phase-field approach, where the scalar-valued phase-field function is defined as \(\phi : \Lambda \times [0,T] \rightarrow [0,1]\). Here, \(\phi = 0\) and \(\phi =1\) indicate a fracture and reservoir, respectively. The region \(0< \phi < 1\) implies the diffusive intermediate state with the thickness \(\varepsilon\). More details are shown in Fig. 1. By utilizing the phase-field function, we divide the computational domain \(\Lambda\) implicitly into two sub-domains, namely fracture sub-domain (\({\Omega _F}(t)\)) and reservoir sub-domain (\({\Omega _R}(t)\)), i.e \(\Lambda = \bar{\Omega _F} \cup \bar{\Omega _R}\). Then, we define the fracture interface \(\partial F: = \Gamma (t): = {\Omega _F}(t) \cap {\Omega _R}(t)\).

Fig. 1
figure 1

The phase-field description for acid fracture using the function \(\phi\)

Moreover, there are four additional solution variables in this model, which include the vector-valued displacement \(\mathbf{{u}}: \Lambda \times [0,T] \rightarrow \mathbb {R}^2\), the scalar-valued pressure \(p: \Lambda \times [0,T] \rightarrow \mathbb {R}\), the scalar-valued temperature \(\Theta : \Lambda \times [0,T] \rightarrow \mathbb {R}\), and the scalar-valued acid concentration \(c: \Lambda \times [0,T] \rightarrow [0,1]\). For each sub-domain, we have \(p_F:= p|_{\Omega _F}\), \(p_R:= p|_{\Omega _R}\), \(\Theta _F:= \Theta |_{\Omega _F}\), \(\Theta _R:= \Theta |_{\Omega _R}\), \(c_F:= c|_{\Omega _F}\), and \(c_R:= c|_{\Omega _R}\). Several physical variables interact with each other, and they have numerical lower and upper bounds on their values due to their mathematical structure, such as the phase field variable and the concentration of acid. In this model, the following assumptions are made:

  1. 1.

    The configuration is assumed to be isotropic and symmetric;

  2. 2.

    Fracture propagation is irreversible;

  3. 3.

    The rock strength under acid etching decreases monotonically and continuously;

  4. 4.

    The gas and heat produced by the acid–rock reaction have no influence on the system;

  5. 5.

    The acid fluid consists solely of hydrochloric acid;

  6. 6.

    All fractures and natural structures are filled with fluid;

  7. 7.

    The fluid is micro-compressible in this model.

Based on the notation and preliminary assumptions, the following five different modules are introduced: Temperature module, pressure module, chemical module for acid fracture, geomechanics (displacements) module, and phase-field fracture indicator function module. We notice that the last two are introduced directly in a coupled fashion since already well-known as basic phase-field fracture model; see the many references in the introduction. Moreover, not all possible nonlinear couplings are necessary between all different equations, and details will be discussed in each respective subsection.

2.1 Temperature equation for acid fractures

First, we introduce the temperature equation. It has been shown that reservoir temperature affects the heat transfer properties more strongly than fluid behavior (Shu et al. 2020; Xue et al. 2023). We assume that the fluid moves slowly enough such that inertia effects and the heat radiation can be neglected (Bai et al. 2017; Jiang et al. 2023). Then the temperature equation in two sub-domains (\(\Omega _F\) and \(\Omega _R\)) can be written as: Find \(\Theta _F:{\bar{\Omega }}_F\times [0,T]\rightarrow \mathbb {R}\) and \(\Theta _R:{\bar{\Omega }}_R\times [0,T]\rightarrow \mathbb {R}\) such that:

$$\begin{aligned} \frac{\partial }{\partial t} ({\texttt {Cap}_F}{\rho _F}\Theta _F )= \nabla \cdot {K_{Fd}}\nabla \Theta _F - {V_F} \cdot \nabla \Theta _F + {q_{F\Theta }} \; \text { in } \; {\Omega _F}(t) \times [0,T], \end{aligned}$$
(1)
$$\begin{aligned} \frac{\partial }{\partial t}({\texttt {Cap}_R}{\rho _R}\Theta _R ) = \nabla \cdot {K_{Rd}}\nabla \Theta _R - {V_R} \cdot \nabla \Theta _R + {q_{R\Theta }} \; \text { in } \; {\Omega _R}(t) \times [0,T]. \end{aligned}$$
(2)

Here, \({\rho _F >0}\) and \({\rho _R>0}\) are the densities of mixture of solid and fluid in the fracture and reservoir, respectively, where \({\rho _R}:= \varphi _R^* \rho _{Rf} + (1 - \varphi _R^*) \rho _{Rr}\) and \({\rho _F}:= {\rho _{Ff}}\). \(\rho _{Rr} > 0\) is the rock density in the reservoir, \(\varphi _R^* > 0\) is the porosity of the reservoir (defined in Eq. (5)). The fluid densities in fracture \({\rho _{Ff}}\) and reservoir \(\rho _{Rf}\) are defined in Eqs. (8) and (9). In addition, \(\texttt {Cap}_F, \texttt {Cap}_R>0\) are the heat capacities of the reservoir and the fracture, respectively, and \(K_{Fd}, K_{Rd}>0\) are the thermal diffusion coefficient of reservoir and fracture, respectively. Fluid velocities in the fracture \({V_F}\) and in the reservoir \({V_R}\) are defined in the Eq. (7), and the detailed expression for the source terms \(q_{F\Theta }\) and \(q_{R\Theta }\) will be given in Eq.  (60). The initial and boundary conditions depend on the problem and are shown in the numerical examples section.

2.2 Pressure equation for acid fractures

The pressure module was first developed for fluid-filled phase-field fractures by Mikelić et al. (2015), which was modified with the indicator functions to enhance robustness (Lee et al. 2016c). Based on the mass continuity, the fluid equation can be written as:

$$\begin{aligned} \dfrac{\partial }{\partial t}\left( {{\rho _{Ff}}\varphi _F^*} \right) + \nabla \cdot \left( {{\rho _{Ff}}{V_F}} \right)&= {q_{Ff}} - {q_L} \; \text { in } \; {\Omega _F}(t) \times [0,T], \end{aligned}$$
(3)
$$\begin{aligned} \dfrac{\partial }{\partial t} \left( {{\rho _{Rf}}\varphi _R^*} \right) + \nabla \cdot \left( {{\rho _{Rf}}{V_R}} \right)&= {q_{Rf}} \; \text{ in } \; {\Omega _R}(t) \times [0,T], \end{aligned}$$
(4)

where \(\varphi _F^*\) and \(\varphi _R^*\) are the porosities of reservoir and fracture respectively, where \({\varphi _F^* = 1.0}\) and

$$\begin{aligned} {\varphi _R^* = \varphi _R^0 + \alpha \nabla \cdot \mathbf{{u}} + \frac{1}{M}(p - {p_0}) + {K_{tc}}(\Theta - {\Theta _0}) + {A_{etch}}(c)}. \end{aligned}$$
(5)

Here, \(0< \varphi _R^0 <1\) is the initial porosity of the reservoir, \({\Theta _0}\) is the initial temperature, \({p_0}\) is the initial pressure, \(\alpha \in [0,1]\) is the Biot coefficient, \(M > 0\) is the Biot modulus, \({K_{tc}}>0\) is the thermal expansion coefficient of pores. In addition, \({A_{etch}}(c)\) is the acid effect term, which is defined as

$$\begin{aligned} A_{etch}(c):= {K_{etch}}\int _0^{{t_{etch}}} R_c \ dt, \end{aligned}$$
(6)

where \({K_{etch}} > 0\) is the acid etching coefficient, \({R_c}\) is the reaction term which is defined in the following section (Eq. (15)), \({t_{etch}}\) is the etching time at a fixed point. The source terms include the leak-off term (Mikelić et al. 2015; Lee et al. 2016c) \({q_L}\), and \({q_{Ff}}\) and \({q_{Rf}}\) are the fluid injection/production terms in the reservoir and fracture, respectively.

The velocities are given by Darcy’s law as

$$\begin{aligned} {{V_i} := - \frac{{K_i}}{{\eta _i}} \nabla {p_i} }, \; i = F,R, \end{aligned}$$
(7)

and, for the simplicity, we neglect the influence of gravity. Here, \(\eta _F>0\) and \(\eta _R>0\) are the fluid viscosities. \(K_F, K_R \in \mathbb {R}^+\) are the permeabilities. The fluid is assumed to be compressible, where \({K_{Ffc}}\in \mathbb {R}^+\) and \({K_{Rfc}}\in \mathbb {R}^+\) are the fluid compressibilities. Then, we have:

$$\begin{aligned} {\rho _{Ff}}&= \rho _{Ff}^0[1 + {K_{Ffc}}(p_F - p_F^0)], \end{aligned}$$
(8)
$$\begin{aligned} {\rho _{Rf}}&= \rho _{Rf}^0[1 + {K_{Rfc}}(p_R - p_R^0)], \end{aligned}$$
(9)

by assuming that the \({K_{Ffc}}\) and \({K_{Rfc}}\) are small, and \(\rho _{Ff}^0\) and \(\rho _{Rf}^0\) are the initial fluid densities in fracture and reservoir.

Then, the pressure equation can be re-written as: Find \(p_F:{\bar{\Omega }}_F\times [0,T]\rightarrow \mathbb {R}\) and \(p_R:{\bar{\Omega }}_R\times [0,T]\rightarrow \mathbb {R}\) such that:

$$\begin{aligned}&\rho _{Ff}^0{K_{Ffc}}{\partial _t}\left( {{p_F}} \right) - \nabla \cdot \rho _{Ff}^0\frac{{K_F}}{{\eta _F}} \left( {\nabla {p_F}} \right) = {q_{Ff}} - {q_L} , \quad \text {in } {\Omega _F}(t) \times [0,T], \end{aligned}$$
(10)
$$\begin{aligned}&\rho _{Rf}^0{\partial _t}\left( {\alpha \nabla \cdot u + \frac{1}{M}{p_R} + {K_{tc}}{\Theta _R} + {A_{etch}}} \right) - \nabla \cdot \rho _{Rf}^0\frac{{K_R}}{{\eta _R}}\left( {\nabla {p_R}} \right) = {q_{Rf}}, \quad \text {in } {\Omega _R}(t) \times [0,T]. \end{aligned}$$
(11)

The boundary and initial conditions depend on the problem and are given in the numerical examples section.

2.3 Chemical equation for acid fractures

The acid fracturing fluid is based on hydrochloric acid, and the chemical reaction (Hou et al. 2021) is given by:

$$\begin{aligned} {2 \textrm{HCl}+\textrm{CaCO}_3=\textrm{CaCl}_2+\textrm{H}_2 \textrm{O}+\textrm{CO}_2 }. \end{aligned}$$
(12)

Here, the unknown variable is the hydrochloric acid concentration. The acid would be injected into the model and react with the rock, which adheres to the law of conservation of matter. The acid moves with the fluid and diffuses from regions of high concentration to those of low concentration. The acid–rock reaction takes place exclusively when the acid contacts with the rock, so there is no reaction term in Eq. (13). The acid–rock reaction rate is influenced by factors such as temperature, pressure, and acid concentration, which is later described in Eq. (16). Thus, the chemical equation for acid diffusion, transport, and reaction can be written as: Find the acid concentrations \(c_F:{\bar{\Omega }}_F\times [0,T]\rightarrow \mathbb {R}\) and \(c_R:{\bar{\Omega }}_R\times [0,T]\rightarrow \mathbb {R}\) such that:

$$\begin{aligned} \dfrac{\partial }{\partial t} \left( {\varphi _F^*{c_F}} \right)&= {K_{Fc}}\nabla \cdot \left( {\varphi _F^*{c_F}} \right) - {V_F} \cdot \nabla {c_F} + {q_{Fc}} \; \text { in }\; {\Omega _F}(t) \times [0,T], \end{aligned}$$
(13)
$$\begin{aligned} \dfrac{\partial }{\partial t} \left( {\varphi _R^*{c_R}} \right)&= {K_{Rc}}\nabla \cdot {c_R} - {V_R} \cdot \nabla {c_R} + {q_{Rc}} - \varphi _R^* {R_c} \; \text { in }\; {\Omega _R}(t) \times [0,T]. \end{aligned}$$
(14)

The penalization method for the chemical equation is introduced in Sect. 3.4 since the acid solution should follow the physical limits. Here, \({K_{Fc}},{K_{Rc}} > 0\) are the acid diffusion coefficients of the reservoir and fracture respectively, and \({q_{Fc}},{q_{Rc}}\) are the acid source terms. According to Eq. (12), the reaction term can be described as:

$$\begin{aligned} {{R_c}:= 2{K_{ar}}(p,\Theta ){{c_R}^2}}, \end{aligned}$$
(15)

where \({K_{ar}}(p,\Theta )\) is reaction rate speed, which is affected by pressure and temperature (Arrhenius 1889; Pham et al. 2022). In this paper, we set as:

$$\begin{aligned} {K_{ar}}(p,\Theta ):= {k_{ar}}\left( {\dfrac{p}{{{p_r}}}} \right) ^{-\frac{1}{2}} \exp \left( - \dfrac{{Ea}}{{R{\Theta _T}}} \right) , \end{aligned}$$
(16)

where \(k_{ar} > 0\) is the reaction rate constant at a reference pressure, \(p_r\) is the reference pressure, Ea is the activation energy of Eq. (12), \(R > 0\) is the gas constant, and \({\Theta _T}\) is the absolute temperature.

2.4 The Phase-Field Energy Functional for Acid Fracture

The phase-field fracture system consists of a displacement variable \(\textbf{u}\) describing geomechanics and a phase-field indicator function \(\phi\) describing the fracture. Traditionally, this was introduced from an energy point of view (Francfort and Marigo 1998; Bourdin et al. 2000) and later interpreted as a thermodynamically consistent phase-field model (Kuhn and Müller 2010; Miehe et al. 2010). The energy equation for variational fracture (yet without \(\phi\)) can be described as:

$$\begin{aligned} E(\mathbf{{u}},f) = \dfrac{1}{2}\int _\Omega {\sigma (\mathbf{{u}}):e(\mathbf{{u}}) \ d\mathbf{{x}} + {G_F}{H^{d - 1}}(f)}, \end{aligned}$$
(17)

where, \(\Omega = \Lambda \backslash f\), \({G_F} > 0\) is the critical energy release rate, and \({H^{d - 1}}(f)\) is the length of the fracture. The linear elastic stress tensor (\(\sigma (\mathbf{{u}})\)) and strain tensor (\(e(\mathbf{{u}})\)) are described as:

$$\begin{aligned} \sigma (\mathbf{{u}}) = \lambda (\nabla \cdot \mathbf{{u}})I + 2Ge(\mathbf{{u}}), \ \ e(\mathbf{{u}}) = \frac{{\nabla \mathbf{{u}} + \nabla {\mathbf{{u}}^T}}}{2}, \end{aligned}$$
(18)

where, \(\lambda , G > 0\) are the Lamé coefficients, and I is the identity tensor. In this model, we assume that the acid fracture would begin in the homogeneous media and the rock parameter would change with the acid etching. Thus, the acid fracturing problem becomes a dynamic heterogeneous problem. It is well known from the previous studies (Pournik 2008; Melendez et al. 2007; Zhou et al. 2021), that different rock samples would lead to different trends in the change of rock strength after acid etching. Here, we assume that the rock strength under acid etching decreases monotonically and continuously and the mechanical parameters would change as:

$$\begin{aligned} E = {E_0} - {K_{Eetch}}\int _0^{{t_{etch}}} {{R_c}dt}\;, \; \nu =\nu _0. \end{aligned}$$
(19)

Here, \({K_{Eetch}} > 0\) is the acid effect constant for Young’s modulus. E is the Young’s modulus and \(\nu\) is the Poisson ratio. \(E_0\) and \(\nu _0\) are the initial Young’s modulus and initial Poisson ratio. According to Hooke’s Law, the lame coefficients \(\lambda , G\) are defined as:

$$\begin{aligned} G=\frac{E}{2(1+\nu )} \;, \; \lambda =\frac{E \nu }{(1+\nu )(1-2 \nu )}. \end{aligned}$$
(20)

Thus, we can rewrite the Eq. (18):

$$\begin{aligned} \sigma (\mathbf{{u}},c):= \lambda (c, t)(\nabla \cdot \mathbf{{u}})I + 2G(c, t)e(\mathbf{{u}}). \end{aligned}$$
(21)

In the following, we perform two modifications in Eq. (17). First, the poroelastic stress tensor \(\sigma _{eff}:= \sigma (\mathbf{{u}},c) - \alpha pI\) contributes one additional term, namely \(\alpha p I\). Here, \(\alpha \in [0,1]\) is Biot’s coefficient. The same procedure applies to the temperature contribution. Coussy (2004) proposed the resulting free-energy model. The use of these ideas for fracture formulations in porous media was outlined by Tran et al. (2013). The extension to phase-field fracture descriptions in pressurized and non-isothermal configurations was derived by Noii and Wick (2019). To this end, we obtain the energy functional

$$\begin{aligned} \begin{aligned} E(\mathbf{{u}},p,c,\Theta ,f) = \frac{1}{2}\int _\Omega {\sigma (\mathbf{{u}},c):e(\mathbf{{u}})d\mathbf{{x}}} - \int _\Omega {\alpha p\nabla \cdot \mathbf{{u}} \ d\mathbf{{x}}} \\ - \int _\Omega {3{\alpha _\Theta }{K_d}\Theta \nabla \cdot \mathbf{{u}} \ d\mathbf{{x}}} + {G_F}{H^{d - 1}}(f). \end{aligned} \end{aligned}$$
(22)

Here, \(3{\alpha _\Theta } > 0\) is the thermal expansion coefficient and \({K_d}:= G + \lambda\). The first three terms in the above equation are bulk energy terms and \({G_F}{H^{d - 1}}(f)\) is the fracture surface energy term. The latter can be rewritten as a computable form by utilizing the phase-field by employing the following Ambrosio–Tortorelli elliptic functional approximation (Ambrosio and Tortorelli 1990, 1992; Bourdin et al. 2000). In more detail, the line integral \({G_F}{H^{d - 1}}(f)\) is difficult to approximate numerically. Thus, the elliptic approximation is defined as domain integral and makes it easier to treat numerically. To this end, we work with

$$\begin{aligned} \int _f {{G_F}ds} \approx \int _\Lambda {{G_F} \left( \frac{1}{{2\varepsilon }}{{(1 - \phi )}^2} + \frac{\varepsilon }{2}{{(\nabla \phi )}^2} \right) \ d\mathbf{{x}}}. \end{aligned}$$
(23)

Inserting (23) into (22) yields

$$\begin{aligned} \begin{aligned} E(\mathbf{{u}},p,c,\Theta ,f) = \frac{1}{2}\int _\Omega {\sigma (\mathbf{{u}},c): e(\mathbf{{u}})d\mathbf{{x}}} - \int _\Omega {\alpha p\nabla \cdot \mathbf{{u}} \ d\mathbf{{x}}} \\ - \int _\Omega {3{\alpha _\Theta }{K_d}\Theta \nabla \cdot \mathbf{{u}} \ d\mathbf{{x}}} + \int _\Lambda {{G_F} \left( \frac{1}{{2\varepsilon }}{{(1 - \phi )}^2} + \frac{\varepsilon }{2}{{(\nabla \phi )}^2} \right) \ d\mathbf{{x}}} \end{aligned}. \end{aligned}$$
(24)

In this energy functional, porous media contributions and phase-field of the reservoir are included. However, the specific influence of the fracture itself is not yet contained. Utilizing interface laws of continuity of pressures and temperatures, as well as continuity of the stress tensors into normal directions, were performed by Noii and Wick (2019). These ideas were earlier derived and discussed by Mikelić et al. (2013); Wick (2020). Numerical approximation of interface laws becomes challenging due to the smeared representation of fractures with only the phase field. Mikelić et al. (2013) employed Gauss’ divergence theorem to rewrite interface contributions as domain integrals. With two new contributions for both the pressure and the temperature in Eq. (23), the energy functional for acid fracture can be written as:

$$\begin{aligned} E(\mathbf{{u}},p,c,\Theta ,\phi )&= \int _\Lambda {\frac{1}{2}((1 - k){\phi ^2} + k){\sigma ^ + } (\mathbf{{u}},c):e(\mathbf{{u}})d\mathbf{{x}}} + \int _\Lambda {\frac{1}{2}{\sigma ^ - }(\mathbf{{u}},c):e(\mathbf{{u}})d\mathbf{{x}}} \nonumber \\&- \int _\Lambda {(\alpha - 1){\phi ^2}p\nabla \cdot \mathbf{{u}} \ d\mathbf{{x}}} + \int _\Lambda {({\phi ^2}\nabla p)\mathbf{{u}} \ d\mathbf{{x}}} \nonumber \\ {}&- \int _\Lambda {(3{\alpha _\Theta }{K_d} + {C_\Theta }){\phi ^2}\Theta \nabla \cdot \mathbf{{u}} \ d\mathbf{{x}}} + \int _\Lambda {{C_\Theta }{\phi ^2}\nabla \Theta \mathbf{{u}} \ d\mathbf{{x}}} \nonumber \\&+ \int _\Lambda {{G_F}\left( \frac{1}{{2\varepsilon }}{{(1 - \phi )}^2} + \frac{\varepsilon }{2}{{(\nabla \phi )}^2} \right) \ d\mathbf{{x}}}, \end{aligned}$$
(25)

Here, k is a positive regularization parameter for the elastic energy and \({C_\Theta }\) is a constant to describe the relation for the temperature near the fracture (Tran et al. 2013). Due to the irreversibility constraint and loading conditions, phase-field fracture is an incremental or time-dependent procedure. Here and above, we consider a quasi-static setting in which no time derivatives appear in the main equations, but only in the irreversibility constraint. However, this means that the variables are space and time-dependent. Then, let \(p,\Theta ,c\) be given, find \(\mathbf{{u}}:\Lambda \times [0,T] \rightarrow \mathbb {R}^2\), \(\phi :\Lambda \times [0,T] \rightarrow [0,1]\) through the complementarity system

$$\begin{aligned} - \nabla \cdot (((1 - k){\phi ^2} + k){\sigma ^ + }(\mathbf{{u}},c) + {\sigma ^- }(\mathbf{{u}},c)) + (\alpha - 1)\nabla ({\phi ^2}p) \nonumber \\ + {\phi ^2}\nabla p + (3{\alpha _\Theta }{K_d} + {C_\Theta })\nabla ({\phi ^2}\Theta ) + {\phi ^2}\nabla \Theta&= 0 \quad \text {in }\Lambda \times [0,T], \end{aligned}$$
(26)
$$\begin{aligned} - ((1 - k){\sigma ^ + }:e(\mathbf{{u}})\phi - \frac{{G_F}}{\varepsilon }(1 - \phi ) - {G_F}\varepsilon \Delta \phi - 2(\alpha - 1)\phi p\nabla \cdot \mathbf{{u}} \nonumber \\ + 2\phi \nabla p \mathbf{{u}} - 2(3{\alpha _\Theta }{K_d} + {C_\Theta })\phi \Theta \nabla \cdot \mathbf{{u}} + 2{C_\Theta }\phi \nabla \Theta \mathbf{{u}})&\le 0 \quad \text {in } \Lambda \times [0,T] , \end{aligned}$$
(27)
$$\begin{aligned} {\partial _t}\phi&\le 0 \quad \text {in } \Lambda \times [0,T] , \end{aligned}$$
(28)
$$\begin{aligned} - ((1 - k){\sigma ^ + }:e(\mathbf{{u}})\phi - \frac{{G_F}}{\varepsilon }(1 - \phi ) - {G_F}\varepsilon \Delta \phi - 2(\alpha - 1)\phi p\nabla \cdot \mathbf{{u}} \nonumber \\ + 2\phi \nabla p \mathbf{{u}} - 2(3{\alpha _\Theta }{K_d} + {C_\Theta })\phi \Theta \nabla \cdot \mathbf{{u}} + 2{C_\Theta }\phi \nabla \Theta \mathbf{{u}}){\partial _t}\phi&= 0 \quad \text {in } \Lambda \times [0,T] . \end{aligned}$$
(29)

2.5 Initial and Boundary Conditions

In this section, we supplement the initial and boundary conditions in the system. The acid fractures begin at a homogeneous media. For all \(x \in {\Omega _F} \cup {\Omega _R}(t = 0)\), \(p_F^0,p_R^0\) are the smooth given pressure. \(\Theta _F^0,\Theta _R^0\) are the smooth given temperature. \(c_F^0,c_R^0\) are the smooth given acid concentration. We also have \(\phi (x,0) = {\phi ^0}\), where \({\phi ^0}\) is the given initial phase-field. We prescribe Dirichlet boundary conditions for temperature, pressure, displacement and acid equation on \(\partial \Lambda\). The boundary conditions for this model are given as follows:

$$\begin{aligned} \mathbf{{u}} = 0 ,\; {\partial _n}\phi = 0 \;, \; p = {f_p} \;, \; \Theta = {f_\Theta } \;, \; c = {f_c} \quad \text {on } \partial \Lambda \times [0,T], \end{aligned}$$
(30)

Here, n is the outward normal vector of the domain \(\Lambda\), and \({f_p}\), \(f_\Theta\), \(f_c\) are the given boundary values.

3 Numerical Modeling, Discretization and Solution Algorithms

In this section, we discuss numerical aspects of the previously defined systems. First, numerical discretizations in time and space are introduced for each module. The final goal is the design of an algorithm that couples all modules. The strong forms need to be rewritten into weak formulations (Lee et al. 2016c, 2017a; Wheeler et al. 2020), which our overall numerical modeling strategy relies on. Here, care must be taken for the mechanics-phase-field part since the phase-field function is subject to a fracture irreversibility constraint. The governing functional framework is posed in function spaces and convex sets, forming a CVIS (coupled variational inequality system). In this work, this is regularized by using a primal-dual active set method for a primal-dual active set phase-field formulation (Heister et al. 2015). Then, temporal and spatial discretizations are applied. Next, indicator variables obtained from the phase-field functions are computed for the three diffraction systems, namely pressure, temperature, and chemical equation. Having all weak forms at hand, a final algorithm based on the fixed-stress scheme will be derived. Here, we extend our own previously derived algorithms (Lee et al. 2017a) to the THMC phase-field fracture system.

3.1 Discretization: Basics

A mesh family \({\{ {M_h}\} _{h > 0}}\) is introduced and assumed to be shape regular. Each mesh \({M_h}\) is square and a subdivision of \({\overline{\Lambda }}\) made of disjoint elements \({{\mathcal {K}}}\). Each subdivision is assumed to approximate the computational domain. The diameter of an element \({{\mathcal {K}}} \in {M_h}\) is denoted by h, and \({h_{\max }}\) is the global refine mesh size and \({h_{\min }}\) is the local refine mesh size. The computational time interval ([0, T]) is discretized as \(0: = {t^0}< \cdot \cdot \cdot< {t^n}< \cdot \cdot \cdot < {t^N}: = T\). The time step size is \(\delta t: = {t^n} - {t^{n - 1}}\). The domain \(\Lambda\) is divided into the fracture sub-domain (\({\Omega _F}(t)\)) and reservoir sub-domain (\({\Omega _R}(t)\)). Here we introduce the indicator functions:

$$\begin{aligned} {\chi _F}(x,t): = \left\{ {\begin{array}{*{20}{c}} {\mathrm{{1 }} \; \; \; \; \; \; \; \; \; \mathrm{{ if }}\; \phi \mathrm{{< }}{\mathrm{{D}}_{\mathrm{{f}}}}},\\ {\mathrm{{1 -\phi (x,t) }}\; \; \mathrm{{ if }} \; {\mathrm{{D}}_{\mathrm{{f}}}}\mathrm{{< }}\phi \mathrm{{< }}{\mathrm{{D}}_{\mathrm{{r}}}}},\\ {\mathrm{{0 }} \; \; \; \; \; \; \; \; \; \mathrm{{if }} \; \phi \mathrm{{> }}{\mathrm{{D}}_{\mathrm{{r}}}}}, \end{array}} \right. \; \; {\chi _R}(x,t): = \left\{ {\begin{array}{*{20}{c}} {\mathrm{{1 }} \; \; \; \; \ \mathrm{{ if }}\; \phi \mathrm{{< }}{\mathrm{{D}}_{\mathrm{{f}}}}}\\ {\phi (x,t) \; \; \; \;\mathrm{{ if }}\;{\mathrm{{D}}_{\mathrm{{f}}}}\mathrm{{< }}\phi \mathrm{{ < }}{\mathrm{{D}}_{\mathrm{{r}}}}}\\ {\mathrm{{0 }} \; \; \; \; \ \mathrm{{if }} \; \phi \mathrm{{ > }}{\mathrm{{D}}_{\mathrm{{r}}}}} \end{array}} \right. . \end{aligned}$$
(31)

Thus, \(\chi _F(x,t) = 1\) in fracture sub-domain and \(\chi _R(x,t) = 1\) in reservoir sub-domain. It follows \({\chi _F} + {\chi _R} = 1\) obviously. Here, \(0< D_f< D_r <1\) are the distinguishing indexes for fracture and reservoir. The indicator functions are continuous in the intermediate state.

3.2 Discretization of the Temperature Equation

Since the fluid compressibility is small enough, the temperature equation for both fracture and reservoir subdomains can be rewritten as:

$$\begin{aligned} {{\texttt {Cap}}_F}\rho _{Ff}^{0}\frac{\partial \Theta _F}{\partial t}&= \nabla \cdot {K_{Fd}}\nabla \Theta _F - {V_F} \cdot \nabla \Theta _F + {q_{F\Theta }} \quad \text {in } {\Omega _F}(t) \times [0,T], \end{aligned}$$
(32)
$$\begin{aligned} {{\texttt {Cap}}_R}{\rho _{Rr}}\frac{{\partial \Theta _R }}{{\partial t}}&+ {{\texttt {Cap}}_R}(\rho _{Rf}^0 - {\rho _{Rr}})\frac{{\partial \varphi _R^* \Theta _R }}{{\partial t}} = \nabla \cdot {K_{Rd}}\nabla \Theta _R - {V_R} \cdot \nabla \Theta _R + {q_{R\Theta }} \quad \text {in } {\Omega _R}(t) \times [0,T]. \end{aligned}$$
(33)

The space approximation \(\Theta\) of the temperature is approximated by using continuous piecewise polynomials given in the finite element space \(\mathbb {W}(M_h)\). According to the Galerkin method, the temperature equation can be discretized as:

$$\begin{aligned}&{\chi _F} ( \cdot ,\phi )\left( {\int _\Lambda {\left( {{\texttt {Cap}_F}\rho _{Ff}^0 \frac{{\partial \Theta }}{{\partial t}}} \right) } \omega d\mathbf{{x}} = \int _\Lambda {\nabla \cdot {K_{Fd}}\nabla \Theta \omega } d\mathbf{{x}} - \int _\Lambda {{V_F} \cdot \nabla \Theta } \omega d\mathbf{{x}} + \int _\Lambda {{q_{F\Theta }}} \omega d\mathbf{{x}}} \right) , \end{aligned}$$
(34)
$$\begin{aligned}&{\chi _R} ( \cdot ,\phi )\left( \int _\Lambda {\left( {\texttt {Cap}_R}{\rho _{Rr}} \frac{{\partial \Theta }}{{\partial t}} + {\texttt {Cap}_R}(\rho _{Rf}^0 - {\rho _{Rr}})\frac{{\partial \varphi _R^*\Theta }}{{\partial t}} \right) } \omega d\mathbf{{x}} \right. \nonumber \\&=\left. \int _\Lambda {\nabla \cdot {K_{Rd}}\nabla \Theta \omega } d\mathbf{{x}} - \int _\Lambda {{V_R} \cdot \nabla \Theta } \omega d\mathbf{{x}} + \int _\Lambda {{q_{R\Theta }}} \omega d\mathbf{{x}} \right) , \; \; \; \forall \omega \in \mathbb {W}(M_h). \end{aligned}$$
(35)

Then we discretize the equation in time by utilizing the first order backward Euler method. Let the \({\phi ^n}\), \({p^n}\) and \({\Theta ^n}\) be given, then \({\Theta ^{n + 1}}\) can be computed as:

$$\begin{aligned} {B_{F\Theta }}({\Theta ^{n + 1}})(\omega ) =&{\chi _F}( \cdot ,{\phi ^n}) \left( \int _\Lambda {\left( {{\texttt {Cap}_F} \rho _{Ff}^0\frac{{{\Theta ^{n + 1}} - {\Theta ^{n}}}}{{\delta t}}} \right) } \omega d\mathbf{{x}} - \int _\Lambda {\nabla \cdot {K_{Fd}}\nabla {\Theta ^{n + 1}}\omega } d\mathbf{{x}} \right. \nonumber \\&\left. + \int _\Lambda {V_F^n \cdot \nabla {\Theta ^{n + 1}}} \omega d\mathbf{{x}} - \int _\Lambda {{q_{F\Theta }}} \omega d\mathbf{{x}} \right) , \end{aligned}$$
(36)
$$\begin{aligned} {B_{R\Theta }}({\Theta ^{n + 1}})(\omega ) =&{\chi _R}( \cdot ,{\phi ^n}) \left( \int _\Lambda {\left( {{\texttt {Cap}_R} \left( \varphi _R^0 \rho _{Rf}^0 + (1 - \varphi _R^0) \rho _{Rr} \right) \frac{{{\Theta ^{n + 1}} - {\Theta ^{n}}}}{{\delta t}}} \right) } \omega d\mathbf{{x}} \right. \nonumber \\&\left. - \int _\Lambda {\nabla \cdot {K_{Rd}}\nabla {\Theta ^{n + 1}}\omega } d\mathbf{{x}} + \int _\Lambda {V_R^n \cdot \nabla {\Theta ^{n + 1}}} \omega d\mathbf{{x}} - \int _\Lambda {{q_{R\Theta }}} \omega d\mathbf{{x}} \right) , \end{aligned}$$
(37)
$$\begin{aligned}&{B_\Theta }({\Theta ^{n + 1}})(\omega ) = {B_{F\Theta }}({\Theta ^{n + 1}}) (\omega ) + {B_{R\Theta }}({\Theta ^{n + 1}})(\omega ) = 0. \end{aligned}$$
(38)

3.3 Discretization of the Pressure Equation

The space approximation P of the pressure is approximated by using continuous piecewise polynomials given in the finite element space, \(\mathbb {W}(M_h)\). According to the Galerkin method, the pressure equation can be discretized as:

$$\begin{aligned}&{\chi _F}( \cdot ,\phi )\left( \int _\Lambda {\left( {\rho _{Ff}^0{K_{Ffc}}{\partial _t}P} \right) } \omega d\mathbf{{x}} - \int _\Lambda {\left( {\rho _{Ff}^0\frac{{{K_F}}}{{{\eta _F}}} \left( {\nabla P} \right) } \right) } \nabla \omega d\mathbf{{x}} = \int _\Lambda {({q_{Ff}} - {q_L})\omega } d\mathbf{{x}} \right) , \end{aligned}$$
(39)
$$\begin{aligned}&{\chi _R}( \cdot ,\phi )(\int _\Lambda {\left( {\rho _{Rf}^0{\partial _t} \left( {\alpha \nabla \cdot u + \frac{1}{M}P + {K_{tc}}{\Theta _R} + {A_{etch}}} \right) } \right) } \omega d\mathbf{{x}} \nonumber \\&- \int _\Lambda {\left( {\rho _{Rf}^0\frac{{{K_R}}}{{{\eta _R}}} \left( {\nabla P} \right) } \right) } \nabla \omega d\mathbf{{x}} = \int _\Lambda {{q_{Rf}}} \omega d\mathbf{{x}}), \; \; \forall \omega \in \mathbb {W}(M_h). \end{aligned}$$
(40)

Then we discretize the equation in time by utilizing the first order backward Euler method. Let the \({\Theta ^{n + 1}}, {\Theta ^{n}}, { \mathbf{{u}}^{n + 1}}, { \mathbf{{u}}^{n}}, { c ^{n }}, { c ^{n - 1}}\) and \(P^n\) be given, then the \({P ^{n + 1}}\) can be computed as:

$$\begin{aligned} B_{Fp}(P^{n + 1})(\omega )&= \chi _F( \cdot ,\phi ^n) \left( \int _\Lambda \left( \rho _{Ff}^0 K_{Ffc}\frac{{P^{n + 1}} - {P^n}}{{\delta t}} \right) \omega d\mathbf{{x}} - \int _\Lambda \left( \rho _{Ff}^0\frac{K_F}{\eta _F} \nabla P^{n + 1} \right) \nabla \omega d\mathbf{{x}} \right. \nonumber \\&\left. - \int _\Lambda ({q_{Ff} - q_L})\omega d\mathbf{{x}} \right) , \end{aligned}$$
(41)
$$\begin{aligned} B_{Rp}(P^{n + 1})(\omega )&= \chi _R( \cdot ,{\phi ^n}) \nonumber \\&\left( \int _\Lambda {\rho _{Rf}^0\left( {\alpha \frac{{\nabla \cdot {u^{n + 1}} - \nabla \cdot {u^n}}}{{\delta t}} + \frac{1}{M}\frac{{{P^{n + 1}} - {P^n}}}{{\delta t}} + {K_{tc}}\frac{{{\Theta ^{n + 1}} - {\Theta ^n}}}{{\delta t}} + \frac{{A_{etch}^n - A_{etch}^{n - 1}}}{{\delta t}}} \right) } \omega d\mathbf{{x}} \right. \nonumber \\&\left. - \int _\Lambda {\left( {\rho _{Rf}^0\frac{{K_R}}{{\eta _R}} \nabla P^{n + 1} } \right) } \nabla \omega d\mathbf{{x}} - \int _\Lambda {q_{Rf} \omega } d\mathbf{{x}} \right) , \end{aligned}$$
(42)
$$\begin{aligned} {B_P}({P^{n + 1}})(\omega )&= B_{Fp}(P^{n + 1})(\omega )+ B_{Rp}(P^{n + 1})(\omega ) = 0. \end{aligned}$$
(43)

Here, the pressure source term is given with the leak-off term \(q_L\), which is defined as (Heister et al. 2015):

$$\begin{aligned} {q_L}: = \nabla \cdot ({\rho _{Ff}}{V_{leak}}). \end{aligned}$$
(44)

3.4 Discretization of the Chemical Equation with Penalization Method

The chemical equation for acid fractures and reservoir subdomains can be written as:

$$\begin{aligned} \partial _t {c_F}&= {K_{Fc}}\nabla \cdot c_F - {V_F} \cdot \nabla {c_F} + {q_{Fc}} \quad \text {in } {\Omega _F}(t) \times [0,T], \end{aligned}$$
(45)
$$\begin{aligned} {\partial _t}\left( {\varphi _R^*{c_R}} \right)&= {K_{Rc}}\nabla \cdot {c_R} - {V_R} \cdot \nabla {c_R} + {q_{Rc}} - \varphi _R^* {R_c}\left( c_R^{n-1} , p_R^{n-1} ,\Theta _R ^{n-1}\right) \quad \text {in } {\Omega _R}(t) \times [0,T]. \end{aligned}$$
(46)

Here, \(R_c\) is a chemical reaction coupling term, and for the simplicity, we linearize it by employing the old timestep solutions of acid, temperature, and pressure. In addition, the acid injection terms are related to fluid rate, pressure and temperature (Eqs. (64), (65)).

Due to the physical meaning of hydrochloric acid content, the solution variable \(c_i\) in the chemical equation should follow \(0< c_i < {c_s}\) (\(i = F\) in fracture domain and \(i = R\) in reservoir domain), where \(c_s\) is the saturation concentration of acid, \(c_s <1\). Thus, to preserve this physics, the following penalization method is introduced in this model:

$$\begin{aligned} {\gamma _0}{[ - c_i]^ + } + {\gamma _s}{[c_i - {c_s}]^ + }. \end{aligned}$$
(47)

Therefore, we can rewrite the chemical equations with penalization as,

$$\begin{aligned} {\partial _t}\left( {{c_F}} \right) + {\gamma _0^+} + {\gamma _s^+}&= {K_{Fc}}\nabla \cdot \left( {{c_F}} \right) - {V_F} \cdot \nabla {c_F} + {q_{Fc}} \quad \text {in } {\Omega _F}(t) \times [0,T], \end{aligned}$$
(48)
$$\begin{aligned} {\partial _t}\left( {\varphi _R^*{c_R}} \right) + {\gamma _0^+} + {\gamma _s^+}&= {K_{Rc}}\nabla \cdot {{c_R}} - {V_R} \cdot \nabla {c_R} + {q_{Rc}} - \varphi _R^*{R_c^{n-1}} \quad \text {in } {\Omega _R}(t) \times [0,T]. \end{aligned}$$
(49)

If \(\gamma\) is too small, the penalization would have no effect, whereas if \(\gamma\) is too big will lead to ill-conditioned Jacobians and higher nonlinearities. Here we set:

$$\begin{aligned} {{\gamma _0}{[ - c_i]^ + } = \left\{ {\begin{array}{*{20}{c}} {0\mathrm{\;{ if }\;}{c_i}\mathrm{{> 0 }}}\\ {0.1\mathrm{\;{ if }\;}{c_i}\mathrm{{< 0}}} \end{array}} \right. } \;, \; {{\gamma _s}{[c_i - {c_s}]^ + } = \left\{ {\begin{array}{*{20}{c}} {0\mathrm{\;{ if }\;}{c_i}\mathrm{{ < }}{\mathrm{{c}}_s}\mathrm{{ }}}\\ {0.1\mathrm{\;{ if }\;}{c_i}\mathrm{{ > }}{\mathrm{{c}}_s}} \end{array}} \right. }. \end{aligned}$$
(50)

The space approximation \(C \in \mathbb {W}(M_h)\) of the acid concentration is approximated by using continuous piecewise polynomials given in the finite element space. Let the \({\Theta ^{n + 1}}, {\Theta ^{n}}, { \mathbf{{u}} ^{n + 1}}, { \mathbf{{u}} ^{n}}, { P ^{n + 1}}, { P ^{n}}\) and \(C^n\) be given. The global \({C ^{n + 1}}\) can be computed as:

$$\begin{aligned} B_{Fc}(C^{n + 1})(\omega )&= \chi _F( \cdot ,{\phi ^n}) \left( \int _\Lambda {\left( \frac{{{C^{n + 1}} - {C^n}}}{{\delta t}} + ({\gamma _0}^ + + {\gamma _s}^+ , {C^n})\right) } \omega d\mathbf{{x}} \right. \nonumber \\&\left. - \int _\Lambda {({K_{Fc}}\nabla \cdot {C^{n + 1}} - {V_F} \cdot \nabla {C^{n + 1}})} \omega d\mathbf{{x}} - \int _\Lambda {{q_{Fc}}} \omega d\mathbf{{x}},\right) \end{aligned}$$
(51)
$$\begin{aligned} B_{Rc}(C^{n + 1})(\omega )&= \chi _R( \cdot ,{\phi ^n}) \left( \int _\Lambda {(\varphi _R^*\frac{{{C^{n + 1}} - {C^n}}}{{\delta t}} + ({\gamma _0}^ + + {\gamma _s}^ + ,{C^n}))} \omega d\mathbf{{x}} \right. \nonumber \\&\left. - \int _\Lambda {({K_{Rc}}\nabla \cdot {C^{n + 1}} - {V_R} \cdot \nabla {C^{n + 1}})} \omega d\mathbf{{x}} - \int _\Lambda {({q_{Rc}} - \varphi _R^* {R_c^n})} \omega d\mathbf{{x}} \right) , \end{aligned}$$
(52)
$$\begin{aligned} {B_c}({C^{n + 1}})(\omega )&= {B_{Fc}}({C^{n + 1}})(\omega ) + {B_{Rc}}({C^{n + 1}})(\omega ), \; \; \forall \omega \in \mathbb {W}(M_h). \end{aligned}$$
(53)

3.5 A Quasi-Monolithic Formulation of the Coupled Displacement Phase-Field System

In this section, we present a fully-coupled Euler–Lagrange formulation with a quasi-monolithic scheme for \(\textbf{U}\) and \(\Phi\) (approximating \(\mathbf{{u}},\phi\)) (Lee et al. 2016c). Therein, as proposed by Heister et al. (2015), the phase-field variable is linearized through an extrapolation \({\tilde{\Phi }}\) in the first term to obtain a robust numerical scheme. Let the initial conditions \({p^0},{\Theta ^0},{\mathbf{{u}}^0},{\phi ^0}\) be given, and \({P^n},{\Theta ^n}\) are solution variables from the pressure equation and the temperature equation in time step n. Then, we seek \(\{ {\mathbf{{U}}^{n + 1}},{\Phi ^{n + 1}}\}\)

$$\begin{aligned} A\left( {{\mathbf{{U}}^{n + 1}},{\Phi ^{n + 1}}} \right) \left( {\mathbf{{w}},\psi - {\Phi ^{n + 1}}} \right)&= \int _\Lambda {((1 - k)} {\left( {{{\tilde{\Phi }} ^{n + 1}}} \right) ^2} + k){\sigma ^ + }\left( {{\mathbf{{U}}^{n + 1}}} \right) :e(\mathbf{{w}})d\mathbf{{x}} + \int _\Lambda {{\sigma ^ - }} \left( {{\mathbf{{U}}^{n + 1}}} \right) :e(\mathbf{{w}})d\mathbf{{x}} \nonumber \\&- \int _\Lambda {(\alpha - 1)} {\left( {{\Phi ^{n + 1}}} \right) ^2}{P^{n + 1}}\nabla \cdot \mathbf{{w}}d\mathbf{{x}} + \int _\Lambda {{{\left( {{\Phi ^{n + 1}}} \right) }^2}\nabla {P^{n + 1}} \cdot \mathbf{{w}}d\mathbf{{x}}} \nonumber \\&- \int _\Lambda {(3{\alpha _\Theta }{K_d} + {C_\Theta })} {\left( {{\Phi ^{n + 1}}} \right) ^2}{\Theta ^{n + 1}} \nabla \cdot \mathbf{{w}}d\mathbf{{x}} \nonumber \\&- \int _\Lambda 2(\alpha - 1) {{\Phi ^{n + 1}}} {P^{n + 1}}\nabla \cdot {\mathbf{{U}}^{n + 1}} \cdot \left( {\psi - {\Phi ^{n + 1}}} \right) d\mathbf{{x}} \nonumber \\&+ \int _\Lambda 2 {\Phi ^{n + 1}}\nabla {P^{n + 1}} \cdot {\mathbf{{U}}^{n + 1}} \cdot \left( {\psi - {\Phi ^{n + 1}}} \right) d\mathbf{{x}} \nonumber \\&- \int _\Lambda 2(3{\alpha _\Theta }{K_d} + {C_\Theta }) {{\Phi ^{n + 1}}} {\Theta ^{n + 1}}\nabla \cdot {\mathbf{{U}}^{n + 1}} \cdot \left( {\psi - {\Phi ^{n + 1}}} \right) d\mathbf{{x}} \nonumber \\&+ \int _\Lambda {2{C_\Theta }} {\Phi ^{n + 1}}\nabla {\Theta ^{n + 1}} \cdot {\mathbf{{U}}^{n + 1}} \cdot \left( {\psi - {\Phi ^{n + 1}}} \right) d\mathbf{{x}} \nonumber \\&- {G_F}\int _\Lambda {\frac{1}{\varepsilon }} \left( {1 - {\Phi ^{n + 1}}} \right) \cdot \left( {\psi - {\Phi ^{n + 1}}} \right) d\mathbf{{x}} \nonumber \\&+ {G_F}\int _\Lambda \varepsilon \nabla {\Phi ^{n + 1}} \cdot \nabla \left( {\psi - {\Phi ^{n + 1}}} \right) d\mathbf{{x}} \nonumber \\&\ge 0. \end{aligned}$$
(54)

The fixed-stress iteration method (Lee et al. 2017a; Mikelić and Wheeler 2012) is utilized to couple between pressure and displacement phase-field equations. Thus, for each time \(t^{n+1}\), let \(P^n\),\(\mathbf{{U}}^n\), \(\Phi ^ n\) be given, and we compute for \(P^{l+1}\), \(\mathbf{{U}}^{l+1}\), \(\Phi ^{l+1}\) in each iteration for \(l = 0,1,2,\cdot \cdot \cdot\):

$$\begin{aligned} {[}{B_P}({P^{n + 1}})(\omega ) ]^{l+1}&= [ {B_{Fp}}({P^{n + 1}})(\omega ) ]^{l+1} +[ {B_{Rp}}({P^{n + 1}})(\omega ) ]^{l+1} = 0, \end{aligned}$$
(55)
$$\begin{aligned} A\left( {{\mathbf{{U}}^{l + 1}},{\Phi ^{l + 1}}} \right) \left( {\mathbf{{w}},\psi } \right)&= \int _\Lambda {((1 - k)} {\left( {{{\tilde{\Phi }} ^{l + 1}}} \right) ^2} + k){\sigma ^ + } \left( {{\mathbf{{U}}^{l + 1}}} \right) :e(\mathbf{{w}})d\mathbf{{x}} + \int _\Lambda {{\sigma ^ - }} \left( {{\mathbf{{U}}^{l + 1}}} \right) :e(\mathbf{{w}})d\mathbf{{x}} \nonumber \\&- \int _\Lambda {(\alpha - 1)} {\left( {{\Phi ^{l + 1}}} \right) ^2}{P^{l + 1}}\nabla \cdot \mathbf{{w}}d\mathbf{{x}} + \int _\Omega {{{\left( {{\Phi ^{l + 1}}} \right) }^2}\nabla {P^{l + 1}} \cdot \mathbf{{w}}d\mathbf{{x}}} \nonumber \\&- \int _\Lambda {(3{\alpha _\Theta }{K_d} + {C_\Theta })} {\left( {{\Phi ^{l + 1}}} \right) ^2}{\Theta ^{n + 1}} \nabla \cdot \mathbf{{w}}d\mathbf{{x}} + \int _\Lambda {{C_\Theta }{{\left( {{\Phi ^{l + 1}}} \right) }^2} \nabla {\Theta ^{n + 1}} \cdot \mathbf{{w}}d\mathbf{{x}}} \nonumber \\&+ \int _\Lambda (1 - k) {{\Phi ^{l + 1}}} {\sigma ^ + } \left( {{\mathbf{{U}}^{l + 1}}} \right) :e \left( {{\mathbf{{U}}^{l + 1}}} \right) \cdot {\psi } d\mathbf{{x}} - \int _\Lambda 2(\alpha - 1) {{\Phi ^{l + 1}}} {P^{l + 1}}\nabla \cdot {\mathbf{{U}}^{l + 1}} \cdot {\psi } d\mathbf{{x}} \nonumber \\&+ \int _\Lambda 2 {\Phi ^{l + 1}}\nabla {P^{l + 1}} \cdot {\mathbf{{U}}^{l + 1}} \cdot {\psi } d\mathbf{{x}} - \int _\Lambda 2(3{\alpha _\Theta }{K_d} + {C_\Theta }) {{\Phi ^{l + 1}}} {\Theta ^{n + 1}} \nabla \cdot {\mathbf{{U}}^{n + 1}} \cdot {\psi } d\mathbf{{x}} \nonumber \\&+ \int _\Lambda {2{C_\Theta }} {\Phi ^{l + 1}}\nabla {\Theta ^{n + 1}} \cdot {\mathbf{{U}}^{l + 1}} \cdot {\psi } d\mathbf{{x}} - {G_F}\int _\Lambda {\frac{1}{\varepsilon }} \left( {1 - {\Phi ^{n + 1}}} \right) \cdot {\psi }d\mathbf{{x}} \nonumber \\&+ {G_F}\int _\Lambda \varepsilon \nabla {\Phi ^{n + 1}} \cdot \nabla {\psi } d\mathbf{{x}} \ge 0. \end{aligned}$$
(56)

The iteration would be completed if:

$$\begin{aligned} \max \{ ||\mathbf{{U}}^{l+1} - U^{l}||, ||\Phi ^{l+1} - \Phi ^{l}||,||P^{l+1} - P^{l}||\} < TOL_{fs} \;, \; TOL_{fs}>0. \end{aligned}$$
(57)

Then we set \(\mathbf{{U}}^{n+1} = U^{l+1}\), \(\Phi ^{n+1} = \Phi ^{l+1}\), \(P^{n+1} = P^{l+1}\).

3.6 Adaptive Mesh Refinement Using a Predictor–Corrector Scheme

An important parameter in phase-field methods is the mesh size (h), which remains fixed during the simulation process. To maintain fracture resolution, it is necessary to ensure that \(\varepsilon > h\). However, using a smaller mesh size will increase the demand for computational resources and result in longer computation times. Local mesh refinement is a popular method that allows us to refine only the regions of interest. When applied to fracture propagation problems, researchers must predict and refine the potential fracture propagation areas. Unfortunately, this method performs poorly in complex reservoirs due to the randomness of fracture propagation.

In multi-physics fracture propagation problems, a small mesh size is not only essential for improving numerical accuracy but also for obtaining better results and a more accurate representation of other physical parameters. The predictor–corrector adaptivity mesh refinement, as described by Heister et al. (2015), has been developed (Fig. 2). In this paper, we extend the adaptive mesh refinement technology to refine the mesh based on thresholds of the phase-field solution and the acid concentration together as

$$\begin{aligned} \phi (x) < T{H_\phi } \; \text { or } \; c(x) > T{H_c}. \end{aligned}$$
(58)

Here, \(T{H_\phi }\) and \(T{H_c}\) are the thresholds of the phase-field solution and the acid concentration. The algorithm is as follows:

figure a

Despite solving the system several times, the effectiveness of this method has been proven (Heister et al. 2015).

Fig. 2
figure 2

Predictor–corrector adaptive mesh refinement: a the big mesh is used for initial refinement globally. b When there is a tendency to fracture at any point, return to the previous time step and refine the mesh in the possible fracture area, and re-solve the solution variables. c Recalculate the solution for this time step on the fine grid; d Repeat the above steps until the fracture path positions are all the minimum size mesh

Acid fracture propagation is a dynamic and heterogeneous process. We have extended the adaptive mesh refinement method by incorporating thresholds. The effectiveness of this approach is demonstrated in Fig. 3 and Sect. 4.1.

Fig. 3
figure 3

Extended adaptive mesh refinement in Case #1. In time 0.01s, the acid fluid was injected a little and the mesh was refined around the initial fracture. In time 0.1s, the acid fluid fills the fracture and leaks into the reservoir. The mesh would be refined based on the acid region at that time

3.7 Final Algorithm for the Coupled THMC Phase-Field System

In our proposed THMC phase-field model developed in the previous sections, several partial differential equations and a variational inequality are coupled and need to be solved. Partitioned schemes and monolithic schemes are two basic approaches for solving this system. In the partitioned scheme, the equations are often solved separately, while in the monolithic coupling, the coupled equation system is solved as a whole. The governing equations in this paper are based on continuum mechanics and involve four physical fields and several physical quantities.

Our main algorithm is inspired from Wheeler et al. (2020), but adapted to our current system and the couplings with the relationship between the various physical quantities outlined in Fig. 4. We notice that not all equations couple, which is due to our assumptions made in Sect. 2, on the other hand, we are not aware even of a simplified (not all couplings are taken into account) THMC phase-field system published so far in the literature. A rigorous numerical and computational analysis of Algorithm 2 remains ongoing research.

Fig. 4
figure 4

Solving schemes for coupled system in timestep \({t^{n + 1}}\)

The acid–rock reaction term affects the pressure equation, displacements-phase-field equation, and acid equation. Due to the continuity of the variables, this term is fixed with the solution variables at timestep \({t^n}\). We define \(Res(\cdot )\) as the residual of each PDE system, where \(\mathrm {TOL_{s}}\) represents the solver tolerance, with \(\mathrm {TOL_s > 0}\).

figure b

4 Numerical Experiments

In this section, we conducted some numerical experiments to demonstrate the capabilities of our model. All experiments were computed with a version of IPACS (Wheeler et al. 2020), which uses modulus of the open-source pfm-cracks code (Heister and Wick 2020) and the open-source finite element package deal.II (Arndt et al. 2017).

Domain and initial fracture For all numerical tests, the global domain was \(\Lambda = {(0,4\,m)^2}\) and the injection point was \((2\,m,2\,m)\). The initial fracture was set at the center, which is shown in Fig. 5.

Fig. 5
figure 5

Initial fracture setting in two-dimensional porous media. At that time, the acid fluid was not injected and the mesh was refined only based on the phase field

Material parameters The material parameters are shown in Table 1, which were used for all numerical tests.

Table 1 Table to material parameters

Source terms From a physical perspective, the heat and acid would be injected with fluid during acid fracturing. The source terms of the chemical equation were described in Sect. 4.2. The source terms of the pressure equations were defined by Peaceman’s model: (Lee et al. 2016c; Peaceman 1978, 1983):

$$\begin{aligned} {q_{Ff}} = c_{Fp} ({p_b} - p) \times H_p(x)\;, \; {q_{Rf}} = c_{Rp}({p_b} - p) \times H_p(x) \;, \; H_p(x) = \left\{ {\begin{array}{*{20}{c}} {1\mathrm{{ }}\; \text { if }\;\mathrm{{\Vert x - X\Vert }}< r}\\ {\mathrm{{ 0 \;\;otherwise }}} \end{array}} \right. . \end{aligned}$$
(59)

The source terms of the temperature equations were defined as:

$$\begin{aligned} q_{F\Theta } =c_{F\Theta } {q_{Ff}}\;, \; q_{R\Theta } = c_{R\Theta }{q_{Rf}}. \end{aligned}$$
(60)

Here, \(p_b\) was the given wellbore pressure. \(c_{Fp} > 0\) and \(c_{Rp} > 0\) were the pressure injection constants. \(c_{F\Theta } \in \mathbb {R}\) and \(c_{R\Theta } \in \mathbb {R}\) were the temperature injection constants. r was small positive constant, X was the injection point in the domain.

Test cases Based on the given material parameters, we propose the following numerical tests to study the acid fracture behavior:

  • Case #1: Acid fracture propagation in an elastic medium with single acid injection;

  • Case #2: Artificial fracture propagation without acid effects;

  • Case #3: Artificial fracture propagation without thermal and acid effects;

  • Case #4: Acid fracture propagation with autogenic acid injection;

  • Case #5: Acid fracture propagation affected by the natural hole. The coordinate of the hole center is (2.1m, 2.5m) and the radius is 0.01m;

  • Case #6: Acid fracture propagation affected by the natural hole. The coordinate of the hole center is (2.15m, 2.5m) and the radius is 0.01m;

  • Case #7: Acid fracture propagation affected by the natural hole. The coordinate of the hole center is (2.25m, 2.5m) and the radius is 0.01m;

  • Case #8: Acid fracture propagation affected by the natural hole. The coordinate of the hole center is (2.5m, 2.5m) and the radius is 0.01m;

  • Case #9: Acid fracture propagation affected by the natural hole. The coordinate of the hole center is (2.25m, 2.5m) and the radius is 0.02m;

  • Case #10: Acid fracture propagation affected by the natural hole. The coordinate of the hole center is (2.25m, 2.5m) and the radius is 0.04m;

  • Case #11: Acid fracture propagation affected by natural fracture. The angle of the natural fracture is \({90^ \circ }\);

  • Case #12: Acid fracture propagation affected by natural fracture. The angle of the natural fracture is \({45^ \circ }\);

  • Case #13: Acid fracture propagation affected by natural fracture. The angle of the natural fracture is \({20^ \circ }\);

  • Case #14: Acid fracture propagation in complex reservoirs.

Quantities of interest (QoI) In our numerical tests, we compared graphical solutions and studied the following quantities of interests:

  1. 1.

    Fracture volume (FV) (It is fracture area in 2D system)

    $$\begin{aligned} F_V =\int _\Lambda \mathbf{{u}} \nabla \phi d\mathbf{{x}}. \end{aligned}$$
    (61)
  2. 2.

    Crack opening displacements (COD) on the line \(y = y_c\)

    $$\begin{aligned} COD =\int _0^{4} \mathbf{{u}} (x,y_c) \nabla \phi (x,y_c) d\mathbf{{x}}. \end{aligned}$$
    (62)
  3. 3.

    Acid consumption(AC)

    $$\begin{aligned} A_c = 2\int _\Lambda {K_{ar}}(p,\Theta ) \varphi _R^* c^2(x) d\mathbf{{x}}. \end{aligned}$$
    (63)

4.1 Model Verification with Sneddon Fracture

In Case #1, Case #2 and Case #3, we considered the standard Sneddon setting (Sneddon and Lowengrub 1969; Bueckner 1971) in an elastic medium to verify the model, which is nowadays considered as a benchmark (Wheeler et al. 2014; Bourdin et al. 2012; Schröder et al. 2021; Chukwudozie et al. 2019). The fluid pressure, temperature and acid etching were studied during the fracture propagation. The simulation result of Case#1 is shown in Fig. 6.

Fig. 6
figure 6

Acid fracture propagation in Case #1 at time 0.15s. The acid fracture began in the homogeneous media and the Young’s modulus decreased with the acid etching

The numerical tests were computed in a quasi-stationary manner. We chose different adaptive mesh refinements to study their impact on the QoIs in Case #1. The initial meshes were both five times uniformly refined, and local mesh adaptivity was applied for five further levels. The refined threshold for refinement scheme A was set as \(\phi (x) < TH_{\phi }\). The refined thresholds for refinement scheme B were set as \(\phi (x) < TH_{\phi } \; or \; c(x) > TH_c\). The results are shown in  Fig. 7.

Fig. 7
figure 7

The effect of different refinement schemes on QoIs: a, Fracture volume; b, Crack opening displacements(\(y_c = 2.5m\)); c, Acid consumption. The timestep size was 0.01s. The mesh was 5 times uniformly refined and 4 times locally

As shown in Fig. 7, the calculation results of QoIs exhibit variations depending on the refinement scheme. Higher-level refined meshes would contribute to more accurate and smoother results. When the mesh was refined based on the phase-field variables in Scheme A, the calculation results of fracture volume and COD were close to those in Scheme B. However, there is a disparity in the results for the acid consumption between Scheme A and Scheme B. Here, Scheme B, which takes the acid solution into consideration, leads to a smoother result. This difference can be attributed to the fact that the acid consumption is closely related to acid etching, as described in Eq. (63). For improved simulation results in the acid fracture problem, it is necessary to refine the mesh based on both the fracture area and the acid-etched area.

Next, the extended adaptive mesh refinement (outlined in Sect. 3.6) was employed to verify computationally the convergence. The results are shown in Fig. 8. The global refinements were fixed at level 5 and local refinements were employed to study the change of fracture volume for different mesh sizes. The qualitative numerical stability of this model is thus demonstrated since the fracture volume curve variation becomes smaller on finer meshes.

Fig. 8
figure 8

Acid fracture propagation in Case #1 with different mesh size. The extended adaptive mesh refinement was used and the global refinements were fixed as 5 times. The fracture volume curve variation becomes smaller on finer meshes

Then, the extended adaptive mesh refinement (again Sect. 3.6) was also applied to the following Cases. The fracture volume and COD results of Case#1, Case#2 and Case #3 are shown in Fig. 9. It can be observed that both the acid and thermal effects lead to an increase in fracture volume and COD during acid fracture propagation. The initiation time of fracture in the same \(y_c\) would decrease with the effect of thermal stress and acid etching. The thermal stress would appear as tensile stress and play an auxiliary role in fracture propagation. The acid etching would decrease the strength of the rock and increase the fracture volume and COD. Similar findings about the acid and thermal effects have been carried out by Khoei et al. (2012); Fan et al. (2019).

Fig. 9
figure 9

The fracture volume and COD results of Case#1, Case#2 and Case #3.The timestep size was 0.01s: a,Fracture volume; b,Crack opening displacements(\(y_c = 2.5m\))

4.2 Settings for Single Acid Injection and Autogenic Acid Injection

During acid fracturing, acid would be injected into the reservoirs in various methods (Du et al. 2022; Malagon et al. 2008; Aljawad et al. 2020). The single acid injection is a simple and low-cost method. The acid fluid would be injected into the reservoirs directly through the wellbore, which may result in limited fracture coverage and may damage the wellbore. The autogenic acid fluid system is another popular acid system (Wang et al. 2020; Lei et al. 2021). Unlike conventional acid fluids, which are prepared by mixing strong acids with water and other additives, the autogenic acid fluid system would produce the acid by chemical reactions in reservoirs. It would cause less damage to the wellbore and reduce the risk to workers. Different injection methods require specific settings on the injection term in the chemical equation. Here, we proposed two settings for \(q_{Fc}\) and \(q_{Rc}\) to describe the single acid injection and autogenic acid injection. For single acid injection, we have:

$$\begin{aligned} {q_{Fc}} = c_{Fc}c_{Fp} ({p_b} - p) \times H_c(x) \;, \;{q_{Rc}} = c_{Rc}c_{Fp} ({p_b} - p) \times H_c(x) \;, \; H_c(x) = \left\{ {\begin{array}{*{20}{c}} {1\mathrm{{ }}\;\text { if }\;\mathrm{{\Vert x - X\Vert }}< r}\\ {\mathrm{{ 0 \;\;otherwise }}} \end{array}} \right. . \end{aligned}$$
(64)

Here, \(c_{Fc}\) and \(c_{Rc}\) were the chemical injection constants, r was a small positive constant, X was the injection point in the domain. Finally, \({p_b}\), \(c_{Fp}\) and \(c_{Rp}\) were defined in Eq. (59).

For the autogenic acid injection in Case #4, the source term was defined as:

$$\begin{aligned} {q_{Fc}} = c_{Fc} {C_{Fs}}(p,\Theta ) \times H_c(x)\;, \; {q_{Rc}} = c_{Rc} {C_{Rs}}(p,\Theta ) \times H_c(x) \;, \; H_c(x) = \left\{ {\begin{array}{*{20}{c}} {1\mathrm{{ }}\; \text { if }\;p(x)> {p_r} \cap \Theta (x) > {\Theta _r}}\\ {\mathrm{{ 0 \;\; otherwise }}} \end{array}} \right. \end{aligned}$$
(65)

Here, \({C_{Fs}}(p,\Theta )\) and \({C_{Fs}}(p,\Theta )\) were the acid production functionals, and \({p_r}\) and \({\Theta _r}\) were the threshold values for the autogenic acid production. The acid fracture shapes under different injection methods are shown in Fig. 10.

Fig. 10
figure 10

Acid fracture propagation under different acid injection methods at time 0.4s: a. single acid injection b. autogenic acid injection. Compared with the single acid injection, the acid concentration under autogenic acid injection was more uniform

It was observed that different injection methods would lead to different etching results. The autogenic acid injection methods would etch the formation uniformly, which is good for further development. The simulation results show agreement with practical field experiences (Liu et al. 2014; Hou et al. 2019).

4.3 Effect of the Natural Holes on Acid Fracture Propagation

Natural structures would affect the propagation of artificial fractures (Dai et al. 2021; Gou et al. 2021). In this section, we simplified the natural holes into circles and studied the effect of natural holes on acid fracture propagation.

Fig. 11
figure 11

Effect of the natural holes on the acid fracture propagation at time \(0.4\,s\). The attraction effect of natural holes to acid fractures would decrease with the distance and increase with the size of natural holes. When the distance was 0.1 m (Case #5) and 0.15 m (Case #6), the acid fractures would penetrate the natural hole. When the distance was 0.25 m (Case #7), the acid fracture would turn its propagation direction. When the distance was 0.5m (Case #8), the natural hole had nearly no influence on the acid fracture propagation. When the distances were the same, the attraction effect of natural holes to acid fractures would increase with the size of the natural holes. The acid fracture would turn its propagation (Case #9) and penetrate the natural hole (Case #10) with the hole size increasing

As we observed in Fig. 11, the effect of the single natural hole on acid fracture would change with the distance and hole size. The acid fracture would turn its propagation direction to the hole. If the distance was sufficiently close and the hole size was big enough, acid fracture would penetrate the natural hole. If the distance was not close or the hole size was not big enough, the acid propagation path would only be close to the hole location. If the distance was far away, the natural holes would have no influence on acid fracture propagation. Similar studies about natural holes with analogous findings have been carried out by Bing et al. (2022); Jiawei et al. (2020).

4.4 Effect of the Natural Fractures on Acid Fracture Propagation

Natural fractures often exist in carbonate reservoirs, which may affect the propagation of artificial fractures (Gou et al. 2021). In Case #11, Case #12 and Case #13, we studied the interaction between acid fracture and natural fractures to validate our model. In this simulation, we simplified the natural fractures into straight slits.

Fig. 12
figure 12

Effect of the natural fractures on the acid fracture propagation at time 0.4s. The acid fractures would grow into the natural fracture and re-crack at the end of the natural fracture. When the angle between the natural fracture and acid fracture was \({90^ \circ }\), the fracture would re-crack at both sides uniformly. With the angle decreasing, the propagation speed and re-crack direction would be different at both sides

As we observed in Fig. 12. The effect of the single natural fracture would be affected by the angle between acid fracture and natural fracture. When the acid fracture intersected the natural fracture, it would go into the natural fracture and re-initiate at the end of the natural fracture. The re-initiation direction would be determined by the angle of the natural fracture. Similar studies about natural fractures with analogous findings have been carried out by Li et al. (2018); Jiawei et al. (2020).

Fig. 13
figure 13

Acid fracture propagation in complex reservoirs. Fracture propagation was influenced by multiple factors and presented strong randomness

In addition to the single natural fracture and the hole, we also conducted numerical experiments with multiple fractures and holes, which are easy to find in complex carbonate reservoirs. The simulation result is shown in Fig. 13. The randomness of acid fracture propagation was stronger in complex formations. Due to the limitations of rock samples in physical experiments, it is necessary to develop numerical models to study acid fracture propagation in complex formations.

5 Guidance for the Validation Experiment Based on the Phase-Field Idea

Researchers have observed that natural fractures and holes affect artificial fracture propagation (Lee and Wheeler 2021), which has been proved by many physical experiments (Hou et al. 2021; Dai et al. 2021). From an engineering point of view, accuracy and correctness are paramount in numerical simulations within complex geological formations (Weng 2015; Ju et al. 2019). Unfortunately, analytical solutions of acid fracture in fracture-hole formation are hard to get. Based on the phase-field method, we can design new visual experimental equipment for 2D fracture propagation (Fig. 14) and propose a quantitative method for assessing the accuracy and correctness of numerical simulations.

Fig. 14
figure 14

Visual experimental equipment for fracture propagation in two-dimensional rock plate. The boundary conditions would be controlled by the computer and the pumps. The rock plate size is \(100mm \times 100mm\)

First, we would prepare a rock plate with natural fractures and holes, as shown in Fig. 14. The plate can be obtained from an outcrop or artificial rock source. Next, we would load the rock plate into the visual experimental equipment. By injecting fluid into the center of the plate, we can observe and record the propagation of fractures. Afterward, we need to perform numerical simulations based on the characteristics of the rock plate. Since the numerical simulation and physical simulation have the same size and characteristics, we can define a difference function based on the concept of the phase-field method. The mesh from the numerical simulation can be extracted and mapped to the results of the physical simulation (Fig. 15).

Fig. 15
figure 15

The phase-field value on rock plate from the physical experiment. Random natural holes in the rock will affect the propagation of the artificial fracture. By using image technology, the phase-field value on the rock plate can be gotten and used to evaluate the accuracy of numerical simulation quantitatively

We use \({\phi _p} = 0\) to represent the fracture and \({\phi _p} = 1\) to represent the non-fractured rock, and \({\phi _n}\) is the numerical simulation result at the corresponding node (\({n_m}\) is the number of nodes). The local difference function and global difference function can be defined as:

$$\begin{aligned} {D_{\text {local}}} = |{\phi _p} - {\phi _n}| \ \ \text { and } \ \ {D_{\text { global }}} = \frac{1}{n_m}\sum \limits _0^{{n_m}} {D{\hspace{1.0pt}}_{\text {local}}}. \end{aligned}$$
(66)

If the difference function is large, it indicates that there is a significant disparity between numerical simulations and physical simulations, resulting in lower accuracy of the numerical model. The difference function’s outcome is evidently influenced by the resolution. There are some conflicts related to adaptive mesh refinement. Additionally, improvements are needed for the acid-proofing of the visual experimental equipment. Even though the accuracy evaluation method is in need of improvement, the comparison method using the difference function establishes a connection between physical experiments and numerical simulations. We believe it can assist petroleum engineers in quantitatively assessing numerical models.

6 Conclusion

In this paper, we modeled acid fracture employing a phase-field approach. Therein, we considered the influences of temperature, pressure, and acid etching, resulting into a THMC (Thermo-Hydro-Mechanical-Chemical) model. Numerically, we used a quasi-monolithic scheme to solve displacements and phase-field variables, while partitioned schemes were employed to solve temperature, pressure, and acid concentration. This coupling scheme performed effective in presented numerical simulations. We extended the adaptive mesh refinement technique to consider the acid etching effects in the fracture area. This enhancement provides high resolution in the area of interest while keeping computational costs reasonably low. In addition to these advancements in the solution algorithm, we conducted several numerical experiments for verifications and validations. We demonstrated the computational capabilities for the presented phase-field approach for studying acid fracture propagation, including different types of acid injection and complex geological reservoir domains. The computational stability of the proposed model was also investigated through these numerical experiments. The main concluding remarks are summarized as follows:

1. The acid fracture propagation is affected by several factors. The acid and thermal effect would increase the fracture volume and fracture width. The natural fracture and holes would affect the fracture propagation direction. The randomness of acid fracture propagation is strong in complex formations. This study shows once more that it remains necessary to develop numerical models continuously to compensate for the shortage of physical experiments.

2. The temperature equations and the coupling terms were implemented into the model. The acid equations including diffusion, transport and reaction are derived based on the penalization method. The overall algorithm is of iterative coupling type. The proposed model performs well in complex engineering conditions. The numerical stability of this model was demonstrated by several simulations.

3. Acid fracture is a dynamic heterogeneous problem. Independently, whether the fracture grows in homogeneous media or heterogeneous media, the rock parameter would change with the acid etching. Thus, the acid area and fracture area are both important regions that need small mesh sizes during numerical simulations. For the dynamic heterogeneous problem, the extended adaptive mesh refinement can be used to get higher accuracy and saving in the computational costs.