1 Introduction

Flow through porous media, especially in multi-phase systems, is of interest in a variety of applications from oil recovery and CO2 sequestration to fuel cells and biological systems. Traditionally these are modeled using extended Darcy’s law for two phases, which lacks the mathematical derivation from pore-scale information available for the single-phase Darcy’s law. Single-phase Darcy’s law can be derived from a pore-scale model of (Navier–)Stokes equations through upscaling procedures. For two phases Darcy’s law has been extended by introducing empirically derived relative permeability saturation curves to capture fluid interactions. Commonly, the effective behavior depends only on the averaged saturation and the model fails to capture different pore-scale effects. Further empiric modifications such as play-type hysteresis have been added to account for missing behavior. Additionally, efforts have been made to derive macro-scale models with effective parameters incorporating more detailed effects through closure problems (Auriault and Sanchez-Palencia 1986; Auriault 1987; Auriault et al. 1989; Bourgeat 1997; Whitaker 1986, 1994; Lasseux et al. 1996). In this work we start from a two-phase-flow model at the pore scale and through appropriate assumptions and a periodic homogenization approach, we derive a two-scale model of macroscopic Darcy’s law-type equations with effective parameters computed from solutions of resulting pore-scale cell problems. The presented two-scale model is derived for creeping flow and moderate capillary number.

The flow of the two fluids is modeled on the pore scale using quasi-compressible Navier–Stokes equations with phase-dependent density and viscosity as well as an additional term capturing surface tension forces at the fluid-fluid interface. For the pore-scale model with resolved phase distribution we use a diffuse interface approach in the form of an Allen–Cahn phase-field model (Allen and Cahn 1979). Where a sharp-interface model separates the pore space into subdomains for each fluid phase, our approach captures the interface implicitly through a smooth phase field function. All unknowns are defined and modified equations hold on the entire domain of the pore space. This removes the need to track or capture the interface and decompose the domain in the numeric simulation. To resolve the transition zone between the two bulk phases a fine discretization is required near the interface, requiring high computational effort in the absence of adaptive local mesh refinement. Furthermore the Allen–Cahn model used in this work is not conservative, including a curvature-driven motion of the interface. While the conservative Cahn–Hilliard model requires solving a fourth-order partial differential equation, we consider the second-order Allen–Cahn equation, which offers a much simpler numerical implementation, and we investigate the two-scale model derived from it. While there are different approaches to ensuring conservation of the phase field (Bringedal 2020) or counteracting this curvature-driven motion entirely (Xu et al. 2012), we apply the scaled mobility approach presented in Abels (2021) to eliminate the curvature-driven motion only in the sharp-interface limit. A core advantage of the diffuse interface approach is the ease of upscaling the equations, as they are defined on a stationary domain encompassing both fluid phases. In contrast, upscaling a sharp-interface model requires special attention to the evolving domains (van Noorden 2009).

The model is presented for two phases but extends well to more evolving phases (Kelm et al. 2022; Redeker et al. 2016), only a non-neutral contact angle at internal triple points between phases requires more attention (Rohde and von Wolff 2021). We consider an isothermal model but mention that phase-field models for two-phase flow influenced by temperature variations can be found in the literature (Zhang et al. 2022).

To bridge the scale gap between pore scale and the averaged Darcy scale we employ the method of formal asymptotic homogenization (Hornung 1997). Representing the porous medium by a periodic arrangement of scaled reference cells, one introduces an additional spatial coordinate for this smaller scale. Here the macroscopic scale corresponds to the Darcy scale and the microscopic scale is the pore scale. These two scales are sufficiently separated, with representative length scales L and \(\ell\) respectively defining a length scale ratio \(\epsilon = \ell /L \ll 1\). Assuming asymptotic expansions of the unknowns in terms of \(\epsilon\), considering the limit \(\epsilon \rightarrow 0\) and grouping by orders of \(\epsilon\), one obtains equations that are defined on the macro-scale and form micro-scale cell problems. The former contains effective parameters which are computed from the cell problem unknowns, linking the two scales. Through the cell problems, these parameters and the effective behavior depend additionally on the distribution of fluids and are able to capture more detailed effects on the fluid velocities.

The homogenization leads to macroscopic equations similar to the extended Darcy’s law but with effective parameters computed from solutions of cell problems instead of being given by empiric relations. These effective parameters can be understood as total phase mobilities and for isotropic pore geometries a relative permeability can be computed. Through the cell problems these relative permeabilities in the two-scale model depend on the local phase distribution at the pore scale. This motivates a comparison of computed relative permeabilities to commonly used functional relations, enabling us to investigate under which conditions the models agree and which additional pore-scale effects are captured by the two-scale model. We investigate numerically the effective parameters computed for different geometries and fluid properties. Constructing fluid distributions of varying saturations, we solve the cell problems for the velocity contributions to obtain a relative permeability curve. The models are implemented using a staggered finite volume discretization in DuMu\(^{\textsf{x}}\) (Koch et al. 2021), with Dune-SPGrid (Nolte 2011) and Dune-Subgrid (Gräser and Sander 2009) used for the grid.

In Daly and Roose (2015), Metzger and Knabner (2021), and Sharmin et al. (2022) a Cahn-Hilliard model was used to derive a similar two-scale model. We instead investigate the applicability of the simpler Allen–Cahn model and the effects of micro-scale information on the effective flow parameters. The derivation of a two-scale model in Metzger and Knabner (2021) additionally assumes a separation of time scales and a different asymptotic expansion to arrive at an instationary problem for the phase distribution. We use the full expansion in the spatial separation \(\epsilon\) instead and afterward introduce an artificial evolution to obtain a local phase distribution. In Daly and Roose (2015) three time scales are used to separate interface equilibration, macroscopic flow and saturation changes. In Sharmin et al. (2022) a solute-dependent surface tension is considered and simulations of the coupled two-scale model are presented. We instead focus on a systematic investigation of the effective parameters computed from the cell problems. A similar comparison of effective parameters is included in Lasseux and Valdés-Parada (2022), where a sharp-interface Stokes model for two-phase flow is upscaled using volume averaging. However, Lasseux and Valdés-Parada (2022) does not account for a three-phase contact line or slip velocities at the solid, which are accounted for in the current work.

In this contribution we aim to derive a two-scale model for two-phase flow in porous media, which captures effects of pore-scale fluid distribution and surface tension on the effective behavior at the macro-scale. Our goal is to determine conditions under which the computed effective parameters show significantly different behavior to commonly used saturation-dependent curves and highlight the importance of resolving pore-scale behavior through a two-scale model for two-phase porous-medium flow.

The structure of this paper is as follows. We present our pore-scale model for two-phase flow using an Allen–Cahn formulation coupled to a modified Navier–Stokes system in section 2. In Sect. 3 we perform the upscaling and obtain a two-scale model using periodic homogenization. We investigate the dependence of computed effective parameters on pore-scale conditions using DuMu\(^{\textsf{x}}\) in Sect. 4. Section 5 summarizes the derived model and relates it to the extended Darcy’s law.

2 Pore-Scale Modeling

We begin by presenting the pore-scale model describing two-phase flow. The model is first presented in a sharp-interface formulation, before we introduce the diffuse-interface description for the phase-field model.

The general domain is a stationary void space inside a porous medium. We consider a domain \(\Omega = {\mathcal {P}}\cup {\mathcal {G}}\) decomposed into a domain \({\mathcal {P}}\) capturing the pore space and the solid matrix \({\mathcal {G}}\). Here the distribution of two fluid phases needs to be captured and evolved according to the flow of the fluids, including effects of surface tension at the fluid-fluid interface.

2.1 Sharp-Interface Model

The model is first formulated with a sharp interface separating the fluid phases and corresponding evolving subdomains \(\Omega _\alpha (t) \subset {\mathcal {P}}\), \(\alpha = 1,2\) of the stationary pore space \({\mathcal {P}}\) (Fig. 1). The interfaces between the fluid phases, denoted by \({\Gamma _f}(t) = \overline{\Omega _1(t)} \cap \overline{\Omega _2(t)}\), as well as the fluid-solid interfaces \(\Gamma _\alpha = \overline{\Omega _\alpha } \cap {\mathcal {G}}\) evolve accordingly. Within each subdomain the flow is modeled using incompressible Navier-Stokes equations, with constant viscosity \(\mu ^{(\alpha )}\) and density \(\rho ^{(\alpha )}\).

$$\begin{aligned} \nabla \cdot \textbf{v}^{(\alpha )}{}&= 0 ~,{} & {} \text { in }\Omega _\alpha ~, \end{aligned}$$
(1)
$$\begin{aligned} \rho ^{(\alpha )}\frac{\partial }{\partial t} \textbf{v}^{(\alpha )}+ \rho ^{(\alpha )}\nabla \cdot (\textbf{v}^{(\alpha )}\otimes \textbf{v}^{(\alpha )})&= -\nabla p^{(\alpha )}+ \mu ^{(\alpha )}\nabla ^2 \textbf{v}^{(\alpha )}+ \rho ^{(\alpha )}\textbf{g} ~,{} & {} \text { in }\Omega _\alpha ~. \end{aligned}$$
(2)

At the interfaces \(\Gamma _\alpha\) with the solid matrix we prescribe a generalized Navier-slip (Barber et al. 2004) boundary condition with slip length \(\lambda \ge 0\) for the velocity \(\textbf{v}^{(\alpha )}\)

$$\begin{aligned} \textbf{v}^{(\alpha )}= -\lambda (\textbf{I} - \textbf{n}\textbf{n}) \cdot \left[ \textbf{n}\cdot \left( \nabla \textbf{v}^{(\alpha )}+ \nabla \textbf{v}^{(\alpha )T} \right) \right] ~, \qquad \text {on }\Gamma _\alpha ~, \end{aligned}$$
(3)

where \(\textbf{n}\) is the unit normal pointing into the solid matrix. This relaxation of a no-slip boundary condition is a simplified view of slip at the wall, ignoring the smaller scale phenomena causing it, see discussion in Ren and E (2007) and references therein. Note that the slip length \(\lambda\) may vary depending on phase and position, or be localized to the contact line of the fluid-fluid interface with the solid. As these dependencies are not the focus of this paper, they will not be made explicit in the following equations.

Fig. 1
figure 1

Interfaces and triple point

