1 Introduction

On the microscopic scale, displacement of multiple immiscible phases in cases where interfacial tension cannot be neglected is governed by elementary processes at liquid–liquid, liquid–gas, liquid–solid, and gas–solid interfaces involving capillary, viscous, and also inertial forces. Such situations are encountered in configurations that can be represented by capillaries, e.g., microfluidic devices and porous media. In particular, porous media are of large interest, due to their relevance for many natural processes in biology, geology, hydrology, and technical processes ranging from fuel cells to oil recovery and \(\hbox {CO}_{2}\) sequestration. Many researchers have studied such processes in porous media or transparent micromodels (Roof 1970; Chatzis and Dullien 1983; Lenormand et al. 1983; Lenormand 1990; Cramer 2004) and have identified a set of elementary microscopic processes into which multiphase flow during displacement can be decomposed. The accurate modeling of such processes poses a substantial challenge to numerical modeling, in particular with respect to simulating microscopically resolved displacement in relatively large systems, e.g., multiphase flow in porous media involving many thousands of pores.

To date, there are a number of techniques used for multiphase flow modeling including possible application for multiphase flows in pores. The most commonly known methods are (listed in alphabetical order) Cahn–Hilliard equation method, embedded interface, free boundary problem, lattice Boltzmann, level set, phase field, pore network, smooth particle hydrodynamics, and volume of fluid (VOF). These approaches address different challenges of the general problem, while having multiple advantages and disadvantages. Our overviews of these methods can be found elsewhere (Demianov et al. 2011, 2014) and are not repeated herein. We also refer the reader to the reviews by Anderson et al. (1998), Jakobsen (2008), Meakin and Tartakovsky (2009), Joekar-Niasar et al. (2012), Kim (2012), and Blunt et al. (2013).

In this work, we describe the density functional hydrodynamics (Dinariev 1995, 1998) and its application to the numerical study of basic multiphase phenomena. We start from a brief historical overview pertaining to this method. This overview is a reduced version of the more detailed one that is published elsewhere (Demianov et al. 2011, 2014).

Capillary action has been of scientific interest since the nineteenth century. Such famous scientists as Laplace, Young, and Gauss performed studies of equilibrium capillary surfaces even before 1830. Early studies by Poisson, Maxwell, and Gibbs provide the understanding that immiscible phases are separated not by a mathematical zero-thickness surface, but by a transition layer having finite thickness. Gibbs (1876) is also the author of the first consistent model of thermodynamic equilibrium between phases, which is still in use today. The first systematic works explaining the structure of the interfacial zone in the frame of the gradient approach were conducted by Rayleigh and van der Waals. In particular, van der Waals (1894) used his gradient theory to predict correctly the width of typical interfaces. Further on, Korteweg (1901) enhanced the existing gradient models by calculating the static stress tensor term responsible for surface tension.

Even with all their success, the first gradient theories of interfacial zone were phenomenological. However, a rigorous description is possible in the frame of the density functional theory (DFT), whose central idea is representation of energy of a heterogeneous system as a functional of densities of chemical components constituting this system. The first consistent results in this direction are related to Thomas–Fermi model of electron gas developed in 1927; see review in the book by Parr and Yang (1989). But the genuine interest in DFT occurred between 1964 and 1965 after the works by Hohenberg and Kohn (1964). Since then, a lot of works on this subject were published. The 1998’s Nobel prize in chemistry was awarded to Walter Kohn, the major contributor in developing the DFT. Currently, this approach has been successfully applied to quantum chemistry, nuclear physics, physics of semiconductors, superconductivity, and diamagnetics. In his Nobel lecture, Kohn (1999) has identified 13 various directions of possible DFT generalization, among them heterogeneous systems and Helmholtz free energy at finite temperatures. Density functional hydrodynamics (DFH) of multiphase compositional mixtures, developed by Dinariev (1995), can be considered as an example of such generalization of DFT. Previously, order parameter functional methods in hydrodynamics were used for separate set of problems by Hohenberg and Halperin (1977), Evans (1979), Harrowell and Oxtoby (1987), Emmerich (2003), and Onuki (2004). The DFH method presented here has no order parameter concept.

DFH uses classical mass, momentum, and energy conservation laws with specific constitutive relations. These constitutive relations are derived to ensure consistency between hydrodynamic and thermodynamic descriptions of multiphase compositional systems in the frame of the density functional approach. The specific expression for the density functional uses square gradients of molar densities, which enables description of surface tension. The thermodynamic state of the mixture is described by means of bulk and surface Helmholtz energies, where the latter enables correct description of liquid–solid interaction, i.e., wettability and adsorption. The detailed theory of DFH is provided in Sect. 2, and a simple solution to the DFH equations for 1D isothermal compositional flow is provided in the “Appendix 1.” Lastly, the simulations presented in this paper have been carried out by means of the direct hydrodynamic simulator (DHD) that is a numerical realization of DFH. This simulator is described briefly in Sect. 3.

Validation is a crucial step for any new modeling approach. We have previously demonstrated capabilities of DFH by modeling a set of simple two- and three-phase problems (immiscible liquids without phase transitions) with simple geometry that allow for analytical description (Demianov et al. 2011, 2014). The direct comparison between numerical and analytical solutions resulted in maximum errors within 5 % for stationary problems and 10 % for dynamic ones using numerical grids of modest resolutions. Also, we have made direct quantitative comparison between two-phase flow modeling and two-phase flow experiments in a micromodel (Armstrong et al. 2014, 2015).

In the paper Demianov et al. (2011), we have also presented modeling of problems with complex physics involving those with the presence of surfactant, mobile solid phase, phase transitions (even between liquid and solid), with temperature effects and turbulence. The modeling results have showed both versatility and consistency of DFH over a wide range of physical phenomena. In this paper, we narrow the focus on more applied problems, particularly on the processes inherent in porous media multiphase flows.

Multiphase flow in porous media is characterized by extremely complex flow patterns; the complexity is primarily derived from the intricacy of pore channels through which multiphase fluids move. Besides, such type of flow is essentially cooperative meaning that events in some of the pores may have non-local effects triggering a cascade of developments in other pores (Armstrong et al. 2014; Moebius and Or 2014). Usually, one is interested in averaged characteristics of such flows representative for Darcy-scale behavior. Probably the most essential among them is the so-called residual fluid saturation. For example, speaking in oil industry terms, this is the residual, or unrecovered, oil saturation after water flood. Correct prediction of such macroscopic quantities, however, requires comprehensive understanding of the basic multiphase mechanisms that drive fluids on the pore scale. These mechanisms are essentially related to the balance between viscous and interfacial forces. Even a slight change in the balance between forces may considerably influence residual fluid saturation. This is why correct and detailed understanding and prediction of the relevant elementary multiphase displacement mechanisms is paramount.

A particular strength of our method, DFH, comes from its capacity to model complex physics (e.g., surfactants, phase transitions, non-Newtonian rheologies, temperature effects, mobile solid bodies, and turbulence) within the practical problem statements relevant for industrial applications; the simulations are always performed using a single numerical code. Recently, we have demonstrated a set of such applications for the problems in oil industry (Koroteev et al. 2013, 2014) and microfluidics (Armstrong et al. 2014, 2015).

