## 2 Materials and Methods
### Multiscale Compositional Model  
#### 2.2.1 Basis Model  
Based on the compositional model, the following assumptions are made:  
1. The reservoir consists of three phases: oil (denoted by subscript l), gas (subscript v), and water (subscript w). 2. The component model considers these three flowing phases. The water phase contains only the water component and does not achieve phase equilibrium with the other phases, whereas phase equilibrium is established among m components in the oil and gas phases. 3. Fluid flow follows Darcy's law. 4. The reservoir is isothermal. 5. Phase equilibrium is achieved instantaneously. Under these assumptions, the compositional control equations are formulated, beginning with the continuity equations for components in the oil and gas phases [52]. \[\frac{\partial}{\partial t}[\phi(\rho_{l}S_{l}X_{i}+\rho_{v}S_{v}Y_{i})]+ \
abla\cdot(\rho_{l}X_{i}\overrightarrow{v}_{l}+\rho_{v}Y_{i}\overrightarrow {v}_{v})-q_{i}=0 \tag{11}\]  
where \(\phi\) represents porosity, \(\rho_{\text{A}}\) and \(S_{\text{A}}\) denote the density and saturation of phase \(\alpha\), respectively, \(l/v\) corresponds to the oil and gas phases, in accordance with phase equilibrium calculation theory. The continuity equation for the water component is formulated as follows:  
\[\frac{\partial}{\partial t}(\phi\rho_{w}S_{w})+\
abla\cdot(\rho_{w} \overrightarrow{v}_{w})-q_{w}=0 \tag{12}\]Phase velocities are determined according to multiphase Darcy's law. \[v_{\alpha}=-\mathbf{K}\lambda_{\alpha}(\
abla p_{\alpha}-\rho_{\alpha}g\Delta z),\;\lambda_{\alpha}=\frac{kr_{\alpha}}{\mu_{\alpha}} \tag{13}\]  
where K denotes the absolute positive-definite permeability tensor, while \(kr_{\alpha}\), \(\mu_{\alpha}\), \(\lambda_{\alpha}\) represent the relative permeability, viscosity, and mobility of phase \(\alpha\), respectively. For each component, the source and sink terms in the continuity equation, along with the well control equations, follow the standard Peaceman model [53]. Additionally, the compositional model accounts for component transfer between the oil and gas phases, incorporating phase equilibrium equations to ensure accurate phase behavior representation  
\[f_{l}^{i}-f_{v}^{i}=0 \tag{14}\]  
In addition, the constraints must also be considered:  
\[S_{w}+S_{v}+S_{l}=1,\;S_{\alpha}\in[0,1]\forall\alpha \tag{15}\]  
\[\sum_{i=1}^{m}x_{i}=1,\;\sum_{i=1}^{m}y_{i}=1,\;x_{i},y_{i}\in[0,1]\forall i\in \{1,\dots,m\} \tag{16}\]  
By combining Equations (11) to (16), the governing equations are reformulated into residual forms. The Newton-Raphson iteration method is then applied to solve these equations efficiently. \[-J_{\epsilon}\Delta\epsilon=r_{\epsilon},\;J_{\epsilon}=\frac{\partial r_{ \epsilon}}{\partial\epsilon},\;r_{\epsilon}= \begin{bmatrix}R_{\epsilon}\\ W_{\epsilon}\\ F_{\epsilon}\\ C_{\epsilon}\end{bmatrix}  \tag{17}\]  
where \(J_{\epsilon}\) represents the Jacobian matrix of the system, and \(r_{\epsilon}\) denotes the residual term, consisting of the residuals from the continuity equations (\(R_{\epsilon}\)), the well control equations (\(W_{\epsilon}\))--with \(W_{\epsilon}\) constructed based on the Peaceman model [53], fugacity equations (\(F_{\epsilon}\)), and constraints (\(C_{\epsilon}\)), as defined in Equations (15) and (16). While the above equations can be solved directly in compositional numerical simulation, the computational efficiency remains low. To enhance efficiency, the Schur complement reduction method [54] is employed to decrease the degrees of freedom of the matrix. By partitioning the variables (\(\epsilon\)) into primary variables (\(u\)) and eliminable variables (\(v\)), and reordering the Jacobian matrix accordingly, the system can be expressed as:  
\[ \begin{bmatrix}\frac{\partial U}{\partial u}&\frac{\partial U}{\partial v}\\ \frac{\partial V}{\partial u}&\frac{\partial V}{\partial v}\\ \end{bmatrix}\begin{bmatrix}\Delta u\\ \Delta v\end{bmatrix} = \begin{bmatrix}r_{u}\\ r_{v}\end{bmatrix}