Abstract
We propose a formulation for nonisothermal twocomponent twophase flow through deformable porous media. The approach covers phase transitions among both phases, i.e. liquid phase components evaporate into the gas phase while gas phase components dissolve or condensate into the liquid phase. These phase transitions always take place in thermodynamic equilibrium. The set of model equations is thereby largely independent of the specific constitutive relations. Starting from general equilibrium equations, we show the evolution of the system of weak formulations of all governing equations, which are then discretised with TaylorHood elements in a standard finite element approach. The model equations and the construction of the constitutive equilibria are implemented in the opensource simulator OpenGeoSys, which can be freely used and modified. To verify the implementation, we have selected a number of complementary test cases covering a wide range of process couplings. The numerical model is compared with analytical and semianalytical solutions of these problems as well as with experimental results. It is shown in the paper that by including thermodynamic effects, solid mechanics, and phase transition processes, the proposed numerical model covers many characteristic features of unsaturated geomaterials and can be employed for the description of a broad range of problems encountered in geotechnical engineering.
Article highlights

An opensource FEM tool for nonisothermal twophase flow in deformable porous or fractured media is presented in detail.

The model features phase transitions across both fluid phases based on simple equilibrium conditions.

A variety of benchmark tests is presented and compared to other software results and to exact solutions.
1 Introduction
Numerical models of multiphase flow have been used since the middle of the last century in reservoir engineering and environmental or hydrogeological research, where problems essentially focused on water and nonaqueous liquid interactions. Due to the complexity of the physical processes, those early models were often developed from empirical equations and observations (Hassanizadeh and Gray 1979a). With the upcoming theory of mixtures in the 1970s (Bear 1972; Atkin and Craine 1976; Bowen 1976), multiphase formulations were more frequently based on theoretical approaches, such as continuous fields methods or phaseaveraging methods, that describe phases as overlapping continua occupying the entire control volume (Hassanizadeh and Gray 1979b). Today, most numerical multiphase models are founded on continuum mechanical principles (Ehlers 2002; Ehlers and Blome 2003; De Boer 2012), although discontinuous approaches or hybrids of both methods do exist (Pan et al. 2016).
The main principle behind multiphase methods in the framework of porous or fractured media is the consideration of simultaneous flow of at least two immiscible fluids such as water, air, or variations of nonaqueous liquids. The continuum approach purposely ignores the exact inner boundaries between fluid and solid phases and instead assigns volume fractions to describe their continuous distribution over a defined control volume.
Especially if a gaseous phase is to be considered, thermodynamic effects must be included in the model development, since compression and expansion of gases are thermodynamic processes that are often accompanied by temperature changes. Moreover, basic thermodynamic considerations are crucial for capturing phase transition effects, which have a significant impact on pressure predictions in deforming porous media whose pores are filled by both liquids and gases. If components of the fluid phases undergo a phase change due to condensation, dissolution or evaporation, the corresponding energy cost must be considered in the energy balance of the multiphase body.
Furthermore, widely different fields of engineering tasks require the consideration of solid mechanics in order to evaluate structural safety, consolidation phenomena or the change of the porous solid’s properties in regard to fluid transport. This requires to account for the rate of change of linear momentum to be included in the set of balance equations and for an appropriate constitutive setting based on the generalised Biot theory (Biot 1941).
Mechanical models that account for fluid flow and heat transport are often referred to as thermohydromechanical (THM) models. Several THM codes are available in the literature. Many of them refer only to fully saturated conditions (Xu et al. 1999; Ai and Wang 2016; Zheng et al. 2017; Cui et al. 2018), to unsaturated media with an isobaric gas phase (Sheng et al. 2003; Rutqvist et al. 2008; Wang et al. 2009, 2015; Zhu et al. 2020), or to formulations that do not cover phase transitions (Schrefler and Xiaoyong 1993; Oettl et al. 2004; Klubertanz et al. 2003).
There is also a variety of models available that exclude mechanical processes (Pruess and Joseph 1984; Class et al. 2002; Pruess 2004; Bourgeat et al. 2013), or those that consider isothermal conditions only (Khoei and Mohammadnejad 2011; Dagher et al. 2019).
The isobaric gas phase approach uses the Richards approximation^{Footnote 1}. In this approximation, the gas phase pressure is considered constant and bulk gas flow is assumed to be instantaneous and thus ignored so that no mass balance equation for the gas phase is required. This approximation produces reasonable results only when gas permeability is large enough and the gas phase can drain freely (Wang et al. 2011). This statement indicates that the isobaricgas approach is not suitable for tasks involving the buildup of gas pressures or the evaluation of barrier performance when subjected to significant gas pressures. Such phenomena are of interest in several deep geotechnical applications such as geothermal reservoirs or repositories for nuclear waste disposal. For such applications, a flexible and fully tested modelling approach is advantageous, which can assess all phases of deep geological repositories for various geotechnical applications, i.e. their construction, operation and postoperational phases, within the same numerical setting.
Nonisothermal multiphase flow models, which take phase transitions and the deformation of the solid phase into account, are not often encountered so far. Examples of such simulators are implemented in the model environments CODE_BRIGHT (Olivella et al. 1996), MOOSE (Green et al. 2021) or are available as a combination of the simulator TOUGH and the commercial code FLAC\(^\text {3D}\) (Rutqvist 2011). Although these examples provide similar functionality to the model presented here, they have some disadvantages, either because they are not freely usable or because they do not have open source code, offer only a limited choice of constitutive relations, or because they only provide sequential couplings between processes, which are partly based on the exchange of text files.
In this paper, we propose a TH\(^2\)Mmodel, where H\(^2\) indicates the twophase character of our THM formulation. The nonisothermal formulation is founded on the theory of porous media, prominently developed by De Boer (2012); Ehlers (2002), and considers a triphasic medium consisting of a deformable and intrinsically compressible solid skeleton whose pores are filled by two immiscible fluid phases. Phase change and phase transitions from one fluid phase to another are permitted via evaporation, condensation, as well as dissolution of fluid constituents. Thus, this model approach is a twophase, twocomponent formulation. Both components can be transported in phase space, but are subject to the constraints of phase equilibrium.
Foremost fields of use for this model setup are geotechnical applications, such as radioactive waste disposal, carbon dioxide storage in geological formations, enhanced oil or gas recovery, or deep geothermal energy systems. In the context of nuclear waste management, the model is currently utilised for benchmark studies and the design of underground rock laboratory experiments (c.f. the DECOVALEX project^{Footnote 2} and the EURAD program,^{Footnote 3} BenVaSim project, cf. Lux and Rutenberg (2018)).
The consideration of solid mechanical processes is required to assess barrier integrity, soil consolidation or changes in host rock porosity or permeability in underground storage applications. It also allows the inclusion of shrinking and swelling processes and their effects on stress and displacement fields.
The inclusion of phase transition processes provides knowledge of phase compositions, which permits detailed investigations of physical phenomena such as vapour diffusion or buoyancydriven advective flow. For example, the dissolution of gases (e.g. hydrogen) in porewater is one of the main processes responsible for the reduction of gas pressure in radioactive waste repositories. Phase transition processes are also important for geomechanical analyses, as otherwise fluid pore pressures (and thus effective stresses) may be quantified incorrectly (Khaledi et al. 2021). It must be noted here that our formulation does not cover the appearance or disappearance of individual phases. Such tasks require specific methods such as the switching of or the definition of persistent primary variables (Lauser et al. 2011; Bourgeat et al. 2009; Mahjoub et al. 2018).
In addition to increasing functionality of codes for numerical simulation of coupled multifield processes in fractured and porous media, the availability of mature opensource platforms as a starting point for further development and application is becoming a community effort. Opensource solutions are important for both flexibility and transparency. Flexibility is a prerequisite for workflow integration, i.e. seamless connection of simulation tools into data integration and data analytics frameworks (Kolditz et al. 2019). Providing transparent simulation tools is fundamental when it comes to improving public acceptance of largescale geotechnical projects which are often controversially discussed. Hence, since siting decisions are usually made by politicians on the basis of scientific suggestions, transparency is crucial to increase public confidence in scientific methods. Opensource workflows require significant extra effort for quality assurance on the side of the scientific community concerning software engineering including version management, automated benchmarking, peerreview for code development etc. The presented TH\(^2\)M model is implemented into the OpenGeoSys (Bilke et al. 2019) framework and permanently available through the related GitLab repository.^{Footnote 4} OpenGeoSys offers a variety of coupled processes, including those featuring multiple fluid phases. However, the presented paper offers the first monolithically coupled model of nonisothermal twophase flow with mechanics
The structure of this article is as follows. As part of the introduction, we summarise all assumptions made during the development of the formulation.
In Sect. 3, the mathematical framework based on continuum mechanical balance equations is outlined, followed by a detailed description of the constitutive setting for phase equilibria as well as thermodynamical, mechanical and transport properties in Sect. 4. In Sect. 5, the balance equations are developed further to governing equations by applying further assumptions and by selecting primary variables. Then, weak formulations of the governing equations are obtained by applying a standard Bubnov–Galerkin procedure in Sect. 6. Section 7 describes briefly some aspects of the numerical implementation, while Sect. 8 presents a selection of benchmark tests for code verification purposes. Finally, Sect. 9 concludes and summarises the article and suggests necessary future work.
2 Notation and assumptions
The work at hand describes a triphasic body consisting of a deformable and intrinsically compressible solid skeleton phase \(\alpha =\mathrm {S}\) as well as two compressible, interstitial fluid phases \(\alpha \in \lbrace\mathrm {L,G}\rbrace\). The fluid phases are composed of the constituents \(\zeta \in \lbrace\mathrm {W,C}\rbrace\) that are allowed to cross the phase boundaries according to specified phaseequilibrium conditions. To conveniently describe the phase transitions, the fluidrelated equations are developed in terms of these constituents rather than actual phases. Therefore, the fluid constituent equations are perfectly symmetrical, since both constituents are allowed to cross phase boundaries and both are considered compressible.
We chose gas phase pressure \(p_\mathrm {GR}\) and capillary pressure \(p_\mathrm {cap}\) as primary variables for the hydraulic part of the formulation. While pressuresaturation approaches are often used since they allow for an easy assignment of boundary conditions, they are known for their inability to reproduce physical behaviour in heterogeneous media (unless upwind correction techniques are employed). Pressurepressure formulations allow for correct physical behaviour in this context without such correction (Park et al. 2011). For mechanical and thermodynamical processes, we use displacement of the solid phase \({{\varvec{u}}}_\mathrm {S}\) and temperature T as primary variables.
Multiphase fluid flow, solid deformation and temperature evolution affect each other strongly. Due to its high accuracy and numerical stability, we chose a monolithic coupling concept where all coefficients of the partial differential equations are assembled into one global matrixvector system and solved simultaneously.
Further assumptions that form the basis of our formulation include:

