  This paper presents the implementation of the eXtended Finite Element Method
(XFEM) in the general-purpose commercial software package COMSOL Multiphysics
for multi-field thermo-hydro-mechanical problems in discontinuous porous media.
To this end, an exclusive enrichment strategy is proposed in compliance with
the COMSOL modeling structure. COMSOL modules and physics interfaces are
adopted to take account of the relevant physical processes involved in
thermo-hydro-mechanical coupling analysis, namely: the mechanical deformation,
fluid flow in porous media and heat transfer. Essential changes are made to the
internal variables of the physics interfaces to ensure consistency in the
evaluation of enriched solution fields. The model preprocessing, level-set
updates, coupling of the relevant physics and postprocessing procedures are
performed adopting a coherent utilization of the COMSOL built-in features along
with the COMSOL LiveLink for MATLAB functions. The implementation process,
remedies for the treatment of the enriched zones, XFEM framework setup,
multiphysics coupling, numerical integration and numerical solution strategy
are described in detail. The capabilities and performance of the proposed
approach are investigated by examining several multi-field
thermo-hydro-mechanical simulations involving single/multiple discontinuities
in 2D/3D porous rock settings.