In Sect. 4, we present a number of practical simulation scenarios demonstrating various elementary multiphase processes related to immiscible fluid/fluid displacement in simple geometries for a range of capillary numbers. The modeling results are compared to experimental observations and/or literature data. The main focus is given to displacement processes where interfacial discontinuities occur, such as snap-off, which is considered to be the main mechanism responsible for capillary entrapment of non-wetting fluids. Our results are presented for two-phase flow in crossing ducts similar to those described in the classical work by Lenormand et al. (1983) and Lenormand (1990), circular pore with constriction analogous to that studied by Roof (1970), and different pore doublet models used routinely for studying basic two-phase mechanisms (Chatzis and Dullien 1983; Lake 1989). The results demonstrate that DFH constantly reproduces the published experimental data. In addition, we provide one-to-one comparison between the numerical simulation and experiments on droplet pinch-off dynamics recorded with a high-speed camera. We validate consistency with the existing theory of geometry-related snap-off. Overall, the results affirm the predictive capability of the method to model multiphase flow either in porous media or in highly constricted geometries.

2 Theoretical Base of the Density Functional Hydrodynamics

Density functional theory is widely known as a breakthrough approach in quantum chemistry (Hohenberg and Kohn 1964; Koch and Holthausen 2001). It is based on the idea that the energy of the system considered can be represented as a functional depending on the density of particles. The application of density functional theory to compositional hydrodynamics was first presented by Demianov et al. (2011) and Demianov et al. (2014). An exposition of the theoretical base for this approach is given by Dinariev (1995) and Dinariev (1998). Herein, we restrict ourselves to the basic concepts and equations, which are necessary for modeling multiphase flow.

First, one must specify basic fields describing the instantaneous state of the mixture. It is convenient to introduce, as basic fields, the following quantities: chemical component molar densities \(n _i \), average mass velocity \(v _a \), and internal energy density u. Here is a brief summary of how these parameters can be defined. The summation over repeated indices is implied everywhere. We use shortened notations for partial derivatives in respect of Cartesian coordinates \(\partial _a =\partial /\partial x^{a}\), to time \(\partial _t =\partial /\partial t\) and to molar density of ith chemical component \(\partial f_{,i} =\partial f/\partial n_i \).

Let us assume a homogeneous mixture of M chemical components inside a spatial region D of volume V with the amount of each type of molecules being \(N _{i D} \,(i=1 ,\ldots ,M)\). To avoid large numbers, the quantities \(N _{i D} \) are measured in moles and by definition \(n _i = N _{i D} / V _D \). If the mixture is inhomogeneous, one can define \(n _i \) locally by establishing a small volume limit, such as \(n _i = n _i ( t , x ^{a} ) = {\mathop {\hbox {lim}}\nolimits _{V\rightarrow 0}} ( N _{i D} / V _D )\). Here, t is time and \(x ^{a}\) are Cartesian coordinates.

By counting the flow rate of molecules through a small area inside the mixture, one can define the component flux \(I _{i a} = I _{i a} ( t , x ^{b} )\). The component fluxes are used to calculate the mass flux \(I _a = m _i I _{i a} \), where \(m _i \) is the molar mass of the ith component. By introducing mass density \(\rho = m _i n _i \), it is possible to define an average mass velocity \(v _a = \rho ^{-1} I _a \). Component flux \(I _{i a} \) can be represented as a combination of average transport \(n _i v _a \) and diffusion flux \(Q _{i a} \):

$$\begin{aligned} I _{i a} = n _i v _a + Q _{i a} , \end{aligned}$$
(1)

where by definition diffusion flux does not influence net mass transfer.

$$\begin{aligned} m _i Q _{i a} = 0. \end{aligned}$$
(2)

To calculate the total energy \(E _D \) of the molecules inside region D, which is the sum of kinetic and potential energy (the latter being the result of molecular interaction), the energy density can be calculated by establishing a small volume limit, \(\varepsilon = \varepsilon ( t , x ^{a} ) = {\mathop {\hbox {lim}}\nolimits _{V\rightarrow 0}} ( E _D / V _D )\). Internal energy density can be defined by subtracting the kinetic energy density from the total energy:

$$\begin{aligned} u = u ( t , x ^{a} ) = \varepsilon - \frac{1}{2} \rho v _a v _a . \end{aligned}$$
(3)

If a mixture occupies some spatial region D, then we assume the existence of the entropy functional

$$\begin{aligned} S _D = S _D [ u , n _i ]. \end{aligned}$$
(4)

Here, the value of entropy \(S _D = S _D (t)\) is determined at any moment of time by the density fields \(n _i = n _i ( t , x ^{a} )\) and internal energy field \(u = u ( t , x ^{a} )\). It can be argued that the entropy functional can also depend on the velocity field \(v _a = v _a ( t , x ^{b} )\). But, the absence of velocity dependence in the right side of Eq. (4) can be derived rigorously from the local Galilean invariance (Zubarev 1974). In Eq. (4) and below, the term “functional” is used in the sense that the considered quantity depends on the spatial fields (and not on point values) at a particular moment of time.

The explicit expression (4) is introduced into mechanics of continuous media, in general, (and into hydrodynamics in particular) from other branches of science, such as physical chemistry and statistical physics. In many cases, it is possible to use the following functional, which is considered a good approximation to the exact functional:

$$\begin{aligned} S _D= & {} S _D [ u , n _i ] = \int \limits _D \tilde{\theta } \mathrm{d}V + \int \limits _{\partial D} s _*\mathrm{d}A, \end{aligned}$$
(5)
$$\begin{aligned} \tilde{\theta }= & {} s ( u , n _i ) -2 ^{-1} \alpha _{i j} ( n _k ) \partial _a n _i \partial _a n _j , \end{aligned}$$
(6)

where \(\partial D\) is the boundary surface for the region D (when the region is finite), \(s = s ( u , n _i )\) is the entropy bulk density for homogeneous mixture, \(\alpha _{i j} \) is the positive-definite symmetric matrix, and \(s _*= s _*( u , n _i )\) is the entropy surface density (not equal to zero if \(\partial D\) is a contact surface with some immobile solid). Substantiation of the square gradient approximation (6) used in the density functional (5) can be found in (Barral and Hansen 2003; Hansen and McDonald 2006).

The model, shown in Eqs. (5) and (6), is adequate for many important phenomena, but it is not universal. Up to now, it was successfully used to simulate multiphase multicomponent phenomena with or without phase transitions, surfactants, mixtures with solid phases (e.g., gas hydrates or sand particles), and thermal effects (Demianov et al. 2011, 2014). However, it is not sufficient for the simulation of electrokinetic phenomena or structured liquids (e.g., liquid crystals), which require more complex expressions for the entropy functional.

For the hydrodynamic variables, we use the classical continuous mechanics set of equations that are local conservation laws for chemical components of the mixture, momentum, and energy, respectively (Sedov 1997):

$$\begin{aligned}&\partial _t n _i + \partial _a ( n _i v _a + Q _{i a} ) = 0, \end{aligned}$$
(7)
$$\begin{aligned}&\rho ( \partial _t v _a + v _b \partial _b v _a ) = \partial _b p _{a b} , \end{aligned}$$
(8)
$$\begin{aligned}&\partial _t u + \partial _a ( u v _a + q _a ) = p _{a b} \partial _b v _a . \end{aligned}$$
(9)

The boundary conditions at the immobile solid walls are as follows:

