## 2 Materials and Methods
### Simulation of Two-Phase Fluid Flow  
The basic principle of operation of the X-ray \(\mathrm{\SIUnitSymbolMicro}\)CT method is to obtain a sequence of 2D X-ray images of an object. After this, this set of images is processed with Avizo software \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Sample**} & \multirow{2}{*}{**HCl Concentration, \%**} & \multirow{2}{*}{**Injection Rate, mL/min**} & \multicolumn{2}{c}{**Permeability, D**} \\ \cline{3-4}  & & & **Before** & **After** \\ \hline A & 12 & 8 & 0.72 & 3.90 \\ \hline B & 18 & 2 & 0.29 & 0.99 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Flow conditions of HCl solutions and measured absolute permeability. Figure 2: Schematic of the experimental procedure. 2019.1 [29] in order to create a 3D volumetric image of the object. In this technique, the key unit that determines the resolution of a 3D model of an object is the voxel. Voxels are similar to pixels, but they operate in 3D space, allowing you to accurately determine the structure of an object. The result of 3D image reconstruction is a 3D array of voxels organized according to XYZ coordinate axes. This array is a 3D representation of the internal structure of the object, and it is used for further visualization and analysis. Before the construction of 3D pore space, the \(\upmu\)CT images went through several stages of image processing, which are illustrated in Figure 3. Image processing includes cropping, noise removal, and segmentation. The cropping was performed to remove unwanted edge noise. Filtering of the image was carried out to remove noise and artifacts directly within the sample. In this study, the median filter was used for noise removal. After filtering, segmentation of the pore space was performed. All operations were carried out using Avizo software. After the image processing procedure, 3D models of both cylindrical samples were built using volume rendering (Figure 4a,b). Figure 4: Pore space of (**a**) sample A and (**b**) sample B. (**c**) Schematic illustration of the sub-volume extraction. Figure 3: Stages of processing of the \(\upmu\)CT images. The dark blue color represents the pore space. It should be noted that the transparency of the images corresponding to the dissolved state of the samples was increased to visualize the wormholes formed due to dissolution. Also, it is important to note that the injection of acid solutions into the samples was carried out from bottom to top. As can be seen from Figure 4, as a result of rock dissolution, a dominant wormhole was formed in sample A when injecting a 12% HCl solution at a rate of 8 mL/min, whereas in sample B, a conical wormhole formed due to the comparatively low injection rate (2 mL/min), even though a more concentrated solution was used. For both samples, the injection of acid solutions led to a significant increase in their absolute permeability (see Table 2). The initial data for the studies were cubic sub-volumes about 8 mm in size, extracted from the 3D model of each sample before and after rock dissolution (Figure 4c). The representative elementary volume (REV) selection is presented in Figure 5. As can be seen from the figure, the porosity becomes constant for a sub-volume with a volume higher than 150 mm\({}^{3}\). The volume of extracted sub-volumes is \(-8^{3}\) mm\({}^{3}\), which is larger than the REV (\(-6^{3}\) mm\({}^{3}\)). In total, 10 sub-volumes were extracted from each sample, 5 before dissolution, 5 after dissolution. It should be noted that the extracted sub-volumes from the models of the same sample, corresponding to its undissolved and dissolved states, were extracted from the same location to achieve their identity. In total, 20 sub-volumes were extracted from both samples. The extraction of these sub-volumes from the samples was carried out using Avizo software. The pore space of the sub-volumes extracted from samples A and B before and after their dissolution is shown in Figure 6, where the gray color corresponds to the pore space, and white corresponds to the solid phase.