Skip to main content
Log in

Fully Coupled Thermo-hydro-mechanical Model for Wellbore Stability Analysis in Deep Gas-Bearing Unsaturated Formations Based on Thermodynamics

  • Original Paper
  • Published:
Rock Mechanics and Rock Engineering Aims and scope Submit manuscript

Abstract

A fully rigorous unsaturated thermo-hydro-mechanical (THM) coupling model based on non-equilibrium thermodynamics and continuum mechanics is developed to investigate the instability mechanism of the borehole drilled in deep gas-bearing formations. It incorporates the gas–water two-phase seepage phenomena, geomechanical loading, and temperature-difference disturbance during deep drilling process. Comparing the predictions of the previous saturated THM model and the presented model, the maximum relative errors of pore pressure, effective radial stress, effective tangential stress, and temperature are 30.2%, 34.6%, 3.4%, and 0.5%, respectively. The maximum prediction deviation in the width and depth of the failure zone occurs at the early time (t = 10−5 d). The unsaturated thermal coupling effect, although less influential on pore pressure and effective radial stress, makes a great contribution to the effective tangential stress with a maximum relative error of 10.1% for the temperature-difference of 30 K, and enhances the time dependence of the failure zone. The cooling condition is favorable to avoid shear collapse failure of the borehole, while the heating condition is not. The results also show that the gas-bearing formations with lower initial water saturation, higher rock permeability, or higher water phase relative permeability correspond to the higher risk of wellbore instability. The thermal conductivity and thermal expansion coefficient of the solid phase have a much greater effect on wellbore stability than those of the fluid phases. The effect of unsaturated THM coupling on wellbore stability may be more significant at lower rock permeabilities. The research findings provide insight into the wellbore stability analysis during drilling in deep gas-bearing formations.

Highlights

  • A fully rigorous unsaturated thermo-hydro-mechanical (THM) coupling model based on thermodynamics is developed.

  • The unsaturated THM responses of pore pressure, stress components, and failure zone of a borehole were clarified.

  • The prediction differences between the presented model and previous saturated THM and unsaturated HM models were quantitatively analyzed.

  • The influence of two-phase seepage and thermal transport on wellbore stability were discussed parametrically.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15
Fig. 16
Fig. 17
Fig. 18
Fig. 19

Similar content being viewed by others

Data Availability

All data generated or analyzed during this study are included in this article.

Abbreviations

ERS:

Effective radial stress

ETS:

Effective tangential stress

FEM:

Finite element method

FI:

Failure index

FZ:

Failure zone

HM:

Hydro-mechanical

REV:

Representative elementary volume

TH:

Thermal-hydro

TM:

Thermal–mechanical

THM:

Thermo-hydro-mechanical

THMC:

Thermo-hydro-mechanical–chemical

WSA:

Wellbore stability analysis