$$\begin{aligned}&v _a \big | _{\partial \mathrm{D}} = 0, \end{aligned}$$
(10)
$$\begin{aligned}&l _a Q _{i a} \big | _{\partial \mathrm{D}} = 0, \end{aligned}$$
(11)
$$\begin{aligned}&\partial _t u _*\big | {_{\partial D} } = l _a ( q _a^{\mathrm{ext}} - q _a ), \end{aligned}$$
(12)
$$\begin{aligned}&( u _{*, i} - T s _{*, i} - T \alpha _{i j} l _a \partial _a n _j ) \big | {_{\partial D} } = 0. \end{aligned}$$
(13)

Here, \(p _{a b} \) is the stress tensor, \( q _a \) is the heat flux inside the mixture, \(T ^{-1}= \left( {\frac{\partial s}{\partial u}} \right) _{n_{i}} \)—inverse temperature, \(u _*= u _*( u , n _i )\) is the surface energy, \(l _a \) is the internal unit normal for \(\partial D\), and \( q _a^{\mathrm{ext}} \) is the external heat flux. Boundary conditions (10) through (13) possess clear physical meaning and can be explained in the following way:

  • Eq. (10) is the usual no-slip condition for the average mass velocity

  • Eq. (11) determines that the solid surface \(\partial \hbox {D}\) is impermeable to the diffusion flux \(Q _{i a} \)

  • Eq. (12) is the boundary energy conservation law

  • Eq. (13) reflects the wetting properties of the boundary \(\partial \hbox {D}\)

The hydrodynamic model can be closed by specifying: (a) explicit expressions for the thermodynamic potentials \(s , u _*, s _*\), and (b) constitutive relations for the fluxes \(Q _{i a} \), \(p _{a b} \), \( q _a \). The former are determined by the chemistry of the mixture, while the latter should be introduced in accordance with the entropy production principle. The thermodynamic properties of mixture are better described by Helmholtz energy functions

$$\begin{aligned}&\displaystyle f = f ( T , n _i ) = u - T s, \end{aligned}$$
(14)
$$\begin{aligned}&\displaystyle f _*= f _*( T , n _i ) = u _*- T s _*, \end{aligned}$$
(15)

because all other thermodynamic potentials can be derived from (14) and (15). Explicit expressions for (14) and (15) will be discussed later. In order to derive constitutive relations, it is useful to break the stress tensor \(p _{a b} \) into the sum of the static part \(\sigma _{a b} \) and the viscous part \(\tau _{a b} \)

$$\begin{aligned} p _{a b} = \sigma _{a b} + \tau _{a b} . \end{aligned}$$
(16)

The static stress tensor does not depend on the velocity field and can be calculated from the density functional using variational approach (Dinariev 1995, 1998, concerning calculus of variations see also Gelfand and Fomin 1963).

$$\begin{aligned} \sigma _{a b} = ( f +2 ^{-1} T \alpha _{i j} \partial _a n _i \partial _a n _j + T \Theta _i n _i ) \delta _{a b} - T \alpha _{i j} \partial _a n _i \partial _b n _j . \end{aligned}$$
(17)

Here and below, we use notation \( \kappa _i = \left( {\frac{\partial f}{\partial n _i }} \right) _{T} \) as chemical potential,

$$\begin{aligned} \Theta _0 = T ^{-1} , \Theta _i = - T ^{-1} \kappa _i - \frac{1}{2} \alpha _{k j , i} \partial _a n _k \partial _a n _j + \partial _a ( \alpha _{i j} \partial _a n _j ). \end{aligned}$$
(18)

It is important to mention two properties of \(\sigma _{a b} \). First, it is proportional to hydrostatic pressure p in the case of a homogeneous equilibrium mixture

$$\begin{aligned} \sigma _{a b} = - p \delta _{a b} . \end{aligned}$$
(19)

Second, if the mixture is in a state of equilibrium, \(\sigma _{a b} \) satisfies the equations of mechanical equilibrium

$$\begin{aligned} \partial _b \sigma _{a b} = 0. \end{aligned}$$
(20)

This tensor can be used to calculate the interfacial tension (IFT) between fluid phases. Indeed, if we consider an equilibrium 1D solution \(T = \mathrm{const}, n _i = n _i ( x ^{1} )\) describing the transition from one phase \(n _{i -} \) at \(x ^{1} \rightarrow -\infty \) to another phase \(n _{i+} \) at \(x ^{1} \rightarrow +\infty \), then IFT is calculated by the following procedure (Ono and Kondo 1960)

$$\begin{aligned} \gamma = \int \limits _{-\infty }^{+\infty } ( \sigma _{2 2} - \sigma _{1 1} ) \mathrm{d}x ^{1} = T \int \limits _{-\infty }^{+\infty } \alpha _{i j} \partial _1 n _i \partial _1 n _j \mathrm{d}x ^{1}. \end{aligned}$$
(21)

From (5), (6) and (7)–(13), one can derive equations for local and global entropy change rate

$$\begin{aligned}&\displaystyle \partial _t \tilde{\theta } = - \partial _a J _{s a} + \sigma , \end{aligned}$$
(22)
$$\begin{aligned}&\displaystyle \frac{d S _D }{d t} = \int \limits _{\partial D} l _a T^{-1} q _a^{\mathrm{ext}} \mathrm{d}A +\int \limits _D \sigma \mathrm{d}V , \end{aligned}$$
(23)
$$\begin{aligned}&\displaystyle J _{s a} = ( u \Theta _0 + n _i \Theta _i ) v _a + T ^{-1} \sigma _{a b} v _b + \Theta _A Q _{A a} +\alpha _{i j} \partial _t n _i \partial _a n _j , \end{aligned}$$
(24)
$$\begin{aligned}&\displaystyle \sigma = Q _{A a} \partial _a \Theta _A + T ^{-1} \tau _{a b} \partial _b v _a . \end{aligned}$$
(25)

From here on, we use indices \(A, B =0, 1, \ldots ,M\). As before, the summation is implied over the repeated indices. The canonical form of the entropy Eqs. (22) and (23) implies that quantities (24) and (25) should be interpreted as entropy flux and local entropy production rate, respectively (de Groot and Mazur 1962; Prigogine 1967). To obtain the nonnegative entropy production, one must keep constitutive relations consistent with inequalities

$$\begin{aligned}&Q _{A a} \partial _a \Theta _A \ge 0, \end{aligned}$$
(26)
$$\begin{aligned}&\tau _{a b} \partial _b v _a \ge 0. \end{aligned}$$
(27)

There are many ways to satisfy these inequalities. Here, we give only the simplest options. For the fluxes \(Q _{A a} \), one can use the following constitutive relation:

$$\begin{aligned} Q _{A a} = \mu _{A B} \partial _a \Theta _B \end{aligned}$$
(28)

with \(\mu _{A B} \) being a nonnegative definite symmetric matrix with one zero eigenvalue: \(\mu _{A i} m _i = 0\). For the viscous stress tensor \(\tau _{a b} \), one can use the following constitutive relations:

$$\begin{aligned} \tau _{a b} = \eta _\mathrm{v} \delta _{a b} \partial _c v _c + \eta _\mathrm{s} \left( \partial _a v _b + \partial _b v _a - \frac{2}{3} \delta _{a b} \partial _{c } v _c \right) \end{aligned}$$
(29)

with \(\eta _\mathrm{v} \) and \(\eta _\mathrm{s} \) being nonnegative bulk and shear viscosity coefficients, respectively. In a viscous linear model, these coefficients can depend on local temperature and component densities. In nonlinear viscous models, they can depend also on local velocity gradient.

