## 2 Mathematical Models
### Three-Phase Relative Permeability Hysteresis Model
If the pore volume injected during different cycles is not constant, the average can be calculated and used in the simulation (if necessary):  
\[\Big{[}K_{rg}^{drain}\Big{]}_{n}=\bigg{\{}\Big{[}K_{rg}^{2 Ph}\big{(}S_{g} \big{)}-K_{rg}^{2 Ph}\Big{(}S_{g}^{init}\Big{)}\Big{]}\cdot\bigg{(}\frac{S_{w_{ j}}}{S_{w}^{init}}\bigg{)}^{a}\bigg{\}}_{n}+\Big{[}K_{rg}^{imb}\Big{(}S_{g}^{ init}\Big{)}\Big{]}_{n-1} \tag{82}\]8  
\[\Big{[}K_{rg}^{drain}\Big{]}_{n}=\bigg{\{}\Big{[}K_{rg}^{2 Ph}\big{(}S_{g} \big{)}-K_{rg}^{2 Ph}\Big{(}S_{g}^{init}\Big{)}\Big{]}\cdot\bigg{(}\frac{S_{w_{ j}}}{S_{w}^{init}}\bigg{)}^{a}\bigg{\}}_{n}+\Big{[}K_{rg}^{imb}\Big{(}S_{g}^{ init}\Big{)}\Big{]}_{n-1} \tag{82}\]9  
Here, \(S_{wf}\) is the water saturation, and \(S_{gf}\) is the gas saturation. The simulation results indicate that this new approach can capture the gradual variation of the captured gas saturation, even if it is not based on the calculation of the captured gas saturation. As mentioned earlier, there are limitations to estimating the relative permeability of water and gas using existing WAG hysteresis models. Therefore, it is suggested to use two empirical equations to predict the changes in water and gas relative permeability. For the imbibition cycle, the change in water relative permeability is calculated as follows (assuming the obtained curves are reversible in the extraction cycle):  
\[\Big{[}K_{rg}^{imb}\big{(}S_{g}\big{)}\Big{]}_{n}=\Big{[}K_{rg}^{imb}\Big{(}S _{gf}^{trans}\Big{)}\Big{]}_{n-1} \tag{83}\]0  
\[\Big{[}K_{rg}^{imb}\big{(}S_{g}\big{)}\Big{]}_{n}=\Big{[}K_{rg}^{imb}\Big{(}S _{gf}^{trans}\Big{)}\Big{]}_{n-1} \tag{83}\]1  
Here, \(k_{rw}^{n}\) is the water-phase relative permeability in the \(n\)-th cycle, \(\beta_{w}\) is the scaling factor for adjusting the water-phase relative permeability, and \(\Delta P\) is the pressure difference. During the WAG experiment, it is assumed that the gas relative permeability will decrease as follows. For the drainage cycle, it is recommended to use a reduction factor for gas \(k_{r}\) data to estimate the reduction in gas relative permeability:  
\[\Big{[}K_{rg}^{imb}\big{(}S_{g}\big{)}\Big{]}_{n}=\Big{[}K_{rg}^{imb}\Big{(}S _{gf}^{trans}\Big{)}\Big{]}_{n-1} \tag{83}\]2  
\[\Big{[}K_{rg}^{imb}\big{(}S_{g}\big{)}\Big{]}_{n}=\Big{[}K_{rg}^{imb}\Big{(}S _{gf}^{trans}\Big{)}\Big{]}_{n-1} \tag{83}\]3  
Use another equation to calculate the gas relative permeability during the imbibition cycle:  
\[\Big{[}K_{rg}^{imb}\big{(}S_{g}\big{)}\Big{]}_{n}=\Big{[}K_{rg}^{imb}\Big{(}S _{gf}^{trans}\Big{)}\Big{]}_{n-1} \tag{83}\]4  
Before proceeding with the next simulation step, update the calculated final saturations at the end of each cycle. Assume that the relative permeability of gas and water depends only on their saturation levels. 1. Sigmoid Model [45]
2. [PERSON] et al. developed a three-phase oil relative permeability prediction model based on the sigmoid function. This model incorporates the key effects of pore-scale phase distribution into the proposed effective Kro empirical model. It can reflect the reactivation of oil and gas due to gas injection in water-wet media, the smooth transition to a drainage system with low oil saturation formations, and the subsequent reduction of residual oil saturation in the three-phase system. According to the [PERSON]'s [25] model saturation weighted interpolation method, \(k_{ro}\) is:  
\[\Big{[}K_{rg}^{imb}\big{(}S_{g}\big{)}\Big{]}_{n}=\Big{[}K_{rg}^{imb}\Big{(}S _{gf}^{trans}\Big{)}\Big{]}_{n-1} \tag{83}\]5  
Here, \(\overline{k}_{row}^{S}\) and \(\overline{k}_{rog}\), respectively, are water and gas saturations for three-phase flow conditions; \(\overline{S}_{wc}\) and \(\overline{k}_{rog}\), respectively, are connate water saturation and oil relative permeability in an oil-gas environment; and \(\overline{S}_{gt}\) is the trapped gas saturation.