References

  • Abousleiman Y, Ekbote S (2005) Solutions for the inclined borehole in a porothermoelastic transversely isotropic medium. J Appl Mech 72(1):102–114

    Article  Google Scholar 

  • Ahmed T (2018) Reservoir engineering handbook. Gulf Professional Publishing, Houston

    Google Scholar 

  • Chen XH, Pao W, Li XK (2013) Coupled thermo-hydro-mechanical model with consideration of thermal-osmosis based on modified mixture theory. Int J Eng Sci 64:1–13

    Article  Google Scholar 

  • Chen L, Zhao XG, Liu J, Ma HS, Wang CP, Zhang HY, Wang J (2023) Progress on rock mechanics research of Beishan granite for geological disposal of high-level radioactive waste in China. Rock Mech Bull 2(3):100046

    Article  Google Scholar 

  • Cheng AHD (2020) A linear constitutive model for unsaturated poroelasticity by micromechanical analysis. Int J Numer Anal Methods Geomech 44(4):455–483

    Article  Google Scholar 

  • Coussy O (2004) Poromechanics. Wiley, Hoboken

    Google Scholar 

  • Cui L, Cheng AHD, Abousleiman Y (1997) Poroelastic solution for an inclined borehole. J Appl Mech 64:32–38

    Article  Google Scholar 

  • Detournay E, Cheng AHD (1988) Poroelastic response of a borehole in a non-hydrostatic stress field. Int J Rock Mech Min Sci Geomech Abstr 25(3):171–182

    Article  Google Scholar 

  • Diersch HJG, Kolditz O (2002) Variable-density flow and transport in porous media: approaches and challenges. Adv Water Resour 25(8–12):899–944

    Article  Google Scholar 

  • Feng Y, Xiao XM, Wang EZ, Gao P, Lu CG, Li G (2023) Gas storage in shale pore system: a review of the mechanism, control and assessment. Pet Sci 20(5):2605–2636

    Article  Google Scholar 

  • Gao JJ, Deng JG, Lan K, Feng YT, Zhang WD, Wang HD (2017) Porothermoelastic effect on wellbore stability in transversely isotropic medium subjected to local thermal non-equilibrium. Int J Rock Mech Min Sci 96:66–84

    Article  Google Scholar 

  • Gao JJ, Lau HC, Sun J (2020) A semianalytical poroelastic solution to evaluate the stability of a borehole drilled through a porous medium saturated with two immiscible fluids. SPE J 25(05):2319–2340

    Article  Google Scholar 

  • Gao JJ, Lin H, Wu BS, Deng JG, Liu HL (2021) Porochemothermoelastic solutions considering fully coupled thermo-hydro-mechanical-chemical processes to analyze the stability of inclined boreholes in chemically active porous media. Comput Geotech 134:104019

    Article  Google Scholar 

  • Gao JJ, Lin H, Sun J, Chen XP, Wang HX, Liu XF (2022) A porothermoelastic model considering the dynamic temperature-perturbation boundary effect for borehole stability in fractured porous rocks. SPE J 27(04):2491–2509

    Article  Google Scholar 

  • Geng JB, Zeng GX, Liu CY, Li XS, Zhang DM (2023) Development and application of triaxial seepage test system for gas-water two-phase in coal rock. Energy 277:127439

    Article  Google Scholar 

  • Ghassemi A, Diek A (2002) Porothermoelasticity for swelling shales. J Petrol Sci Eng 34(1–4):123–135

    Article  Google Scholar 

  • Ghassemi A, Diek A (2003) Linear chemo-poroelasticity for swelling shales: theory and application. J Petrol Sci Eng 38(3–4):199–212

  • Ghassemi A, Tao Q, Diek A (2009) Influence of coupled chemo-poro-thermoelastic processes on pore pressure and stress distributions around a wellbore in swelling shale. J Petrol Sci Eng 67(1–2):57–64

    Article  Google Scholar 

  • Gonçalvès J, Trémosa J (2010) Estimating thermo-osmotic coefficients in clay-rocks: I. Theoretical insights. J Colloid Interface Sci 342(1):166–174

    Article  Google Scholar 

  • He X, Chen GS, Wu JF, Liu Y, Wu S, Zhang J, Zhang XT (2023) Deep shale gas exploration and development in the southern Sichuan Basin: new progress and challenges. Nat Gas Ind B 10(1):32–43

    Article  Google Scholar 

  • Heidug WK, Wong SW (1996) Hydration swelling of water-absorbing rocks: a constitutive model. Int J Numer Anal Methods Geomech 20(6):403–430

    Article  Google Scholar 

  • Ibrahim A (2021) A review of mathematical modelling approaches to tackling wellbore instability in shale formations. J Nat Gas Sci Eng 89:103870

    Article  Google Scholar 

  • Jha B, Juanes R (2014) Coupled multiphase flow and poromechanics: a computational model of pore pressure effects on fault slip and earthquake triggering. Water Resour Res 50(5):3776–3808

    Article  Google Scholar 

  • Ji JY, Song XZ, Song GF, Xu FQ, Shi Y, Lv ZH, Li S, Yi JL (2023) Study on fracture evolution model of the enhanced geothermal system under thermal-hydraulic-chemical-deformation coupling. Energy 269:126604

    Article  Google Scholar 

  • Jia AL, Wei YS, Guo Z, Wang GT, Meng DW, Huang SQ (2022) Development status and prospect of tight sandstone gas in China. Nat Gas Ind B 9(5):467–476

    Article  Google Scholar 

  • Jia CZ, Pang XQ, Song Y (2023) Whole petroleum system and ordered distribution pattern of conventional and unconventional oil and gas reservoirs. Pet Sci 20(1):1–19

    Article  Google Scholar 

  • Jiang GC, Sun JS, He YB, Cui KX, Dong TF, Yang LL, Yang XK, Wang XX (2021) Novel water-based drilling and completion fluid technology to improve wellbore quality during drilling and protect unconventional reservoirs. Engineering 18:129–142

    Article  Google Scholar 

  • Kanfar MF, Chen Z, Rahman SS (2016) Fully coupled 3D anisotropic conductive-convective porothermoelasticity modeling for inclined boreholes. Geothermics 61:135–148

    Article  Google Scholar 

  • Katchalsky A, Curran PF (1965) Nonequilibrium thermodynamics in biophysics. Harvard University Press, Cambridge

    Book  Google Scholar 

  • Liu C, Abousleiman Y (2018) Multiporosity/multipermeability inclined-wellbore solutions with mudcake effects. SPE J 23(05):1723–1747

    Article  Google Scholar 

  • Liu J, Liang X, Xue Y, Yao K, Fu Y (2020) Numerical evaluation on multiphase flow and heat transfer during thermal stimulation enhanced shale gas recovery. Appl Therm Eng 178:115554

    Article  Google Scholar 

  • Liu JH, Ma TS, Fu JH, Peng N, Qiu Y, Liu Y, Gao JJ (2023) Fully coupled two-phase hydro-mechanical model for wellbore stability analysis in tight gas formations considering the variation of rock mechanical parameters. Gas Sci Eng 115:205023

    Article  Google Scholar 

  • Ma TS, Chen P, Yang CH, Zhao J (2015) Wellbore stability analysis and well path optimization based on the breakout width model and Mogi-Coulomb criterion. J Petrol Sci Eng 135:678–701

    Article  Google Scholar 

  • Ma K, Tang CA, Wang LX, Tang DH, Zhuang DY, Zhang QB, Zhao J (2016) Stability analysis of underground oil storage caverns by an integrated numerical and microseismic monitoring approach. Tunn Undergr Space Technol 54:81–91

    Article  Google Scholar 

  • Ma TS, Liu JH, Fu JH, Wu BS (2022a) Drilling and completion technologies of coalbed methane exploitation: an overview. Int J Coal Sci Technol 9(1):68

    Article  Google Scholar 

  • Ma TS, Zhang Y, Qiu Y, Liu Y, Li ZL (2022b) Effect of parameter correlation on risk analysis of wellbore instability in deep igneous formations. J Petrol Sci Eng 208:109521

    Article  Google Scholar 

  • Ma Y, Chen XH, Hosking LJ, Yu HS, Thomas HR (2022c) THMC constitutive model for membrane geomaterials based on mixture coupling theory. Int J Eng Sci 171:103605

    Article  Google Scholar 

  • Moghadam A, Vaisblat N, Harris NB, Chalaturnyk R (2020) On the magnitude of capillary pressure (suction potential) in tight rocks. J Petrol Sci Eng 190:107133

    Article  Google Scholar 

  • Moran MJ, Shapiro HN, Boettner DD, Bailey MB (2010) Fundamentals of engineering thermodynamics. Wiley, Hoboken

    Google Scholar 

  • Nair R, Abousleiman Y, Zaman M (2005) Modeling fully coupled oil-gas flow in a dual-porosity medium. Int J Geomech 5(4):326–338

    Article  Google Scholar 

  • Qiu Y, Ma TS, Peng N, Liu Y, Liu JH, Ranjith PG (2023) Wellbore stability analysis of inclined wells in transversely isotropic formations accounting for hydraulic-mechanical coupling. Geoenergy Sci Eng 224:211615

    Article  Google Scholar 

  • Qiu Y, Ma TS, Peng N, Liu JH, Ranjith PG (2023b) Fully coupled anisotropic porothermoelasticity modeling for inclined borehole in shale formations. Rock Mech Rock Eng 57:597–619

    Article  Google Scholar 

  • Rahman MK, Naseby D, Rahman SS (2000) Borehole collapse analysis incorporating time-dependent pore pressure due to mud penetration in shales. J Petrol Sci Eng 28(1–2):13–31

    Article  Google Scholar 

  • Roshan H, Oeser M (2012) A non-isothermal constitutive model for chemically active elastoplastic rocks. Rock Mech Rock Eng 45:361–374

    Article  Google Scholar 

  • Sanei M, Duran O, Devloo PRB, Santos ESR (2021) Analysis of pore collapse and shear-enhanced compaction in hydrocarbon reservoirs using coupled poro-elastoplasticity and permeability. Arab J Geosci 14:1–18

    Article  Google Scholar 

  • Sanei M, Duran O, Devloo PRB, Santos ESR (2022) Evaluation of the impact of strain-dependent permeability on reservoir productivity using iterative coupled reservoir geomechanical modeling. Geomech Geophys Geo-Energy Geo-Resour 8(2):54

    Article  Google Scholar 

  • Siddiqui MAQ, Regenauer-Lieb K, Roshan H (2024) Thermo-Hydro-Chemo-Mechanical (THCM) continuum modelling of subsurface rocks: a focus on thermodynamics-based constitutive models. Appl Mech Rev 76(3):031001

  • Siddiqui MAQ, Roshan H (2022) Thermodynamic characterization of chemical damage in variably saturated water-active shales. Rock Mech Rock Eng 55(8):5259–5284

    Article  Google Scholar 

  • Soler JM (2001) The effect of coupled transport phenomena in the Opalinus Clay and implications for radionuclide transport. J Contam Hydrol 53(1–2):63–84

    Article  Google Scholar 

  • Van Genuchten MT (1980) A closed-form equation for predicting the hydraulic conductivity of unsaturated soils. Soil Sci Soc Am J 44(5):892–898

    Article  Google Scholar 

  • Wang HG, Huang HC, Bi WX, Ji GD, Zhou B, Zhuo LB (2022) Deep and ultra-deep oil and gas well drilling technologies: progress and prospect. Nat Gas Ind B 9(2):141–157

    Article  Google Scholar 

  • Wang JG, Wang HM, Wang XL, Yang SQ, Wu HT, Leung CF, Tian JL (2023) A multiphysical-geochemical coupling model for caprock sealing efficiency in CO2 geosequestration. Deep Undergr Sci Eng 2(2):188–203

    Article  Google Scholar 

  • Wei YR, Feng YC, Tan ZL, Yang TY, Li XR, Dai ZY, Deng JG (2023) Borehole stability in naturally fractured rocks with drilling mud intrusion and associated fracture strength weakening: a coupled DFN-DEM approach. J Rock Mech Geotech Eng. https://doi.org/10.1016/j.jrmge.2023.07.012

    Article  Google Scholar 

  • Wu BS, Zhang X, Jeffrey RG, Wu BL (2012) A semi-analytic solution of a wellbore in a non-isothermal low-permeability porous medium under non-hydrostatic stresses. Int J Solids Struct 49(13):1472–1484

    Article  Google Scholar 

  • Wu L, Hou ZM, Xie YC, Luo ZF, Xiong Y, Cheng L, Wu XN, Chen QJ, Huang LC (2023) Fracture initiation and propagation of supercritical carbon dioxide fracturing in calcite-rich shale: a coupled thermal-hydraulic-mechanical-chemical simulation. Int J Rock Mech Min Sci 167:105389

    Article  Google Scholar 

  • Xie YC, Wu XN, Hou ZM, Li ZY, Luo JS, Lüddeke CT, Huang LC, Wu L, Liao JX (2023) Gleaning insights from German energy transition and large-scale underground energy storage for China’s carbon neutrality. Int J Min Sci Technol 33(5):529–553

    Article  Google Scholar 

  • Yan CL, Deng JG, Yu BH, Li WL, Chen ZJ, Hu LB, Li Y (2014) Borehole stability in high-temperature formations. Rock Mech Rock Eng 47:2199–2209

    Article  Google Scholar 

  • Yan CL, Dong LF, Zhao K, Cheng YF, Li XR, Deng JG, Li ZQ, Chen Y (2022) Time-dependent borehole stability in hard-brittle shale. Pet Sci 19(2):663–677

    Article  Google Scholar 

  • Zeynali ME (2012) Mechanical and physico-chemical aspects of wellbore stability during drilling operations. J Petrol Sci Eng 82:120–124

    Article  Google Scholar 

  • Zhang JZ, Gao SS, Wei X, Ye LY, Liu HX, Zhu WQ, Sun XW, Li XG, Zhu WT (2023a) An improved experimental procedure and mathematical model for determining gas-water relative permeability in tight sandstone gas reservoirs. Geoenergy Sci Eng 221:211402

  • Zhang QG, Yao BW, Fan XY, Li Y, Fantuzzi N, Ma TS, Chen YF, Zeng FT, Li X, Wang LZ (2023b) A failure criterion for shale considering the anisotropy and hydration based on the shear slide failure model. Int J Min Sci Technol 33(4):447–462

    Article  Google Scholar 

  • Zhang L, Zhang ZF, Wu BS, Zhang X, Nie YX, Wang GJ, Yang L (2023c) A fully coupled thermo-poro-elastic model predicting the stability of wellbore in deep-sea drilling. Part A: analytic solutions. Geoenergy Sci Eng 228:211950

    Article  Google Scholar 

Download references

Acknowledgements

This work was supported by the Sichuan Science and Technology Program (Grant No. 2020JDJQ0055), the Natural Science Foundation of Sichuan, China (Grant No. 24NSFSC0086), the National Natural Science Foundation of China (Grant No. 41874216), the Program of Introducing Talents of Discipline to Chinese Universities (111 Plan) (Grant No. D18016), and the Ministry of Science and Higher Education of the Russian Federation (Project Nos. FSNM-2023-0005 and FSNM-2024-0005).

Funding

No funding was received for conducting this study.

Author information

Authors and Affiliations

Authors

Contributions

TM: conceptualization, writing-reviewing and editing, supervision, and funding. JL: methodology, software, simulation, validation, writing-original draft preparation, visualization, and investigation. JF: conceptualization, supervision, and funding. YQ: simulation, methodology, visualization, and investigation. XF: writing-reviewing and editing, and supervision. DAM: methodology, and writing—reviewing and editing.

Corresponding authors

Correspondence to Tianshou Ma or Jianhong Fu.

Ethics declarations

Conflict of Interest

The authors declare that they have no known competing financial interests or personal relationships that could have influenced the work reported in this study.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Appendices

Appendix 1

1.1 Balance Equations

1.1.1 Mass Balance Equations

The balance equations based on the mixture coupling theory for a thermodynamic open system have recently been widely recognized, discussed, and extended, and the details can be referred to found in previous literature (Heidug and Wong 1996; Chen et al. 2013; Coussy 2004), will not be repeated here. For the porous medium mixture of interest containing solids and fluids (including liquid and gas phases), assuming no mass exchange between components, the mass balance equation is generally expressed as

$$\frac{{\rm D}}{{\rm D}t}\left( {\int_{V} {\rho^{\xi } {\rm d}V} } \right) = - \int_{\Gamma } {{\varvec{I}}^{\xi } \cdot {\varvec{n}}{\rm d}\Gamma } ,$$
(50)

where the superscript ξ = s, l and g represent solid, liquid, and gas, respectively, ρξ denotes the mass density of each component, n is the outward normal vector, and the component mass flux Iξ can be given by

$${\varvec{I}}^{\xi } = \rho^{\xi } \left( {{\mathbf{v}}_{\xi } - {\mathbf{v}}_{{\rm s}} } \right),$$
(51)

where vξ represents the velocity of liquid (ξ = l) and gas (ξ = g), vs denotes the solid velocity, and the material time derivative following the motion of the solid is expressed as

$$\frac{{\rm D}\left( \cdot \right)}{{{\rm D}t}} = \frac{\partial \left( \cdot \right)}{{\partial t}} + {\mathbf{v}}_{{\rm s}} \cdot \nabla \left( \cdot \right).$$
(52)