The constitutive relations (28), (29) close the hydrodynamic model. To apply this model to the description of particular multiphase flow scenarios, one should specify explicitly the thermodynamic potentials (14) and (15) and the transport coefficients, as shown in (28) and (29). This can be done using experimental or tabular data on bulk and surface thermodynamics, thermal and diffusive transport, and viscous stresses. Also, certain interpolation/extrapolation procedures can be used when input data do not cover the entire range of temperature and component density values (Demianov et al. 2014).

Isothermal hydrodynamic equations can be derived using non-isothermal equations, if one assumes constant temperature

$$\begin{aligned} T = \hbox {const} \end{aligned}$$
(30)

and excludes from consideration the energy Eq. (9) with boundary condition (19). In this case, the constitutive relations are effectively reduced to a simpler system of equations

$$\begin{aligned} Q _{i a} = \mu _{i j} \partial _a \Theta _j . \end{aligned}$$
(31)

In this paper, we consider several applications to isothermal problems, though the existing numerical simulator (see below) can handle non-isothermal cases, as well.

To conclude this section, we provide a brief summary of the equations presented and explain how various multiphase phenomena are accounted for in the framework of DFH (Demianov et al. 2011, 2014).

  • DFH governing equations are expressed by conservation laws (7) through (9) closed using relations (16) through (18) and (28) and (29) together with the boundary conditions in (10) through (13). In isothermal case condition, Eq. (30) holds, and Eq. (9) is omitted together with the boundary condition (12), while Eq. (28) is reduced to (31).

  • Interfacial tension is taken into account by means of molar density gradient terms that enter the expression for bulk entropy (6) or bulk Helmholtz energy (14) in isothermal case. Each of these expressions includes the set of gradients of component molar densities as indicator of interfacial region. The interfacial tension \(\gamma \) is related to the coefficients \(\alpha _{ij} \) by Eq. (21). Assuming \(\gamma \) is known from experiment, Eq. (21) is solved numerically to find parameters \(\alpha _{ij} \). Alternatively, \(\alpha _{ij} \) can be found by numerical modeling of a typical 3D Laplace jump problem. In both approaches, quantities \(\alpha _{ij} \) are corrected upon results of the modeling and thus found iteratively. The number of free parameters in \(\alpha _{ij} \) should represent the number of physical degrees of freedom that depend on the particular problem conditions, i.e., number of chemical components and phases. In the simple case of two immiscible phases and two components, only one free parameter is needed. Therefore, matrix \(\alpha _{ij} \) is taken to be proportional to the identity matrix. In the modeling examples described in this paper, interfacial tension does not depend on composition and so it is sufficient to use constant \(\alpha _{ij} \).

  • If adsorption phenomena are to be modeled (not the case for the examples presented in this paper), \(\alpha _{ij} \) can no longer be constant. Indeed, adsorption into interfacial area between mobile liquid phases is governed by assuming that coefficients \(\alpha _{ij} \) in (6) are functions of local composition, i.e., \(\alpha _{ij} =\alpha _{ij} (n_k )\). In this case, the minimum energy state is achieved when certain components (i.e., surfactants) adsorb on the interface to reduce interfacial tension, which leads to reduction in energy. Thus, adsorption and reduction in interfacial tension are two interrelated processes that happen simultaneously.

  • Wettability (interfacial tension between liquid and solid) and adsorption onto solid boundaries are determined by the boundary condition (13).

  • Coalescence and breakup of droplets and any other topological changes in interfacial boundaries occur naturally and can be traced from the evolution of molar density fields that occurs in such a way as to increase total entropy of the system; see Eq. (22) through (27).

  • Motion of interfacial boundaries over solid surface, i.e., contact line movement, is possible despite the presence of no-slip boundary condition (10); it is enabled by the nonlinear diffusion fluxes (28) that enter the molar density conservation Eq. (7). These fluxes are allowed to be nonzero over the surface, because even in being so they do not transfer mass [see the definition in Eq. (28) and the comment therein] and, therefore, do not violate the boundary condition (10).

  • DFH is not limited to Newtonian rheology and can handle non-Newtonian rheologies by simply using an appropriate expression for viscous stress tensor instead of the Navier–Stokes’s one in (29). In particular, viscoelastic, visco-elasto-plastic, as well as the well-known Herschel-Bulkley rheological models, can be employed (Demianov et al. 2011, 2014).

  • Phase transitions are simply governed by the bulk entropy or Helmholtz energy properties following the classical theories (Prigogine 1967; Stanley 1971); their particular expressions should be selected to represent fluid experimental behavior.

  • The same system of hydrodynamic Eqs. (7)–(9) is solved in each spatial point of a domain containing multicomponent mixture. Accordingly, the evolution of the system is described by the evolution of molar densities of chemical components and average mass velocity. Information about actual distribution of phases is obtained by analyzing molar density distributions. By knowing composition of phases (in molar densities), one is able to tell at which point which phase is currently present. Thus, no phase indicator field is used in DFH. Phase boundaries also do not require any special description. One learns the position of an interface by simply analyzing local molar density gradients. The interface is always determined by sharp (but continuous) transition of mixture composition from that related to one phase to that inherent in another phase (such approach is similar to the so-called diffuse-interface method, which is usually used over concentration or phase indicator fields, e.g., Emmerich (2003).

There are extensions of DFH published elsewhere (Demianov et al. 2014) that significantly widen the range of phenomena that can be modeled. Further clarification of the DFH method can be found in “Appendix 1” where we provide a detailed overview of a 1D analytical solution to the DFH equations for two-phase system.

3 DHD Simulator

The direct hydrodynamic (DHD) simulator is a computer code that solves numerically the dynamical equations of the density functional hydrodynamics (7)–(9) with boundary conditions (10)–(13). The code uses an explicit conservative uniform finite volume numerical scheme on a staggered grid. The numerical method possesses first-order approximation in time and second order in space. A particular numerical scheme implemented in DHD was specifically designed to accommodate for the DFH equations. The scheme is called Tensor-Aligned Conservative Uniform scheme on a Staggered grid (TACUS); its description can be found in Demianov et al. (2014). A detailed description and analysis of numerical methods belonging to the same class can be found, for example, in the monographs by Versteeg and Malalasekera (1995) and Ferziger and Peric (2002).

Historically, DHD simulator was developed by Schlumberger Moscow Research (SMR) in 2005; however, the first rudimentary versions of the code were created by some of the authors as early as 2000. In 2009–2011, an optimized GPGPU version of the DHD simulator code for GPU-based computer clusters was developed in SMR. This version of the code has enabled a 30- to 40-fold increase in performance in comparison with the previous CPU version. Depending on the physics of the multiphase problem, the typical scenarios can be simulated on models with sizes from \(200^{3}\) (using several GPGPU cards) to \(1000^{3}\) (using a 64-GPGPU computer cluster) grid blocks within a day.

To date, DHD simulator has been extensively verified by numerous numerical exercises comprising: a) standard grid convergence tests (Demianov et al. 2014), b) various single-phase and multiphase problems that have analytical solutions (Demianov et al. 2011, 2014). Also, simulator’s capabilities were demonstrated by solving various multiphase problems with complex physics, e.g., non-Newtonian rheology, phase transitions, the presence of surfactants, mobile solid phase, turbulence, and thermal effects (Demianov et al. 2011, 2014). In this paper, we demonstrate additional verification of the DHD simulator in respect of typical two-phase pore-scale phenomena inherent to porous media flow. We start with elementary displacement mechanisms and then pay special attention to snap-off processes which involve topological changes in interfaces.

