## 2 Mathematical Models
### Three-Phase Relative Permeability Hysteresis Model
Displacement of gas phase relative permeability:  
\[\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}\]  
where \(K_{rg}^{drain}\) is the gas phase relative permeability during drainage; \(K_{rg}^{2 Ph}\) is the two-phase gas phase relative permeability; \(S_{g}\) is the gas saturation; \(S_{g}^{init}\) is the gas saturation after water injection or before gas injection; \(S_{w_{j}}\) is the irreducible water saturation; \(S_{w}^{init}\) is the water saturation after water injection or before gas injection; \(a\) is the coefficient for reduction in gas phase relative permeability; and \(K_{rg}^{imb}\) is the gas phase relative permeability during imbibition. Gas-phase relative permeability during imbibition:  
\[\Big{[}K_{rg}^{imb}\big{(}S_{g}\big{)}\Big{]}_{n}=\Big{[}K_{rg}^{imb}\Big{(}S _{gf}^{trans}\Big{)}\Big{]}_{n-1} \tag{83}\]  
where  
\[\bigg{\{}S_{gf}=\frac{1}{2}\bigg{[}\big{(}S_{g}-S_{gr}\big{)}+\sqrt{\big{(}S_ {g}-S_{gr}\big{)}^{2}+\frac{4}{C^{\rm trans}}\big{(}S_{g}-S_{gr}\big{)}}\bigg{]} \bigg{\}}_{n} \tag{84}\]  
\[\Big{(}S_{gf}^{trans}\Big{)}_{n}=\Big{(}S_{gf}\Big{)}_{n}+\Big{(}S_{g}^{end} \Big{)}_{n-1} \tag{85}\]  
In the Larsen and Skauge model, the primary parameters used are \"a\" and \"\(\alpha\)\", which control and identify hysteresis effects. In the relative permeability between two adjacent cycles, \"\(\alpha\)\" is used to input the value of the reduction index when calculating the relative permeability during drainage (increasing gas saturation), while \"a\" is used to modify the residual oil saturation required as input in the STONE1 oil-phase relative permeability model, referred to as the residual oil reduction index. The Larsen and Skauge model provided a higher recovery factor compared to simulations without relative permeability hysteresis or with a two-phase gas hysteresis mode. (3) Egermann Model [12]  
[PERSON] proposed expressions for hysteresis to avoid any negative effects on numerical instability. \(C_{L}\), \(C_{T}\), and \(C_{U}\) represent constants for Land, trapping, and untrapped phases, respectively. \(C_{T}\) equals \(C_{L}\) in all trapping stages (imbibition) because it corresponds entirely to conditions where Land constants can be directly used. As \(S_{gr}\) decreases, \(C_{U}\) approximates \(C_{L}\) because there is almost no gas trapped in the largest pores, making it the easiest to trap. As \(S_{gr}\) increases, it becomes harder to release trapped gas, causing \(C_{U}\) to rise above \(C_{L}\). When a significant portion of gas has been trapped (high \(S_{gt}\)), reversibility can be assumed, attributed to the presence of trapped gas saturation that remains unapproachable in the smallest gas-occupied pores. An empirical expression for \(C_{U}\) has been established to meet the above requirements:  
\[C_{U}=(\frac{K_{\text{rg}}-K_{\text{rgmin}}}{K_{\text{rg}}^{\text{D1}}})^{ \lambda}(\frac{S_{\text{gt}}}{S_{\text{gr2}}})(C_{\text{UM}}-C_{\text{L}})+C_{ \text{L}} \tag{86}\]  
where \(\lambda\) is an empirical coefficient governing the evolution of \(C_{U}\),\(C_{UM}\) represents the maximum value of unmapped constants, \(K_{rgmin}\) is the low mobility curve, \(K_{rg}^{\text{D1}}\) is the high mobility curve, and \(S_{\text{gr2}}\) is the maximum trapped gas saturation. The gas phase is the most easily modified expression because free gas flows in the center of the fractal pore. The apparent saturation of the liquid phase is \(S_{L}\). It is a general expression.