Considering that there is no solid mass flux into V, while it is open to fluid mass flow (liquid and gas), by substituting Eqs. (51) and (52) into Eq. (50), the localized version of the mass balance equations for solid and fluid components can be derived as

For solid phase (ξ = s):

$$\dot{\rho }^{{\rm s}} + \rho^{{\rm s}} \nabla \cdot {\mathbf{v}}_{{\rm s}} = 0.$$
(53)

For liquid and gas phase (ξ = l and g):

$$\dot{\rho }^{\xi } + \rho^{\xi } \nabla \cdot {\mathbf{v}}_{{\rm s}} + \nabla \cdot {\varvec{I}}^{\xi } = 0,$$
(54)

where the time derivative ∂(·) is replaced by the over dot ‘·’.

The mass density of each component ρξ is defined with respect to the total volume of the fluid–solid mixture system, and can be expressed in terms of respective volume fraction φξ and true state density ρξ a as

$$\rho^{\xi } = \varphi_{\xi } \rho_{\xi } ,$$
(55)

where the component volume fraction φξ is related to the total porosity φ of the porous medium through

$$\varphi_{{\rm s}} = 1 - \varphi , \, \varphi_{{\rm l}} = \varphi S_{{\rm l}} , \, \varphi_{{\rm g}} = \varphi S_{{\rm g}} ,$$
(56)

where Sξ is the saturation of liquid (ξ = l) and gas (ξ = g).

The following density relationship is then obtained:

$$\rho^{{\rm s}} = \left( {1 - \varphi } \right)\rho_{{\rm s}} , \, \rho^{{\rm l}} = \varphi S_{{\rm l}} \rho_{{\rm l}} , \, \rho^{{\rm g}} = \varphi S_{{\rm g}} \rho_{{\rm g}} ,$$
(57)

in which Sl + Sg = 1.

1.1.2 Heat Balance Equation

In the REV, the thermal density, is influenced only by the heat flow flux across the boundary Γ, and can be defined in a unified form for different components as

$$q_{\xi } = \rho^{\xi } C_{\xi } T.$$
(58)

Substituting Eq. (57) into Eq. (58), one can obtain

$$q_{{\rm s}} = \left( {1 - \varphi } \right)\rho_{{\rm s}} C_{{\rm s}} T, \quad q_{{\rm l}} = \varphi S_{{\rm l}} \rho_{{\rm l}} C_{{\rm l}} T, \quad q_{{\rm g}} = \varphi S_{{\rm g}} \rho_{{\rm g}} C_{{\rm g}} T,$$
(59)

where qs, ql, and qg are the heat density of solid, liquid, and gas, respectively, Cs, Cl, and Cg represent the specific heat capacity of solid, liquid, and gas, respectively, and T is the temperature.

The total heat flow q includes two aspects (Ma et al. 2022c; Siddiqui and Roshan 2022):

  1. (1)

    The heat flow contained in the liquid and gas flow, which are defined as hwIw and hgIg, where hw and hg represent the enthalpy of the liquid and gas, respectively.

  2. (2)

    The reduced heat flow q′ = q-hwIw − hgIg, which means the difference between the total heat flow and the heat flow carried by the fluids (Katchalsky and Curran 1965).

Therefore, the heat balance equation can be obtained based on the balance law for the thermodynamic open system as

$$\frac{{\rm D}}{{\rm D}t}\int_{V} {\left( {q_{{\rm s}} + q_{{\rm l}} + q_{{\rm g}} } \right)} {\rm d}V = - \int_{\Gamma } {\left( {{{\varvec{q}}^{\prime}} + h^{{\rm l}} {\varvec{I}}^{{\rm l}} + h^{{\rm g}} {\varvec{I}}^{{\rm g}} } \right)} \cdot {\varvec{n}}{\rm d}\Gamma .$$
(60)

Using Eq. (52) and neglecting any other heat source or heat change, Eq. (60) can be rewritten as

$$\left( {q_{{\rm s}} + q_{{\rm l}} + q_{{\rm g}} } \right)^{ \cdot } + \left( {q_{{\rm s}} + q_{{\rm l}} + q_{{\rm g}} } \right)\nabla \cdot {\mathbf{v}}_{{\rm s}} + \nabla \cdot {{\varvec{q}}^{\prime}} + \nabla \cdot h^{{\rm l}} {\varvec{I}}^{{\rm l}} + \nabla \cdot h^{{\rm g}} {\varvec{I}}^{{\rm g}} = 0.$$
(61)

1.1.3 Helmholtz Free Energy Balance Equation

First, involving in the concepts of the internal energy density ε and entropy density η, the Helmholtz free energy density ψ is conveniently defined as (Chen et al. 2013)

$$\psi = \varepsilon - T\eta .$$
(62)

The local form of the internal energy balance equation can be written as

$$\dot{\varepsilon } + \varepsilon \nabla \cdot {\mathbf{v}}_{{\rm s}} - \nabla \cdot \left( {{\varvec{\sigma}}{\mathbf{v}}_{{\rm s}} } \right) + \nabla \cdot {{\varvec{q}}^{\prime} + }\nabla \cdot h^{{\rm w}} {\varvec{I}}^{{\rm w}} + \nabla \cdot h^{{\rm g}} {\varvec{I}}^{{\rm g}} = 0,$$
(63)

where σ denotes the Cauchy stress tensor.

Likewise, the local form of the entropy balance equation can be obtained as

$$\left( {\eta^{{\rm s}} + \eta^{{\rm l}} + \eta^{{\rm g}} } \right)^{ \cdot } + \left( {\eta^{{\rm s}} + \eta^{{\rm l}} + \eta^{{\rm g}} } \right)\nabla \cdot {\mathbf{v}}_{{\rm s}} + \nabla \cdot {\varvec{I}}_{\eta } - \gamma = 0,$$
(64)

where ηs, ηl, and gg represent the entropy density of the solid, liquid, and gas phases, respectively, γ denotes the entropy production per unit mixture volume, and Iη means the entropy exchange with surroundings (Katchalsky and Curran 1965), and can be expressed as

$${\varvec{I}}_{\eta } = \frac{{{\varvec{q}} - \omega^{{\rm l}} {\varvec{I}}^{{\rm l}} - \omega^{{\rm l}} {\varvec{I}}^{{\rm l}} }}{T} = \frac{{{{\varvec{q}}^{\prime}}}}{T} + \eta^{{\rm l}} {\varvec{I}}^{{\rm l}} + \eta^{{\rm g}} {\varvec{I}}^{{\rm g}} ,$$
(65)

in which ωξ = hξ− ξ (ξ = l and g) represent the chemical potential of the liquid and gas.

Therefore, according to Eq. (62), using Reynold’s transport theorem and combining Eqs. (63) and (64), the balance equation for the Helmholtz free energy density can ultimately be derived as

$$\dot{\psi } + \psi \nabla \cdot {\mathbf{v}}_{{\rm s}} - \nabla \cdot \left( {{\varvec{\sigma}}{\mathbf{v}}_{{\rm s}} } \right) + \nabla \cdot {{\varvec{q}}^{\prime} + }\nabla \cdot h^{{\rm w}} {\varvec{I}}^{{\rm w}} + \nabla \cdot h^{{\rm g}} {\varvec{I}}^{{\rm g}} + \left( {\dot{T} + T\nabla \cdot {\mathbf{v}}_{{\rm s}} } \right)\eta^{{\rm mix}} - T\nabla \cdot {\varvec{I}}_{\eta } = - T\gamma \le 0,$$
(66)

where ηmix = ηs + ηl + ηg represents the entropy density of the mixture.

1.2 Entropy Production and Transport Law

It is essential to interpret the entropy production to quantify the dissipation mechanism within the rock. The entropy production is assumed to be due to the frictional resistance at the solid–fluid interface as the fluid flow in the porous medium here. Thus, using standard arguments of non-equilibrium thermodynamics, a macroscopic expression for dissipation under non-isothermal conditions is given by (Ma et al. 2022c; Siddiqui and Roshan 2022)

$$T\gamma = - {\varvec{I}}_{\eta } \cdot \nabla T - {\varvec{I}}^{{\rm l}} \cdot \nabla \omega^{{\rm l}} - {\varvec{I}}^{{\rm g}} \cdot \nabla \omega^{{\rm g}} .$$
(67)

Moreover, according to the Gibbs–Duhem equation (Moran et al. 2010), the relationship between the fluid chemical potential ωξ and the respective pressure pξ can be established based on the assumption of the local thermal equilibrium condition as

$$\rho_{{\rm l}} \nabla \omega^{{\rm l}} = \nabla p_{{\rm l}}$$
(68)
$$\rho_{{\rm g}} \nabla \omega^{{\rm g}} = \nabla p_{{\rm g}} ,$$
(69)

where pl and pg are the pore liquid pressure and gas pressure, respectively.

In addition, the Darcy velocity of fluids are given by

$${\varvec{u}}_{{\rm l}} = \varphi_{{\rm l}} \left( {{\mathbf{v}}_{{\rm l}} - {\mathbf{v}}_{{\rm s}} } \right)$$
(70)
$${\varvec{u}}_{{\rm g}} = \varphi_{{\rm g}} \left( {{\mathbf{v}}_{{\rm g}} - {\mathbf{v}}_{{\rm s}} } \right).$$
(71)

Therefore, neglecting the chemical potential of the liquid and gas phases, Eqs. (66) and (67) are available to rewrite the dissipation function by making the necessary rearrangements for driving forces and fluxes as

$$0 \le T\gamma = - {{\varvec{q}}^{\prime}} \cdot \frac{\nabla T}{T} - {\varvec{u}}_{{\rm w}} \nabla p_{{\rm w}} - {\varvec{u}}_{{\rm g}} \nabla p_{{\rm g}} = - {{\varvec{q}}^{\prime}} \cdot \frac{\nabla T}{T} - {\varvec{u}}_{{\rm w}} \nabla p_{{\rm w}} - {\varvec{u}}_{{\rm g}} \nabla p_{{\rm g}} .$$
(72)