4 Numerical Results

In this section, we focus on modeling typical two-phase phenomena observed at the pore scale (orders from about \(1\,\upmu \hbox {m}\) to 1 mm, where interfacial tension is usually dominating) in porous materials and in microfluidic devices. The typical macroscopic flow rates in porous media are on order of 0.1 to 1 m/day (Lake 1989). The balance between viscous forces and interfacial tension is usually described by the concept of capillary number \(N_\mathrm{c} =\eta _\mathrm{s} v/\gamma \), which lies mostly between \(10^{-5}\) and \(10^{-8}\), i.e., the displacement is an interfacial tension-dominated process. However, Haines jumps and snap-off events typically last only a few milliseconds as shown by acoustic measurements of pore-scale displacements (DiCarlo et al. 2003). This leads to Reynolds numbers \(Re>1\) (Mohanty et al. 1987), which implies that inertial forces are also relevant for such processes. These forces are described by the full viscous stress tensor (29) present in DFH. In single-phase single-component case, DFH equations are reduced to the classical Navier–Stokes equations (providing that accounting for liquid–solid interaction that may be relevant even in single-phase case is not needed). The timescale of the snap-off indicates that the short time stepping is needed when solving the equations numerically. This is compatible with the explicit numerical scheme used in DHD.

Some of the basic two-phase mechanisms that involve interfacial tension are:

  • piston-type wetting fluid displacement by non-wetting fluid (drainage) and vice versa (imbibition) (Fig. 1a, b) (Sect. 4.1)

  • wetting fluid meniscus collapse (Fig. 1c) (Sect. 4.1).

  • snap-off in free fluid (Sect. 4.2.1).

  • geometrically constrained snap-off through wetting films (Sect. 4.2.2).

  • snap-off and trapping in pore doublets (Sect. 4.2.3)

  • trapping and flow pattern at different flow regimes in simple system of pores (Sect. 4.2.4)

All these phenomena happen more or less simultaneously in different regions of a complex pore system, such as hydrocarbon reservoir rock. Consequently, adequate modeling of such a system requires resolution of the mentioned mechanisms using a single unified approach. In other words, interfacial tension, wettability, topological changes in phase boundaries (including droplet coalescence and breakup), and moving contact lines must be accounted for in a consistent way and in the presence of significant density and viscosity contrasts that may span several orders of magnitude. This poses a significant challenge for many traditional modeling techniques; however, it lies completely within the scope of DFH (the corresponding review can be found in Demianov et al. 2011).

Simulation of the problems described in the following sections was carried out by the DFH-based (Sect. 2) DHD simulator (Sect. 3) using a small portion of a GPU-based cluster solution. In all cases, we used the same code with the same discretized equations discussed in Sect. 2. Depending on the particular case, the simulation was performed using 1 or 2 computational nodes (each node has four GPU Fermi cards with 3 Gb RAM connected via high-speed PCI Express bus), while the simulation time ranged from a few minutes to several hours.

Unless otherwise stated, the simulations were carried out using the same pair of fluids specified by the following properties: \(\rho _\mathrm{A} =1000\,\hbox {kg/m}^{3}, \rho _\mathrm{B} =800\,\hbox {kg/m}^{3}\), \(m_1 =18\,\hbox {kg/kmol}, m_2 =100\,\hbox {kg/kmol}\), where \(\rho _\mathrm{A} , \rho _\mathrm{B} \)—mass density of phase A, B, \(m_1 , m_2 \)—molar mass of component 1, 2. The phases were defined in such a way that phase A consisted 100 % of component 1, while phase B consisted 100 % of component 2. Interfacial surface tension was \(\gamma _{\mathrm{AB}} =0.044\,\hbox {N/m}\). Shear viscosities of phases A and B were \(\eta _\mathrm{A} =0.001\,\hbox {Pa}\,\hbox {s}\) and \(\eta _\mathrm{B} =0.003\,\hbox {Pa}\,\hbox {s}\). The construction of Helmholtz energy functions (14) and (15) is essentially a problem of chemical thermodynamics. For the present simulations, we used an approach, which is described in our previous publications; see Demyanov and Dinariev (2004a, b), Dinariev and Evseev (2005), and also Demianov et al. (2011, 2014) and references therein. The key statements are also provided in “Appendix 2.”

Fig. 1
figure 1

Schematic representation of piston flow (a, b), and meniscus collapse (c) in a square duct

In visualization of numerical results (see below), we represent by color the relative amount of either fluid inside the respective grid block. So the resolution of the interface is determined by the size of the grid cell.

4.1 Piston-Type Motion and Meniscus Collapse in Two Crossing Ducts

Piston-type displacements have been proposed by Lenormand et al. (1983) and Lenormand (1990) as elementary processes in two-phase flow at the microscale. For drainage (non-wetting fluid displaces wetting fluid), the flow can only occur when pressure at the entrance of a capillary equals or exceeds a threshold pressure determined by the capillary geometry and interfacial tension between wetting and non-wetting fluids (Lenormand et al. 1983), whereas in the case of imbibition (wetting fluid displaces non-wetting fluid), the process starts spontaneously once the wetting fluid is put in contact with the capillary entrance.

There is also a simple related case of capillary–gravity equilibrium in a single circular capillary, which can be analytically specified in both statics and dynamics. We had already used this case for the validation of the DFH and DHD simulator (Demianov et al. 2014) in the past. Our aim here is performing a study in a more complex geometry with two crossing square-shaped ducts (Fig. 1) described by Lenormand et al. (1983) and Lenormand (1990). Some preliminary results related to this study have been reported by Koroteev et al. (2013, 2014).

Fig. 2
figure 2

Piston-type flow from three ducts in imbibition scenario of case 1. Phase A is shown in blue, and phase B is shown in red semitransparent

The parameters used in the simulations are as follows:

Geometry: 3D model with sizes \(6\,\hbox {mm} \times 6\,\hbox {mm} \times 1\,\hbox {mm}\) approximated by \(300 \times 300 \times 50\) cubic cells, the square duct side length was 1 mm.

The wetting properties were defined by \(\gamma _{\mathrm{Bs}} -\gamma _{\mathrm{As}} =0.031\,\hbox {N/m}\) (case 1) and \(\gamma _{\mathrm{As}} -\gamma _{\mathrm{Bs}} =0.031\,\hbox {N/m}\) (case 2), where \(\gamma _{\mathrm{As}} \) and \(\gamma _{\mathrm{Bs}} \) are the surface tensions in contact with the solid (ducts’ walls) for phases A and B. The corresponding contact angle follows from the Young formula

$$\begin{aligned} \cos \theta =\frac{\gamma _{\mathrm{As}} -\gamma _{\mathrm{Bs}} }{\gamma _{\mathrm{AB}} } \end{aligned}$$
(32)

and equals \(45^{\circ }\) for case 1 (phase A is wetting) and \(135^{\circ }\) for case 2 (phase B is wetting).

In Fig. 2, we present the simulation results corresponding to case 1. Initially, both ducts of the model are filled with non-wetting phase B (Fig. 2a). In the simulation, three out of four ducts were connected to phase A reservoir with the same reference pressure as in phase B. The wetting phase A invaded the model spontaneously causing piston-like displacement of the non-wetting phase (Fig. 2b–f). The contact angle is close to \(45^{\circ }\), and corner flow of wetting fluid is observed throughout the simulation. The overall displacement development corresponds closely to the description given by Lenormand et al. (1983).