solid deformation follows the smallstrain approach, where absolutes of the displacement gradient remain below about \({5}\,{\%}\), so that linear kinematics can be used;

phase motion occurs in a quasistatic manner, \({{\varvec{a}}}_\alpha =0\).

local thermal equilibrium, \(T_\alpha =T\) is maintained;

all phases \(\alpha\) are compressible according to suitable equations of state;

phase transitions occur among fluid phases only;

interphase mass transfer occurs instantaneously and is thus subject to equilibrium conditions;
3 Balance equations
Considering a continuum mechanical approach, a multiphase system can be expressed as a mixture of constituents. According to mixture theory (cf. Green and Naghdi 1969; Passman et al. 1984), balance equations for an entire multiphase body can be assembled in the same manner as for individual constituents, insofar all interactions between all involved constituents are incorporated. Therefore, general balance equations can be taken directly from continuum mechanical methods of single phase bodies (Ehlers 2002).
A generic balance equation relates the temporal change of a quantity within some reference volume with effluxes over its boundary, supply resulting from external distance, and production due to interaction with other phases or constituents (internal interactions of the mixture). Which mechanical or thermodynamical quantities are necessary to be considered depends on the purpose of the model and its assumptions. In this work, it is sufficient to incorporate the balances of mass, linear and angular^{Footnote 5} momentum as well as the energy of the multiphase body.
3.1 Mass balance
The local form of the mass balance for an arbitrary phase \(\alpha\) can be written as
where \({\left( \bullet \right)^{\prime}_{ {\alpha }}}\) denotes the material time derivative of a quantity \(\bullet\) with respect to the phase velocity of \(\alpha\), and \(\hat{\rho }_{\alpha }\) are density production terms related to mass transfer from or to phase \(\alpha\). Here, we consider only physical interphase mass transfer of the constituents, i.e. the latter undergo no chemical alteration. Thus, the phase density production is given as
with \(\beta\) as phases other than \(\alpha\) and with \(\zeta\) as constituents residing in all phases. Indices \(\alpha \beta\) define the direction of mass transfer from phase \(\beta\) to phase \(\alpha\).
3.1.1 Solid phase
The solid phase consists of a single component \(\zeta _\mathrm {S}\) only, while mass exchange to other phases is precluded by assumption, such that
and for simplicity, it is convenient to write \(\rho ^{\zeta _S}_\mathrm {S}=\rho _\mathrm {S}\). Since there is no mass production, the mass balance equation for the solid phase simplifies to
where \({{\varvec{u}}}_\mathrm {S}\) as the displacement vector of the solid phase.
3.1.2 Component mass balance equation
The mass transfer terms \(\hat{\rho }_{\alpha }\) in (1) express the combination of all phase transitions of all constituents. In case that \(\alpha\) consists of multiple constituents (as in this work), it may be convenient to devise balance equations based on constituents \(\zeta\) within \(\alpha\), which yield
with component velocity \({{\varvec{v}}}^{\zeta }_{\alpha }={{\varvec{v}}}_{\alpha }+{{\varvec{d}}}^{\zeta }_{\alpha }\), which results from phase velocity \({{\varvec{v}}}_{\alpha }\) and diffusion velocity \({{\varvec{d}}}^{\zeta }_{\alpha }\). Except for the solid material, all components \(\zeta\) considered in this work can exist in both fluid phases \(\alpha \in \lbrace\mathrm {L,G}\rbrace\). To describe a component balance for the entire system, the mass balance equations for a balanced component \(\zeta\) are summed over all fluid phases. Since all phase transitions are restricted to fluid phases, the mass transfer terms disappear since mass fluxes of \(\zeta\) leaving one phase are equal and opposite to those entering the other phases.
When all material time derivatives are transformed into a solid phase reference frame, the mass balance for a constituent \(\zeta\) reads
with the diffusivedispersive mass flux \({{\varvec{J}}}^{\zeta }_{\alpha }=\rho ^{\zeta }_{\alpha }{{\varvec{d}}}^{\zeta }_{\alpha }\) and the advective mass flux \({{\varvec{A}}}^{\zeta }_{\alpha }=\rho ^{\zeta }_{\alpha }{{\varvec{v}}}_{\alpha }\rho ^{\zeta }_{\alpha }{\left( {{\varvec{u}}}_\mathrm {S}\right)^{\prime}_{\mathrm {S}}}=\rho ^{\zeta }_{\alpha }{{\varvec{w}}}_{\alpha \mathrm {S}}\), where \({{\varvec{w}}}_{\alpha \mathrm {S}}\) is the phase velocity relative to the movement of the solid phase. Continuing evaluation of the balance equation is aided by the introduction of phase saturation \(s_\alpha\) and phase volume fraction \(\phi _{\alpha }=\phi s_\alpha\), where phase saturation is the ratio of phase volume to the combined volume of all fluid phases and \(\phi\) is porosity. Phase saturation and porosity, together with the real (intrinsic) mass density, define the apparent mass density \(\rho _{\alpha }=\phi s_\alpha \rho _{\alpha \mathrm {R}}\). Temporal changes of \(\rho _{\alpha }\) are caused by the combined changes of all of those quantities.
The solid phase mass balance (4) can be inserted into (6) in order to eliminate porosity variations, which finally leads to
Note in passing, that this commonly used form of the mass balance already includes the assumption of a variable porosity—as can be observed by the different factor in front of the solid velocity divergence between Eq. (6) and Eq. 7—and requires specification of an equation of state for the intrinsic solid density evolution.
3.2 Balance of linear momentum
The variation of linear momentum of the multiphase body is caused by the combination of all acting forces. Thereby, it can be differentiated between body forces acting on the control volume (e.g. gravity) and forces acting on its surface. The local form of the balance of linear momentum can be written as
The partial stress tensor \({{\varvec{\sigma }}}_{\alpha }\) results from the partial surface traction vector \({{\varvec{t}}}_\alpha\) following Cauchy’s fundamental theorem \({{\varvec{t}}}_\alpha ={{\varvec{\sigma }}}_{\alpha }{{\varvec{n}}}\). A momentum production term \({{\varvec{{\hat{s}}_\alpha }}}\) has to be considered for a phaseformulation of the momentum balance equation, which results from direct momentum productions \(\hat{{{\varvec{p}}}}_{\alpha }\) and from material phase transition momenta \(\hat{\rho }_{\alpha }{{\varvec{v}}}_{\alpha }\). The production terms follow the constraint
Considering this constraint, the final balance equation of linear momentum can be written as
where \({{\varvec{a}}}_\alpha ={\left( {{\varvec{v}}}_{\alpha }\right)^{\prime}_{ {\alpha }}}\) is phase acceleration and \({{\varvec{b}}}_\alpha\) are specific body forces.
3.3 Energy balance
The total specific energy per unit mass is composed of the specific internal energy and the specific kinetic energy \(\frac{1}{2}{{\varvec{v}}}\cdot {{\varvec{v}}}\). The rate of change of total energy implies a change in both internal and kinetic energy and is equal to the work done by external body forces and surface tractions, the heat input by conduction and external supply, and energy production terms (e.g. due to phase transitions).
The local form of the total energy balance can be written as follows
with specific internal energy \(u_\alpha\). Since only small velocities are expected, all parts associated with kinetic energy are neglected. The term governing the power of the surface tractions can be expanded to
with the spatial velocity gradient \({{\varvec{l}}}_{\alpha }=\,\mathrm {grad}\,{{\varvec{v}}}_{\alpha }\) and the deviatoric part of the rate of deformation tensor \({{\varvec{d}}}_\alpha ^\mathrm {D}\). By incorporating the momentum balance equation (10) and neglecting deviatoric stress power contributions, we find
Rewriting time derivatives to follow the motion of the solid phase and introducing specific enthalpy^{Footnote 6}\(h_\alpha =u_\alpha +p_{\alpha }\rho _{\alpha }^{1}\), the final balance equation reads
In analogy to Sect. 3.1.2, the above equation can also be set up for arbitrary components \(\zeta\) in the phase \(\alpha\). One obtains
with the relative component velocity \({{\varvec{w}}}^{\zeta }_{\alpha \mathrm {S}}={{\varvec{v}}}^{\zeta }_{\alpha }{{\varvec{v}}}_\mathrm {S}\) considered relative to the solid phase.
4 Constitutive setting
The system of balance equations from the previous chapter has to be closed by a variety of constitutive relations, which in turn specify the necessary material properties and express the thermodynamic equilibrium between the constituents of liquid and gas phases. The specific choices of constitutive equations made in this section are used in the examples shown in Sect. 8, but the process equations are derived independently so that a large variety of material laws and equations of state can be utilised.
In order to describe the phase composition, we assume both fluid phases to consist of a binary mixture of components \(\mathrm {W}\) and \(\mathrm {C}\), where \(\mathrm {W}\) is considered the main component of the liquid phase \(\mathrm {L}\) (e.g. water) and \(\mathrm {C}\) is considered the component mainly present in the carrier gas phase \(\mathrm {G}\).
4.1 Fluid phase composition
As stated above, both constituents \(\mathrm {W}\) and \(\mathrm {C}\) exist in both fluid phases; their distribution among the phases follows a very basic equilibrium condition which is based on the ideal gas conception and Henry’s law. A more sophisticated phase equilibrium model for twophase flow applications is proposed in Grunwald et al. (2020).
4.1.1 Gas phase
Determining the composition of the gas phase, we assume that the sum of all constituents’ partial pressures accounts for the entire gas phase pressure (Dalton’s law). Therefore, the binary gas phase composition in terms of molar fractions \(x_{n,\mathrm {G}}^{\zeta }\) results in
with the partial pressure of water vapour \(p_\mathrm {GR}^\mathrm {W}\), which is derived from the saturation vapour pressure of pure water \(p_\mathrm {vap}^\mathrm {W}\). The saturation vapour pressure can be determined by the approximate ClausiusClapeyron equation,
or by using empirical relations such as the Antoine equation, which is simple to compute yet still produces very accurate results. It is given by
with \(A={10.1962}\), \(B={1730.63}\), and \(C={39.724}\) for water if \({274.15}{\,\mathrm{K}}\le T<{373.15}\,{\mathrm{K}}\) and \(A={10.2651}\), \(B={1810.94}\), and \(C={28.365}\) if \({373.15}\,{\mathrm{K}}\le T\le {647.15}\,{\mathrm{K}}\).
Vapour pressures derived from abovementioned methods refer to flat liquidvapour interfaces only. Above curved interfaces such as those prevailing in porous media, the vapour pressure may change depending on the direction of the curvature. In general, convex interfaces as on droplets have larger vapour pressures, concave surfaces exhibit smaller vapour pressures than flat interfaces.
The curvature of the vapourliquid interface in porous media is directly associated with wettability and the capillary pressure. Written in terms of capillary pressure, the KelvinLaplace equation can be used to evaluate the true vapour pressure above curved interfaces:
with \(M^\mathrm {W}\) and \(\rho^\mathrm{W}_\mathrm {LR}\) as molar mass of component \(\mathrm {W}\) and real mass density of the liquid phase. (19) shows that this effect is significant for very large capillary pressures only (to lower the vapour pressure by \({1}\,{\%}\) requires a capillary pressure of approx. \({1.3}\,{\mathrm{MPa}}\)), as they are characteristic for media with very small pores such as claystone.
4.1.2 Liquid phase
The concentration of component \(\mathrm {C}\) dissolved in the liquid phase is proportional to its partial pressure in the gas phase
with Henrycoefficient \(H^\mathrm {C}\). A relation for Henry coefficients as a function of temperature can be found in Sander (2015), which reads
where \(H^\zeta _\theta\) is given in \({\mathrm{mol\,m^{3} Pa^{1}}}\).
4.2 Mass density
4.2.1 Gas phase
The gas phase density can be determined using an appropriate equation of state for binary mixtures, such as the PengRobinson equation of state (Peng and Robinson 1976). For simplicity, we use the thermal equation of state of ideal gases in this work, which gives sufficient results at high temperatures and low pressures. A more realistic approach based on realgas equations of state is developed and described in detail in Grunwald et al. (2020). The ideal gas law for the entire gas phase and for gas phase constituents can be written as
with the average molar mass \(M_\mathrm {G}=\sum _\zeta x_{n,\mathrm {G}}^{\zeta }M^\zeta\) and constituent mass fraction \(x_{m,\mathrm {G}}^{\zeta }=\rho ^{\zeta }_\mathrm {GR}\rho _\mathrm {GR}^{1}\).
4.2.2 Liquid density
As a model for the liquid phase density, a simple, empirical multilinear equation of state can be fitted easily to measurement data in a state region of interest:
where \({\beta _{c,\mathrm {LR}}}\) is a liquid phase coefficient to describe density changes due to concentration changes of component \(\mathrm {C}\). With \(\rho _\mathrm {LR}=\Sigma _{\zeta =\mathrm {W,C}}\rho ^{\zeta }_\mathrm {LR}\) and \(\rho ^\mathrm {W}_\mathrm {LR}=\rho _\mathrm {LR}\left( p_\mathrm {LR},T,c^\mathrm {C}_\mathrm {L}=0\right)\), we find the partial density of dissolved gas in the liquid phase via (20) and (23) to
4.3 Specific enthalpy and specific internal energy
Specific enthalpies of the fluid phases are considered as functions of composition, realised as the mass fraction weighted sum of the constituents’ enthalpies,
with \(\Delta h^\mathrm {W}_\mathrm {L}=\Delta h^\mathrm {C}_\mathrm {G}=0\), \(\Delta h^\mathrm {W}_\mathrm {G}=\Delta h^\mathrm {W}_\mathrm {vap}\) is enthalpy of vaporisation, and \(\Delta h^\mathrm {C}_\mathrm {L}=\Delta h^\mathrm {C}_\mathrm {solv}\) is the enthalpy change of solution.
For determining the internal energy, contributions of the specific phase enthalpies and (for fluids) the pressure work are added:
In the case of the solid, this contribution is ignored and \(u_\mathrm {S}=h_\mathrm {S}\) applies. For a detailed discussion on this topic refer to Lion et al. (2017), for example.
4.4 Heat conduction
Heat conduction is driven by the temperature gradients and proportional to the heat conductivity tensor \({{\varvec{\lambda }}}_\alpha\). This relation is known as Fourier’s law and yields
When heat conduction occurs over multiple phases, a mixing rule can describe averaged heat conduction if local thermal equilibrium is assumed. In this case, we apply a very simple model (upper Wiener bound, Wiener (1912)) to find an effective heat conductivity by averaging individual phase conductivities by volume fraction,
which resembles a parallel conductivity model where the overall conductivity is the arithmetic mean of individual phase conductivities. Other thermal conductivity mixing rules are possible and the choice of the model strongly depends on the materials and material distributions present in the model domain. A large variety of proposed mixing models for thermal conductivity of unsaturated porous media is reviewed in detail by Dong et al. (2015) and Tong et al. (2009) provides multiple mixing rules for multiphase flow problems in particular.
4.5 Molecular diffusion
The diffusivedispersive mass flux \({{\varvec{J}}}^{\zeta }_{\alpha }\) results directly from the product of the component partial density \(\rho _{\alpha \mathrm {R}}^{\zeta }\) and the diffusion velocity of the component \({{\varvec{d}}}^{\zeta }_{\alpha }={{\varvec{v}}}^{\zeta }_{\alpha }{{\varvec{v}}}_{\alpha }\). This diffusion velocity denotes the difference between component velocity and phase velocity. In addition, Fick’s law describes the diffusive mass flux as a function of the concentration gradient. Given in form of mass fraction gradient (Hassanizadeh 1986a) it reads
with the effective molecular dispersion tensor \({{\varvec{D}}}_{\alpha ,\mathrm {m}}=\tau \phi _{\alpha }{{\varvec{D}}}_{\alpha }\). In Hassanizadeh (1986b), the general case of Fick’s law is described as
so that
describes the diffusivedispersive velocity of a component \(\zeta\) in the phase \(\alpha\). More sophisticated multicomponent gas diffusion models are discussed in e.g. Pisani (2008).
4.6 Viscosity
Dynamic viscosity of composite phases is obtained from the simple mixing rule
which computes the molar fraction averaged combined viscosity \(\mu _{\alpha \mathrm {R}}\) from constitutent viscosities \(\mu ^{\zeta }_{\alpha \mathrm {R}}\). More elaborate, classical mixing models can be found in Wilke (1950) for gases and in Grunberg and Nissan (1949) for liquids.
4.7 Saturation
Phase saturation \(s_\alpha\) is the volumetric fraction of phase \(\alpha\) within the pore space. It is considered in this work as a function of the capillary pressure only. Depending on the field of study, there are numerous different correlations available that correlate liquid phase saturation with capillary pressure, most prominently the works of Brooks and Corey (1964) or Van Genuchten (1980), which both are included in the material property library of our modelling platform. For more complex problems, the use of more sophisticated models is advisable. A detailed review of the existing soil properties can be consulted in Leong and Rahardjo (1997).
The BrooksCorey formulation accounts for residual saturations of both fluid phases and links effective saturation to capillary pressure by
where \(p_\text {b}\) is the entry pressure (i.e. the minimum capillary pressure for desaturation to occur) and \(\lambda\) is a parameter governing the shape of the curve. This effective saturation is defined by
with residual saturation \(s_\mathrm {L}^\mathrm {res}\) and maximum saturation \(s_\mathrm {L}^\mathrm {max}=1s_\mathrm {G}^\mathrm {res}\). Since only two fluid phases are present, it follows that
which constitutes the fundamental saturation constraint.
4.8 Relative permeability
Due to the existence of multiple phases within the pore space, the movement of a fluid phase is obstructed by the presence of the other phase. In multiphase flow applications, this effect is usually realised by introducing relative permeabilities as functions of saturation which calculate the effective permeability of each phase as described in the extended Darcy law.
Relative permeability models can be purely empirical or derived from theoretical pore network models. The latter have the advantage that they can be differentiated on the basis of capillary pressuresaturation relationships (Helmig 1997). Several formulations for relative permeability are included in OpenGeoSys’ material property library, such as Mualem (1976) or Brooks and Corey (1964) which both are based on the theoretical approach. The BrooksCorey models for wetting and nonwetting phases are
and
with empirical constant \(\lambda\) and entry pressure \(p_\text {b}\) from the BrooksCorey characteristic curve (33). Once more, the choice of the appropriate relative permeability model depends strongly on the problem under consideration.
4.9 Solid phase density and porosity
Assuming solid phase density being a function of temperature and the hydrostatic pressure in the solid, we recognize the latter is composed of pore fluid pressure \(p_\mathrm {FR}=s_\mathrm {G}p_\mathrm {GR}+s_\mathrm {L}p_\mathrm {LR}\) and an effective pressure \(p_\mathrm {E}\) resulting from effective stress,
The solid density rate follows
where \(K_\mathrm {SR}\) is the intrinsic bulk modulus of the solid grains and \(K_\mathrm {Sp}\) is the compression modulus of the grains measured under a change in pore pressure in unjacketed conditions. Now we split the total pressure rate into fluid and effective pressure rates. We further assume that volume changes associated with homogeneous temperature changes and homogeneous pore pressure changes (as in the aforementioned unjacketed test) do not cause a change in effective stresses:
where \(K_\mathrm {S}\) is the bulk modulus of the solid skeleton. This equation can be rearranged to introduce a modified effective stress that no longer does include an explicit dependency on the pore pressure^{Footnote 7}. Instead this effect is captured by the introduction of Biot’s coefficient \(\alpha _\mathrm {B}\):
with \({\left( \tilde{p}_\mathrm {E}\right)^{\prime}_{\mathrm {S}}} = {\left( p_\mathrm {E}\right)^{\prime}_{\mathrm {S}}} + (\alpha _\mathrm {B}1){\left( p_\mathrm {FR}\right)^{\prime}_{\mathrm {S}}}\). Total pressure and real solid pressure are equal in the unjacketed test while the effective pressure remains zero. Hence, experimentally we get \(K_\mathrm {Sp} = K_\mathrm {SR}\). The second term in (39) is treated by recognising that \(\partial p_\mathrm {SR}/\partial p_\mathrm {E} = (1\phi )^{1}\) and by substituting the definitions in (40):
with \(\beta _{p,\mathrm {SR}}=K_\mathrm {SR}^{1}\). From solid phase mass balance (4) we find
for the rate of porosity change.
4.10 Other relations
The compilation of constitutive equations is not meant to be complete here as this would go beyond the scope of this paper and is available in the cited textbooks above. We focus here on the constitutive theory important for the examples in Sect. 8 and from the viewpoint of code implementation presented in Sect. 7.
Some other essential and mostly standard constitutive relations will be given without detailed discussion in Sect. 5.
5 Governing equations
In this section, balance equations are specialised to the triphasic system \(\alpha \in \lbrace\mathrm {G,L,S}\rbrace\) and the independent unknowns are chosen to be gas pressure \(p_\mathrm {GR}\), capillary pressure \(p_\mathrm {cap}\), temperature T, and displacement \({{\varvec{u}}}_\mathrm {S}\).
5.1 Mass balance
From (7), the constituent mass balances are added for each fluid phase \(\alpha \in \lbrace\mathrm {G,L}\rbrace\), where the solid phase density derivative is replaced by (42). Expanding the remaining pore fluid pressure derivative leads to
with the abbreviations \({{\varvec{A}}}^{\zeta }={{\varvec{A}}}^{\zeta }_\mathrm {L}+{{\varvec{A}}}^{\zeta }_\mathrm {G}\) for combined constituent advective fluxes, \({{\varvec{J}}}^{\zeta }={{\varvec{J}}}^{\zeta }_\mathrm {L}+{{\varvec{J}}}^{\zeta }_\mathrm {G}\) for combined constituent diffusivedispersive fluxes, and \(\rho ^{\zeta }_\mathrm {FR}=s_\mathrm {G}\rho ^{\zeta }_\mathrm {GR}+s_\mathrm {L}\rho ^{\zeta }_\mathrm {LR}\) as an intrinsic effective constituent mass density. The dispersivediffusive mass fluxes are driven by gradients in constituent mass fraction \(x_{m,{\alpha }}^{\zeta }\). In this work, the distribution of a constituent \(\zeta\) among phases \(\alpha\) is governed by a phase equilibrium model fully determined locally by the thermodynamic state of the system. Therefore, the mass fractions are understood as functions of the independent unknowns that define the state of the multiphase body and the diffusivedispersive mass flux can be expanded as
with binary diffusivity defined in Sect. 4.5.
5.2 Momentum balance
The phase stress \({{\varvec{\sigma }}}_{\alpha }\) in the general momentum balance equation (10) can be split into parts contributed by the pore pressures and extra stresses
with \({{\varvec{\sigma }}}_{\alpha }^\text {E} \approx {{\varvec{0}}}\) for fluid phases \(\alpha \in \lbrace\mathrm {L,G}\rbrace\) due to the insignificance of the associated forces in comparison to pressure gradients and frictional interaction with the solid (Markert 2006). Written in terms of fluid phases only, (10) reads
into which an extra momentum production term \(\hat{{{\varvec{p}}}}_{\alpha }^\mathrm {E}=\phi _{\alpha }^2\mu _{\alpha }{k^\mathrm {rel}_{\alpha }}^{1}{{{\varvec{k}}}_\mathrm {S}}^{1}{{\varvec{w}}}_{\alpha \mathrm {S}}=\hat{{{\varvec{p}}}}_{\alpha }p_{\alpha \mathrm {R}}\,\mathrm {grad}\,\phi _{\alpha }\), which is found by evaluating of the entropy inequality^{Footnote 8} (cf. Ehlers and Blome 2003; Markert 2006; Nagel et al. 2013; Häberle 2017) can be inserted. This results in
which provides a generalised description of the fluid velocity (Darcyvelocity) relative to the porous medium.
In (48), \({k^\mathrm {rel}_{\alpha }}\left( s_\alpha \right)\) is a function of phase saturation and \({{{\varvec{k}}}_\mathrm {S}}\) is the intrinsic permeability of the porous medium.
Introducing Biot’s coefficient to account for the solid grain compressibility, we follow the general approach in Lewis and Schrefler (1998) to find the effective stress (see also the discussion in Sect. 4.9) for the solid phase to
where \(p_\mathrm {FR}=s_\mathrm {G}p_\mathrm {GR}+s_\mathrm {L}p_\mathrm {LR}\) is the overall pore fluid pressure. We consider the linear momentum balance of the entire multiphase body by summing up the balance equations for all phase momenta. From the constraints in (2) and (9) as well as assuming \({{\varvec{b}}}_\alpha \equiv {{\varvec{b}}}\), the overall aggregate momentum equation reduces to
with an overall effective density \(\rho =\phi _\mathrm {S}\rho _\mathrm {SR}+\phi _\mathrm {L}\rho _\mathrm {LR}+\phi _\mathrm {G}\rho _\mathrm {GR}\).
5.3 Energy balance
Following the assumption of local thermal equilibrium, the overall aggregate energy balance is obtained by summing (14) for all phases \(\alpha\) and components \(\zeta\) which cancels out all energy productions (\(\sum _\alpha {\hat{u}}_\alpha =0\)). Incorporating the momentum balances for fluids (47) we find \(\hat{{{\varvec{p}}}}_{\alpha }=\,\mathrm {grad}\,p_{\alpha }\rho _{\alpha }{{\varvec{b}}}_\alpha\) and by considering (9) and (25) we obtain the overall aggregate energy balance with
with the combined effective heat conduction \({{\varvec{q}}}=\sum _\alpha {{\varvec{q}}}_{\alpha }={{\varvec{\lambda }}}_\mathrm {eff}\,\mathrm {grad}\,T\) governed by Fourier’s law as described in Sect. 4.4.
6 Weak formulations
In this section, the balance equations for mass, linear momentum and energy are restated into weak forms by multiplication with a BubnovGalerkintype test function \(\delta a\,\) and integrated over the entire domain \(\Omega\).
6.1 Component mass balance
In this work, two constituents \(\zeta\) are considered where each component can exist in both fluid phases simultaneously. Therefore, (44) is applied for each constituent individually. The mass flux terms can be expanded using partial integration
and applying Gauß’ divergence theorem yields
where \({\dot{m}}^{\zeta }_\mathrm {AJ}\) are combined advective and diffusive fluxes of constituent \(\zeta\) across the domain boundaries (Neumann boundary conditions) and with \(\delta p\,\) as test function. By restoring the advective \({{\varvec{A}}}^{\zeta }\) and diffusive mass fluxes \({{\varvec{J}}}^{\zeta }\) by (45) and together with the definition of the Darcy velocity (48) we obtain with
the weak form of the mass balance equation for fluid constituents \(\zeta\). Thus, (54) is actually implemented twice, i.e. once for each \(\zeta \in \lbrace\mathrm {W,C}\rbrace\). Due to the mutual phase transition by evaporation and solution, and since both liquid and gas phases are considered compressible according to their equations of state, both implementations are perfectly symmetrical. However, the componentbased mass balances can be used traditionally as phase mass balances if no phase transitions occur. To put it clearly, if phase transitions are prevented by the constitutive setup (e.g. by constraining both saturation vapour pressure in (16) and Henrycoefficient in (20) to zero), (54) is reduced consequently to the classical mass balances of gas and liquid phase.
6.2 Momentum balance
Similar to the previous section, the linear momentum balance equation (50) is now integrated over the overall volume \(\Omega\) and multiplied by a vectorvalued test function \(\delta {{\varvec{u}}}_\mathrm {s}\,\). Substituting the total stress tensor defined in Sect. 5.2 and applying the divergence theorem, we find the weak formulation for the momentum balance to
with the total traction vector \({{\varvec{t}}}\) and with \(\delta {{\varvec{\epsilon }}}_\mathrm {s}\,=\text {sym}\,\,\mathrm {grad}\,\delta {{\varvec{u}}}_\mathrm {s}\,\).
6.3 Energy balance
Similar to mass and momentum balance equations, the energy governing equation, (51), is integrated over the domain \(\Omega\) and multiplied by a test function \(\delta T\,\). Conductive heat fluxes are governed by Fourier’s law (28). The advective and conductivediffusive heat fluxes split into internal heat transport and heat transport across the domain boundary \(\Gamma\). By applying the divergence theorem we find
7 Implementation
The weak forms of constituent mass balance, (54), overall aggregate momentum, (55), and energy balance, (56), are discretized using a standard finite element procedure. Thereby, the field of displacement unknowns \({{\varvec{u}}}_\mathrm {S}\) can be discretized by elements of higher order than the unknowns gas pressure \(p_\mathrm {GR}\), capillary pressure \(p_\mathrm {cap}\), and temperature T, utilising TaylorHoodelements. For the temporal discretization using a BackwardEuler scheme, a variable time step length \(\Delta t\) is employed. Scalarvalued unknowns a and test functions \(\delta a\,\), their rates and gradients are approximated via
where \({{\varvec{ {N}}}}_a(\mathbf {x})\) are row vectors of appropriate shape functions and \({{\varvec{{\hat{a}}}}}\) are column vectors of nodal degrees of freedom, represented by
The entries \(\mathrm {N}_a^i(\mathbf {x})\) are the interpolation weights associated with node i of the finite element at position \(\mathbf {x}\)^{Footnote 9} .
For the description of displacement processes it is advantageous to express vector and tensor values in the form of column matrices while maintaining their tensor character (Nagel et al. 2016). The vectorvalued displacement \({{\varvec{u}}}_\mathrm {S}\) and the scalar volume strain rate \(\,\mathrm {div}\,\left( {{\varvec{u}}}_\mathrm {S}\right)^{\prime}_{\mathrm {S}}\) are approximated by
with \({{\varvec{m}}}\) as the vectorial counterpart of the identity tensor \({{\varvec{ {I}}}}\) given by \({{\varvec{m}}}^\mathrm {T}=\left[ 1\,1\,1\,0\,0\,0\right]\) and with quadratic shape functions \({{\varvec{ {N_u}}}}\) arranged such that the resulting matrix accommodates for vectorial nodal unknowns. \({{\varvec{ {B}}}}_u\) is the corresponding straindisplacement matrix; cf. Nagel et al. (2016) for implementational details.
Instead of analytically expanding the time derivatives of secondary variables in terms of the independent unknowns, they are approximated here by backward difference quotients directly. Due to the temporal discretization of the numerical method, this has proven to represent more accurate rates than using derivatives only exact in the limit \(\Delta t \rightarrow 0\) (Celia et al. 1990). We use the notation
with \(y^{t+\Delta t}\) denoting a function evaluation at the current time step, \(y^t\) at the previous time step and \(\Delta t\) as the time step size.
The discretised forms of the component mass balances, momentum and energy balances are listed in Sect. 1. The resulting system of equations is solved in a monolithic way using an incremental iterative NewtonRaphson scheme.
The set of equations together with the constitutive setting is implemented into the opensource software OpenGeoSys (Kolditz et al. 2012; Bilke et al. 2019), which can be downloaded from the project website^{Footnote 10}. Together with the source code, the website provides an automated documentation of the code and a large variety of test cases and benchmark tests that verify the implementation and can be used as starting points for new users in order to develop own numerical models. The quality of the software is maintained by using stateofthe art development tools such as git, and new contributions to the source code are subjected to a peerreview process.
8 Verification
Approximate numerical solutions of coupled, nonlinear problems are usually verified by comparison to closedform solutions. Those exact solutions exist only for a very limited range of spatial domains or for simplified constitutive settings (Kolditz et al. 2015). To our knowledge, there is no closedform solution available that covers all aspects of nonisothermal twophase flow in deformable media as described in this work. There are a few examples with roughly the same functionality (cf. LaForce et al. 2014a, b), but these do not consider phase transitions or diffusion processes. Instead, the task of verifying the developed set of equations was split up into several parts. Thereby, the complexity of the equation system is reduced to simpler combinations of the individual physical processes, cf. Fig. 2.
Each of the meaningful subsets of process combinations can then be tested against closedform solutions or the results of physical experiments. An entire set of test cases (benchmark tests) is produced to verify the individual terms in the system of equations presented in previous chapters.
All of these test cases are available on the project website^{Footnote 11}, where they can be downloaded together with the source code of the entire modelling platform. Examples of the first and second levels of simplification, i.e. TH (Sect. 8.1), THM (Sect. 8.2), TH\(^2\) (Sect. 8.3), and H\(^2\)M benchmarks (Sect. 8.4), respectively, are shown and explained in detail in the following sections.
8.1 TH: Isentropic gas compression
In this test, the thermodynamic relationships between gas pressure, temperature and density are tested. For that, a cubeshaped domain consisting of an ideal gas is compressed by 50 % of its initial volume over a short period of time, starting from the top surface. The boundaries of that domain are impermeable to fluid flow, therefore gas pressure and density must increase as a result of the decreasing volume. Since energy flow across the boundaries is also prevented, this compression is an adiabatic change of state. No frictional losses are taken into account, so the process can be reversed at any time and the entropy in the overall system remains constant. The mass balance for such a system can be found by simplifying (7). With \(\phi =s_\mathrm {G}=\alpha _\mathrm {B}=1\) and \({{\varvec{A}}}^{\zeta }_{\alpha }={{\varvec{J}}}^{\zeta }_{\alpha }=0\) one obtains
or
where \({\left( e\right)^{\prime}_{\mathrm {S}}}=\,\mathrm {div}\,\left( {{\varvec{u}}}_\mathrm {S}\right)^{\prime}_{\mathrm {S}}\) is the volume strain rate. This function can now be integrated over the density interval \(\left[ \rho ^\mathrm {0}_\mathrm {GR},\rho _\mathrm {GR}\right]\) and the volume strain interval [0, e] so that the final evolution equation of the gas density is given by
with initial gas density \(\rho ^\mathrm {0}_\mathrm {GR}\). The evolution of gas pressure can be found in a similar way from the energy balance (51). Without fluid velocities, heat conduction, or gravity, the energy balance for the gas in this case simplifies to
with \(u_\mathrm {G}=h_\mathrm {G}p_\mathrm {GR}\rho _\mathrm {GR}^{1}\) and with \(h_\mathrm {G}=c_{p\mathrm {G}}T\). For ideal gases, Mayer’s relation can be simplified to \(T\left( c_{p\mathrm {G}}c_{v\mathrm {G}}\right) =p_\mathrm {GR}\rho _\mathrm {GR}^{1}\), such that it follows
when \(c_{v\mathrm {G}}\) is considered constant and using the definition of the adiabatic index \(\kappa =c_{v\mathrm {G}}c_{p\mathrm {G}}^{1}\). The equation can be integrated over the pressure interval \(\left[ p^\mathrm {0}_\mathrm {GR},p_\mathrm {GR}\right]\) and the volume strain interval [0, e] to find the solution for the pressure evolution
with initial gas pressure \(p^\mathrm {0}_\mathrm {GR}\). The temperature evolution follows Poisson’s equation for isentropic processes
with initial temperature \(T^\mathrm {0}\).
The numerical approach for this problem is carried out with a very simple setup. The gas cube is represented by a single quadrilateral element, which eliminates any transient fluid velocities or heat conduction effects. The liquid phase equation was disabled by defining \(s_\mathrm {G}=1\) as a constant parameter, which also prevents any phase transitions. Due to the simplification of the model, only the specific heat capacity and the molar mass of the gas phase remain as relevant material properties, which are given here as \(c_{p\mathrm {G}}={14.3}\,{\mathrm{kJ\,kg^{1}\,K^{1}}}\) and \(M_\mathrm {G}={0.002016}\,{\mathrm{kg\,mol^{1}}}\) and which correspond to molecular hydrogen. Other material properties do not affect the model result, except for those kept constant for manipulation and simplification of the complex TH\(^2\)M equation system: The saturation of the liquid phase remains at \(s_\mathrm {L}={0}\), the porosity of the medium and the Biot coefficient of the solid phase are given by \(\phi =\alpha _\mathrm {B}={1}\).
As can be seen from the equations (63), (66), and (67), the analytical solutions are scaled via the initial conditions. Thus, initial pressure and temperature are irrelevant in the numerical model as long as the gas density is consistently determined from the starting conditions via the ideal gas law. Compression is carried out by a displacement boundary condition of \(u_z={0.5}\,{\mathrm{m}}\) at the upper boundary of the domain, which is applied via a time ramp over a period of \({10}\,{\mathrm{s}}\). This time period is divided into 100 discrete time steps of \(\Delta t={0.1}\,{\mathrm{s}}\) each.
From Figure 3 it can be seen that the relative density when the cube is fully compressed (at \(t={10}\,{\mathrm{s}}\)) is about \({65}\,{\%}\) above its initial value. This fact may seem counterintuitive, after all, the height of the cube is shortened by \({50}\,{\%}\). Since no mass can escape, one could expect a doubling of the gas density. Here the effect of the assumption of small deformations made at the beginning of this paper becomes apparent: In this approach, the integration volume remains fixed at its initial value (reference configuration). Geometrical changes are only included to first order (linear kinematics). It can be deduced from the results of this example in which the height of the domain is shifted by \({50}\,{\%}\), this basic assumption is no longer valid.
Regardless, the analytical solutions (63), (66), and (67) as well as their numerical approximation are valid for the verification of the thermodynamic model. Both solutions agree very well in all cases, which shows that the constitutive approaches of specific internal energy, specific enthalpy and the contribution of pressure work have been implemented correctly.
8.2 THM: Consolidation around a point heat source
Containers with highly radioactive waste generate a lot of heat in the repository, which is released into the surrounding rock. A problem considering thermally induced expansion of liquid and solid phases resulting in thermal strain was first proposed by Booker and Savvidou (1985), who provided an analytical solution for temperature, pressure, displacement and stress evolution in a spherical domain around a point heat source. This work was later revised and clarified by Chaudhry et al. (2019).
A point heat source will increase the temperature within the biphasic domain that will cause expansion of the soil water and the solid skeleton. Since pore water expansion exceeds the expansion of the pore space of the skeleton, the rise of pore water pressure will cause a reduction of geomechanical effective stress. Over time, the pore water flow directed outwards will result in the dissipation of the pore water pressure and thereby the relaxation of the effective stresses.
We use the revised analytical solution (Chaudhry et al. 2019) to verify our numerical formulation. Therefore, our model complexity has to be reduced by one degree of freedom. This is realized by constraining capillary pressure to zero over the entire domain, while the gas phase pressure equation will take the role of the pore water. Since the analytical solution is developed for spherical domains, the numerical model domain is set up as a radial symmetrical quadrant, c.f. Fig. 4.
At boundaries \(x={0}\,{\mathrm{m}}\) and \(y={0}\,{\mathrm{m}}\), displacements in y or x direction are restricted while temperature and pressure are kept constant at the outer boundary at \(r={10}\,{\mathrm{m}}\). A constant heat source of \(q_\mathrm{th}={300}\,{\mathrm{J\,s^{1}}}\) is applied in the center an \(r={0}\,{\mathrm{m}}\). All material properties used in this test case are given in Table 1.
In Fig. 5, it can be seen that temperature and pore pressure at a point at \(r={0.5}\,{\mathrm{m}}\) rise over time as expected. The pressure buildup of the pore water causes an increase of the tensile stress in the solid, whose maximum occurs at approximately \(t={3.0\times 10^{5}}\,{\mathrm{s}}\). Overall, all parameters plotted in Fig. 5 show very good agreement with the analytical solution of the problem. The small deviations seen in the pressure and effective stress results are due to the fact that the analytical model contains expressions with an invariant density, while the numerical model updates density consistent with the specified thermal expansivities and compressibilities of the pore fluid. Thus, the deviation is the result of a simplification made in the derivation of the analytical solution but not in the numerical model.
8.3 TH\(^2\): Heat pipe
Similar to the former example, the test resembles a highlevel radioactive waste repository generating heat in a lowpermeable medium, which is this time considered rigid but of variable saturation. Driven by the heat source in the centre of the domain, liquid water evaporates and thus increases the vapour pressure in the gas phase. The resulting pressure gradient causes a gas flow directed away from the heat source. At the cooler parts of the domain, vapour condenses again and returns, driven by suction, as liquid water towards the heat source.
If the heat source is strong enough, the regions adjacent to the heat source will dry out entirely, while the distant regions are not affected by a change in saturation. In these two border regions, singlephase conditions prevail (gas phase at the heat source, liquid phase in the distant region, cf. Fig. 6). The region in between is a twophase region and represents the actual heat pipe zone. Here, the cycles of evaporation, gas flow, condensation and liquid backflow take place. In the stationary case, the mass flows of water vapour and liquid water are equal.
This test case was originally proposed by Udell (1985), who present a semianalytical solution of the problem. This solution is valid for the steadystate and the heatpipe region only. Departing from the method proposed by Udell (1985), the semianalytical solution in this work was extended as presented by Helmig (1997) to include ideal gas behaviour and a mixing rule for gas viscosity (cf. (32)). Although a radially symmetric version has been proposed for this purpose by Doughty and Pruess (1988), the classical, Cartesian formulation is used in this work to verify the numerical model. Schematics of the concept of this test are shown in Fig. 6.
A constant heat flow \(q_\text {th}={100}\,{\mathrm{W\,m^{2}}}\) is applied at the right model boundary \(x_\text {R}={1}\,{\mathrm{m}}\). Constant pressure and temperature conditions prevail at the left boundary \(x_\text {L}={0}\,{\mathrm{m}}\) of the domain. Consequently, the saturation and the molar fraction of air in the gas phase do not change with time at this point. Over time, a saturation profile forms with a gradient from the heated end to the cold end. In conjunction with the relationship between capillary pressure and saturation, this leads to a pressure gradient in the aqueous phase in the same direction. The pressure gradients of the two phases run in opposite directions, so that finally a stationary circular flow is established. The water vapour flows away from the heat source, taking with it the enthalpy of evaporation, which is released again during condensation. Since the condensed water simultaneously flows back to the heat source due to capillary forces, this enables a very efficient heat transfer. The steam pushes the nonwater gas component to the left, where parts of it leave the problem domain during the buildup of the steadystate.
Saturation and relative permeability models are governed by the Brooks–Corey formulations model (c.f. Sects. 4.7, 4.8). The model domain was discretized using a onedimensional mesh consisting of 200 quadrilateral elements with a width of \(\mathrm {d}x={0.5}\,{\mathrm{cm}}\) each. Initial and boundary conditions are shown in Fig. 6 and material properties are summarised in Table 2.
Resulting temperature, saturation, and air molar fraction distributions in the domain are shown in Fig. 7 at the steadystate, which establishes after \(t\approx {5\times 10^6}\,{\mathrm{s}}\). All three variables reproduce the results of the analytical solution very accurately. Due to the complexity of the processes involved, a successful implementation of the model equations and the constitutive relationships can therefore be assumed.
The length of the resulting heat pipe is approximately \({90}\,{\mathrm{cm}}\) In Fig. 7, it can be seen very clearly how the increasing vapour pressure caused by the rising temperature elevates the gas pressure. The resulting pressure gradient transports all air present in the domain to the left edge of the model. From approximately \(x={10}\,{\mathrm{cm}}\) there is almost no more air in the gas phase.
As expected, the temperature in the region does not rise significantly despite the constant heat source, but remains in the range of the boiling temperature of water. This is due to the fact that almost all supplied energy is used for the ongoing evaporation process (latent heat). The temperature difference between the left and right model boundary is about \(\Delta T={9}\,{\mathrm{K}}\), from which an apparent thermal conductivity of \(\lambda _\mathrm {HP}={11}\,{\mathrm{W\,m^{1}\,K^{1}}}\) can be derived (compare the individual thermal conductivities of the three phases present in the model area in Table 2). The heat pipe effect ensures that a considerably larger amount of heat is transported through the domain than would be the case with conventional conductive heat transport.
8.4 H\(^2\)M: Liakopoulos experiment
Multiphase flow coupled with consolidation is tested using the wellknown experiment of Liakopoulos (1964), which has become one of the most frequently consulted benchmark tests for multiphase flow processes in deformable media (cf. Schrefler and Xiaoyong 1993; Helmig 1997; Lewis and Schrefler 1998; Ehlers et al. 2004; Khoei and Mohammadnejad 2011; Asadi and AtaieAshtiani 2015). The physical experiment consisted of a narrow acrylic column with a length of \({1}\,{\mathrm{m}}\) packed with Del Monte sand. In order to guarantee uniform flow conditions, a continuous water supply was added to the top of the column while free water drainage was allowed at the bottom. Once a steadystate velocity profile was established in the sand column, the water supply was stopped (while the air passage was permitted) and the column began to drain from the top due to gravity.
The hydraulic properties of the porous medium were determined by Liakopoulos (1964) for their original experiment and were fitted to
and
For the gas phase relative permeability, a BrooksCorey model was used with a pore size distribution index of \(\lambda =3\), following
Figure 1 show the curves of those property functions in comparison to other models. While water density is constant, gas density is governed by the ideal gas law, where the molar mass of the gas corresponds to air \(M^\mathrm {C}={0.028949}\,{\mathrm{kg\,mol^{1}}}\). Mechanical parameters were not measured by Liakopoulos, therefore we follow the properties suggested by Lewis and Schrefler (1998). Those, and other essential material parameters of the test are given in Table 3.
The numerical model concept is shown in Fig. 8. At top and bottom boundaries, a constant atmospheric gas pressure boundary condition \(p_\mathrm {GR}={101.325}\,{\mathrm{kPa}}\) is applied, while capillary pressure at the bottom was fixed to \(p_\mathrm {cap}={0}\,{\mathrm{Pa}}\). Left and right boundaries of the domain are considered impermeable. Displacement in horizontal directions, as well as vertical displacement at the bottom of the column were restricted and a traction free boundary condition is applied at the top of the domain. Initial conditions correspond to fully saturated conditions with atmospheric gas pressure and zero capillary pressure, and the initial stress filed compensates initial pore pressures.
For this test case we apply two solution schemes: a twophase flow scheme and one with an isobaric gas field (Richards approximation) which has a constant uniform gas pressure of \(p_\mathrm {GR}={101.325}\,{\mathrm{kPa}}\) throughout the model domain. The overall simulation time is \(t={7200}\,{\mathrm{s}}\), where time step size increases from \(\Delta t={10}\,{\mathrm{s}}\) at the beginning to \(\Delta t={400}\,{\mathrm{s}}\) at the end of the simulation. The domain is discretized by a one dimensional arrangement of 44 quadrilateral elements.
In Fig. 9, the simulated profiles of gas phase pressure, capillary pressure, saturation, and vertical displacement are shown after \(t=5\), 10, 20, 30, 60, and \({120}\,{\mathrm{min}}\). At steadystate, the total consolidation settlement at the upper boundary of the column is \({1.6}\,{\mathrm{mm}}\) while the saturation does not drop below \({91}\,{\%}\) in both multiphase and Richards variants.
The results of both model variants (twophase and Richards flow) agree quite well with those of other authors as the comparison of gas pressure results in Fig. 10 suggests. Another comparison can be found in Fig. 11, where the simulated water pressures of different works are compared with the experimentally determined pressures in the original experiment. Both Figs. 10 and 11 show results from twophase simulations as well as those using the Richards approximation. As both figures show, the model results of different simulators differ slightly, especially in the transient stage. The reason for this can be found in slightly different model assumptions on which the individual models are built. The differences can be caused by: different minimum permeabilities of the gas phase, use of the ideal gas law or a constant gas density, consideration or omission of mechanical processes, as well as general differences in the numerical formulations (choice of primary variables, coupling schemes, equation solvers, etc.).
It should be noted that it is not the purpose of this article to make a comprehensive comparison of models and to investigate all differences thoroughly. Rather, the comparison of the different solutions is only intended to show that the results of all the works considered (both for the twophase formulation and for the Richards approximation) show close similarities that confirm the validity of the method proposed here.
9 Summary and Conclusions
In this work, we presented a fully coupled, nonisothermal twophase flow (TH\(^2\)M) model for deformable porous media. Phase transitions via evaporation, condensation and solution processes are considered and follow an equilibrium approach. Governing equations based on fundamental balance equations are developed to weak forms by a standard BubnovGalerkin scheme.
The new TH\(^2\)M model is equipped with a comprehensive set of test cases at different coupling levels. Both single processes (T, H, M), binary (TH, TM, H\(^2\), HM) and ternary (THM, TH\(^2\), H\(^2\)M) couplings are considered. No test example has yet been created for the complete TH\(^2\)M coupling; however, this will be made up for, either in the form of a (semi)analytical solution or by comparison with a suitable laboratory experiment.
Four test cases representing a broad range of physical phenomena were selected in this article to verify the implementation of the TH\(^2\)M formulation. These tests were selected because analytical/semianalytical solutions are available or because they have already been calculated with other codes and thus a basis for code comparison is available. The first benchmark in Sect. 8.1 compared the model results with simple exact solutions for isentropic gas compression to show the validity of the thermodynamic relations. The second test (Pointheatsource, Sect. 8.2) allowed the verification of the nonisothermal hydromechanical process part of the model formulation by comparing the simulation results to an exact solution. The third benchmark test (Heat pipe, Sect. 8.3) examines thermodynamic effects associated with evaporation and condensation of pore water. Finally, the fourth example (Liakopoulos, Sect. 8.4) showed the validity of the twophase flow formulation and its interaction with the mechanical process. Furthermore, it has been shown that the differences between twophase flow and the Richards approximation can be significant and have to be taken into account for similar cases, cf. Wang et al. (2011).
In addition to the systematic benchmarking procedure, the TH\(^2\)M model has been implemented in an opensource framework (OpenGeoSys) which benefits from professional software engineering (i.e. platform independence, continuous integration, consequent code review for maintaining software quality, automated testing etc.; see Bilke et al. (2019) for details). By choosing an opensource concept for our model, we want to achieve that scientific results can be better understood, acknowledged and improved. The model is freely available along with its test cases, documented and can be modified in order to fit specific needs. In this way, controversial projects, which have a significant impact on the environment, should meet with greater public acceptance.
Further developments of the model presented here are to be carried out in particular for application in the field of nuclear waste disposal. For the investigation of gas transport processes in artificial and natural barriers, the transition from dissolved gas transport within fully saturated media to viscocapillary twophase flow is to be examined more closely; for this purpose, it is planned to integrate the concept of persistent primary variables (c.f. Bourgeat et al. 2009) into the model assumptions. This will also allow phase transitions up to the complete disappearance of one of the phases to be considered. Another aspect of future development is the consideration of enhanced transport in the dilatancy zone induced by very high gas pressures. For this purpose, the mechanical process part is to be extended by damage models and coupled with improved permeability models (c.f. Zill et al. 2021; Yoshioka et al. 2022).
Notes
The balance of angular momentum remains implicit in this work, in which all apparent Cauchy stress tensors are considered symmetric.
Should deviatoric stress powers become nonnegligible, the specific enthalpy definition can be generalised accordingly for solids, e.g. \(h = u  \rho _\text {R}^{1}{{\varvec{S:E}}}\).
Note that the modified effective stress should not be used in strength assessment. Rather the yield function should take into account the compressibility contribution, i.e. the original effective pressure definition above.
Note that an extra term \(p_\mathrm {cap}s_\mathrm {L}^{1} \,\mathrm {grad}\,s_\mathrm {L}\) appears in the relation for the liquid’s Darcy velocity. This term is neglected here, see (Häberle 2017) and references therein for a discussion.
The number of nodes \(n_a\) can be different for different unknowns. In the present case (TaylorHood elements) it will be higher for displacement than for \(p_\mathrm {GR}\), \(p_\mathrm {cap}\) and T.
References
Ai ZY, Wang LJ (2016) Threedimensional thermohydromechanical responses of stratified saturated porothermoelastic material. Appl Math Model 40(21–22):8912–8933. https://doi.org/10.1016/j.apm.2016.05.034
Asadi R, AtaieAshtiani B (2015) A comparison of finite volume formulations and coupling strategies for twophase flow in deforming porous media. Comput Geotech 67:17–32. https://doi.org/10.1016/j.compgeo.2015.02.004
Atkin RJ, Craine RE (1976) Continuum theories of mixtures: basic theory and historical development. Q J Mech Appl Math 29(2):209–244. https://doi.org/10.1093/qjmam/29.2.209
Bandara S, Ferrari A, Laloui L (2016) Modelling landslides in unsaturated slopes subjected to rainfall infiltration using material point method. Int J Numer Anal Met 40(9):1358–1380. https://doi.org/10.1002/nag.2499
Bear J (1972) Dynamics of fluids in porous media. American Elsevier Publishing Company, New York
Bilke L, Bernd FT, Kalbacher OK, Helmig R, Nagel T (2019) Development of opensource porous media simulators: principles and experiences. Transp Porous Med 130(1):337–361. https://doi.org/10.1007/s11242019013101
Biot MA (1941) General theory of threedimensional consolidation. J Appl Phys 12(2):155–164. https://doi.org/10.1063/1.1712886
Booker JR, Savvidou C (1985) Consolidation around a point heat source. Int J Numer Anal Met 9(2):173–184. https://doi.org/10.1002/nag.1610090206
Bourgeat A, Granet S, Smaï F (2013) Compositional twophase flow in saturatedunsaturated porous media: benchmarks for phase appearance/disappearance. Simul Flow Porous Med 12:81–106. https://doi.org/10.1002/nag.1610090206
Bourgeat A, Jurak M, Smaï F (2009) Twophase, partially miscible flow and transport modeling in porous media; application to gas migration in a nuclear waste repository. Comput Geosci 13(1):29–42. https://doi.org/10.1007/s1059600891021
Bowen Ray M (1976) Theory of mixtures in continuum physics. In: Mixtures and electromagnetic field theories 3
Brooks RH, Corey AT (1964) Hydraulic properties of porous media. Colorado State University Hydrology Papers, Colorado State University
Celia MA, Bouloutas ET, Zarba RL (1990) A general massconservative numerical solution for the unsaturated flow equation. Water Resour Res 26(7):1483–1496. https://doi.org/10.1029/WR026i007p01483
Chaudhry AA, Jörg BO, Kolditz Nagel T (2019) Consolidation around a point heat source (correction and verification). Int J Numer Anal Met 43(18):2743–2751. https://doi.org/10.1002/nag.2998
Class H, Helmig R, Bastian P (2002) Numerical simulation of nonisothermal multiphase multicomponent processes in porous media: 1 An efficient solution technique. Adv Wat Resour 25(5):533–550. https://doi.org/10.1016/S03091708(02)000143
Cui W, Potts DM, Zdravković L, Gawecka KA, Taborda DMG (2018) An alternative coupled thermohydromechanical finite element formulation for fully saturated soils. Comput Geotech 94:22–30. https://doi.org/10.1016/j.compgeo.2017.08.011
Dagher EE, Nguyen TS, Infante Sedano JA (2019) Development of a mathematical model for gas migration (twophase flow) in natural and engineered barriers for radioactive waste disposal. Geol Soc Lond Specl Publ 48(1):115–148. https://doi.org/10.1144/SP482.14
De Boer R (2012) Theory of porous media: highlights in historical development and current state. Springer, Berlin
Dong Y, McCartney JS, Ning L (2015) Critical review of thermal conductivity models for unsaturated soils. Geotech Geol Eng 33(2):207–221. https://doi.org/10.1007/s1070601598432
Doughty C, Pruess K (1988) A semianalytical solution for heatpipe effects near highlevel nuclear waste packages buried in partially saturated geological media. Int J Heat Mass Trans 31(1):79–90. https://doi.org/10.1016/00179310(88)902244
Ehlers W (2002) Porous media: theory, experiments and numerical applications. Springer, Berlin
Ehlers W, Blome P (2003) A triphasic model for unsaturated soil based on the theory of porous media. Math Comput Model 37(5–6):507–513. https://doi.org/10.1016/S08957177(03)000438
Ehlers W, Graf T, Ammann M (2004) Deformation and localization analysis of partially saturated soil. Comput Method Appl M 193(27–29):2885–2910. https://doi.org/10.1016/j.cma.2003.09.026
Gawin D, Bernhard AS, Galindo M (1996) Thermohydromechanical analysis of partially saturated porous materials. Eng Comput. https://doi.org/10.1108/02644409610151584
Green AE, Naghdi PM (1969) On basic equations for mixtures. Q J Mech Appl Math 22(4):427–438. https://doi.org/10.1093/qjmam/22.4.427
Green CP, Andy W, Jonathan EK, Tara L (2021) Geomechanical response due to nonisothermal fluid injection into a reservoir. Adv Wat Resour 153:103942. https://doi.org/10.1016/j.advwatres.2021.103942
Grunberg L, Nissan AH (1949) Mixture law for viscosity. Nature 164(4175):799–800. https://doi.org/10.1038/164799b0
Grunwald N, Maßmann J, Kolditz O, Nagel T (2020) Noniterative phaseequilibrium model of the H2OCO2NaClsystem for largescale numerical simulations. Math Comput Simulat. https://doi.org/10.1016/j.matcom.2020.05.024
Häberle K (2017) Fluidphase transitions in a multiphasic model of CO$\(_2\)$ sequestration into deep aquifers: a fully coupled analysis of transport phenomena and solid deformations. PhD thesis. Universität Stuttgart
Hassanizadeh M, Gray WG (1979) General conservation equations for multiphase systems: 1 Averaging procedure. Adv Wat Resour 2:131–144. https://doi.org/10.1016/03091708(79)900253
Hassanizadeh M, Gray WG (1979) General conservation equations for multiphase systems: 2 Mass, momenta, energy, and entropy equations. Adv Wat Resour 2(4):191–203. https://doi.org/10.1016/03091708(79)900356
Hassanizadeh SM (1986) Derivation of basic equations of mass transport in porous media, Part 1 Macroscopic balance laws. AdvWat Resour 9(4):196–206. https://doi.org/10.1016/03091708(86)900242
Hassanizadeh SM (1986) Derivation of basic equations of mass transport in porous media, Part 2 Generalized Darcy’s and Fick’s laws. Adv Wat Resour 9(4):207–222. https://doi.org/10.1016/03091708(86)900254
Helmig R et al (1997) Multiphase flow and transport processes in the subsurface: a contribution to the modeling of hydrosystems. Springer, Berlin
Khaledi K, Hamdi P, Winhausen L, Jalali M, Jaeggi D, Amann F (2021) Unloading induced absolute negative pore pressures in a low permeable clay shale. Eng Geol. https://doi.org/10.1016/j.enggeo.2021.106451
Khoei AR, Mohammadnejad T (2011) Numerical modeling of multiphase fluid flow in deforming porous media: a comparison between twoand threephase models for seismic analysis of earth and rockfill dams. Comput Geotech 38(2):142–166. https://doi.org/10.1016/j.compgeo.2010.10.010
Klubertanz G, Bouchelaghem F, Laloui L, Vulliet L (2003) Miscible and immiscible multiphase flow in deformable porous media. Math Comput Model 37(5–6):571–582. https://doi.org/10.1016/S08957177(03)000505
Kolditz O, Bauer S, Lars Bilke N, Delfs Böttcher JO, Fischer T, Görke Uwe J, Kalbacher T, Georg Kosakowski CI, McDermott, et al (2012) OpenGeoSys: an opensource initiative for numerical simulation of thermohydromechanical/chemical (THM/C) processes in porous media. Environ Earth Sci 67(2):589–599. https://doi.org/10.1007/s126650121546x
Kolditz O, Shao H, Wang W, Bauer S (2015) Thermohydromechanicalchemical processes in fractured porous media: modelling and benchmarking closedform solutions. Springer, Berlin
Kolditz O, UweJens G, Haibing S, Hua S, Thomas N (2019) Workflows in Environmental Geotechnics: StatusQuo and Perspectives. Environ Sci Eng. https://doi.org/10.1007/9789811322211_6
LaForce T, EnnisKing J, Paterson L (2014a) Semianalytical solutions for nonisothermal fluid injection including heat loss from the reservoir: Part 1 Saturation and temperature. AdvWat Resour 73:227–241. https://doi.org/10.1016/j.advwatres.2014.08.008
LaForce T, Mijić A, EnnisKing J, Paterson L (2014b) Semianalytical solutions for nonisothermal fluid injection including heat loss from the reservoir: Part 2. Pressure and stress. AdvWat Resour 73:242–253. https://doi.org/10.1016/j.advwatres.2014.08.009
Lauser A, Hager C, Helmig R, Wohlmuth B (2011) A new approach for phase transitions in miscible multiphase flow in porous media. Adv Wat Resour 34(8):957–966. https://doi.org/10.1016/j.advwatres.2011.04.021
Leong EC, Rahardjo H (1997) Review of soilwater characteristic curve equations. J Geotech Geoenviron 123(12):1106–1117. https://doi.org/10.1061/(ASCE)10900241(1997)123:12(1106)
Lewis RW, Schrefler BA (1998) The finite element method in the static and dynamic deformation and consolidation of porous media. Wiley, New York
Liakopoulos AC (1964) Transient flow through unsaturated porous media. PhD thesis. University of California, Berkeley
Lion A, Mittermeier C, Johlitz M (2017) Heat capacities and volumetric changes in the glass transition range: a constitutive approach based on the standard linear solid. Continuum Mech Therm 29(5):1061–1079. https://doi.org/10.1007/s0016101605519
Lux KH, Rutenberg M (2018) VorprojektInternationales Benchmarking zur Verifizierung und Validierung von TH2MSimulatoren insbesondere im Hinblick auf fluiddynamische Prozesse in Endlagersystemen (Ben VaSim): Abschlussbericht zum BMWiForschungsvorhaben: Zeitraum: 01.07. 201630.04. 2017. Lehrstuhl für Deponietechnik und Geomechanik, Technische Universität Clausthal
Mahjoub M, Ahmed R, Michel T, Sylvie G, Sofia M, Jean T (2018) Numerical study of CallovoOxfordian argillite expansion due to gas injection. Int J Geomech 18(1):04017134. https://doi.org/10.1061/(ASCE)GM.19435622.0001050
Markert B (2006) Directional response of a reconstituted finegrained soil–Part II? Performance of different constitutive models. Int J Numer Anal Met 30(13):1303–1336
Mualem Y (1976) A new model for predicting the hydraulic conductivity of unsaturated porous media. Water Resour Res 12(3):513–522. https://doi.org/10.1029/WR012i003p00513
Nagel T, Görke UJ, Moerman KM, Kolditz O (2016) On advantages of the Kelvin mapping in finite element implementations of deformation processes. Environ Earth Sci 75(11):937. https://doi.org/10.1007/s1266501654294
Nagel T, Shao H, Singh AK, Watanabe N, Roßkopf C, Linder M, Wörner A, Kolditz O (2013) Nonequilibrium thermochemical heat storage in porous media: Part 1Conceptual model. Energy 60:254–270. https://doi.org/10.1016/j.energy.2013.06.025
Oettl G, Stark RF, Hofstetter G (2004) Numerical simulation of geotechnical problems based on a multiphase finite element approach. Comput Geotech 31(8):643–664. https://doi.org/10.1016/j.compgeo.2004.10.002
Olivella S, Gens A, Carrera J, Alonso EE (1996) Numerical formulation for a simulator (CODE\(_{\rm BRIGHT}\)) for the coupled analysis of saline media. Eng Comput 13(7):87–112
Pan P, Zhenhua W, Feng X, Yan F (2016) Geomechanical modeling of CO2 geological storage: a review. J Rock Mech Geotech Eng 8(6):936–947
Park CH, Böttcher N, Wenqing W, Kolditz O (2011) Are upwind techniques in multiphase flow models necessary? J Comput Phys 230(22):8304–8312. https://doi.org/10.1016/j.jcp.2011.07.030
Passman SL, Jace WN, Edward KW (1984) A theory of multiphase mixtures. Rational thermodynamics. Springer, Berlin, pp 286–325
Peng DY, Robinson DB (1976) A new twoconstant equation of state. Ind Eng Chem Fundam 15(1):59–64. https://doi.org/10.1021/i160057a011
Pisani L (2008) Multicomponent gas mixture diffusion through porous media: A 1D analytical solution. Int J Heat Mass Trans 51(3–4):650–660. https://doi.org/10.1016/j.ijheatmasstransfer.2007.04.043
Pruess K (2004) The TOUGH codesA family of simulation tools for multiphase flow and transport processes in permeable media. Vadose Zone J 3(3):738–746. https://doi.org/10.2136/vzj2004.0738
Pruess K, Joseph SYW (1984) Tough  a numerical model for nonisothermal unsaturated flow to study waste Canister Heating effects. Proc 26:1031–1038. https://doi.org/10.1557/PROC261031
Raats PAC, John HK (2018) The contributions of Lewis Fry Richardson to drainage theory, soil Physics, and the soilplantatmosphere continuum. Front Environ Sci 6:13. https://doi.org/10.3389/fenvs.2018.00013
Richardson LF (1922) Weather prediction by numerical process. Cambridge University Press, Cambridge
Rutqvist J (2011) Status of the TOUGHFLAC simulator and recent applications related to coupled fluid flow and crustal deformations. Comput Geosci 37:6. https://doi.org/10.1016/j.cageo.2010.08.006
Rutqvist J, Barr D, Birkholzer JT, Chijimatsu M, Kolditz O, Quansheng L, Oda Y, Wenqing W, Chengyuan Z (2008) Results from an international simulation study on coupled thermal, hydrological, and mechanical processes near geological nuclear waste repositories. Nucl Technol 163(1):101–109
Sander R (2015) Compilation of Henry’s law constants (version 4.0) for water as solvent. Atmos Chem Phys 15.8:4399–4981. https://doi.org/10.5194/acp1543992015
Schrefler BA, Scotta R (2001) A fully coupled dynamic model for twophase fluid flow in deformable porous media. Comput Method Appl M 190(24–25):3223–3246. https://doi.org/10.1016/S00457825(00)00390X
Schrefler BA, Xiaoyong Z (1993) A fully coupled model for water flow and airflow in deformable porous media. Water Resour Res 29(1):155–167. https://doi.org/10.1029/92WR01737
Sheng D, Sloan SW, Gens A, Smith DW (2003) Finite element formulation and algorithms for unsaturated soils Part I: Theory. Int J Numer Anal Met 27(9):745–765. https://doi.org/10.1002/nag.295
Tong F, Jing L, Zimmerman RW (2009) An effective thermal conductivity model of geological porous media for coupled thermohydromechanical systems with multiphase flow. Int J Rock Mech Mining Sci 46(8):1358–1369. https://doi.org/10.1016/j.ijrmms.2009.04.010
Udell Kent S (1985) Heat transfer in porous media considering phase change and capillaritythe heat pipe effect. Int J Heat Mass Trans 28(2):485–495. https://doi.org/10.1016/00179310(85)900821
Van Genuchten MT (1980) A closedform equation for predicting the hydraulic conductivity of unsaturated soils. Soil Sci Soc Am J 44(5):892–898. https://doi.org/10.2136/sssaj1980.03615995004400050002x
Wang W, Rutqvist J, Görke UJ, Birkholzer JT, Kolditz O (2011) Nonisothermal flow in low permeable porous media: a comparison of Richards’ and twophase flow approaches. Environ Earth Sci 62(6):1197–1207. https://doi.org/10.1007/s1266501006081
Wang W, Kosakowski G, Kolditz O (2009) A parallel finite element scheme for thermohydro mechanical (THM) coupled problems in porous media. Comput Geosci 35(8):1631–1641. https://doi.org/10.1016/j.cageo.2008.07.007
Wang X, Shao H, Wang W, Hesser J, Kolditz O (2015) Numerical modeling of heating and hydration experiments on bentonite pellets. Eng Geol 198:94–106. https://doi.org/10.1016/j.enggeo.2015.09.009
Wiener O (1912) Abhandl Math Phys. Kl. Königl. Sächsischen Gesell 32:509
Wilke CR (1950) A viscosity equation for gas mixtures. J Chem Phys 18(4):517–519. https://doi.org/10.1063/1.1747673
Xu T, Samper J, Ayora C, Manzano M, Custodio E (1999) Modeling of nonisothermal multicomponent reactive transport in field scale porous media flow systems. J Hydrol 214(1–4):144–164. https://doi.org/10.1016/S00221694(98)002832
Yoshioka K, Amir S, Mathias N, RalfMichael G, FrankWuttke Thomas F, Thomas N (2022) Numerical models of pressuredriven fluid percolation in rock salt: nucleation and propagation of flow pathways under variable stress conditions. Environ Earth Sci 81(5):139. https://doi.org/10.1007/s12665022102289
Zheng T, XingYuan M, Shao H, Kolditz O, Nagel T, Dmitri N (2017) A thermohydromechanical finite element model of freezing in porous mediathermomechanically consistent formulation and application to ground source heat pumps. In: COUPLED VII: proceedings of the VII International Conference on Computational Methods for Coupled Problems in Science and Engineering. CIMNE, pp 10081019
Zhu B, Zhigang Y, Lujun W, Deqiong K, Wenjie X, Kolditz O, Nagel T, Yunmin C (2020) Hydromechanical behavior of unsaturated soil surrounding a heated pipeline considering moisture evaporation and condensation. Comput Geotech 119:103377. https://doi.org/10.1016/j.compgeo.2019.103377
Zill F, Christoph L, Olaf K, Thomas N (2021) Hydromechanical continuum modelling of fluid percolation through rock salt. Int J Rock Mech Min Sci 147:104879. https://doi.org/10.1016/j.ijrmms.2021.104879
Acknowledgements
The authors gratefully acknowledge the funding provided partially by the German Federal Ministry of Education and Research (BMBF) for projects GeomInt and iCross, Grant Nos. 03G0866A, 03G0899D and 02NUK053E, as well as the Helmholtz Association (HelmholtzGemeinschaft e.V.) through the Impulse and Networking Funds (Grant No. SO093). Furthermore, this work has been cofinanced within the framework of EURAD, the European Joint Programme on Radioactive Waste Management (Grant Agreement No. 847593), German Federal Ministry for Economic Affairs and Energy (BMWi) for the CLUSTER project (Grant No. 03ET7031A), and the Federal Institute for Geosciences and Natural Resources (BGR). The authors deeply appreciate and thank all funding organisations for their support.
Funding
Open Access funding enabled and organized by Projekt DEAL.
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflict of interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.
Appendix A
Appendix A
1.1 Mass balances coefficients
1.1.1 Mass balance without phase transition
Gas pressure equation, where no \(\mathrm {C}\)constituent resides in the liquid phase (\(\rho ^\mathrm {C}_\mathrm {LR}=0\)), thus \(\rho ^\mathrm {C}_\mathrm {GR}=\rho _\mathrm {GR}\) and \(x_{m,\mathrm {G}}^\mathrm {C}=1\), \(\partial x_{m,\mathrm {G}}^\mathrm {C}=0\).
Capillary pressure equation, where no \(\mathrm {W}\)constituent resides in the gas phase (\(\rho ^\mathrm {W}_\mathrm {GR}=0\)), thus \(\rho ^\mathrm {W}_\mathrm {LR}\equiv \rho _\mathrm {LR}\), and molar fractions are always \(x_{m,\mathrm {L}}^\mathrm {W}=1\), \(x_{m,\mathrm {L}}^\mathrm {C}=0\), \(\partial x_{m,\mathrm {L}}^\mathrm {W}=0\).
1.2 Momentum balance coefficients
1.3 Energy balance coefficients
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Grunwald, N., Lehmann, C., Maßmann, J. et al. Nonisothermal twophase flow in deformable porous media: systematic opensource implementation and verification procedure. Geomech. Geophys. Geoenerg. Georesour. 8, 107 (2022). https://doi.org/10.1007/s40948022003942
Received:
Accepted:
Published:
DOI: https://doi.org/10.1007/s40948022003942
Keywords
 Nonisothermal twophase twocomponent flow
 Phase change
 Unsaturated soil mechanics
 Thermohydromechanical
 OpenGeoSys