Furthermore, the linear dependence of fluid fluxes and heat flux on the corresponding driving forces can then be expressed with the help of phenomenological equations as (Ma et al. 2022c; Siddiqui and Roshan 2022)

$$\rho_{{\rm l}} {\varvec{u}}_{{\rm l}} = - L_{11} \left( {\frac{{\nabla p_{{\rm l}} }}{{\rho_{{\rm l}} }}} \right) - L_{12} \left( {\frac{{\nabla p_{{\rm g}} }}{{\rho_{{\rm l}} }}} \right) - L_{13} \left( {\frac{\nabla T}{T}} \right)$$
(73)
$$\rho_{{\rm g}} {\varvec{u}}_{{\rm g}} = - L_{21} \left( {\frac{{\nabla p_{{\rm w}} }}{{\rho_{{\rm w}} }}} \right) - L_{22} \left( {\frac{{\nabla p_{{\rm g}} }}{{\rho_{{\rm g}} }}} \right) - L_{23} \left( {\frac{\nabla T}{T}} \right)$$
(74)
$${{\varvec{q}}^{\prime}} = - L_{31} \left( {\frac{{\nabla p_{{\rm w}} }}{{\rho_{{\rm w}} }}} \right) - L_{32} \left( {\frac{{\nabla p_{{\rm g}} }}{{\rho_{{\rm g}} }}} \right) - L_{33} \left( {\frac{\nabla T}{T}} \right).$$
(75)

1.3 Equations of State

Following the above Helmholtz free energy balance and dissipation equations, the solid/fluid coupling interaction response to stress, strain, pressure, and temperature can be further determined.

1.3.1 Basic Equation of State

Considering that the rock is in mechanical equilibrium, there is

$$\nabla \cdot {\varvec{\sigma}} = 0.$$
(76)

Substituting Eq. (67) into Eq. (66), thus the Helmholtz free energy balance equation is then rewritten as

$$\dot{\psi } + \psi \nabla \cdot {\mathbf{v}}_{{\rm s}} - {\rm tr}\left( {{\varvec{\sigma}}\nabla {\mathbf{v}}_{{\rm s}} } \right) + \omega^{{\rm l}} \nabla \cdot {\varvec{I}}^{{\rm l}} + \omega^{{\rm g}} \nabla \cdot {\varvec{I}}^{{\rm g}} + \left( {\dot{T} + T\nabla \cdot {\mathbf{v}}_{{\rm s}} } \right)\eta^{{\rm mix}} = 0.$$
(77)

For the small strain ε problem of interest, according to the relative concepts of continuum mechanics, invoking the fluid mass balance (Eq. 54) and making the necessary simplifications, one can obtain the referential equivalent expression of Eq. (77) as

$$\dot{\Psi } = {\rm tr}\left( {{{\varvec{\sigma}} \dot{\varvec{\varepsilon }}}} \right) + \omega^{{\rm l}} \dot{m}^{{\rm l}} + \omega^{{\rm g}} \dot{m}^{{\rm g}} - J\eta^{{\rm mix}} \dot{T},$$
(78)

where Ψ =  represents the free energy in the reference configuration, ml = JφSlρl and mg = JφSgρg are the masses of the liquid and gas per unit referential volume, respectively, ε is the infinitesimal strain tensor, and J denotes the Jacobian of the deformation, the time derivative of which is given by

$$\dot{J} = J\nabla \cdot {\mathbf{v}}_{{\rm s}} .$$
(79)

1.3.2 Helmholtz Free Energy Density of the Pore Fluids

According to the classical thermodynamics, the free energy density ψpore of the fluids (liquid and gas) contained in the free pore space can be defined as

$$\psi_{{\rm pore}} = - p_{{\rm pore}} + \rho_{{\rm l}} S_{{\rm l}} \omega^{{\rm l}} + \rho_{{\rm g}} S_{{\rm g}} \omega^{{\rm g}} ,$$
(80)

where ppore = plSl + pgSg represents the average pore pressure.

Under the non-isothermal condition, where the presence of both liquid and gas is considered, based on the Gibbs–Duhem equation, there is

$$\dot{p}_{{\rm pore}} = S_{{\rm l}} \eta_{{\rm l}} \dot{T} + S_{{\rm g}} \eta_{{\rm g}} \dot{T} + S_{{\rm l}} \dot{\omega }^{{\rm l}} \rho_{{\rm l}} + S_{{\rm g}} \dot{\omega }^{{\rm g}} \rho_{{\rm g}} + \dot{S}_{{\rm l}} p_{{\rm l}} + \dot{S}_{{\rm g}} p_{{\rm g}} ,$$
(81)

where ηl and ηg represent the liquid and gas entropies per liquid and gas volume, respectively, and ηl = φSlηl and ηg = φSgηg. Combining Eq. (81) with the time derivative of Eq. (80) can finally yield

$$\dot{\psi }_{{\rm pore}} = - S_{{\rm l}} \eta_{{\rm l}} \dot{T} - S_{{\rm g}} \eta_{{\rm g}} \dot{T} + \omega^{{\rm l}} \left( {S_{{\rm l}} \rho_{{\rm l}} } \right)^{ \cdot } + \omega^{{\rm g}} \left( {S_{{\rm g}} \rho_{{\rm g}} } \right)^{ \cdot } - \dot{S}_{{\rm l}} p_{{\rm l}} - \dot{S}_{{\rm g}} p_{{\rm g}} .$$
(82)

1.3.3 Helmholtz Free Energy Density of the Solid Matrix

By subtracting the contribution of the pore fluid free energy Jφψpore from the total free energy Ψ of the solid/fluid mixture system, the free energy of the solid matrix can be expressed as

$$\left( {\Psi - J\varphi \psi_{{\rm pore}} } \right)^{ \cdot } = \dot{\Psi } - J\varphi \dot{\psi }_{{\rm pore}} - \psi_{{\rm pore}} \left( {J\varphi } \right)^{ \cdot } .$$
(83)

Substituting Eqs. (78), (80) and (82) into (83) yields

$$\begin{aligned} \left( {\Psi - J\varphi \psi_{{\rm pore}} } \right)^{ \cdot } & = {\rm tr}\left( {{{\varvec{\sigma}} \dot{\varvec{\varepsilon }}}} \right) + \omega^{{\rm l}} \dot{m}^{{\rm l}} + \omega^{{\rm g}} \dot{m}^{{\rm g}} - J\eta^{{\rm mix}} \dot{T} \\ & \quad - J\varphi \left( { - S_{{\rm l}} \eta_{{\rm l}} \dot{T} - S_{{\rm g}} \eta_{{\rm g}} \dot{T} + \omega^{{\rm l}} \left( {S_{{\rm l}} \rho_{{\rm l}} } \right)^{ \cdot } + \omega^{{\rm g}} \left( {S_{{\rm g}} \rho_{{\rm g}} } \right)^{ \cdot } - \dot{S}_{{\rm l}} p_{{\rm l}} - \dot{S}_{{\rm g}} p_{{\rm g}} } \right) \\ & \quad - \left( { - p_{{\rm l}} S_{{\rm l}} - p_{{\rm g}} S_{{\rm g}} + \rho_{{\rm l}} S_{{\rm l}} \omega^{{\rm l}} + \rho_{{\rm g}} S_{{\rm g}} \omega^{{\rm g}} } \right)\left( {J\varphi } \right).^{ \cdot } \\ \end{aligned}$$
(84)

And Eq. (84) can be further rearranged as

$$\begin{aligned} \left( {\Psi - J\varphi \psi_{{\rm pore}} } \right)^{ \cdot } & = {\rm tr}\left( {{{\varvec{\sigma}} \dot{\varvec{\varepsilon }}}} \right) + \omega^{{\rm l}} \dot{m}^{{\rm l}} + \omega^{{\rm g}} \dot{m}^{{\rm g}} - J\eta^{{\rm mix}} \dot{T} \, \\ & \quad + \left( {J\varphi } \right)^{ \cdot } \left( {p_{{\rm l}} S_{{\rm l}} + p_{{\rm g}} S_{{\rm g}} } \right) + J\varphi \left( {S_{{\rm l}} \eta_{{\rm l}} + S_{{\rm g}} \eta_{{\rm l}} } \right)\dot{T} + J\varphi \left( {\dot{S}_{{\rm l}} p_{{\rm l}} + \dot{S}_{{\rm g}} p_{{\rm g}} } \right) \\ & \quad - \omega^{{\rm l}} \left( {J\varphi S_{{\rm l}} \rho_{{\rm l}} } \right)^{ \cdot } - \omega^{{\rm g}} \left( {J\varphi S_{{\rm g}} \rho_{{\rm g}} } \right)^{ \cdot } . \\ \end{aligned}$$
(85)

Recalling the previous definition of mix, ml and mg, Eq. (85) can finally be simplified as

$$\left( {\Psi - J\varphi \psi_{{\rm pore}} } \right)^{ \cdot } = {\rm tr}\left( {{{\varvec{\sigma}} \dot{\varvec{\varepsilon }}}} \right) + p_{{\rm l}} \dot{\upsilon }_{{\rm l}} + p_{{\rm g}} \dot{\upsilon }_{{\rm g}} - H_{{\rm s}} \dot{T},$$
(86)

where υl = JφSl and υg = JφSg represent the pore liquid and gas volumes per unit referential volume, respectively, Hs = s denotes the entropy density of the solid matrix in the reference configuration.

To simplify, the following potential can be easily defined based on Eq. (86) as:

$$W = \left( {\Psi - J\varphi \psi_{{\rm pore}} } \right) - p_{{\rm l}} \upsilon_{{\rm l}} - p_{{\rm g}} \upsilon_{{\rm g}} .$$
(87)

Next, substituting Eq. (86) into the time derivative of W, we obtain

$$\dot{W}\left( {{\varvec{\varepsilon}},p_{{\rm l}} ,p_{{\rm g}} ,T} \right) = {\rm tr}\left( {{{\varvec{\sigma}} \dot{\varvec{\varepsilon }}}} \right) - \upsilon_{{\rm l}} \dot{p}_{{\rm l}} - \upsilon_{{\rm g}} \dot{p}_{{\rm g}} - H_{{\rm s}} \dot{T}.$$
(88)