In Fig. 3, we demonstrate a similar scenario except that the reservoirs with the wetting phase A are now connected to two ducts (Fig. 3a). The frames (b)–(f) show the piston-like displacement. The particular phase configuration enables for the temporal formation of a single meniscus (c) inside the wider area of the crossing ducts. The meniscus soon meets the corner (d) and breaks into two menisci again (e). This mechanism has also been observed experimentally by Lenormand et al. (1983).

In the final simulation of this series, we deal with non-wetting fluid displacing the wetting fluid with the end of Case 2 as the initial condition. Figure 4a shows the model filled with wetting phase A. The non-wetting phase B was injected through two ducts, while the other two were connected to the reservoirs with phase A at reference pressure. The injection pressure was slightly above the minimum pressure enabling for the entrance of the non-wetting phase into the ducts. The dynamics are presented in Fig. 4b–f. Both phases, in the captured frames, were made semitransparent to better reveal the structure of the interfaces. Unlike the scenarios from Case 1, now we notice trapping of the wetting phase in corners of the ducts (Fig. 4e, f). This feature is characteristic for drainage processes and is observed in experiments (Lenormand et al. 1983 and Lenormand 1990).

Fig. 3
figure 3

Piston-type flow from two ducts in imbibition scenario of Case 1. Phase A is shown in blue, and phase B is shown in red semitransparent

Fig. 4
figure 4

Piston-type flow from two ducts in imbibition scenario of Case 2. Phase A is shown in blue semitransparent and phase B is shown in red semitransparent

4.2 Snap-Off Mechanisms

Another important class of two-phase phenomena is related to snap-off, i.e., when a single-phase body breaks or disrupts into two. This can occur under various circumstances; for example, a liquid phase can drip from an outlet (nozzle or needle) forming a droplet. Eventually, the droplet can become separated from the liquid cluster’s body as it grows larger and the pressure inside it falls below the pressure on the outlet end. Under the influence of gravity, the separation can occur earlier; a growing droplet gets so heavy that surface tension connecting it to the outlet becomes insufficient and the droplet detaches. In some cases (depending on the liquid properties and flow rate), liquid pouring from an outlet can form a single continuous filament. But, gravity–capillary waves propagating along the filament can disrupt it in one or several locations, thus causing snap-off (Rayleigh instability). Both of these mechanisms are related to snap-off in free fluids and are reviewed by Clift et al. (1978) and Cramer (2004). Alternatively, snap-off can occur without influence of any particular bulk force in cases when the phase body is geometrically constrained by solid walls or bodies in such a way that the single-phase body becomes unstable and breaks apart (this breakup leads to the forming of two fragments having less total surface energy than the parent single body). This phenomenon, from here on, called “geometry-constrained snap-off” was studied quantitatively by Roof (1970).

Fig. 5
figure 5

Experimental results for pinch-off of a droplet in free fluid. The frames (a) through (f) are captured at the time moments 0, 8, 9, 10, 15, and 24 ms correspondingly

4.2.1 Snap-Off in Free Fluid

We start by presenting numerical simulations from an example demonstrating snap-off in free fluid. It is the basis for other snap-off processes studied later. It serves here as an example demonstrating that topological changes in interfaces are modeled correctly, which is verified by presenting a spatial and temporal match with experimental data. The model corresponds to an experimental study performed with water and decane. In the experiment, decane was slowly injected into water, through a vertical nozzle using a syringe pump to form a droplet that eventually disconnects from the nozzle. The geometry of the nozzle is specified with an outer diameter of 1.65 mm and inner diameter of 1.19 mm. The dynamics of this process (Fig. 5) was captured using a high-speed camera. The first frame (a) from Fig. 5, captured at the moment of time 0 s, shows the beginning of necking. At 8 ms, the neck becomes very thin (b), and at 9 ms (c), it breaks and a decane droplet is formed. Dragged by buoyancy, the droplet rises and undergoes gravity–capillary oscillations as seen in frames (d) through (e) captured at 10, 15, and 24 ms, respectively.

In the numerical simulation of this experiment, a parallelepiped model with sizes \(18.4\,\hbox {mm} \times 18.4\,\hbox {mm} \times 26.6\,\hbox {mm}\) approximated by \(400 \times 400 \times 580\) cubic cells was used. Attached to the center of its lower side (the model was oriented vertically along its longest edges), the model has a single nozzle with outer diameter equal to 1.65 mm and inner diameter equal to 1.19 mm. Gravity was applied vertically. To match the physical properties of the fluids used in the experiments, some of the data in this scenario were different from that used in the other simulations: \(\rho _\mathrm{B} =730\,\hbox {kg/m}^{3}\), \(m_2 =142\,\hbox {kg/kmol}\), \(\eta _\mathrm{B} =0.00092\,\hbox {Pa}\,\hbox {s}\) and \(\gamma _{\mathrm{AB}} =0.029\,\hbox {N/m}\). Initially, the model was filled with phase A and phase B was injected slowly through the nozzle. The results of the numerical simulation are presented in Fig. 6. The successive frames (a) through (f) correspond to the same moment of time as the experimental images in Fig. 5. The resemblance between the experimental and numerical results is good. Similar to the experiment results, the model shows necking, breaking of the neck and pinch-off, and gravity–capillary oscillations. Also, the shapes of the experimental droplet and the simulated droplet are similar at the identical moment of time. Also, the secondary “satellite” droplet observed in the experiment (Fig. 5d–f) was reproduced in the numerical simulation (Fig. 6d, f). However, the exact dynamics of this secondary droplet cannot be expected to be accurate because accuracy in reproduction of this phenomena requires a higher-resolution numerical model; instead, it is worth stressing that the prediction of this tiny secondary droplet in our numerical simulation is highly significant.

We conclude the snap-off in free fluid discussion by referring the reader to Finn (1986) where pendant drops of various shapes were studied. Also in Thoroddsen et al. (2007), an experimental series similar to that presented herein can be found.

Fig. 6
figure 6

Numerical modeling results for pinch-off of a droplet in free fluid. The frames (a) through (f) are captured at the time moments 0, 8, 9, 10, 15, and 24 ms correspondingly

4.2.2 Geometry-Constrained Snap-Off

Geometry-constrained snap-off occurs in porous media flows in narrow constrictions (pore throats) where the non-wetting phase is disconnected by swelling of wetting films. It occurs in imbibition and drainage processes. The example shown here follows closely the work by Roof (1970) where the non-wetting phase snaps-off in a circular capillary with a constriction (Fig. 8). Previously, simulations of a similar problem have been demonstrated using an axisymmetric formulation and the commercial computational fluid dynamics software by Beresnev et al. (2009) and Beresnev and Deng (2010).

We start with a 3D model with sizes \(15\,\hbox {mm} \times 2\,\hbox {mm} \times 2\,\hbox {mm}\) approximated by \(750 \times 100 \times 100\) cubic cells, and the diameter of the constriction is equal to 0.28 mm (Case 1). Initially, the model was filled with phase A (Fig. 8a), which uniformly wets the entire surface of the capillary with a zero contact angle. Then, phase B was injected from the left side of the model very slowly (the head gradient is close to zero) in order to make dynamic effects as small as possible. Frames (b)–(g) in Fig. 8 demonstrate the simulation results. It is seen that the wetting phase has formed a film on a contact with solid boundaries, while the non-wetting phase comes through the center as a single stream. Frame (b) shows the distribution of fluids just before phase B reaches the constriction. The subsequent frames (c)–(e) were captured with very fine time resolution (0.5 ms) to reveal the snap-off process in detail. Once phase B passes the constriction, necking occurs in the narrowest point of the constriction (c). Then, the non-wetting phase filament rapidly becomes thinner (d) and snap-off occurs (e). The detached droplet flows away and forms a spherical shape once a sufficiently wide region of the capillary is reached (f). At the same time, more of phase B passes through the constriction and detaches by the exact same snap-off mechanism. In due course, a train of detached droplets forms (g).

