## 2 Materials and Methods
### Multiscale Compositional Model
#### 2.2.3 Improved Multiscale Formulation  
The multiscale formulation primarily targets the pressure Equation (23) and is written in the following form:  
\[\hat{J}_{p}\Delta p=\hat{r}_{p} \tag{27}\]  
Since Equation (27) exhibits significant coefficient variations and strong coupling between adjacent cells, direct solution is inefficient. Instead, a multiscale expansion is employed to approximate pressure, enabling efficient computation on a coarser grid.  
Following the algebraic multigrid approach, prolongation operator \(P\) and restriction operator \(R\) are defined to relate the fine-scale and coarse-scale pressure increments [44]. Fine-scale information is mapped to the coarse scale using a restriction operator. Solving on the coarse scale reduces the number of iterations due to low-frequency errors on the fine scale. The coarse-scale pressure increment is then mapped back to the fine-scale using a prolongation operator, approximating the fine-scale exact pressure increment:  
\[\Delta p\approx\Delta p_{f}=P\Delta p_{c} \tag{28}\]  
Using Equations (28) and (27), the solution of the fine-scale pressure increment is reformulated as solving the coarse-scale pressure increment, enhancing computational efficiency.  
\[(R\hat{J}_{p}P)\Delta p_{c}=\hat{J}_{c}\Delta p_{c}=R\hat{r}_{p}=\hat{r}_{c} \tag{29}\]  
The construction of the operator format is key to achieving a multiscale solution. The restriction operator maps physical quantities from the fine-scale grid to the coarse-scale grid, with a common approach being the control volume restriction operator.  
\[(R_{cv})_{ji}=\begin{cases}1,&\text{if }x_{i}\in\Omega_{j}^{b}\\ 0,&\text{otherwise}\end{cases} \tag{30}\]  
[PERSON] and [PERSON] et al. [44; 45] employed this restriction operator in the multiscale finite volume method, demonstrating its ability to ensure mass conservation. [PERSON] et al. [56] further proposed a Galerkin restriction operator to improve convergence rates. [PERSON] et al. have combined these approaches, applying the Galerkin restriction operator in the early stages for faster convergence and the control volume restriction operator later to maintain mass conservation [56]. This hybrid strategy is also applicable to the multiscale solution method proposed in this study. [PERSON] and [PERSON] et al. conducted numerical experiments on various restriction operators in multiscale formulations using different test models. Their findings indicate that in the original multiscale formulation, the choice of restriction operator influences the convergence of the multiscale method. However, when an iterative scheme is used to construct the prolongation operator, both types of restriction operators demonstrate identical convergence performance [57]. Therefore, this study adopts the control volume restriction operator.  
The prolongation operator extends physical quantities from the coarse-scale grid to the fine-scale grid. A standard approach for constructing the multiscale prolongation operator \(P\) involves solving a series of local flow problems numerically. Unlike the classical MSFV method, this study follows [PERSON] and [PERSON] [44; 46] by constructing \(P\) using an iterative scheme, eliminating the need for complex boundary conditions when setting up flow problems. This approach addresses the challenge of constructing high-quality basis functions on unstructured grids. The iterative format is as follows:  
\[P^{n+1}=P^{n}-\mathcal{M}(\omega\mathbf{D}_{\mathrm{s}}{}^{-1}JP^{n}) \tag{31}\]  
In Equation (31) \(\mathbf{D}_{s}\) represents the constructed smoother, a diagonal matrix composed of the diagonal elements of the matrix \(\int_{p}\). The smoother is used to compute increments and progressively refine them. \(\mathcal{M}\) serves as a restrictor, confining the smoothing of basis functions to a support region centered on the coarse-scale grid. The boundary of this region is defined by the eight surrounding grid center points, ensuring the accuracy of the prolongation operator.