Equation (88) indicates that W is a function of state variables ε, pl, pg, and T, and thus, the expressions for their conjugate thermodynamics state variables σ, υl, υg and Hs can be obtained.

Appendix 2

To solve system variables u, pw, Sw, and T, the governing equations (Eqs. (34), (40), (41) and (45)) needs to be integrated and simplified as follows:

$$G\nabla^{2} {\varvec{u}} + \left( {\frac{G}{1 - 2v}} \right)\nabla \left( {\nabla \cdot {\varvec{u}}} \right) - \alpha \nabla p_{{\rm w}} - \alpha \left( {1 - S_{{\rm w}} } \right)\nabla p_{{\rm c}} - K\beta_{{\rm s}} \nabla T = 0$$
(89)
$$\begin{aligned} & \left( {\frac{{\varphi S_{{\rm w}} }}{{K_{{\rm w}} }} + \frac{{\varphi S_{{\rm g}} }}{{K_{{\rm g}} }} + \frac{\alpha - \varphi }{{K_{{\rm s}} }}} \right)\frac{{\partial p_{{\rm w}} }}{\partial t} + \left( {\frac{{\varphi S_{{\rm g}} }}{{K_{{\rm g}} }} + \frac{\alpha - \varphi }{{K_{{\rm s}} }}S_{{\rm g}} } \right)\frac{{\partial p_{{\rm c}} }}{\partial t} + \alpha \frac{{\partial \varepsilon_{v} }}{\partial t} + \left[ { - \left( {\alpha - \varphi } \right)\beta_{{\rm s}} - \varphi S_{{\rm w}} \beta_{{\rm w}} - \varphi S_{{\rm g}} \beta_{{\rm g}} } \right]\frac{\partial T}{{\partial t}} \\ & \quad + \nabla \cdot \left[ { - \frac{{kk_{rw} }}{{\mu_{{\rm w}} }}\nabla p_{{\rm w}} - \frac{{kk_{{\rm rg}} }}{{\mu_{{\rm g}} }}\nabla \left( {p_{{\rm w}} + p_{{\rm c}} } \right) - \left( {k_{{\rm Tw}} + k_{{\rm Tg}} } \right)\nabla T} \right] = 0 \\ \end{aligned}$$
(90)
$$\begin{aligned} & \left( {\frac{{\varphi S_{{\rm w}} }}{{K_{{\rm w}} }} + \frac{\alpha - \varphi }{{K_{{\rm s}} }}S_{{\rm w}} } \right)\frac{{\partial p_{{\rm w}} }}{\partial t} + \left( {\frac{\alpha - \varphi }{{K_{{\rm s}} }}S_{{\rm w}} S_{{\rm g}} } \right)\frac{{\partial p_{{\rm c}} }}{\partial t} + \varphi \frac{{\partial S_{{\rm w}} }}{\partial t} + \alpha S_{{\rm w}} \frac{{\partial \varepsilon_{v} }}{\partial t} \\ & \quad + \left[ { - \left( {\alpha - \varphi } \right)S_{{\rm w}} \beta_{{\rm s}} - \varphi S_{{\rm w}} \beta_{{\rm w}} } \right]\frac{\partial T}{{\partial t}} + \nabla \cdot \left( { - \frac{{kk_{rw} }}{{\mu_{{\rm w}} }}\nabla p_{{\rm w}} - k_{{\rm Tw}} \nabla T} \right) = 0 \\ \end{aligned}$$
(91)
$$\begin{aligned} & \left[ {\left( {1 - \varphi } \right)\rho_{{\rm s}} C_{{\rm s}} + \varphi S_{{\rm w}} \rho_{{\rm w}} C_{{\rm w}} + \varphi S_{{\rm g}} \rho_{{\rm g}} C_{{\rm g}} } \right]\frac{\partial T}{{\partial t}} \\ & \quad + \nabla \cdot \left[ { - \lambda_{{\rm eff}} \nabla T + \rho_{{\rm w}} C_{{\rm w}} T\left( { - \frac{{kk_{rw} }}{{\mu_{{\rm w}} }}\nabla p_{{\rm w}} - k_{{\rm Tw}} \nabla T} \right) + \rho_{{\rm g}} C_{{\rm g}} T\left( { - \frac{{kk_{{\rm rg}} }}{{\mu_{{\rm g}} }}\nabla p_{{\rm g}} - k_{{\rm Tg}} \nabla T} \right)} \right] = 0. \\ \end{aligned}$$
(92)

Thus, the weak form of above governing equations then can be derived by multiplying them by correspond test functions based on divergence and Gauss’s theorem as follows:

$$\begin{aligned} & \int_{\Omega } {\nabla \tilde{u} \cdot \left[ {G\nabla {{\varvec{u}} + }\left( {\frac{G}{1 - 2v}} \right)\nabla \cdot {\varvec{u}} - \alpha p_{{\rm w}} - \alpha \left( {1 - S_{{\rm w}} } \right)p_{{\rm c}} - K\beta_{{\rm s}} T} \right]} {\rm d}\Omega \\ & \quad - \int_{\Gamma } {\tilde{u} \cdot \left[ {G\nabla {{\varvec{u}} + }\left( {\frac{G}{1 - 2v}} \right)\nabla \cdot {\varvec{u}} - \alpha p_{{\rm w}} - \alpha \left( {1 - S_{{\rm w}} } \right)p_{{\rm c}} - K\beta_{{\rm s}} T} \right]} \cdot {\mathbf{n }}{\rm d}\Gamma = 0 \\ \end{aligned}$$
(93)
$$\begin{aligned} & \int_{\Omega } {\tilde{p}_{{\rm w}} \cdot \left( {\frac{{\varphi S_{{\rm w}} }}{{K_{{\rm w}} }} + \frac{{\varphi S_{{\rm g}} }}{{K_{{\rm g}} }} + \frac{\alpha - \varphi }{{K_{{\rm s}} }}} \right)} \frac{{\partial p_{{\rm w}} }}{\partial t}{\rm d}\Omega + \int_{\Omega } {\tilde{p}_{{\rm w}} \cdot } \left[ {\left( {\frac{{\varphi S_{{\rm g}} }}{{K_{{\rm g}} }} + \frac{\alpha - \varphi }{{K_{{\rm s}} }}S_{{\rm g}} } \right)\frac{{\partial p_{{\rm c}} }}{{\partial S_{{\rm w}} }}} \right]\frac{{\partial S_{{\rm w}} }}{\partial t}{\rm d}\Omega \\ & \quad + \int_{\Omega } {\tilde{p}_{{\rm w}} \cdot \left( \alpha \right)} \frac{{\partial \varepsilon_{v} }}{\partial t}{\rm d}\Omega + \int_{\Omega } {\tilde{p}_{{\rm w}} \cdot } \left( { - \left( {\alpha - \varphi } \right)\beta_{{\rm s}} - \varphi S_{{\rm w}} \beta_{{\rm w}} - \varphi S_{{\rm g}} \beta_{{\rm g}} } \right)\frac{\partial T}{{\partial t}} {\rm d}\Omega \\ & \quad - \int_{\Omega } {\nabla \tilde{p}_{{\rm w}} \cdot \left[ { - \frac{{kk_{rw} }}{{\mu_{{\rm w}} }}\nabla p_{{\rm w}} - \frac{{kk_{{\rm rg}} }}{{\mu_{{\rm g}} }}\nabla \left( {p_{{\rm w}} + p_{{\rm c}} } \right) - \left( {k_{{\rm Tw}} + k_{{\rm Tg}} } \right)\nabla T} \right]} {\rm d}\Omega \\ & \quad + \int_{\Gamma } {\tilde{p}_{{\rm w}} \cdot \left[ { - \frac{{kk_{rw} }}{{\mu_{{\rm w}} }}\nabla p_{{\rm w}} - \frac{{kk_{{\rm rg}} }}{{\mu_{{\rm g}} }}\nabla \left( {p_{{\rm w}} + p_{{\rm c}} } \right) - \left( {k_{{\rm Tw}} + k_{{\rm Tg}} } \right)\nabla T} \right]} \cdot {\mathbf{n}} {\rm d}\Gamma = 0 \\ \end{aligned}$$
(94)
$$\begin{aligned} & \int_{\Omega } {\tilde{S}_{{\rm w}} \cdot \left( {\frac{{\varphi S_{{\rm w}} }}{{K_{{\rm w}} }} + \frac{\alpha - \varphi }{{K_{{\rm s}} }}S_{{\rm w}} } \right)} \frac{{\partial p_{{\rm w}} }}{\partial t}{\rm d}\Omega + \int_{\Omega } {\tilde{S}_{{\rm w}} \cdot } \left[ {\left( {\frac{\alpha - \varphi }{{K_{{\rm s}} }}S_{{\rm w}} S_{{\rm g}} } \right)\frac{{\partial p_{{\rm w}} }}{{\partial S_{{\rm w}} }} + \varphi } \right]\frac{{\partial S_{{\rm w}} }}{\partial t}{\rm d}\Omega \\ & \quad + \int_{\Omega } {\tilde{S}_{{\rm w}} \cdot \left( {\alpha S_{{\rm w}} } \right)} \frac{{\partial \varepsilon_{v} }}{\partial t}{\rm d}\Omega + \int_{\Omega } {\tilde{S}_{{\rm w}} \cdot } \left( { - \left( {\alpha - \varphi } \right)S_{{\rm w}} \beta_{{\rm s}} - \varphi S_{{\rm w}} \beta_{{\rm w}} } \right)\frac{\partial T}{{\partial t}} {\rm d}\Omega \\ & \quad - \int_{\Omega } {\nabla \tilde{S}_{{\rm w}} \cdot \left( { - \frac{{kk_{rw} }}{{\mu_{{\rm w}} }}\nabla p_{{\rm w}} - k_{{\rm Tw}} \nabla T} \right)} {\rm d}\Omega + \int_{\Gamma } {\tilde{S}_{{\rm w}} \cdot \left( { - \frac{{kk_{rw} }}{{\mu_{{\rm w}} }}\nabla p_{{\rm w}} - k_{{\rm Tw}} \nabla T} \right)} \cdot {\mathbf{n}} {\rm d}\Gamma = 0 \\ \end{aligned}$$
(95)
$$\begin{aligned} & \int_{\Omega } {\tilde{T} \cdot } \left[ {\left( {1 - \varphi } \right)\rho_{{\rm s}} C_{{\rm s}} + \varphi S_{{\rm w}} \rho_{{\rm w}} C_{{\rm w}} + \varphi S_{{\rm g}} \rho_{{\rm g}} C_{{\rm g}} } \right]\frac{\partial T}{{\partial t}}{\rm d}\Omega \\ & \quad - \int_{\Omega } {\nabla \tilde{T} \cdot \left[ { - \lambda_{{\rm eff}} \nabla T + \rho_{{\rm w}} C_{{\rm w}} T\left( { - \frac{{kk_{rw} }}{{\mu_{{\rm w}} }}\nabla p_{{\rm w}} - k_{{\rm Tw}} \nabla T} \right) + \rho_{{\rm g}} C_{{\rm g}} T\left( { - \frac{{kk_{{\rm rg}} }}{{\mu_{{\rm g}} }}\nabla p_{{\rm g}} - k_{{\rm Tg}} \nabla T} \right)} \right]} {\rm d}\Omega \\ & \quad + \int_{\Gamma } {\tilde{T} \cdot \left[ { - \lambda_{{\rm eff}} \nabla T + \rho_{{\rm w}} C_{{\rm w}} T\left( { - \frac{{kk_{rw} }}{{\mu_{{\rm w}} }}\nabla p_{{\rm w}} - k_{{\rm Tw}} \nabla T} \right) + \rho_{{\rm g}} C_{{\rm g}} T\left( { - \frac{{kk_{{\rm rg}} }}{{\mu_{{\rm g}} }}\nabla p_{{\rm g}} - k_{{\rm Tg}} \nabla T} \right)} \right]} \cdot {\mathbf{n}} {\rm d}\Gamma = 0, \\ \end{aligned}$$
(96)