To make our study more comprehensive, we carried out two more simulations in the similar geometries: One 3D model with the size of \(15\,\hbox {mm} \times 2\,\hbox {mm} \times 2\,\hbox {mm}\) and approximated by \(750 \times 100 \times 100\) cubic cells (the size of the cubic grid block is \(20~\upmu \hbox {m}\)) with the constriction diameter equal to 0.46 mm (Case 2). And another 3D model with the size of \(15\,\hbox {mm} \times 3\,\hbox {mm} \times 3\,\hbox {mm}\) and approximated by \(750 \times 150 \times 150\) cubic cells, with the constriction diameter equal to 0.68 mm (Case 3). The simulation results for these additional models are presented in Fig. 9. In each case, the dynamics follows a similar pattern: necking at the constriction [(b) and (f)] is followed by snap-off [(c) and (g)]. The detached droplet travels away and regains a spherical shape once the geometrical constrictions are no more preventing it (d).

Also we have conducted a small grid convergence study and simulated one additional case (Case 2*) with all the parameters of the Case 2 except that the numerical grid was refined with a factor of 2, so that the grid dimensions were \(1500 \times 200 \times 200\).

Fig. 7
figure 7

Schematic representation of a non-wetting fluid jet and its leading spherical interface inside a capillary with constriction

Roof (1970) describes the snap-off mechanism in a similar geometry. In this paper, both experimental results and a simplified theoretical model are presented. The energy balance considerations lead to the conclusion that snap-off occurs in the constriction of the capillary tube when the radius of the detaching drop is approximately two times larger than the radius of the non-wetting phase stream in the constriction. Indeed, the stream inside the constriction has a near cylindrical shape with only one curvature radius \(r_\mathrm{j} \) meaning that capillary pressure equals \(p_\mathrm{j} =\gamma _{\mathrm{AB}} /r_\mathrm{j} \). At the same time, the detaching droplet has a near spherical leading interface with two identical curvature radii \(r_\mathrm{d} \) (Fig. 7). Therefore, capillary pressure of the detaching droplet is \(p_\mathrm{d} =2\gamma _{\mathrm{AB}} /r_\mathrm{d} \). The detachment can only occur when \(p_\mathrm{d} \le p_\mathrm{j} \) (meaning that separate droplet is more energy favorable since it has less pressure).

The pictures in Figs. 8 and 9 allow for measuring the curvature radii at the outer interface of the detaching droplet \(r_\mathrm{d} (x)\) and inside the constriction \(r_\mathrm{j} \). A quantitative analysis of the simulation results is presented in Table 1 and in Fig. 10, which visualizes the table. The error bars for the numerical simulation results are determined by the grid resolution; the smallest error bar corresponds to Case 2* with refined grid. The straight dashed line in Fig. 10 corresponds to the energy balance criterion \(r_\mathrm{d} =2r_\mathrm{j} \) discussed above.

To conclude this subsection, we note first that in all of the simulated cases, the snap-off occurs exactly in the constriction, which is in complete accordance with the theory. Also, the dependence of the detaching drop radius as it appears in the numerical simulation \((\tilde{r}_\mathrm{d} )\) versus the radius of the jet inside the constriction \((r_\mathrm{j} )\) follows the correct trend. A quantitative look at the simulation results reveals a minimal systematic difference between the radii \(\tilde{r}_\mathrm{d}\) and the theoretical one \((r_\mathrm{d} )\) following from the energy balance. However, the difference becomes significantly smaller for Case 2* with refined grid. Here, it also worth noting that the energy balance criterion is a quasi-static approximation not accounting for inertial effects (snap-off is a fast process having \(Re>1\) (DiCarlo et al. 2003)) and deformation of the interface caused by viscous friction. Therefore, one should not ultimately expect an exact correspondence between the simulation based on the full system of hydrodynamic equations and this criterion. The correspondence is improved (in relative quantities) for Case 3, where the constriction is wider and all types of errors (both simulation inaccuracies caused by finite-difference approximation and inertial effects unaccounted in the energy balance criterion) become smaller.

Fig. 8
figure 8

Geometry-related snap-off, Case 1

Fig. 9
figure 9

Geometry-related snap-off, ad Case 2, ef Case 3

Table 1 Simulation results for the geometrically constrained snap-off
Fig. 10
figure 10

Comparison of the DHD results (red dots) against the energy balance snap-off criterion by Roof (dashed line)

4.2.3 Immiscible Displacement and Snap-Off in Pore Doublets

In porous media flows, next to the geometry-related snap-off due to the swelling of wetting films in narrow constrictions, another type of snap-off occurs which is observed in imbibition when the front of the wetting phase advances faster through narrow pores and then disconnects and traps the non-wetting phase in larger pores (Unsal 2013). This situation can be reduced to the very simple model geometry of pore doublet models (PDM) that are widely used for studying two-phase flow and trapping mechanisms (Chatzis and Dullien 1983; Lake 1989). The basic pore doublet consists of two capillaries (pores) with different diameters connected to each other. In some cases, both capillaries may have a common inlet and outlet. This model represents an idealized pore space where the balance between capillary and viscous forces can be studied in great detail. At the same time, a theoretical understanding of the relevant processes is known since (at least) 1956 (Moore and Slobod 1956).

First, we describe a simple PDM constructed of two connected bent circular capillaries with different radii (Fig. 11): The thin capillary has radius equal to 0.3 and 0.6 mm, and the outlet capillary is 0.4 mm. A grid with \(500 \times 300 \times 60\) cubic cells was used to represent a model with dimensions of \(10\,\hbox {mm} \times 6\,\hbox {mm} \times 1.2\,\hbox {mm}\). The capillary walls are uniformly wet by phase A with a zero contact angle.

Initially, the model was filled with phase A as shown in Fig. 11a. Then, non-wetting phase B was continuously injected through the left-side capillary inlet. When phase B reached the nearest crossing of the two capillaries with different diameters, it flows through the broadest one [frames (b) and (c) of Fig. 11] as expected. Once phase B forms a single connected cluster, the steady-state regime is established (Fig. 11d) and Phase B never enters the thin capillary.

In the other scenario, the same model was filled initially with the non-wetting phase B with the wetting phase A present as a thin film on the walls of the capillaries (Fig. 12a). Then, the model was connected at the left inlet to the phase A reservoir. Phase A flows along the walls displacing the non-wetting phase B [frames (b)–(i) of Fig. 12] As a first remarkable feature of this process, a neck on the phase B cluster appears inside the thin capillary (c). Then, snap-off occurs and phase B rapidly recedes from the thin capillary (d, e). Only after phase B was completely displaced from the thin capillary did it start receding from the broad capillary (f). Soon a neck appears on the phase B cluster inside the exit outlet (g), quickly followed by snap-off causing the remaining portion of the non-wetting phase to become trapped (h). After being trapped, phase B recedes from the thinner capillary outlet back into the broader capillary where it remains (i).