At the fluid–fluid interface \({\Gamma _f}\) we prescribe continuity of velocities, with interface velocity \(V_{\Gamma _f}\) in the direction of the interface normal \(\textbf{n}_{\Gamma _f}\) pointing from fluid 1 into fluid 2,

$$\begin{aligned} \textbf{v}^{(\alpha )}{} \cdot \textbf{n}_{\Gamma _f}= V_{\Gamma _f}~. \end{aligned}$$
(4)

The interface itself moves due to the local velocity of the fluids, and with surface tension \(\gamma\) and curvature \(H_{\Gamma _f}\), we have a jump condition

$$\begin{aligned} {[}-p^{(\alpha )}{} \textbf{I} + \mu ^{(\alpha )}{} (\nabla \textbf{v}^{(\alpha )}{} + (\nabla \textbf{v}^{(\alpha )}{})^T ]\textbf{n}_{\Gamma _f}= - \gamma H_{\Gamma _f}\textbf{n}_{\Gamma _f}\qquad \text {on }{\Gamma _f}~, \end{aligned}$$
(5)

where \([\psi ] = \psi _{2} - \psi _{1}\) denotes the jump over the interface. At the three-phase contact point the fluid–fluid-interface meets the solid with a contact angle \(\theta\) (Fig. 1). In a sharp-interface formulation this could be incorporated using a boundary condition for a level set equation, when a level set is used to track the location of the fluid-fluid-interface.

2.2 Phase-Field Model

To model two-phase flow at the pore scale we use a diffuse-interface approach, capturing the distribution of phases with a phase-field function \(u\) defined on the total void space \(u: T \times {\mathcal {P}}\rightarrow [0, 1]\) with \(u=0\) and \(u=1\) corresponding to the two distinct phases \(\alpha =2\) and \(\alpha =1\) respectively. The phase-field variable evolves according to an advective Allen–Cahn equation, a second-order partial differential equation (PDE) with a nonlinear source term. The multi-phase system is then modeled as one fluid with varying properties, depending on \(u(t, \textbf{x})\) to account for phase distribution.

We use the compressible Navier–Stokes equations for non-constant viscosity, derived from conservation laws neglecting the second viscosity coefficient. A surface tension flux is added to the momentum equation, coupling it to the Allen–Cahn equation as presented for the stationary Stokes equation in Abels and Liu (2018). In Abels et al. (2012) the surface tension term is introduced to a Navier-Stokes equation with a phase field evolved according to the Cahn–Hilliard equation.

The resulting Navier–Stokes equations in conservative form are

$$\begin{aligned} \frac{\partial \rho }{\partial t} + \nabla \cdot (\rho \textbf{v})&= 0&\text { in }{\mathcal {P}}~, \end{aligned}$$
(6a)
$$\begin{aligned} \frac{\partial }{\partial t}(\rho \textbf{v}) + \nabla \cdot (\rho \textbf{v}\otimes \textbf{v})&= -\nabla p + \nabla \cdot \left( \mu \left( \nabla \textbf{v}+ (\nabla \textbf{v})^T - \frac{2}{3} (\nabla \cdot \textbf{v}) {\textbf{I}} \right) \right) + \rho \textbf{g}&\nonumber \\&\quad - \frac{3}{2} \xi \gamma \nabla \cdot (\nabla u\otimes \nabla u)&\text { in }{\mathcal {P}}~, \end{aligned}$$
(6b)

with density-averaged velocity

$$\begin{aligned} \textbf{v}= (u \rho ^{(1)} \textbf{v}^{(1)} + (1-u)\rho ^{(2)} \textbf{v}^{(2)})/\rho (u) ~. \end{aligned}$$
(7)

The prefactor \((3/2)\xi\) of the surface tension flux in (6b) serves to cancel the integral arising in the sharp interface limit (92), evaluating to \(2/(3\xi )\) for the phase-field profile defined by (9). We focus on the case of each fluid being incompressible, treating the multi-phase system as a quasi-incompressible fluid with density and viscosity dependent on the present phase in a linear manner. Denoting mass and viscosity ratios \(R = \rho ^{(1)} / \rho ^{(2)}\) and \(M = \mu ^{(1)} / \mu ^{(2)}\), we write

$$\begin{aligned} \rho (u)&= \rho ^{(1)} u+ \rho ^{(2)} (1-u) = \rho ^{(2)} + u(\rho ^{(1)} - \rho ^{(2)}) = \rho ^{(2)} \left( 1+u\left( \frac{\rho ^{(1)}}{\rho ^{(2)}} - 1\right) \right) \nonumber \\&= \rho ^{(2)} (1 + u(R-1) ) ~, \end{aligned}$$
(8a)
$$\begin{aligned} \mu (u)&= \mu ^{(1)} u+ \mu ^{(2)} (1-u) = \mu ^{(2)} ( 1 + u(M-1) ) ~. \end{aligned}$$
(8b)

This is combined with the advective Allen–Cahn equation, additionally coupled via the advecting velocity and the surface tension momentum flux. The phase-field equation is given as

$$\begin{aligned} \frac{\partial u}{\partial t} + \nabla \cdot (\textbf{v}u) = \sigma \xi ( \nabla ^2 u- \xi ^{-2} P'(u) ) \,,\quad \text {in }{\mathcal {P}}\,,\quad P(u) = 8 u^2 (1-u)^2 ~, \end{aligned}$$
(9)

with volume fraction \(u\) as the order parameter and the scaled diffusivity \(\sigma \xi\) suggested in Abels (2021) in order to obtain a more favorable sharp-interface limit. The parameter \(\sigma\) and diffuse–interface width \(\xi\) prescribe how strongly a certain profile is enforced for the transition zone between bulk phases and the width of this zone, respectively. The double-well potential, employing the commonly used expression \(P(u)\), encourages a separation of phases through stable minima at \(u= 0\) and \(u= 1\).

The (no-)slip boundary conditions on solid boundaries apply also here, with dependence of \(\lambda\) on the phase-field \(u\) if appropriate. Additionally for the phase-field a Neumann boundary condition encoding the contact angle \(\theta\) measured through fluid 1, corresponding to \(u= 1\) (Fig 2), is prescribed (Frank et al. 2018).

$$\begin{aligned} \textbf{v}&= -\lambda (\textbf{I} - \textbf{n}\textbf{n}) \cdot \left[ \textbf{n}\cdot \left( \nabla \textbf{v}+ \nabla \textbf{v}^T \right) \right] ~,{} & {} \text { on }\partial {\mathcal {P}}~, \end{aligned}$$
(10a)
$$\begin{aligned} \partial _\textbf{n}u&= -\cos (\theta ) \Vert \nabla u\Vert = -\cos (\theta ) \xi ^{-1} \sqrt{2P(u)} ~,{} & {} \text { on }\partial {\mathcal {P}}~. \end{aligned}$$
(10b)

The expression on the right-hand side of (10b) relates to the norm of \(\nabla u\) through the profile of the diffuse interface, see (83). In a numeric context, a flux boundary condition for the momentum equation needs to be specified to incorporate a nonzero slip velocity boundary condition. The normal flux of the surface tension term in (6b) requires derivatives of \(u\) also in the tangential plane. By vector decomposition the magnitude of the tangential component is given accordingly as

$$\begin{aligned} \Vert (\textbf{I} - \textbf{n}\textbf{n}) \nabla u\Vert = |\sin (\theta )| \xi ^{-1} \sqrt{2 P(u)} ~, \end{aligned}$$
(11)

but the direction depends on the distribution of phases and is to be determined in a numeric implementation.

While the contact angle generally depends on the local fluid velocity, and wall properties may introduce heterogeneity, we consider for simplicity only constant contact angles. Dynamic contact angles can be incorporated in the homogenization procedure by treating the varying contact angle as a variable, as done in a sharp-interface context in Lunowa et al. (2021). For a phase-field model, a dynamic contact angle is introduced by including a time derivative \(\partial _t u\) into the contact angle boundary condition as done for Cahn–Hilliard systems in (Jacqmin 2000; Xu et al. 2018).

Slip can be limited to the contact line by an interface indicator \(\delta _1(u) = 4 u(1-u)\), and phase-dependent slip lengths can be incorporated by interpolating at the diffuse interface. More complex models for slip velocities have been considered for the Cahn-Hilliard systems in (Jacqmin 2000; Xu et al. 2018), incorporating wall shear stresses and the uncompensated Young stress of generalized Navier boundary condition, respectively.

The effect of such extended boundary conditions on the derived two-scale model is limited, as the upscaling procedure simply selects leading order terms for the respective cell problems. The resulting expressions for effective parameters would accordingly include the leading order of the applied boundary condition, otherwise leaving their structure unchanged. Therefore, we consider for simplicity the special cases defined through (10) only.

Note that for vanishing slip length \(\lambda =0\) and for neutral contact angle \(\theta = \frac{\pi }{2}\), the boundary conditions reduce to homogeneous Dirichlet and Neumann conditions for velocity and phase field, respectively. The appendix 1 includes the sharp-interface limit of the coupled Navier–Stokes Allen–Cahn system presented in this section, yielding again the sharp-interface model presented in Sect. 2.1.

Fig. 2
figure 2

Contact angle boundary condition for the diffuse-interface phase-field model

3 Upscaling Using Periodic Homogenization

Starting from the diffuse-interface model from Sect. 2.2, describing the phase distribution and flow at the pore scale, we derive effective equations capturing the behavior at the Darcy scale. At the same time we obtain a set of micro-scale cell problems, defined at each macroscopic point, the solutions of which allow the computation of effective tensors. These are then used as parameters to the macro-scale problem, which in turn supplies global pressure gradients and saturations used by the cell problems, arriving at a coupled two-scale problem. As will be shown, these effective parameters can be interpreted as phase mobilities.

To achieve this we assume a sufficient separation of scales, with characteristic length scales \(\ell\) for the pore scale and L for the Darcy scale at which we are interested in the effective behavior. Assuming a scale separation \(\epsilon = \ell /L \ll 1\), we first non-dimensionalize the model. We then follow the approach of periodic homogenization, modeling the porous medium as a periodic arrangement of scaled reference cells \(\epsilon Y\), \(Y = [0, 1]^\textrm{d}\) with dimension \(\textrm{d}\), where \(\textrm{d}\) is 2 or 3, (see Fig. 3). The domain of the porous medium is thus decomposed into \(\Omega ^\epsilon = \cup _{w \in W_\Omega } \,\epsilon (w + Y)\), with \(W_\Omega \in {\mathbb {Z}}^\textrm{d}\) a set of indices. With local pore space and solid matrix denoted as \(Y = {\mathcal {P}}\cup {\mathcal {G}}\) and the outer boundary of the reference cell given as \(\partial Y\) we denote the interior boundary between solid and fluid as

$$\begin{aligned} \Gamma = {\overline{{\mathcal {P}}}} \cap {\mathcal {G}}~. \end{aligned}$$
(12)

The global pore space and its boundary with the solid matrix in the non-dimensional case is then given as

$$\begin{aligned} {\mathcal {P}}^\epsilon = \cup _{w \in W_\Omega } \,\epsilon (w + {\mathcal {P}}) ~,\quad \Gamma ^\epsilon = \cup _{w \in W_\Omega } \,\epsilon (w + \Gamma ) ~. \end{aligned}$$
(13)

While their fluid content can generally vary between the cells, we here assume that the porous matrix is constant both in time and space in order to facilitate the derivation of the two-scale model. As the reference cell is the unit cube, we can define the constant porosity \(\varphi = |{\mathcal {P}}|\). The conditions inside the pore spaces still vary, with fluid saturations and distributions changing in time and between cells.

Fig. 3
figure 3

Separation of scales and domain definitions

We use the scale separation to introduce a micro-scale coordinate, rewrite spatial derivatives accordingly, assign scalings in terms of \(\epsilon\) for the dimensionless numbers and assume all unknowns to have an asymptotic expansion in \(\epsilon\). Inserting the expansions into the model equations and gathering terms of equal order in terms of \(\epsilon\) we obtain a new set of equations containing derivatives with respect to coordinates of only one of the spatial scales. This procedure yields macroscopic equations capturing the effective behavior and cell problems defined on the reference cell. Effective parameters are defined through cell problems and integrals of their solutions, linking the two sets of equations and capturing detailed effects of local phase distribution on effective behavior. In addition to pressure driven flow, a separate cell problem captures flow due to surface tension forces, reflected in an added velocity contribution on the effective scale.

3.1 Non-dimensionalization

In preparation of upscaling by periodic homogenization we non-dimensionalize the micro-scale model. The homogenization requires a separation of scales between representative length \(\ell\) at the pore scale and the length scale of interest L at the macro scale, quantified by the small number \(\epsilon = \ell /L \ll 1\). Defining reference values with dimensions

$$\begin{aligned} \begin{aligned} {[}{\hat{L}}]&= \textrm{m}&[{\hat{\ell }}]&= \textrm{m}&[{\hat{\xi }}]&= \textrm{m}&[{\hat{t}}]&= \textrm{s}&[{\hat{v}}]&= \mathrm {\frac{m}{s}} \\ [{{\hat{\rho }}}]&= \mathrm {\frac{kg}{m^3}}&[{{\hat{\mu }}}]&= \mathrm {\frac{kg}{m \cdot s}}&[{\hat{p}}]&= \mathrm {\frac{kg}{m \cdot s^2}}&[{{\hat{\lambda }}}]&= \textrm{m}&[{{\hat{\sigma }}}]&= \mathrm {\frac{m}{s}} ~, \end{aligned} \end{aligned}$$
(14)

and letting

$$\begin{aligned} {\hat{L}}&= L&{\hat{\ell }}&= \ell&{{\hat{\xi }}}&= {\hat{\ell }}&{\hat{t}}&= \frac{{\hat{L}}}{{\hat{v}}}&{{\hat{\rho }}}&= \rho ^{(2)}&{{\hat{\mu }}}&= \mu ^{(2)}&{{\hat{\lambda }}}&= {\hat{\ell }}&{{\hat{\sigma }}}&= \sigma ~, \end{aligned}$$
(15)

one can rewrite the phase-field model equations using non-dimensional variables and parameters

$$\begin{aligned} {{\bar{\xi }}}&= \frac{\xi }{{\hat{\xi }}}&{{\bar{\textbf{v}}}}&= \frac{\textbf{v}}{{\hat{v}}}&{{\bar{\rho }}}&= \frac{\rho }{{{\hat{\rho }}}}&{{\bar{\mu }}}&= \frac{\mu }{{{\hat{\mu }}}}&{\bar{p}}&= \frac{p}{{\hat{p}}}&{\bar{t}}&= \frac{t}{{\hat{t}}}&{{\bar{\lambda }}}&= \frac{\lambda }{{\hat{\lambda }}} ~. \end{aligned}$$
(16)

Note that to resolve pore-scale interfaces with a diffuse interface, the parameter \(\xi\) must scale with the pore-scale length \(\ell\).

In the following all variables and parameters are non-dimensional and the overline notation is dropped for convenience. Despite their nondimensionality, they are referred to as their associated dimensional quantities, e.g. velocity in the following. Using dimensionless numbers

$$\begin{aligned} \textrm{Re}\,&= \frac{{{\hat{\rho }}} {\hat{v}} {\hat{L}}}{{{\hat{\mu }}}}&\textrm{Ca}\,&= \frac{{\hat{v}} {{\hat{\mu }}}}{\gamma }&\textrm{Eu}&= \frac{{\hat{p}}}{{{\hat{\rho }}} {\hat{v}}^2}&\textrm{Fr}&= \frac{{\hat{v}}}{\sqrt{g {\hat{L}}}}&S&= \frac{{{\hat{\sigma }}}}{{\hat{v}}} ~, \end{aligned}$$
(17)

one obtains (see appendix 2 for details)

$$\begin{aligned} \frac{\partial \rho }{\partial t} + \nabla \cdot (\rho \textbf{v})&= 0{} & {} ~, \text { in }{\mathcal {P}}~, \end{aligned}$$
(18a)
$$\begin{aligned} \frac{\partial }{\partial t} (\rho \textbf{v}) + \nabla \cdot (\rho \textbf{v}\otimes \textbf{v})&= - \textrm{Eu}\nabla p + \frac{1}{\textrm{Re}\,} \nabla \cdot \left( \mu \left( \nabla \textbf{v}+ (\nabla \textbf{v})^T - \frac{2}{3} (\nabla \cdot \textbf{v}){\textbf{I}} \right) \right) \nonumber \\&\quad - \frac{1}{\textrm{Fr}^2} \rho {\textbf{z}} - \frac{\epsilon }{\textrm{Ca}\,} \frac{3\xi }{2} \nabla \cdot (\nabla u\otimes \nabla u){} & {} ~, \text { in }{\mathcal {P}}~, \end{aligned}$$
(18b)

with boundary condition

$$\begin{aligned} \textbf{v}= -\epsilon \lambda (\textbf{I} - \textbf{n}\textbf{n}) \cdot \left[ \textbf{n}\cdot \left( \nabla \textbf{v}+ \nabla \textbf{v}^T \right) \right] ~, \text { on } \Gamma ~. \end{aligned}$$
(19)

For the phase-field equation the non-dimensionalization yields (see appendix 2 for details)

$$\begin{aligned} \frac{\partial u}{\partial t} - S \epsilon \xi \nabla ^2 u+ \nabla \cdot (\textbf{v}u) = -S \epsilon ^{-1} \xi ^{-1} P'(u) ~, \text { in }{\mathcal {P}}~, \end{aligned}$$
(20)

with boundary condition

$$\begin{aligned} \partial _\textbf{n}u= -\epsilon ^{-1} \xi ^{-1} \cos (\theta ) \sqrt{2P(u)} ~, \text { on } \Gamma ~. \end{aligned}$$
(21)

3.1.1 Phase-Constant Density and Viscosity

Using the above equations (8) for density and viscosity and the reference values (15), the non-dimensional viscosity and density in (18) are

$$\begin{aligned} \mu (u) =&\frac{1}{{{\hat{\mu }}}}(\mu ^{(1)} u+ \mu ^{(2)} (1-u)) = 1 + u(M - 1) ~, \end{aligned}$$
(22)
$$\begin{aligned} \rho (u) =&1 + u(R - 1) ~. \end{aligned}$$
(23)

3.2 Periodic Homogenization

Given the scale separation \(\epsilon\) we introduce the micro-scale coordinate \(\textbf{y}= \epsilon ^{-1} \textbf{x}\) and assume all unknowns can be written as an asymptotic expansion in \(\epsilon\), depending on both \(\textbf{x}\) and \(\textbf{y}\) with periodicity in the unit cell Y. For an unknown \(\psi \in \{p, \textbf{v}, u\}\) we introduce Y-periodic \(\psi _k(t, \textbf{x}, \textbf{y})\) such that

$$\begin{aligned} \psi (t, \textbf{x}) = \sum _{k=0}^\infty \epsilon ^k \psi _k \left( t, \textbf{x}, \frac{\textbf{x}}{\epsilon } \right) ~. \end{aligned}$$
(24)

The spatial derivatives are rewritten as

$$\begin{aligned} \nabla \psi = \nabla _\textbf{x}\sum _{k=0}^\infty \epsilon ^k \psi _k (t, \textbf{x}, \textbf{y}) + \frac{1}{\epsilon } \nabla _\textbf{y}\sum _{k=0}^\infty \epsilon ^k \psi _k (t, \textbf{x}, \textbf{y}) ~. \end{aligned}$$
(25)

For the upscaling we consider a flow regime that would correspond to Darcy’s law being valid for single-phase flow, with laminar flow driven by the pressure drop and capillary forces, and where advective and diffusive time scales are of the same order. We assume capillary forces to be moderate. For the phase distribution, the phase-field parameter \(\sigma\) should be comparable to the micro-scale advection, captured by \(S \in {\mathcal {O}}(\epsilon ^{0})\). As will be shown in Remark 1, with \(S\in {\mathcal {O}}(\epsilon ^{1})\) the advective term separates in the upscaling process and yields a restrictive pore-scale equation as well as introducing mixed-scale derivatives into the phase-field equation. Choosing non-dimensional numbers \(\textrm{Ca}\,\in {\mathcal {O}}(\epsilon ^{0})\), \(\textrm{Re}\,\in {\mathcal {O}}(\epsilon ^{0})\), \(\textrm{Eu}\in {\mathcal {O}}(\epsilon ^{-2})\) and \(\textrm{Fr}\in {\mathcal {O}}(\epsilon ^{0})\), the leading terms for \(\epsilon \rightarrow 0\) are given as follows (see appendix 3 for details).

For the phase-dependent fluid properties we observe

$$\begin{aligned} \mu (u)&= (1+u(M-1)) = \underbrace{1 + u_0(M-1)}_{=\mu (u_0)} + \epsilon u_1(M-1) + {\mathcal {O}}(\epsilon ^{2}) \end{aligned}$$
(26a)
$$\begin{aligned} \rho (u)&= (1+u(R-1)) = \underbrace{1 + u_0(R-1)}_{=\rho (u_0)} + \epsilon \underbrace{u_1(R-1)}_{=\rho _1} + {\mathcal {O}}(\epsilon ^{2}) ~, \end{aligned}$$
(26b)

and for the double-well potential of the phase-field equation, due to its polynomial structure,

$$\begin{aligned} P'(u)&= P'(u_0) + \epsilon u_1 P''(u_0) + {\mathcal {O}}(\epsilon ^{2}) ~. \end{aligned}$$
(26c)

Denoting \({\overline{\textrm{Eu}}}:= \epsilon ^2 \textrm{Eu}\), we have for (18a), (18b) and (20) in \({\mathcal {P}}\)

$$\begin{aligned} {\mathcal {O}}(\epsilon ^{1}) =&\epsilon ^{-1} \nabla _\textbf{y}\cdot (\rho (u_0) \textbf{v}_0) \nonumber \\&+ \epsilon ^{0} \bigg [ \frac{\partial \rho (u_0)}{\partial t} + \nabla _\textbf{y}\cdot (\rho (u_0) \textbf{v}_1 + \rho _1 \textbf{v}_0) + \nabla _\textbf{x}\cdot (\rho (u_0) \textbf{v}_0) \bigg ] \end{aligned}$$
(27a)
$$\begin{aligned} {\mathcal {O}}(\epsilon ^{-1}) =&\epsilon ^{-3} \left[ -{{\overline{\textrm{Eu}}}} \nabla _\textbf{y}p_0 \right] \nonumber \\&+ \epsilon ^{-2} \bigg [ -{{\overline{\textrm{Eu}}}} (\nabla _x p_0 + \nabla _\textbf{y}p_1) \nonumber \\&+ \frac{1}{\textrm{Re}\,} \nabla _\textbf{y}\cdot \left( \mu (u_0) \left( \nabla _\textbf{y}\textbf{v}_0 +(\nabla _\textbf{y}\textbf{v}_0)^T - \frac{2}{3} (\nabla _\textbf{y}\cdot \textbf{v}_0) \textbf{I} \right) \right) \nonumber \\&- \frac{1}{\textrm{Ca}\,} \frac{3\xi }{2} \nabla _\textbf{y}\cdot (\nabla _\textbf{y}u_{0} \otimes \nabla _\textbf{y}u_{0} ) \bigg ] \end{aligned}$$
(27b)
$$\begin{aligned} {\mathcal {O}}(\epsilon ^{1}) =&\epsilon ^{-1} [ \nabla _\textbf{y}\cdot (\textbf{v}_0 u_{0}) - S \xi \nabla _\textbf{y}^2 u_{0} + S \xi ^{-1} P'(u_{0})] \nonumber \\&+ \epsilon ^{0} \bigg [ \frac{\partial u_{0}}{\partial t} + \nabla _\textbf{y}\cdot (\textbf{v}_1 u_{0} + \textbf{v}_0 u_{1}) + \nabla _\textbf{x}\cdot (\textbf{v}_0 u_{0}) +S \xi ^{-1} P''(u_{0}) u_{1} \nonumber \\&-S \xi ( \nabla _\textbf{y}\cdot \nabla _\textbf{x}u_{0} + \nabla _\textbf{x}\cdot \nabla _\textbf{y}u_{0} + \nabla _\textbf{y}^2 u_{1} ) \bigg ] \end{aligned}$$
(27c)

and for boundary conditions (19) and (21) on \(\Gamma\)

$$\begin{aligned} {\mathcal {O}}(\epsilon ^{1})&= \epsilon ^{0} \Big [ \textbf{v}_0 + \lambda (\textbf{I} - \textbf{n}\textbf{n}) \cdot \left[ \textbf{n}\cdot \left( \nabla _\textbf{y}\textbf{v}_0 + \nabla _y \textbf{v}_0^T \right) \right] \Big ] \end{aligned}$$
(27d)
$$\begin{aligned} {\mathcal {O}}(\epsilon ^{-\frac{1}{2}})&= \epsilon ^{-1} \Big [ \nabla _\textbf{y}u_0 \cdot \textbf{n}+ \xi ^{-1} \cos (\theta ) \sqrt{2P(u_0)} \Big ] ~. \end{aligned}$$
(27e)

3.2.1 Phase Field

From the leading order term of (27c) we therefore obtain a stationary equation involving only local derivatives.

$$\begin{aligned} - S \xi \nabla _\textbf{y}^2 u_{0} + \nabla _\textbf{y}\cdot (\textbf{v}_0 u_{0}) = -S \xi ^{-1} P'(u_{0}) ~, \qquad \text { in }{\mathcal {P}}~, \end{aligned}$$
(28)

together with boundary condition (27e)

$$\begin{aligned} \nabla _\textbf{y}u_0 \cdot \textbf{n}= - \xi ^{-1} \cos (\theta ) \sqrt{2P(u_0)}~, \qquad \text { on }\Gamma ~. \end{aligned}$$
(29)

Remark 1

If the phase-field equation is dominated by advection (\(S \in {\mathcal {O}}(\epsilon ^{1})\)) the leading order advective term of (27c) would be isolated at \({\mathcal {O}}(\epsilon ^{-1})\) as

$$\begin{aligned} \nabla _\textbf{y}\cdot ( \textbf{v}_0 u_{0} ) = 0 ~. \end{aligned}$$
(30)

Applied to the leading order term in (27a) this yields a divergence free velocity field and reduces to

$$\begin{aligned} \textbf{v}_0 \cdot \nabla _\textbf{y}u_{0} = 0 ~, \end{aligned}$$
(31)

resulting in a strong limitation on modeled problems. At the order \({\mathcal {O}}(\epsilon ^{0})\) the equation (27c) would instead contain the leading order of the diffusive and potential derivative terms together with the advective terms of the next order, yielding

$$\begin{aligned} 0 = \frac{\partial u_0}{\partial t} + \nabla _\textbf{y}\cdot (\textbf{v}_1 u_0 + \textbf{v}_0 u_1) + \nabla _\textbf{x}\cdot (\textbf{v}_0 u_0) - S \xi \nabla _\textbf{y}^2 u_{0} + S \xi ^{-1} P'(u_{0}) \end{aligned}$$
(32)

with an undesireable mix of scales that leads to neither a pore-scale cell problem nor an effective equation for the Darcy scale. A balance of the two terms is expressed by \(S \in {\mathcal {O}}(1)\), which yields (28) instead of (30) as the leading order equation.

This local phase-field equation (28) is underconstrained, admitting among others the trivial solutions of \(u_0\equiv 0\) and \(u_0\equiv 1\) for divergence free velocity fields. The coupled problem must uniquely define a macro-scale saturation of the fluids. Since the local cell problem does not offer a way to compute the saturation of fluid 1 as the mean integral of \(u_0\), it instead requires it as a constraint as in Sharmin et al. (2022).

From the next order \({\mathcal {O}}(\epsilon ^{0})\) terms of the phase-field equation (27c) we obtain

$$\begin{aligned} \begin{aligned} 0&= \frac{\partial u_0}{\partial t} - S\xi ( \nabla _\textbf{y}^2 u_{1} + \nabla _\textbf{y}\cdot (\nabla _\textbf{x}u_{0}) + \nabla _\textbf{x}\cdot (\nabla _\textbf{y}u_{0}) ) \\&\quad + ( \nabla _\textbf{y}\cdot (\textbf{v}_1u_{0} + \textbf{v}_0u_{1}) + \nabla _\textbf{x}\cdot (\textbf{v}_0 u_{0}) ) + S \xi ^{-1} P''(u_{0}) u_{1} ~. \end{aligned} \end{aligned}$$
(33)

We would like to use this instationary equation to update the saturation and in turn constrain the stationary phase-field equation obtained from the leading order term of the asymptotic expansion. After integrating over the constant local periodicity cell \({\mathcal {P}}\) and using the periodicity with respect to \(\textbf{y}\), (33) reduces to

$$\begin{aligned} \frac{\partial }{\partial t} \int _{\mathcal {P}}u_{0} \,\textrm{d}\textbf{y}+ \nabla _\textbf{x}\cdot \int _{\mathcal {P}}\textbf{v}_0 u_{0} \,\textrm{d}\textbf{y}+ \int _{\mathcal {P}}\frac{S}{\xi } P''(u_{0}) u_{1} \,\textrm{d}\textbf{y}=0 ~. \end{aligned}$$
(34)

While the first two terms yield a macroscopic equation in saturation and phase-specific velocity, the last term includes the additional unknown \(u_{1}\). Assuming a homogeneous porous medium, with \({\mathcal {P}}\) not depending on \(\textbf{x}\), one can use a solvability constraint to show that this term is zero and obtain the desired saturation equation.

Integrating the leading order terms (28) and applying the divergence theorem and periodicity conditions, one is left with only the potential derivative.

$$\begin{aligned} 0 = \underbrace{\int _{\mathcal {P}}-S \xi \nabla _\textbf{y}\cdot (\nabla _\textbf{y}u_0) + \nabla _\textbf{y}\cdot (\textbf{v}_0 u_0) \,\textrm{d}\textbf{y}}_{=0} + \int _{\mathcal {P}}\frac{S}{\xi } P'(u_0) \,\textrm{d}\textbf{y}\end{aligned}$$
(35)

One now views the third term in (34) as a Fredholm operator of index zero \({\mathcal {L}}(u_0)\) applied to \(u_1\). Applying it instead to \(\nabla _\textbf{x}u_0\), using the chain rule and the assumption of \({\mathcal {P}}\) not depending on \(\textbf{x}\), we obtain

$$\begin{aligned} {\mathcal {L}}(u_0) (\nabla _\textbf{x}u_0) = \int _{\mathcal {P}}\frac{S}{\xi } P''(u_0) \nabla _\textbf{x}u_0 \,\textrm{d}\textbf{y}= \int _{\mathcal {P}}\frac{S}{\xi } \nabla _\textbf{x}(P'(u_0)) \,\textrm{d}\textbf{y}= \frac{S}{\xi } \nabla _\textbf{x}\int _{\mathcal {P}}P'(u_0) \,\textrm{d}\textbf{y}~. \end{aligned}$$
(36)

Together with the previously derived information about \(P'\) from (35), one sees that \(\nabla _\textbf{x}u_0\) is an element of the kernel of \({\mathcal {L}}(u_0)\). Rewriting (34) as \(-{\mathcal {L}}(u_0)u_1 = A(u_0, \textbf{v}_0)\) with

$$\begin{aligned} A(u_0, \textbf{v}_0) = \int _{\mathcal {P}}\frac{\partial u_0}{\partial t} + \nabla _\textbf{x}\cdot (\textbf{v}_0 u_0) \,\textrm{d}\textbf{y}~, \end{aligned}$$
(37)

this yields the solvability constraint

$$\begin{aligned} 0 = <A(u_0, \textbf{v}_0), \nabla _\textbf{x}u_0>= \int _\Omega \nabla _\textbf{x}u_0 (\textbf{x},\textbf{y}) \left( \int _{\mathcal {P}}\frac{\partial u_0}{\partial t} + \nabla _\textbf{x}\cdot (\textbf{v}_0 u_0) \,\textrm{d}\textbf{y}\right) (\textbf{x}) \,\textrm{d}\textbf{x}~. \end{aligned}$$
(38)

To avoid trivial behavior (\(\nabla _\textbf{x}u_0 \equiv 0\), \(\nabla _\textbf{x}u_0\) independent of \(\textbf{x}\)), the integral over the local pore-space \({\mathcal {P}}\) must disappear. Using again the assumption of a stationary and homogeneous pore space \({\mathcal {P}}\) with constant porosity \(\varphi\), this yields the saturation equation

$$\begin{aligned} \frac{\partial }{\partial t} \int _{\mathcal {P}}u_0 \,\textrm{d}\textbf{y}+ \nabla _\textbf{x}\cdot \int _{\mathcal {P}}\textbf{v}_0 u_0 \,\textrm{d}\textbf{y}= 0 ~. \end{aligned}$$
(39)

Introducing averaged quantities for the saturation of fluid 1, \(S^{(1)} = \varphi ^{-1} \int _{\mathcal {P}}u_0 \,\textrm{d}\textbf{y}\), as well as velocities

$$\begin{aligned} {{\bar{\textbf{v}}}}^{(1)} = \int _{\mathcal {P}}u_0 \textbf{v}_0 \,\textrm{d}\textbf{y}~,\qquad {{\bar{\textbf{v}}}}^{(2)} = \int _{\mathcal {P}}(1 - u_0) \textbf{v}_0 \,\textrm{d}\textbf{y}~,\qquad {{\bar{\textbf{v}}}} = \int _{\mathcal {P}}\textbf{v}_0 \,\textrm{d}\textbf{y}~, \end{aligned}$$
(40)

we obtain

$$\begin{aligned} \frac{\partial }{\partial t} \int _{\mathcal {P}}u_0 \,\textrm{d}\textbf{y}+ \nabla _\textbf{x}\cdot \int _{{\mathcal {P}}} \textbf{v}_0 u_0\,\textrm{d}\textbf{y}= \varphi \frac{\partial }{\partial t} S^{(1)}(\textbf{x}) + \nabla _\textbf{x}\cdot {{\bar{\textbf{v}}}}^{(1)}(\textbf{x}) = 0 ~. \end{aligned}$$
(41)

The second-order term of the mass conservation equation (27a)

$$\begin{aligned} 0= \frac{\partial \rho (u_0)}{\partial t} + \nabla _\textbf{y}\cdot (\rho (u_0) \textbf{v}_1 + \rho _1 \textbf{v}_0) + \nabla _\textbf{x}\cdot (\rho (u_0) \textbf{v}_0) ~, \end{aligned}$$
(42)

yields, using (26b) and after integration over \({\mathcal {P}}\),

$$\begin{aligned} (R-1) \frac{\partial }{\partial t} \int _{\mathcal {P}}u_{0} \,\textrm{d}\textbf{y}+ (R-1) \nabla _\textbf{x}\cdot \int _{\mathcal {P}}u_{0} \textbf{v}_0 \,\textrm{d}\textbf{y}+ \nabla _\textbf{x}\cdot \int _{\mathcal {P}}\textbf{v}_0 \,\textrm{d}\textbf{y}~, \end{aligned}$$
(43)

a second conservation equation.

Inserting (41) into (43) yields \(\nabla _\textbf{x}\cdot {\bar{\textbf{v}}} = 0\) and with \(S^{(2)} = 1 - S^{(1)}\) a saturation equation for the second phase, corresponding to \(u_0 = 0\),

$$\begin{aligned} 0 = \varphi \frac{\partial }{\partial t} (S^{(1)} + S^{(2)}) = \varphi \frac{\partial }{\partial t} S^{(2)} + \nabla _\textbf{x}\cdot \int _{\mathcal {P}}(1-u_0) \textbf{v}_0 \,\textrm{d}\textbf{y}= \varphi \frac{\partial }{\partial t} S^{(2)} + \nabla _\textbf{x}\cdot {{\bar{\textbf{v}}}}^{(2)} ~. \end{aligned}$$
(44)

These macroscopic equations (41), (44), through the saturation, yield an integral constraint for the local phase-field. Together with the stationary equation (28) and boundary condition (29) we obtain the cell problem

$$\begin{aligned} {\left\{ \begin{array}{ll} \nabla _\textbf{y}\cdot (\textbf{v}_0 u_0) = S\xi \nabla _\textbf{y}^2 u_0 - S\xi ^{-1} P'(u_0) &{} \text { in } {\mathcal {P}}~,\\ \nabla _\textbf{y}u_0 \cdot \textbf{n}= - \xi ^{-1} \cos (\theta ) \sqrt{2P(u_0)}&{} \text { on } \Gamma ~,\\ u_0 \text { is }Y\text {-periodic and } \int _{\mathcal {P}}u_0 = \varphi S^{(1)} ~. \end{array}\right. } \end{aligned}$$
(45)

While this ensures mass-conservation it does not fully prescribe a distribution of the phases. The stationary phase-field equation (45) still defines the profile of the diffuse transition zone but the position is not clear. This phase distribution however is central to the equations for fluid flow. To obtain a meaningful solution to this stationary problem one could introduce an artificial time evolution in \(\tau\), evolving the phase-field function toward the target saturation \(S^{(1)}\). To this end we introduce the difference between the target and current saturation,

$$\begin{aligned} S^{(1)} - \frac{1}{\varphi } \int _{\mathcal {P}}u_0 \,\textrm{d}\textbf{y}~, \end{aligned}$$
(46)

as an additional source term. The function

$$\begin{aligned} \delta _\xi (u_0) = 4 \xi ^{-1} u_0 (1-u_0) \end{aligned}$$
(47)

attains its maximum at \(u_0 = 0.5\) and acts as an indicator for the diffuse interface. Due to the factor \(\xi ^{-1}\), the width of the diffuse interface is compensated for and \(\int _{\mathcal {P}}\delta _\xi (u_0) \,\textrm{d}\textbf{y}\) approximates the area of the corresponding sharp interface. Scaling the new source term (46) with \(\delta _\xi (u_0)\) allows to model it like a heterogeneous reaction, introducing an additional interface velocity equal to the difference of saturations. The Allen–Cahn equation introduces curvature-driven motion of the interface and is not conservative. This motion prevents a stationary state at the target saturation and shifts the stationary state to an incorrect saturation. To obtain a conservative Allen–Cahn equation we additionally introduce the source term (Bringedal 2020)

$$\begin{aligned} \frac{S\xi ^{-1}}{\varphi } \int _{\mathcal {P}}P'(u_0) \,\textrm{d}\textbf{y}~. \end{aligned}$$
(48)

That is, instead of (45) one would solve

$$\begin{aligned} {\left\{ \begin{array}{ll} \frac{\partial u_0}{\partial \tau } + \nabla _\textbf{y}\cdot (\textbf{v}_0 u_0) = S\xi \nabla _\textbf{y}^2 u_0 - S\xi ^{-1} P'(u_0) &{}\\ \qquad \qquad \qquad \qquad \qquad \qquad + \frac{S\xi ^{-1}}{\varphi } \int _{\mathcal {P}}P'(u_0) \,\textrm{d}\textbf{y}+ \delta _\xi (u_0) \left( S^{(1)} - \frac{1}{\varphi } \int _{\mathcal {P}}u_0 \,\textrm{d}\textbf{y}\right) &{} \text { in } {\mathcal {P}}~,\\ \nabla _\textbf{y}u_0 \cdot \textbf{n}= - \xi ^{-1} \cos (\theta ) \sqrt{2P(u_0)}&{} \text { on } \Gamma ~,\\ u_0 \text { is }Y\text {-periodic.} \end{array}\right. } \end{aligned}$$
(49)

3.2.2 Fluid Flow

The derivation of the local cell problems for the fluid velocity follows the common approach of separating derivatives of the two scales and using the linear structures of the equations to obtain different problems for the effect of macroscopic pressure gradients, and additionally one to capture the contribution of the surface tension at the interface.

From the leading order term of the momentum equation (27b) we obtain \(\nabla _\textbf{y}p_0 = 0\) and from the next order term we get

$$\begin{aligned} \begin{aligned} 0 =&-{{\overline{\textrm{Eu}}}} (\nabla _\textbf{x}p_0 + \nabla _\textbf{y}p_1) + \frac{1}{\textrm{Re}\,} \nabla _\textbf{y}\cdot \left( \mu (u_0) \left( \nabla _\textbf{y}\textbf{v}_0 +(\nabla _\textbf{y}\textbf{v}_0)^T - \frac{2}{3} (\nabla _\textbf{y}\cdot \textbf{v}_0)\textbf{I} \right) \right) \\&- \frac{1}{\textrm{Ca}\,} \frac{3\xi }{2} \nabla _\textbf{y}\cdot (\nabla _\textbf{y}u_{0} \otimes \nabla _\textbf{y}u_{0} ) \end{aligned} \end{aligned}$$
(50)

or equivalently, using \(\mu (u_0(t, \textbf{x}, \textbf{y})) = 1 + u_0(t, \textbf{x}, \textbf{y}) (M-1)\),

$$\begin{aligned} \begin{aligned}&{{\overline{\textrm{Eu}}}} \nabla _\textbf{y}p_1 - \frac{M-1}{\textrm{Re}\,} \nabla _\textbf{y}u_{0} \cdot \left( \nabla _\textbf{y}\textbf{v}_0 +(\nabla _\textbf{y}\textbf{v}_0)^T -\frac{2}{3} (\nabla _\textbf{y}\cdot \textbf{v}_0) \textbf{I} \right) \\&\quad \quad - \frac{\mu (u_0)}{\textrm{Re}\,} \left( \nabla _\textbf{y}^2 \textbf{v}_0 + \frac{1}{3} \nabla _\textbf{y}(\nabla _\textbf{y}\cdot \textbf{v}_0) \right) \\&\quad = -{{\overline{\textrm{Eu}}}} \nabla _\textbf{x}p_0 - \frac{1}{\textrm{Ca}\,} \frac{3\xi }{2} \nabla _\textbf{y}\cdot (\nabla _\textbf{y}u_{0} \otimes \nabla _\textbf{y}u_{0} ) ~. \end{aligned} \end{aligned}$$
(51)

Due to the linear structure in the unknowns \(p_1\) and \(\textbf{v}_0\) as well as the contributions of \(p_0(t, \textbf{x})\) and \(u_{0}(t, \textbf{x}, \textbf{y})\), we can find Y-periodic functions \(\textbf{w}_j(t, \textbf{x}, \textbf{y})\), \(\Pi _j(t, \textbf{x}, \textbf{y})\), \(j=0,\ldots , \textrm{d}\) such that

$$\begin{aligned} \textbf{v}_0 =&-\sum _{j=1}^\textrm{d}\textbf{w}_j \partial _{\textbf{x}_j} p_0 - \textbf{w}_0 ~, \end{aligned}$$
(52)
$$\begin{aligned} p_1 =&\sum _{j=1}^\textrm{d}\Pi _j \partial _{\textbf{x}_j} p_0 + \Pi _0 + {\tilde{p}}_1(t, \textbf{x}) ~, \end{aligned}$$
(53)

with a function \({\tilde{p}}_1(t, \textbf{x})\) independent of \(\textbf{y}\) and thus not relevant for (51). The unknowns \(\textbf{w}_j\), \(\textbf{w}_0\) will be referred to as velocity contributions and \(\Pi _j\), \(\Pi _0\) as local pressure contributions. They can be obtained from the following auxiliary cell problems, where we denote the symmetrized gradient \(2\varepsilon _\textbf{y}(\textbf{w}) = \nabla _\textbf{y}\textbf{w}+ (\nabla _\textbf{y}\textbf{w})^T\),

$$\begin{aligned} {\left\{ \begin{array}{ll} {{\overline{\textrm{Eu}}}} (e_j + \nabla _\textbf{y}\Pi _j) = - \frac{1}{\textrm{Re}\,} \nabla _\textbf{y}\cdot ( \mu (u_{0}) 2\varepsilon _\textbf{y}(\textbf{w}_j) - \frac{2}{3} (\nabla _\textbf{y}\cdot \textbf{w}_j)\textbf{I}) , &{} \text { in } {\mathcal {P}} ~, \\ \nabla _\textbf{y}\cdot (\rho (u_{0}) \textbf{w}_j) = 0 , &{} \text { in } {\mathcal {P}} ~, \\ \textbf{w}_j = -\lambda (\textbf{I} - \textbf{n}\textbf{n}) \cdot \left[ \textbf{n}\cdot \left( \nabla _\textbf{y}\textbf{w}_{j} + \nabla _\textbf{y}\textbf{w}_{j}^T \right) \right] , &{} \text { on } \Gamma ~, \\ \Pi _j, \textbf{w}_j \text { are } Y\text {-periodic and} \int _{\mathcal {P}} \Pi _j \,\textrm{d}\textbf{y}= 0 , \end{array}\right. } \end{aligned}$$
(54)

for \(j \in \{ 1, \ldots , \textrm{d}\}\) and

$$\begin{aligned} {\left\{ \begin{array}{ll} {{\overline{\textrm{Eu}}}} \nabla _\textbf{y}\Pi _0 = - \frac{1}{\textrm{Re}\,} \nabla _\textbf{y}\cdot ( \mu (u_{0}) 2\varepsilon _\textbf{y}(\textbf{w}_0) -\frac{2}{3} (\nabla _\textbf{y}\cdot \textbf{w}_0) \textbf{I} ) \\ - \frac{1}{\textrm{Ca}\,} \frac{3\xi }{2} \nabla _\textbf{y}\cdot (\nabla _\textbf{y}u_{0} \otimes \nabla _\textbf{y}u_{0} ) , &{} \text { in } {\mathcal {P}} ~, \\ \nabla _\textbf{y}\cdot (\rho (u_{0})\textbf{w}_0) = 0 , &{} \text { in } {\mathcal {P}} ~, \\ \textbf{w}_0 = -\lambda (\textbf{I} - \textbf{n}\textbf{n}) \cdot \left[ \textbf{n}\cdot \left( \nabla _\textbf{y}\textbf{w}_{0} + \nabla _\textbf{y}\textbf{w}_{0}^T \right) \right] , &{} \text { on } \Gamma ~, \\ \Pi _0, \textbf{w}_0 \text { are } Y\text {-periodic and} \int _{\mathcal {P}} \Pi _0 \,\textrm{d}\textbf{y}= 0 , \end{array}\right. } \end{aligned}$$
(55)

From these solutions we define tensors capturing the effective behavior of the fluid, denoting the phase indicator of phase k as

$$\begin{aligned} u^{(k)} = {\left\{ \begin{array}{ll} u_0 ,\,&{}k=1 \\ 1 - u_0 ,\,&{}k=2 \end{array}\right. } \end{aligned}$$
(56)

and the components of \(\textbf{w}_j\) as \(\textbf{w}_{j,i}\).

$$\begin{aligned} {\mathcal {K}}^{(k)}_{ij} := \int _{\mathcal {P}}u^{(k)} \textbf{w}_{j,i} \,\textrm{d}\textbf{y}\qquad {\mathcal {M}}^{(k)}_{i} := \int _{\mathcal {P}}u^{(k)} \textbf{w}_{0,i} \,\textrm{d}\textbf{y}\end{aligned}$$
(57)

Multiplying (52) with \(u^{(k)}\) and integrating over \({\mathcal {P}}\), we obtain the macroscopic velocity equations containing the effective parameters.

$$\begin{aligned} \begin{aligned} {\bar{\textbf{v}}}^{(k)} = \int _{\mathcal {P}}u^{(k)} \textbf{v}_0 \,\textrm{d}\textbf{y}&= \int _{\mathcal {P}}u^{(k)} (-\sum _{j=1}^\textrm{d}\textbf{w}_j \partial _{\textbf{x}_j} p_0 - \textbf{w}_0) \,\textrm{d}\textbf{y}\\&= - \sum _{j=1}^\textrm{d}\left( \int _{\mathcal {P}}u^{(k)} \textbf{w}_j \,\textrm{d}\textbf{y}\right) (\partial _{\textbf{x}_j} p_0) - \int _{\mathcal {P}}u^{(k)} \textbf{w}_0 \,\textrm{d}\textbf{y}\\&= - {\mathcal {K}}^{(k)} \cdot \nabla _x p_0 - {\mathcal {M}}^{(k)} ~. \end{aligned} \end{aligned}$$
(58)

3.3 Two-Scale Model

Given the a-priori choices for non-dimensional numbers, \(\textrm{Ca}\,= {\mathcal {O}}(1)\), \(\textrm{Re}\,= {\mathcal {O}}(1)\), \(\textrm{Eu}= {\mathcal {O}}(\epsilon ^{-2})\) and \(\textrm{Fr}= {\mathcal {O}}(1)\), we arrive at a micro–macro model, coupling a Darcy-scale flow problem reminiscent of the extended two-phase Darcy’s law to \(d+2\) pore-scale cell-problems on \(Y = [0,1]^d\) at every point of the domain. We solve for five macroscopic unknowns \(p_0(t,\textbf{x})\), \(S^{(1)}(t,\textbf{x})\), \(S^{(2)}(t,\textbf{x})\), \({{\bar{\textbf{v}}}}^{(1)}(t, \textbf{x})\), \({{\bar{\textbf{v}}}}^{(2)}(t, \textbf{x})\) with \(1 = S^{(1)} + S^{(2)}\), and for every set of cell problems the local unknowns \(u_0\) and \(\textbf{w}_{j}\), \(j = 0, \ldots \textrm{d}\).

The macro-scale model reminds of Darcy’s law with one shared pressure unknown as well as additional effective parameters \({\mathcal {M}}^{(k)}\) which, just as \({\mathcal {K}}^{(k)}\), are computed from cell-problem variables. For convenience we drop the subscript \(\textbf{x}\) on the macroscopic gradient.

$$\begin{aligned} 0&= \varphi \frac{\partial }{\partial t} S^{(k)} + \nabla \cdot {{\bar{\textbf{v}}}}^{(k)} \quad \text {, in } \Omega \text {, } k=1,2 \end{aligned}$$
(59a)
$$\begin{aligned} {{\bar{\textbf{v}}}}^{(k)}&= -{\mathcal {K}}^{(k)} \cdot \nabla p - {\mathcal {M}}^{(k)} \quad \text {, in } \Omega \text {, } k=1,2 \end{aligned}$$
(59b)
$$\begin{aligned} {\mathcal {K}}^{(k)}_{ij}&= \int _{\mathcal {P}}u^{(k)} (\textbf{w}_j)_i \,\textrm{d}\textbf{y}~,\qquad {\mathcal {M}}^{(k)}_i = \int _{\mathcal {P}}u^{(k)} (\textbf{w}_0)_i \,\textrm{d}\textbf{y}\end{aligned}$$
(59c)

We see that the effective parameters \({\mathcal {K}}^{(k)}\) represent the phase-specific effective mobilities, containing information about both the absolute permeability of the porous medium and the interactions between the two fluids. Both contributions are in general anisotropic and cannot easily be separated. For isotropic geometries the intrinsic permeability \(\kappa _\textrm{abs}\) is a scalar and the effective mobility can be written as \(\kappa _\textrm{abs} {\mathcal {K}}^{(k)}_\textrm{rel}(u_0) /\mu _k\) with the relative permeability \({\mathcal {K}}^{(k)}_\textrm{rel} \in {\mathbb {R}}^{\textrm{d}\times \textrm{d}}\) depending on the local phase distribution \(u_0\) through the cell problems (61). The second effective parameter \({\mathcal {M}}^{(k)}\) captures effective flow due to surface tension forces between the two fluids. As the pore-scale phase-field model defines a shared pressure, we obtain a mean macroscopic pressure. Coupling effects such as viscous drag captured by additional effective parameters in Whitaker (1986), are thus not explicit on the macro scale. These coupling effects are captured in the pore-scale cell problems and included in the effective parameters. However, in (59b), the contributions to the Darcy-scale flow are instead grouped by whether they are caused by a macroscopic pressure gradient or by surface tension.

In return, the cell problems depend on the local value of the macroscopic saturation through a constraint on the phase-field function.

$$\begin{aligned} {\left\{ \begin{array}{ll} \nabla _\textbf{y}\cdot (\textbf{v}_0 u_0) = S\xi \nabla _\textbf{y}^2 u_0 - S\xi ^{-1} P'(u_0) &{} \text { in } {\mathcal {P}}~,\\ \nabla _\textbf{y}u_0 \cdot \textbf{n}= - \xi ^{-1} \cos (\theta ) \sqrt{2P(u_0)}&{} \text { on } \Gamma ~,\\ u_0 \text { is }Y\text {-periodic and } \int _{\mathcal {P}}u_0 \,\textrm{d}\textbf{y}= \varphi S^{(1)} ~, \end{array}\right. } \end{aligned}$$
(60)

with \(\textbf{v}_0\) depending on the global pressure gradient and local velocity contributions \(\textbf{w}_j\) as defined in (52). These in turn depend on the phase field and are computed through the cell problems defined in (54) and (55)

$$\begin{aligned} {\left\{ \begin{array}{ll} {{\overline{\textrm{Eu}}}} (e_j + \nabla _\textbf{y}\Pi _j) = - \frac{1}{\textrm{Re}\,} \nabla _\textbf{y}\cdot ( \mu (u_0) 2\varepsilon _\textbf{y}(\textbf{w}_j) - \frac{2}{3} (\nabla _\textbf{y}\cdot \textbf{w}_j)\textbf{I}) , &{} \text { in } {\mathcal {P}} ~, \\ \nabla _\textbf{y}\cdot (\rho (u_0) \textbf{w}_j) = 0 , &{} \text { in } {\mathcal {P}} ~, \\ \textbf{w}_j = -\lambda (\textbf{I} - \textbf{n}\textbf{n}) \cdot \left[ \textbf{n}\cdot \left( \nabla _\textbf{y}\textbf{w}_{j} + \nabla _\textbf{y}\textbf{w}_{j}^T \right) \right] , &{} \text { on } \Gamma ~, \\ \Pi _j, \textbf{w}_j \text { are } Y\text {-periodic and} \int _{\mathcal {P}} \Pi _j \,\textrm{d}\textbf{y}= 0 , \end{array}\right. } \end{aligned}$$
(61)

for \(j \in \{ 1, \ldots , d \}\) and

$$\begin{aligned} {\left\{ \begin{array}{ll} {{\overline{\textrm{Eu}}}} \nabla _\textbf{y}\Pi _0 = - \frac{1}{\textrm{Re}\,} \nabla _\textbf{y}\cdot ( \mu (u_0) 2\varepsilon _\textbf{y}(\textbf{w}_0) -\frac{2}{3} (\nabla _\textbf{y}\cdot \textbf{w}_0) \textbf{I} ) \\ - \frac{1}{\textrm{Ca}\,} \frac{3\xi }{2} \nabla _\textbf{y}\cdot (\nabla _\textbf{y}u_0 \otimes \nabla _\textbf{y}u_0 ) , &{} \text { in } {\mathcal {P}} ~, \\ \nabla _\textbf{y}\cdot (\rho (u_0)\textbf{w}_0) = 0 , &{} \text { in } {\mathcal {P}} ~, \\ \textbf{w}_0 = -\lambda (\textbf{I} - \textbf{n}\textbf{n}) \cdot \left[ \textbf{n}\cdot \left( \nabla _\textbf{y}\textbf{w}_{0} + \nabla _\textbf{y}\textbf{w}_{0}^T \right) \right] , &{} \text { on } \Gamma ~, \\ \Pi _0, \textbf{w}_0 \text { are } Y\text {-periodic and} \int _{\mathcal {P}} \Pi _0 \,\textrm{d}\textbf{y}= 0 . \end{array}\right. } \end{aligned}$$
(62)

4 Numeric Investigation

In the following we present an investigation of the cell problems for velocity contributions \(\textbf{w}_j\) and the behavior of the computed effective parameters. We consider two exemplary geometries, denoted "cross" and "obstacle", and investigate the relative permeability saturation relation for different fluid properties and fluid distributions.

4.1 Implementation

For the numerical investigation all model equations are implemented in DuMu\(^{\textsf{x}}\) (Koch et al. 2021), using Newton’s method as a nonlinear solver and backward Euler for temporal discretization in transient problems. The equations are discretized in space with the finite volume method on a regular rectangular grid, using Dune-SPGrid (Nolte 2011) and an adapted Dune-Subgrid (Gräser and Sander 2009) to model the considered geometries with periodic boundaries. For the phase-field and pressure unknowns a cell-centered approach is used, with control volumes equal to grid cells and degrees of freedom placed at their centers. Fluxes over control-volume faces are approximated using the two adjacent values. For the velocities a staggered discretization is used, with separate degrees of freedom for each velocity component placed at the edges between grid cells and control volumes centered around them (Harlow and Welch 1965).

While the cell problem for the phase field uses only the cell-centered discretization, the cell problems for velocity contributions require a coupled system of cell-centered pressures and staggered velocities. In DuMu\(^{\textsf{x}}\) this is achieved using a multidomain formulation with a coupling manager handling the volume coupling of the different discretizations of a shared domain (Koch et al. 2021).

For the phase-field equation a boundary condition prescribing the flux implements the contact angle condition. In the velocity-contribution problems a no-flux condition for the mass conservation and homogeneous Dirichlet conditions for the normal velocity are used at the fluid-solid interfaces. To implement Navier slip boundary conditions, a solution-dependent flux can be defined. In the case of the cell problem capturing surface tension effects the additional flux can be given based on the prescribed contact angle. On the outer boundary of the reference cell Y periodicity conditions are prescribed.

4.2 Numerical Solution of Cell Problems

We consider the cell problems (61) and (62) for the velocity contributions \(\textbf{w}_j\) and investigate the behavior of the resulting effective parameters. The derived two-scale model is similar to two-phase Darcy’s law, with effective parameters computed from cell problems rather than prescribed relative permeability saturation curves. We investigate how the computed parameters compare to commonly used curves and under which conditions core assumptions such as a monotone relation is violated. Anisotropic permeabilities are not the focus of this investigation and we choose simple geometries such that the intrinsic permeability of the pore geometry can be separated from fluid-fluid interactions. This allows us to isolate the influence of the fluid distribution on the relative permeability in a simple manner.

For two different geometries we vary the local phase field to determine the effects of saturation and phase distribution and the impact of the dimensionless ratios for viscosity and density as well as the surface tension. Both the slip length and the contact angle influence the results, see, e.g. the investigation of dynamic contact angles in Lunowa et al. (2021), but will not be considered here. Instead these effects will be controlled by a no-slip condition for the velocity contributions and a homogeneous Neumann condition for the phase field, encoding a neutral contact angle. Since our goal is to address behavior of the effective parameters, we do not couple the flow to the cell problem for the phase distribution (60). Instead we manually prescribe a phase-field function corresponding to a certain saturation and run a few timesteps of the instationary version of the phase-field equation (60) without advection in order to enforce the neutral contact angle. This fluid distribution is then used to solve (61) and (62).

The two domains under consideration vary in geometry and porosity, see Fig. 4. The first setup, "obstacle", contains a square of side length 0.45 placed in the center of the domain, leaving a void fraction of \(79.75\%\). The second investigated geometry, denoted "cross", is a cross of channels with diameter 0.3, resulting in a porosity of \(51\%\).

Fig. 4
figure 4

Investigated cell geometries "obstacle" and "cross". \(u= 1\) (red) corresponds to fluid 1, \(u= 0\) (blue) to fluid 2

We consider four core scenarios of which the first three investigate the effective mobility \({\mathcal {K}}^{(k)}\) for different ratios of viscosity \(M\) and density \(R\). In the last setup the surface tension tensor \({\mathcal {M}}^{(k)}\) is analyzed, with identical fluid properties for both fluids. The dimensionless numbers in the cell problems are chosen as 1.

For all four cases we fix the center of a circle with varying radius r and assign cells inside this circle to phase 1, with the rest of the void space being filled with fluid 2. This initial data already contains a diffuse interface according to the following radial function.

$$\begin{aligned} u(r) = \frac{1}{1+\exp (5/\xi \cdot r)} ~. \end{aligned}$$
(63)

This initial data is evolved under the transient version of the Allen–Cahn equation (60) without advection to enforce a neutral contact angle (see Fig. 5). The resulting phase field is fed into the different cell problems for flow velocity contributions (61), (62), which are then solved.

Fig. 5
figure 5

Preprocessing to enforce a neutral contact angle. Initial condition from (63) (left), and the resulting phase field with desired contact angle (right)

In the "cross" cell geometry we observe recirculation patterns, as will be seen later in Sect. 4.2.3, Fig. 11. Given a horizontal pressure gradient forcing flow from left to right, the recirculation near the top and bottom of the domain leads to flow from right to left at these edges of the periodic cell. Depending on the fluid distribution one of the phases may contain primarily these flows in the opposite direction to the main flow, leading to negative integrated velocity contributions. As the effective mobility should capture net flow through the domain, we aim to exclude these recirculations based on the computed flow field and avoid negative mobilities. Any closed streamlines in the periodically repeated domain do not lead to Darcy-scale transport and are thus removed from the domain of integration. These local flows continue to affect the local phase distribution and thus indirectly the effective parameters. To achieve this, the computed velocity contribution is loaded into ParaView (Ahrens et al. 2005), computing streamlines and marking cells with relevant streamlines. Only these cells contribute to the integrated quantity, excluding closed streamlines within the cell. This process is not performed for the flow problem driven by surface tension (62).

After postprocessing we compute the weighted integrals over marked cells to obtain the effective parameters. The saturation is determined by an integral over the entire domain.

$$\begin{aligned} S^{(1)} = \frac{1}{|{\mathcal {P}}|} \int _{\mathcal {P}}u_0 \,\textrm{d}\textbf{y}~, \end{aligned}$$
(64)

For the effective mobility \({\mathcal {K}}^{(k)}\), the computed entries are divided by the absolute permeability and multiplied with the viscosity, yielding a relative permeability. The results are plotted over the saturation of phase 1.

4.2.1 Equal Fluid Properties

In the first case we consider two fluids with equal viscosity and density (\(M= R= 1\)). The cell problems for velocity contributions driven by the global pressure gradient treat the two-phase system as single-phase flow. The effective mobilities are obtained through integration weighted by the phase-indicator \(u^{(k)}\) and the resulting relative permeabilities always sum to 1, see Fig. 6.

Fig. 6
figure 6

Relative-permeability-saturation relation for equal fluid properties

Due to the symmetries in the fluid distribution the relative permeability is approximately a diagonal matrix and we show only the dominant diagonal entries. For the isotropic setup in the "obstacle" geometry the entries are equal and the relative permeability reduces to a scalar value.

Due to the choice of fluid distribution for every radius r the domain corresponding to fluid 1 contains that for lower radii \(r' < r\) and thus lower saturation. Equivalently, for phase-field functions \(u_1 < u_2\) the corresponding saturations fulfill \(S_1 < S_2\). Under this condition the relative permeability is monotone with respect to the saturation. For differing fluid distributions this monotonicity is not guaranteed and a higher saturation concentrated at areas of lower velocity contributions can result in a lower permeability. Figure 7 shows changing relative permeabilities for fixed saturation and varying fluid distributions obtained by changing the center of the initial circular subdomain for fluid 1. This information about local phase distribution and its impact on macroscopic flow can only be captured by solving the cell problems.

Fig. 7
figure 7

Impact of phase distribution on relative permeability for equal fluid properties with radius \(r=0.15\) (left) and \(r=0.3\) (right)

4.2.2 Influence of Viscosity Differences

Next we investigate the effect of the viscosity ratio by considering \(M= 2\), the investigated cell problems now correspond to an incompressible fluid with varying viscosity.

In stark contrast to typically used relative permeability curves we observe non-monotone behavior for the case "obstacle" with relative permeabilities of the more viscous fluid reaching values above 1 for saturations above 0.8, up to \({\mathcal {K}}^{(1)}_{xx} = 1.039\) at a saturation of 0.95 (see Fig. 8). Due to the chosen fluid distribution the less viscous fluid 2 is located on the surface of the solid matrix at low saturations (high saturation for phase 1). This reduces the resistance exerted on the first fluid and results in higher velocity contributions, especially for higher viscosity ratios \(M\). Such lubricating effects have been observed experimentally in different settings (Berg et al. 2008).

Fig. 8
figure 8

Relative-permeability-saturation relation for viscosity ratio \(M= 2\)

4.2.3 Influence of Density Differences

In the case of non-trivial density ratio \(R\), the cell problem (61) corresponds to Stokes equation for a quasi-compressible fluid. For ratio \(R= 2\) (Fig. 9) no non-monotone behavior is observed but the curves are notably different to the one obtained for the case of equal fluid properties. For density ratio \(R= 10\) (Fig. 10) non-monotonicity is observed for a horizontal pressure gradient in the "cross" setup, with the velocity contribution in the lighter fluid increasing as the main flow path is filled with the more dense fluid. The fluid distribution and computed flow field for highest permeability at a saturation of 0.45 are shown in Fig. 11. In Fig. 12 the results for the "obstacle" geometry are compared to those for equal fluid properties, which highlights the fact that the sum of the relative permeabilities is less than one.

Fig. 9
figure 9

Relative-permeability-saturation relation for density ratio \(R= 2\)

Fig. 10
figure 10

Relative-permeability-saturation relation for density ratio \(R= 10\)

Fig. 11
figure 11

Phase distribution and velocity contribution for density ratio \(R= 10\)

Fig. 12
figure 12

Comparison of relative permeability saturation relation for "obstacle" geometry

4.2.4 Surface Tension Tensor

For the isotropic geometry and fluid distribution considered above the velocity contributions driven by surface tension cancel out in the integral and the computed effective parameter is equal to 0 (Fig. 13, left). For asymmetric fluid distributions (Fig. 13, right) a nonzero contribution is obtained, but no visible trends are observed as the saturation changes. The redistribution of fluids driven by surface tension forces leads to a net flow for the two phases, which corresponds to \({\mathcal {M}}^{(k)}\) being nonzero. The size and direction of this net flow and hence the size and sign of the effective parameter \({\mathcal {M}}^{(k)}\) depends highly on the fluid distribution. Such effects can only be accounted for by solving the cell problem (62).

Fig. 13
figure 13

Symmetric and asymmetric case with center at (0.35, 0.3)

4.3 Discussion

For equal fluid properties and fixed fluid distributions we obtain monotone relative permeability saturation curves comparable to commonly used relations such as Brooks-Corey (Brooks and Corey 1966) or van Genuchten (van Genuchten 1980). However, even in this simple case the relative permeability depends not only on saturation but also on the distribution of the fluids. As observed in Sect. 4.2, even in this simple case no relation can be given without accounting for the local distribution of the fluids.

For differing viscosities the model is able to reproduce non-monotone relative permeabilities with values above 1 as discussed in Berg et al. (2008). When the less viscous fluid coats the solid surface, it can reduce the resistance exerted on the more viscous fluid, resulting in higher velocity contributions. Due to the different fluid distribution such a coating is not observed to the same extent for the "cross" setup, leading to monotone relations for the relative permeability. These effects depend strongly on the local phase distribution and cannot be captured solely by the saturation without additional assumptions.

For moderate density differences the combined permeability is reduced and for higher density ratios non-monotone behavior can be observed. We remark that for very high differences in fluid properties, this should be considered in the derivation of the cell problems and the two-scale problem, which would lead to a different appearance of the effective equations. To obtain equations similar to the often used two-phase Darcy’s law, we use the assumptions presented in Sect. 3.2.

The derived two-scale model contains an additional effective parameter which accounts for the influence of surface tension between the fluid phases. This is not a common part of the extended Darcy’s law and there is no counterpart to compare it to. A similar cell problem and resulting effective parameter has been investigated by Sharmin et al. (2022), incorporating the influence of solute-dependent surface tension. Here only constant surface tension is considered. Lasseux and Valdés-Parada (2022) incorporate the effects of surface tension into macro-scale equations in the context of volume averaging and a sharp-interface description. We find that for symmetric distributions the effective parameter capturing surface tension effects disappears as expected. For anisotropic phase distributions the flow driven by surface tension does not cancel out and the associated cell problem is able to capture significant contributions to effective flow behavior. The size and direction of flow resulting from surface tension and thus the magnitude and sign of the effective parameter depend strongly on the local distribution of fluids.

The numeric investigation of the effective parameters highlights how different fluid distributions with equal saturation can result in very different net flow and effective behavior. Increased relative permeability due to viscosity differences and significant surface tension effects further emphasize the importance of resolving the local fluid morphology.

5 Conclusion

We derived a two-scale model for two-phase flow in porous media using homogenization and investigated the dependence of effective parameters on the fluid distribution in the pore-scale cell problems. This model is conditioned on the assumptions of a homogeneous porous medium and dimensionless numbers \(\textrm{Ca}\,= {\mathcal {O}}(1)\), \(\textrm{Re}\,= {\mathcal {O}}(1)\), \(\textrm{Eu}= {\mathcal {O}}(\epsilon ^{-2})\) and \(\textrm{Fr}= {\mathcal {O}}(1)\). The model was derived for constant contact angle and simplified slip boundary conditions, but extensions to more complex models are possible without changing the structure of the two-scale model.

The model consists of macro-scale equations similar to the extended Darcy’s law with effective parameters computed from solutions to cell problems defined at every macroscopic point. One of the effective parameters can be understood as an effective mobility, while the second effective parameter represents effects of interfacial tension on the effective flow. On the pore-scale the phase distribution is captured by a phase field, using an advective Allen–Cahn formulation. For the velocity field we use a stationary Stokes equation with phase-dependent fluid properties and an additional source term incorporating surface tension forces. Due to the diffuse interface description and weak capillary forces, the model does not contain individual phase pressures. Other coupling effects such as viscous drag are captured implicitly in the effective parameters rather than explicitly in the Darcy-scale equations.

The two-scale structure allows to investigate numerically the effects of pore-scale information on effective behavior. We construct local fluid distributions for the pore scale and solve the cell problems associated with pressure driven velocity contributions.

The similarity to two-phase Darcy’s law motivates a comparison of the dependence of relative permeabilities on saturation. By selecting isotropic pore geometries, relative permeability tensors can be extracted from the effective parameters \({\mathcal {K}}^{(k)}\) in our model and for isotropic fluid distributions these simplify to diagonal matrices or scalar values. As one of the core qualities of relative permeability-saturation curves we investigate the conditions under which a monotone relationship is obtained. If a common fluid morphology is maintained for different saturations, then for equal fluid properties monotone curves, similar to commonly used functions like van Genuchten and Brooks–Corey, are obtained. The calculated curves however depend strongly on the fluid distribution and change with the pore geometry, highlighting the need to account for pore-scale information. For different viscosities the model can produce non-monotone relationships and relative permeabilities greater than 1. This can be related to a lubricating effect of the less viscous fluid coating the surface of the solid matrix, an effect observed experimentally. For moderate density ratios the effective total permeability decreases and no non-monotone behavior was observed.

We also performed numeric simulations for the cell problem corresponding to the effective parameter \({\mathcal {M}}^{(k)}\), capturing effects of surface tension forces. For isotropic geometry and fluid morphologies these forces result in no net flow and a vanishing effective parameter. For asymmetric fluid distributions we obtain significant net flows captured by \({\mathcal {M}}^{(k)}\).

Our two-scale model for two-phase flow captures pore-scale fluid-fluid interactions related to surface tension forces as well as differences in viscosity and density. Through numeric investigation of the effective parameters we highlight the importance of local fluid distribution for accurately capturing effective flow behavior.

A further validation of the derived model using pore-resolved simulations of a larger domain or of the coupled two-scale model is beyond the scope of this current paper. Comparisons of the coupled two-scale model with standard Darcy-scale models and averaged pore-scale simulations are in development.