where \(\widetilde{\text{u}}\), \({\widetilde{\text{p}}}_{\text{w}}\), \({\widetilde{\text{S}}}_{\text{w}}\) and \(\widetilde{\text{T}}\) are the test functions.

To simplify Eqs. (94)–(96), the following intermediate variables are defined, including:

$$\zeta_{1} = \frac{{\varphi S_{{\rm w}} }}{{K_{{\rm w}} }} + \frac{{\varphi S_{{\rm g}} }}{{K_{{\rm g}} }} + \frac{\alpha - \varphi }{{K_{{\rm s}} }}$$
(97)
$$\zeta_{2} = \left( {\frac{{\varphi S_{{\rm g}} }}{{K_{{\rm g}} }} + \frac{\alpha - \varphi }{{K_{{\rm s}} }}S_{{\rm g}} } \right)\frac{{\partial p_{{\rm w}} }}{{\partial S_{{\rm w}} }}$$
(98)
$$\zeta_{3} = - \left( {\alpha - \varphi } \right)\beta_{{\rm s}} - \varphi S_{{\rm w}} \beta_{{\rm w}} - \varphi S_{{\rm g}} \beta_{{\rm g}}$$
(99)
$$\chi_{1} = \frac{{kk_{rw} }}{{\mu_{{\rm w}} }}$$
(100)
$$\chi_{2} = \frac{{kk_{{\rm rg}} }}{{\mu_{{\rm g}} }}$$
(101)
$$\chi_{3} = k_{{\rm Tw}}$$
(102)
$$\chi_{4} = k_{{\rm Tg}}$$
(103)
$$\gamma_{1} = \frac{{\varphi S_{{\rm w}} }}{{K_{{\rm w}} }} + \frac{\alpha - \varphi }{{K_{{\rm s}} }}S_{{\rm w}}$$
(104)
$$\gamma_{2} = \left( {\frac{\alpha - \varphi }{{K_{{\rm s}} }}S_{{\rm w}} S_{{\rm g}} } \right)\frac{{\partial p_{{\rm w}} }}{{\partial S_{{\rm w}} }} + \varphi$$
(105)
$$\gamma_{3} = - \left( {\alpha - \varphi } \right)S_{{\rm w}} \beta_{{\rm s}} - \varphi S_{{\rm w}} \beta_{{\rm w}}$$
(106)
$$\varsigma_{1} = \left( {1 - \varphi } \right)\rho_{{\rm s}} C_{{\rm s}} + \varphi S_{{\rm w}} \rho_{{\rm w}} C_{{\rm w}} + \varphi S_{{\rm g}} \rho_{{\rm g}} C_{{\rm g}}$$
(107)
$$\varsigma_{2} = \lambda_{{\rm eff}}$$
(108)
$$\varsigma_{3} = \rho_{{\rm w}} C_{{\rm w}} T$$
(109)
$$\varsigma_{4} = \rho_{{\rm g}} C_{{\rm g}} T$$
(110)
$$\omega = \frac{{\partial p_{{\rm w}} }}{{\partial S_{{\rm w}} }}.$$
(111)

Moreover, by employing the finite-element interpolation function, the field variables to be solved, including displacement (u), water phase pressure (pw), water saturation (Sw), and temperature (T) can be rewritten in FEM formulation as

$${\varvec{u}} = {\mathbf{N}}_{{\rm u}} \cdot {\mathbf{U}}$$
(112)
$$p_{{\rm w}} = {\mathbf{N}}_{{\rm p}} \cdot {\mathbf{P}}$$
(113)
$$S_{{\rm w}} = {\mathbf{N}}_{{\rm s}} \cdot {\mathbf{S}}$$
(114)
$$T = {\mathbf{N}}_{{\rm T}} \cdot {\mathbf{T}}$$
(115)
$${\varvec{\varepsilon}} = {\mathbf{B}}_{{\rm u}} \cdot {\mathbf{U}}$$
(116)
$$\nabla p_{{\rm w}} = {\mathbf{B}}_{{\rm p}} \cdot {\mathbf{P}}$$
(117)
$$\nabla S_{{\rm w}} = {\mathbf{B}}_{{\rm s}} \cdot {\mathbf{S}}$$
(118)
$$\nabla T = {\mathbf{B}}_{{\rm T}} \cdot {\mathbf{T,}}$$
(119)

where Nu, Np, Ns, and NT are the shape functions of these field variables; U, P, S, and T are the vectors of variables at each node.

Thus, Eqs. (93)–(96) can be rewritten as