The phenomena observed, in these two simulations, are consistent with the experimental behaviors described by Chatzis and Dullien (1983) when using similar PDM.

Fig. 11
figure 11

Drainage dynamics in two paths pore doublet. The wetting phase A is shown in blue semitransparent and the non-wetting phase B is shown in red

Fig. 12
figure 12

Imbibition dynamics in two paths pore doublet. The wetting phase A is shown in blue semitransparent and the non-wetting phase B is shown in red

4.2.4 Trapping and Flow Pattern in Systems of Connected Pores

Here, we describe the next level of complexity in multiphase flow where the capillary number dependency of snap-off is demonstrated using a different type of model. For that purpose, a system of four identical connected simple sections is employed, each made of two circular pores with different radii (Fig. 13) similar to those described by Lake (1989). The larger capillary has a diameter equal to 0.8 mm, and the thinner diameter is equal to 0.15 mm. A grid with \(480 \times 80 \times 80\) cubic cells was used to represent the model with dimensions \(4.8\,\hbox {mm} \times 0.8\,\hbox {mm} \times 0.8\,\hbox {mm}\). Capillary walls are uniformly wet by phase A with a zero contact angle.

Initially, the model was filled with non-wetting phase B, i.e., no wetting films of phase A were initially present. The left side of the model is connected to the Phase A reservoir, and the right side is assigned with constant pressure boundary condition. Three scenarios with different injection rates from the left reservoir were simulated. The scenarios were distinguished by the corresponding capillary numbers for Phase B: Case 1 –\(N_\mathrm{c} =3\times 10^{-5}\), Case 2 –\(N_\mathrm{c} =3\times 10^{-4}\), Case 3 –\(N_\mathrm{c} =3\times 10^{-3}\), where \(N_\mathrm{c} =v_\mathrm{B} \eta _\mathrm{B} /\gamma _{\mathrm{AB}} \) and \(v_\mathrm{B}\) is the average velocity of Phase B.

Fig. 13
figure 13

Imbibition dynamics in single path pore doublet, Case 1 \((N_\mathrm{c} =3\times 10^{-5})\). The wetting phase A is shown in blue semitransparent, and non-wetting phase B is shown in red

Fig. 14
figure 14

Imbibition dynamics in single path pore doublet, Case 2 \((N_\mathrm{c} =3\times 10^{-4})\). The wetting phase A is shown in blue semitransparent, and non-wetting phase B is shown in red

Fig. 15
figure 15

Imbibition dynamics in single path pore doublet, Case 3 \((N_\mathrm{c} =3\cdot 10^{-3})\). The wetting phase A is shown in blue semitransparent, and non-wetting phase B is shown in red semitransparent

Simulation results obtained for low capillary number Case 1 are presented in Fig. 13. Frame (a) shows the initial condition. After the start of injection of wetting phase A, it quickly propagates along the walls forming a film and displacing the non-wetting phase from the thin entry pore (b). In the next thin pore, a collar of phase A around phase B forms and then breaks the non-wetting phase cluster by snap-off, while at the same time the film advances to the beginning of the third largest pore (c). At the next stage, the film breaks through the entire model forming a continuous cluster, where in the thin neck regions phase B is snapped-off in a process analogous to that just described above (d). But displacement of Phase B does not stop here. Actually, it continues through successive dripping of phase B from one large pore to the next one through the neck regions in between the larger pores (d)–(g). During this process, the non-wetting phase is gradually depleted from the leftmost large pore, which is evident by comparing the consecutive images from (d) through (g). At the same time, the amount of phase B in the other large pores remains approximately the same as it is always restored by dripping from its neighbor to the left. Finally, the size of the residual blob of the non-wetting phase becomes so small that the increased surface tension does not allow it to enter the thin pore at the present phase A’s induced drag. At this moment, the described above “dripping and feeding” process stops and all four non-wetting blobs become terminally trapped (h).

At higher capillary number (i.e., Case 2). the imbibition process actually becomes less featured (Fig. 14). The speed at which the wetting phase film forms becomes comparable with Phase B displacement speed: In each frame of Fig. 14, the current position of the film is just one pore ahead the current position of meniscus and thus leaving no time for forming the collar, which could lead to snap-off and entrapment. The displacement of the non-wetting phase in this case goes smoothly and piston-like. This finding gives an important insight into the capillary de-saturation behavior, i.e., the dependency of residual non-wetting phase as a function of capillary number in imbibition (Lake 1989).

The imbibition process at even larger capillary number (Case 3) becomes more interesting (Fig. 15). Now, the wetting phase injection rate is so great that formation of the film lags behind the rush of the flux of phase A, which jets right through the phase B cluster. Overall, the flow is dominated by viscous forces rather than interfacial tension. Hydrodynamic instability leads to complex topological changes seen throughout the simulation (a)–(i). The interface between the phases fragments with forming of droplets. The droplets further breakup and coalesce. Also, temporary trapping of smaller droplets in hydrodynamic vortices can be observed (i).

Thus, the simulation series described above, in a range of capillary numbers covering three orders of magnitude, shows transition from interfacial tension-dominated flow to viscous force-dominated flow. The behavior in Cases 1 and 2 corresponds to the description given by Moore and Slobod (1956) for an experiment with similar geometry.

5 Conclusion

It was demonstrated that DFH applied to modeling two-phase hydrodynamics is able to reproduce elementary physical phenomena linked with both interfacial tension and viscous force-driven flow in simple representative geometries. Particularly, we have reproduced drainage and imbibition processes in a square duct. These simple processes play a fundamental role in multiphase flow through porous media. Our simulation results have appeared in full agreement with the experimental observations presented by Lenormand et al. (1983) and Lenormand (1990).

We have simulated various types of snap-off, including processes in free fluids and geometrically constrained systems. Snap-off is another fundamental mechanism relevant to multiphase flow in pores and determines the amount of the residual fluid trapped inside the pores as well as the efficiency of the recovery techniques. We have performed one-to-one comparison between a controlled experiment and numerical modeling of droplet pinch-off. All the details of the pinch-off dynamics were reproduced. We have correctly captured the droplet size and shape, necking and pinch-off, gravity–capillary oscillations, formation of a tiny secondary droplet, and all stages in both the numerical simulation and the experiment were compared at the same moments in time. Also, our modeling results compare well to the experiments on snap-off in free fluids reported by other authors (Cramer 2004; Thoroddsen et al. 2007).

In the geometrically constrained case, we have modeled snap-off in several slightly different geometries and demonstrated that snap-off occurs in the proper spatial location and shows correct quantitative trends consistent with the energy balance criterion given by Roof (1970).

We modeled more complex processes where various multiphase as well as the purely hydrodynamic phenomena interplay. Particularly, we have simulated drainage and imbibition in the pore doublet model similar to that used by Chatzis and Dullien (1983) and demonstrated that our results are consistent with the experimental observations reported therein. Then, we modeled two-phase flow in a system of connected pores for different flow regimes distinguished by capillary number. In addition to the simple scenarios, where the flow is mostly governed by interfacial tension, we simulated a high capillary number regime where viscous force is also significant. In the latter scenario, we demonstrated the ease, with which complex topological changes in the interfacial boundaries are captured by our modeling approach.

Overall, we demonstrated the application of DFH to the modeling of basic two-phase mechanisms relevant to multiphase flows through pores. Correct reproduction of these basic mechanisms is the necessary precursor for opening usage of DFH for simulation of more complex scenarios, including multiphase flow in realistic pore structures.