$$\begin{aligned} & \int_{\Omega } {\left( {{\mathbf{B}}_{{\rm u}}^{{\rm T}} {\mathbf{DB}}_{{\rm u}} {\rm d}\Omega } \right)} {\mathbf{ U}} - \int_{\Omega } {\left( {{\mathbf{B}}_{{\rm u}}^{{\rm T}} \alpha {\mathbf{N}}_{{\rm p}} {\rm d}\Omega } \right)} {\mathbf{ P}} - \int_{\Omega } {\left[ {{\mathbf{B}}_{{\rm u}}^{{\rm T}} \alpha \left( {1 - S_{{\rm w}} } \right)f\left( {S_{{\rm w}} } \right){\mathbf{N}}_{{\rm s}} {\rm d}\Omega } \right]} {\mathbf{ S}} \\ & \quad - \int_{\Omega } {\left( {{\mathbf{B}}_{{\rm u}}^{{\rm T}} K\beta_{{\rm s}} {\mathbf{N}}_{{\rm T}} {\rm d}\Omega } \right)} {\mathbf{ T}} = \int_{\Gamma } {{\mathbf{N}}_{{\rm u}}^{{\rm T}} \overline{t}_{n} \cdot {\mathbf{n}} {\rm d}\Gamma } \\ \end{aligned}$$
(120)
$$\begin{aligned} & \int_{\Omega } {\left( {{\mathbf{N}}_{{\rm p}}^{{\rm T}} \zeta_{1} {\mathbf{N}}_{{\rm p}} {\rm d}\Omega } \right)} {\dot{\mathbf{P}}} + \int_{\Omega } {\left( {{\mathbf{N}}_{{\rm p}}^{{\rm T}} \zeta_{2} {\mathbf{N}}_{{\rm s}} {\rm d}\Omega } \right)} {\dot{\mathbf{S}}} + \int_{\Omega } {\left( {{\mathbf{N}}_{{\rm p}}^{{\rm T}} \alpha {\mathbf{B}}_{{\rm u}} {\rm d}\Omega } \right)} {\dot{\mathbf{U}}} + \int_{\Omega } {\left( {{\mathbf{N}}_{{\rm p}}^{{\rm T}} \zeta_{3} {\mathbf{N}}_{{\rm T}} {\rm d}\Omega } \right)} {\dot{\mathbf{T}}} \\ & \quad + \int_{\Omega } {\left[ {{\mathbf{B}}_{{\rm p}}^{{\rm T}} \left( {\chi_{1} + \chi_{2} } \right){\mathbf{B}}_{{\rm p}} {\rm d}\Omega } \right]} {\mathbf{ P}} + \int_{\Omega } {\left( {{\mathbf{B}}_{{\rm p}}^{{\rm T}} \chi_{2} \omega {\mathbf{B}}_{{\rm s}} {\rm d}\Omega } \right)} {\mathbf{ S}} + \int_{\Omega } {\left[ {{\mathbf{B}}_{{\rm p}}^{{\rm T}} \left( {\chi_{3} + \chi_{4} } \right){\mathbf{B}}_{{\rm T}} {\rm d}\Omega } \right]} {\mathbf{ T}} \\ & \quad - \int_{\Gamma } {{\mathbf{N}}_{{\rm p}}^{{\rm T}} \left( {\chi_{1} + \chi_{2} } \right){\mathbf{B}}_{{\rm p}} {\mathbf{P}} \cdot {\mathbf{n}} {\rm d}\Gamma } - \int_{\Gamma } {{\mathbf{N}}_{{\rm p}}^{{\rm T}} \chi_{2} \omega {\mathbf{B}}_{{\rm s}} {\mathbf{S}}} \cdot {\mathbf{n}} {\rm d}\Gamma - \int_{\Gamma } {{\mathbf{N}}_{{\rm p}}^{{\rm T}} \left( {\chi_{3} + \chi_{4} } \right){\mathbf{B}}_{{\rm T}} {\mathbf{T}}} \cdot {\mathbf{n}} {\rm d}\Gamma = 0 \\ \end{aligned}$$
(121)
$$\begin{aligned} & \int_{\Omega } {\left( {{\mathbf{N}}_{{\rm s}}^{{\rm T}} \gamma_{1} {\mathbf{N}}_{{\rm p}} {\rm d}\Omega } \right)} {\dot{\mathbf{P}}} + \int_{\Omega } {\left( {{\mathbf{N}}_{{\rm s}}^{{\rm T}} \gamma_{2} {\mathbf{N}}_{{\rm s}} {\rm d}\Omega } \right)} {\dot{\mathbf{S}}} + \int_{\Omega } {\left( {{\mathbf{N}}_{{\rm s}}^{{\rm T}} \alpha {\mathbf{N}}_{{\rm s}} {\mathbf{SB}}_{{\rm u}} {\rm d}\Omega } \right)} {\dot{\mathbf{U}}} + \int_{\Omega } {\left( {{\mathbf{N}}_{{\rm s}}^{{\rm T}} \gamma_{3} {\mathbf{N}}_{{\rm T}} {\rm d}\Omega } \right)} {\dot{\mathbf{T}}} \\ & \quad + \int_{\Omega } {\left( {{\mathbf{B}}_{{\rm s}}^{{\rm T}} \chi_{1} {\mathbf{B}}_{{\rm p}} {\rm d}\Omega } \right)} {\mathbf{ P}} + \int_{\Omega } {\left( {{\mathbf{B}}_{{\rm s}}^{{\rm T}} \chi_{3} {\mathbf{B}}_{{\rm T}} {\rm d}\Omega } \right)} {\mathbf{ T}} - \int_{\Gamma } {\left( {{\mathbf{N}}_{{\rm s}}^{{\rm T}} \chi_{1} {\mathbf{B}}_{{\rm p}} \cdot {\mathbf{P}}} \right)} \cdot {\mathbf{n}} {\rm d}\Gamma - \int_{\Gamma } {\left( {{\mathbf{N}}_{{\rm s}}^{{\rm T}} \chi_{3} {\mathbf{B}}_{{\rm T}} \cdot T} \right)} \cdot {\mathbf{n}} {\rm d}\Gamma = 0 \\ \end{aligned}$$
(122)
$$\begin{aligned} & \int_{\Omega } {\left( {{\mathbf{N}}_{{\rm T}}^{{\rm T}} \varsigma_{1} {\mathbf{N}}_{{\rm T}} {\rm d}\Omega } \right)} {\dot{\mathbf{T}}} + \int_{\Omega } {\left[ {{\mathbf{B}}_{{\rm T}}^{{\rm T}} \left( {\varsigma_{2} + \varsigma_{3} \chi_{3} + \varsigma_{4} \chi_{4} } \right){\mathbf{B}}_{{\rm T}} {\rm d}\Omega } \right]} {\mathbf{ T}} + \int_{\Omega } {\left[ {{\mathbf{B}}_{{\rm T}}^{{\rm T}} \left( {\varsigma_{3} \chi_{1} + \varsigma_{4} \chi_{2} } \right){\mathbf{B}}_{{\rm p}} {\rm d}\Omega } \right]} {\mathbf{ P}} \\ & \quad + \int_{\Omega } {\left( {{\mathbf{B}}_{{\rm T}}^{{\rm T}} \varsigma_{4} \chi_{2} \omega {\mathbf{B}}_{S} {\rm d}\Omega } \right)} {\mathbf{ S}} - \int_{\Gamma } {\left[ {{\mathbf{N}}_{{\rm T}}^{{\rm T}} \left( {\varsigma_{2} + \varsigma_{3} \chi_{3} + \varsigma_{4} \chi_{4} } \right){\mathbf{B}}_{{\rm T}} {\mathbf{T}}} \right]} \cdot {\mathbf{n}} {\rm d}\Gamma \\ & \quad - \int_{\Gamma } {\left[ {{\mathbf{N}}_{{\rm T}}^{{\rm T}} \left( {\varsigma_{3} \chi_{1} + \varsigma_{4} \chi_{2} } \right){\mathbf{B}}_{{\rm p}} {\mathbf{P}}} \right]} \cdot {\mathbf{n}} {\rm d}\Gamma - \int_{\Gamma } {\left( {{\mathbf{N}}_{{\rm T}}^{{\rm T}} \varsigma_{4} \chi_{2} \omega {\mathbf{B}}_{S} {\mathbf{S}}} \right)} \cdot {\mathbf{n}} {\rm d}\Gamma = 0. \\ \end{aligned}$$
(123)

Then, the following variables are further introduced for simplification:

$${\mathbf{F}}_{{\rm u}} = \int_{\Gamma } {{\mathbf{N}}_{{\rm u}}^{{\rm T}} \overline{t}_{n} \cdot {\mathbf{n}} {\rm d}\Gamma }$$
(124)
$${\mathbf{F}}_{{\rm p}} = \int_{\Gamma } {{\mathbf{N}}_{{\rm p}}^{{\rm T}} \left( {\chi_{1} + \chi_{2} } \right){\mathbf{B}}_{{\rm p}} {\mathbf{P}} \cdot {\mathbf{n}} {\rm d}\Gamma } + \int_{\Gamma } {{\mathbf{N}}_{{\rm p}}^{{\rm T}} \chi_{2} \omega {\mathbf{B}}_{{\rm s}} {\mathbf{S}}} \cdot {\mathbf{n}} {\rm d}\Gamma + \int_{\Gamma } {{\mathbf{N}}_{{\rm p}}^{{\rm T}} \left( {\chi_{3} + \chi_{4} } \right){\mathbf{B}}_{{\rm T}} {\mathbf{T}}} \cdot {\mathbf{n}} {\rm d}\Gamma$$
(125)
$${\mathbf{F}}_{{\rm s}} = \int_{\Gamma } {\left( {{\mathbf{N}}_{{\rm s}}^{{\rm T}} \chi_{1} {\mathbf{B}}_{{\rm p}} \cdot {\mathbf{P}}} \right)} \cdot {\mathbf{n}} {\rm d}\Gamma + \int_{\Gamma } {\left( {{\mathbf{N}}_{{\rm s}}^{{\rm T}} \chi_{3} {\mathbf{B}}_{{\rm T}} \cdot T} \right)} \cdot {\mathbf{n}} {\rm d}\Gamma$$
(126)
$$\begin{aligned} {\mathbf{F}}_{{\rm T}} & = \int_{\Gamma } {\left[ {{\mathbf{N}}_{{\rm T}}^{{\rm T}} \left( {\varsigma_{2} + \varsigma_{3} \chi_{3} + \varsigma_{4} \chi_{4} } \right){\mathbf{B}}_{{\rm T}} {\mathbf{T}}} \right]} \cdot {\mathbf{n}} {\rm d}\Gamma \\ & \quad + \int_{\Gamma } {\left[ {{\mathbf{N}}_{{\rm T}}^{{\rm T}} \left( {\varsigma_{3} \chi_{1} + \varsigma_{4} \chi_{2} } \right){\mathbf{B}}_{{\rm p}} {\mathbf{P}}} \right]} \cdot {\mathbf{n}} {\rm d}\Gamma + \int_{\Gamma } {\left( {{\mathbf{N}}_{{\rm T}}^{{\rm T}} \varsigma_{4} \chi_{2} \omega {\mathbf{B}}_{S} {\mathbf{S}}} \right)} \cdot {\mathbf{n}} {\text{d}}\Gamma \\ \end{aligned}$$
(127)
$${\mathbf{M}}_{1} = \int_{\Omega } {\left( {{\mathbf{B}}_{{\rm u}}^{{\rm T}} {\mathbf{DB}}_{{\rm u}} {\rm d}\Omega } \right)}$$
(128)
$${\mathbf{Q}}_{1} = \int_{\Omega } {\left( {{\mathbf{B}}_{{\rm u}}^{{\rm T}} \alpha {\mathbf{N}}_{{\rm p}} {\rm d}\Omega } \right)}$$
(129)
$${\mathbf{W}}_{1} = \int_{\Omega } {\left[ {{\mathbf{B}}_{{\rm u}}^{{\rm T}} \alpha \left( {1 - S_{{\rm w}} } \right)f\left( {S_{{\rm w}} } \right){\mathbf{N}}_{{\rm s}} {\rm d}\Omega } \right]}$$
(130)
$${\mathbf{H}}_{1} = \int_{\Omega } {\left( {{\mathbf{B}}_{{\rm u}}^{{\rm T}} K\beta_{{\rm s}} {\mathbf{N}}_{{\rm T}} {\rm d}\Omega } \right)}$$
(131)
$${\mathbf{M}}_{2t} = \int_{\Omega } {\left( {{\mathbf{N}}_{{\rm p}}^{{\rm T}} \alpha {\mathbf{B}}_{{\rm u}} {\rm d}\Omega } \right)}$$
(132)
$${\mathbf{Q}}_{2t} = \int_{\Omega } {\left( {{\mathbf{N}}_{{\rm p}}^{{\rm T}} \zeta_{1} {\mathbf{N}}_{{\rm p}} {\rm d}\Omega } \right)}$$
(133)
$${\mathbf{W}}_{2t} = \int_{\Omega } {\left( {{\mathbf{N}}_{{\rm p}}^{{\rm T}} \zeta_{2} {\mathbf{N}}_{{\rm s}} {\rm d}\Omega } \right)}$$
(134)
$${\mathbf{H}}_{2t} = \int_{\Omega } {\left( {{\mathbf{N}}_{{\rm p}}^{{\rm T}} \zeta_{3} {\mathbf{N}}_{{\rm T}} {\rm d}\Omega } \right)}$$
(135)
$${\mathbf{Q}}_{2} = \int_{\Omega } {\left[ {{\mathbf{B}}_{{\rm p}}^{{\rm T}} \left( {\chi_{1} + \chi_{2} } \right){\mathbf{B}}_{{\rm p}} {\rm d}\Omega } \right]}$$
(136)
$${\mathbf{W}}_{2} = \int_{\Omega } {\left( {{\mathbf{B}}_{{\rm p}}^{{\rm T}} \chi_{2} \omega {\mathbf{B}}_{{\rm s}} {\rm d}\Omega } \right)}$$
(137)
$${\mathbf{H}}_{2} = \int_{\Omega } {\left[ {{\mathbf{B}}_{{\rm p}}^{{\rm T}} \left( {\chi_{3} + \chi_{4} } \right){\mathbf{B}}_{{\rm T}} {\rm d}\Omega } \right]}$$
(138)
$${\mathbf{M}}_{3t} = \int_{\Omega } {\left( {{\mathbf{N}}_{{\rm s}}^{{\rm T}} \alpha {\mathbf{N}}_{{\rm s}} {\mathbf{SB}}_{{\rm u}} {\rm d}\Omega } \right)}$$
(139)
$${\mathbf{Q}}_{3t} = \int_{\Omega } {\left( {{\mathbf{N}}_{{\rm s}}^{{\rm T}} \gamma_{1} {\mathbf{N}}_{{\rm p}} {\rm d}\Omega } \right)}$$
(140)
$${\mathbf{W}}_{3t} = \int_{\Omega } {\left( {{\mathbf{N}}_{{\rm s}}^{{\rm T}} \gamma_{2} {\mathbf{N}}_{{\rm s}} {\rm d}\Omega } \right)}$$
(141)
$${\mathbf{H}}_{3t} = \int_{\Omega } {\left( {{\mathbf{N}}_{{\rm s}}^{{\rm T}} \gamma_{3} {\mathbf{N}}_{{\rm T}} {\rm d}\Omega } \right)}$$
(142)
$${\mathbf{Q}}_{3} = \int_{\Omega } {\left( {{\mathbf{B}}_{{\rm s}}^{{\rm T}} \chi_{1} {\mathbf{B}}_{{\rm p}} {\rm d}\Omega } \right)}$$
(143)
$${\mathbf{H}}_{3} = \int_{\Omega } {\left( {{\mathbf{B}}_{{\rm s}}^{{\rm T}} \chi_{3} {\mathbf{B}}_{{\rm T}} {\rm d}\Omega } \right)}$$
(144)
$${\mathbf{H}}_{3t} = \int_{\Omega } {\left( {{\mathbf{N}}_{{\rm T}}^{{\rm T}} \varsigma_{1} {\mathbf{N}}_{{\rm T}} {\rm d}\Omega } \right)}$$
(145)
$${\mathbf{Q}}_{3} = \int_{\Omega } {\left[ {{\mathbf{B}}_{{\rm T}}^{{\rm T}} \left( {\varsigma_{3} \chi_{1} + \varsigma_{4} \chi_{2} } \right){\mathbf{B}}_{{\rm p}} {\rm d}\Omega } \right]}$$
(146)
$${\mathbf{W}}_{3} = \int_{\Omega } {\left( {{\mathbf{B}}_{{\rm T}}^{{\rm T}} \varsigma_{4} \chi_{2} \omega {\mathbf{B}}_{S} {\rm d}\Omega } \right)}$$
(147)
$${\mathbf{H}}_{3} = \int_{\Omega } {\left[ {{\mathbf{B}}_{{\rm T}}^{{\rm T}} \left( {\varsigma_{2} + \varsigma_{3} \chi_{3} + \varsigma_{4} \chi_{4} } \right){\mathbf{B}}_{{\rm T}} {\rm d}\Omega } \right]} .$$
(148)

Combining Eqs. (120)–(148), the governing equations (Eqs. (34), (40), (41) and (45)) can then be spatially discretized by FEM, so that a set of nonlinear equations can be written in FEM form as

$$\left\{ \begin{array}{ll} {\mathbf{M}}_{1} \cdot {\mathbf{U}} - {\mathbf{Q}}_{1} \cdot {\mathbf{P}} - {\mathbf{W}}_{1} \cdot {\mathbf{S}} - {\mathbf{H}}_{1} \cdot {\mathbf{T}} = {\mathbf{F}}_{{\rm u}} \hfill \\ {\mathbf{M}}_{2t} \cdot {\dot{\mathbf{U}}} + {\mathbf{Q}}_{2t} \cdot {\dot{\mathbf{P}}} + {\mathbf{W}}_{2t} \cdot {\dot{\mathbf{S}}} + {\mathbf{H}}_{2t} \cdot {\dot{\mathbf{T}}} + {\mathbf{Q}}_{2} \cdot {\mathbf{P}} + {\mathbf{W}}_{2} \cdot {\mathbf{S}} + {\mathbf{H}}_{2} \cdot {\mathbf{T}} = {\mathbf{F}}_{{\rm p}} \hfill \\ {\mathbf{M}}_{3t} \cdot {\dot{\mathbf{U}}} + {\mathbf{Q}}_{3t} \cdot {\dot{\mathbf{P}}} + {\mathbf{W}}_{3t} \cdot {\dot{\mathbf{S}}} + {\mathbf{H}}_{3t} \cdot {\dot{\mathbf{T}}} + {\mathbf{Q}}_{3} \cdot {\mathbf{P}} + {\mathbf{H}}_{3} \cdot {\mathbf{T}} = {\mathbf{F}}_{{\rm s}} \hfill \\ {\mathbf{H}}_{4t} \cdot {\dot{\mathbf{T}}} + {\mathbf{Q}}_{4} \cdot {\mathbf{P}} + {\mathbf{W}}_{4} \cdot {\mathbf{S}} + {\mathbf{H}}_{4} \cdot {\mathbf{T}} = {\mathbf{F}}_{{\rm T}} \hfill \\ \end{array} \right..$$
(149)

Then, using the backward difference method for time-domain discretization, the partial derivative with time of the variables in Eqs. (112)–(115) can be expressed as

$${\dot{\mathbf{U}}} = \frac{{{\mathbf{U}} - {\mathbf{U}}_{{\left( {t_{n} - 1} \right)}} }}{\Delta t}$$
(150)
$${\dot{\mathbf{P}}} = \frac{{{\mathbf{P}} - {\mathbf{P}}_{{\left( {t_{n} - 1} \right)}} }}{\Delta t}$$
(151)
$${\dot{\mathbf{S}}} = \frac{{{\mathbf{S}} - {\mathbf{S}}_{{\left( {t_{n} - 1} \right)}} }}{\Delta t}$$
(152)
$${\dot{\mathbf{T}}} = \frac{{{\mathbf{T}} - {\mathbf{T}}_{{\left( {t_{n} - 1} \right)}} }}{\Delta t},$$
(153)

where tn-1 is the previous time step.

Finally, substituting Eqs. (150)–(153) into Eq. (149), the FEM formulation of the unsaturated THM coupling model can be written in a compact form as

$$\left[ {\begin{array}{*{20}c} {{\mathbf{M}}_{1} } & { - {\mathbf{Q}}_{1} } & { - {\mathbf{W}}_{1} } & { - {\mathbf{H}}_{1} } \\ {{\mathbf{M}}_{2t} } & {{\mathbf{Q}}_{2t} + \Delta t{\mathbf{Q}}_{2} } & {{\mathbf{W}}_{2t} + \Delta t{\mathbf{W}}_{2} } & {{\mathbf{H}}_{2t} + \Delta t{\mathbf{H}}_{2} } \\ {{\mathbf{M}}_{3t} } & {{\mathbf{Q}}_{3t} + \Delta t{\mathbf{Q}}_{3} } & {{\mathbf{W}}_{3t} } & {{\mathbf{H}}_{3t} + \Delta t{\mathbf{H}}_{3} } \\ 0 & {\Delta t{\mathbf{Q}}_{4} } & {\Delta t{\mathbf{W}}_{4} } & {{\mathbf{H}}_{4t} + \Delta t{\mathbf{H}}_{4} } \\ \end{array} } \right]\left[ {\begin{array}{*{20}c} {\mathbf{U}} \\ {\mathbf{P}} \\ {\mathbf{S}} \\ {\mathbf{T}} \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} {{\mathbf{F}}_{{\rm u}} } \\ {\Delta t{\mathbf{F}}_{{\rm p}} + {\mathbf{M}}_{2t} {\mathbf{U}}_{{\left( {t_{n} - 1} \right)}} + {\mathbf{Q}}_{2t} {\mathbf{P}}_{{\left( {t_{n} - 1} \right)}} + {\mathbf{W}}_{2t} {\mathbf{S}}_{{\left( {t_{n} - 1} \right)}} + {\mathbf{H}}_{2t} {\mathbf{T}}_{{\left( {t_{n} - 1} \right)}} } \\ {\Delta t{\mathbf{F}}_{{\rm s}} + {\mathbf{M}}_{3t} {\mathbf{U}}_{{\left( {t_{n} - 1} \right)}} + {\mathbf{Q}}_{3t} {\mathbf{P}}_{{\left( {t_{n} - 1} \right)}} + {\mathbf{W}}_{3t} {\mathbf{S}}_{{\left( {t_{n} - 1} \right)}} + {\mathbf{H}}_{3t} {\mathbf{T}}_{{\left( {t_{n} - 1} \right)}} } \\ {\Delta t{\mathbf{F}}_{{\rm T}} + + {\mathbf{H}}_{4t} {\mathbf{T}}_{{\left( {t_{n} - 1} \right)}} } \\ \end{array} } \right].$$
(154)

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Ma, T., Liu, J., Fu, J. et al. Fully Coupled Thermo-hydro-mechanical Model for Wellbore Stability Analysis in Deep Gas-Bearing Unsaturated Formations Based on Thermodynamics. Rock Mech Rock Eng (2024). https://doi.org/10.1007/s00603-023-03703-7

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s00603-023-03703-7

Keywords

Navigation