Dynamics of displacement in mixed-wet porous media

We identify a distinct two-phase flow invasion pattern in a mixed-wet porous medium. Time-resolved highresolution synchrotron X–ray imaging is used to study the invasion of water through a small rock sample filled with oil, characterized by a wide non-uniform distribution of local contact angles both above and below 90◦. The water advances in a connected front, but throats are not invaded in decreasing order of size, as predicted by invasion percolation theory for uniformly hydrophobic systems. Instead, we observe pinning of the three-phase contact between the fluids and the solid, manifested as contact angle hysteresis, which prevents snap-off and interface retraction. In the absence of viscous dissipation, we use an energy balance to find an effective, thermodynamic, contact angle for displacement and show that this angle increases during the displacement. Displacement occurs when the local contact angles overcome the advancing contact angles at a pinned interface: it is wettability which controls the filling sequence. The product of the interfacial curvatures, the Gaussian curvature, is negative, implying well-connected phases which is consistent with pinning at the contact line while providing a topological explanation for the high displacement efficiencies in mixed-wet media.


Introduction
A material is defined as mixed-wet when the angle that the interface between two fluids form with a solid surface (the contact angle), is both lower and higher than 90 • , meaning that there is a mix of hydrophobic and hydrophilic regions [1]. Flow in porous mixed-wet media is omnipresent in nature [2]. For example, lotus and rice leaves [3,4], butterfly wings and gecko feet [5,6], and also human skin [7] are natural porous systems which are not wetted by water and show different grades of mixed wettability (or hydrophobicity). Mixed wettability is studied for several applications: in the fabric industry, the wettability of textiles is altered to form anti-fogging, self cleaning materials [8]; in the medical and cosmetic sectors, wettability controls skin friction and lubrication [9], while in earth science the wettability of the subsurface governs secure storage of CO 2 [10,11], as well as oil recovery [12,13].
To investigate two-phase flow invasion patterns in a mixed-wet porous medium we will use high resolution X-ray microtomography which provides non-destructive, three dimensional (3D) visualisation of fluids inside different porous materials, from rocks [14,15] to termite nests [16]. This technology has significantly increased our understanding of flow in porous media, including wettability characterisation with direct measurement of in situ contact angle [1,17].
Studies of mixed-wet porous rocks using laboratory-based microtomography show that the wettability has an impact on secure trapping of CO 2 [18] and oil recovery, which is favoured in mixed-wet media [19]. While these studies give valuable insights on end states, they do not capture the displacement or pore-filling sequence, as several minutes (or hours) are required to obtain a single scan. The high energy of synchrotron facilities, instead, allows for fast imaging and can be used to study the dynamics of fluid invasion in porous media [20].
The physics of invasion patterns has been studied in systems with uniform contact angles [21][22][23][24]. Drainage, where a non-wetting phase displaces the wetting phase, is an invasion percolation process where fluid advances in a connected front from pore to pore through the widest restrictions, or throats, between pores [23,24]. Filling a wide region of the pore space requires a lower capillary pressure, Pc. This is defined by the Young-Laplace equation which, for throats with a cylindrical cross-section of radius r, gives: where σ is the interfacial tension between the two fluids and θ is their contact angle [2]. Synchrotron and confocal imaging studies have directly observed the dynamics of drainage at the pore scale, showing that this is characterised by fast invasions of multiple pores (Haines jumps) [25,26], which cause interface recession and distal snap-off in other pores [27]. Snap-off is the filling of throats by the wetting phase, which can disconnect the non-wetting phase [28,29]. If we decrease the contact angle, and the invading phase becomes more wetting, there is a transition from invasion percolation towards frontal advance with displacement controlled by cooperative pore filling in the absence of wetting layer flow -the Cieplak-Robbins transition [30][31][32].
However, in most natural systems, the wetting phase can also flow in corners and roughness in the pore space (layer flow) [33]. In this case, the displacement of the non-wetting phase by a wetting phase (imbibition) has a more complex dynamics dominated by snap-off [23,[34][35][36]. The displacement becomes percolation-like as the wetting phase fills the narrowest pores and throats throughout the domain [2,33].
A recent study of displacement patterns, in micromodels with uniform contact angle, identified this transition from invasion percolation to connected advance, with layer flow for the most wetting systems. Varying the capillary number and the contact angle of the system, it was shown that the 3D structure has a strong impact on multiphase flow even in quasi-2D patterned microfluidic flow cells and that layer flow affected the dynamics [37].
However, the displacement dynamics have not been studied in a 3D mixed-wet material. Crucially, we study displacement patterns in a porous rock with a non-uniform distribution of contact angles both above and below 90 • . We dynamically image capillary-dominated waterflooding, after primary drainage, at high spatial and temporal resolution, using a synchrotron X-ray source. Our objective is to understand pore-scale displacement physics in mixed-wet media using several multiphase flow descriptors including contact angle, interfacial curvature, capillary pressure and interfacial area measured on the X-ray images.
From the experiments we observe a distinct type of displacement pattern, dissimilar to that seen either in drainage or imbibition: there is advance of a connected water front, through the centre of the pores, without evidence of layer flow. The filling sequence is not in order of pore size, while contact angle hysteresis does not allow for interface retraction and snap-off.
Pinning and depinning of the contact line had been previously related to the thermodynamics of wetting of 2D surfaces [38,39]. We show that, inside 3D mixed-wet media, the filling order is controlled by the thermodynamic contact angle [40], which represents the energetic threshold to be overcome for depinning of the interface and displace the defending phase.
Local pinning of the contact line also drives the interfaces to arrange as minimal surfaces, with curvature of opposite signs in orthogonal directions [41]. The consequent negative Gaussian curvature indicates well-connected phases, favouring high displacement efficiency [21].
Our findings can be extended to other kinds of porous materials, as the evidence of pinning and depinning of the contact line in mixed-wet media controls the evaporation of liquids inside hydrophobic materials [42]. This has numerous practical applications such as spray cooling, nanoassembly and DNA stretching, for instance, where a mixed-wet state could be designed for optimal process performance.

Materials and methods (a) Materials
We used a small cylindrical sample of Ketton limestone, 16 mm long and with a diameter of 5.8 mm. The helium porosity of the sample was 28%, and it is chemically composed of >99% calcite [34]. The experimental fluids were doped to increase their X-ray contrast by using 15% by weight iododecane in n-decane for the oil phase and 20% by weight KI in water, which we call the water phase. Table 1 provides the physical properties of the rock and fluids. Table 1. Physical properties of the flids and the rock used in the experiment [43]. Density and viscosity are computed from experimental conditions (8MPa and 60 • C) data of pure elements provided in [44]. Interfacial tension is measured at 25 • C and 1.01 MPa. The total porosity was measured using a Helium porosimeter, while the macro porosity was computed from the images. For the chemical composition refer to [27].

Fluid
Density

(b) Wettability alteration
The wettability of the rock was altered prior to the experiment. The sample was first cleaned using methanol and dried in an oven for 24h, to remove any impurities. Then, the pore space was fully saturated with formation brine, replicating the chemical composition of brine in a giant producing reservoir in the Middle East while the pressure and temperature were raised to reservoir conditions (80 • C and 10 MPa). Crude oil which was extracted from the same reservoir was injected, with increasing flow rate starting at 0.001 mL/min, up to 0.1 mL/min, for a total of 40 PV, from the bottom of the sample. The flow was then reversed and fresh oil was injected from the top of the sample, with the same flow rates and total volume. During the first week, 5 PV of oil were injected each day, at a flow rate of 0.05 mL/min. After 4 weeks, the sample was removed from the core holder and left in a closed crude oil bath at 80 • C for 3 more months.

(c) Experiment and imaging
The sample was transferred to the I13-2 beamline of the Diamond Light Source synchrotron facility (Harwell campus, Didcot, Oxfordshire) in the crude oil bath, at ambient temperature. It was then mounted in a core holder and the crude oil was replaced with the oil phase (doped decane), to avoid the formation of an emulsion during the experiment [45], by flushing 20 PV of oil at a flow rate of 0.1 mL/min. Temperature and pressure were then increased to the experimental conditions (50 • C and 8MPa) and we started to inject water at low flow rate (0.15 µL/min), corresponding to a capillary number of 2.6×10 −9 , obtained using an interfacial tension of 47±5 mN/m [43].

(d) Image processing and segmentation
All the tomograms were reconstructed, obtaining 3D grey scale images of the rock and the fluids within it during the injection (Fig. 1). Image segmentation -the classification of each image voxels into either water, oil or rock -was performed using a machine learning method, called WEKA [46], which provides high quality results, if correctly trained [47] (Fig. 2). We subtracted the images before water invasion (Fig. 1A) from those with water in the pores (Fig. 1B) to create a differential image. The result, shown in Fig. 2C, is an image where the voxels invaded by water can be clearly distinguished. The training dataset was created with manual labelling of the differential image ( Fig. 2A). This was provided as an input, together with the differential images, to the WEKA segmentation random forest algorithm. The resulting binary images were combined with the segmented image of the rock to obtain the final segmented images in which voxels of oil, water and rock were assigned to three discrete values (Fig. 2D).  Workflow for image segmentation. The images before water injection (Fig. 1A) were subtracted from the images with water (Fig. 1B). The resulting differential image is shown in panel C of this image: brighter areas correspond to the places invaded by water. We created a training dataset with manual classification of invaded voxels (green in panel A) versus non invaded by water (red). The machine learning WEKA algorithm computes image features (mean and variance) from the differential image, and these are given as input, together with the training dataset, to the random forest algorithm.
The result is a classifier. We applied this classifier to the differential images obtained at each time step and obtained binary images with 1 where water invaded the sample and 0 elsewhere. Combining these with the dry segmented image of the rock, we obtained the final three-phase images (D). In D, grey is rock, red is oil and blue is water.

(e) Throat occupancy and Pearson correlation coefficient
We used the maximal ball extraction code of a generalized network model [48] on segmented dry images of the porous medium. We determined occupancy as the phase residing in the centre of the throat. The detailed procedure to obtain throat occupancy is described elsewhere [43] which is based on relating any point in the pore space to a maximal ball, which is the largest sphere that fits in the pore space at that point. The throat radius is the radius of the maximal ball that lies in the centre of a restriction in the pore space. We also studied the correlation between throats radius and the time at which they were filled, using the Pearson correlation coefficient r between two variables x and y: where x and y are the estimated mean values and x i and y i are single observations of the two variables. r can range between -1 and +1 representing perfect negative and positive correlation respectively.
(f) Pore scale descriptors, contact angle and capillary pressure The segmented images, obtained as described above, allow the computation of a large number of pore-scale quantities which help us understand the physics of displacement in mixed-wet media. Saturations were computed using the pore space which can be resolved with the voxel size of 3.  were computed considering the total macro pores of the whole sample.
µm. We used previously-developed algorithms to find the geometric contact angle [49], interfacial curvature, specific interfacial area, capillary pressure [41] and the thermodynamic contact angle [40].

Results and discussion (a) Experimental observation of invasion patterns
To observe invasion patterns we acquired images containing 1.4×10 9 voxels with a side length of 3.5 µm every 70 seconds over a period of 77 minutes, giving 66 3D images in total, while water was injected at a flow rate of 0.15 µL/min. This corresponds to a capillary number Ca = µq/σ of 2.6×10 −9 where µ is the injected water viscosity, q is the Darcy flux (volume injected per unit area per unit time) and σ is the interfacial tension (Table 1 shows the physical properties of rock and fluids). Movie S1 and the top row of Fig. 3 show that it took 28 minutes for the water front to reach the other side of the imaged domain, which accounted for about 1/3 of the total rock volume. Until breakthrough, 0.06 pore volumes (PV) were injected. PV are computed considering the total macro pores of the whole sample (porosity and dimensions of the sample are available in Table 1). Firstly, we notice that waterflooding in this mixed-wet rock happened differently to imbibition in water-wet systems: pore centres were invaded first, and oil was not isolated by snap-off [11,34].
Secondly, water displaced oil advancing as a connected phase, and once the pores were occupied, after breakthrough, water kept flowing in the same connected path, without further advancing and receding of the interfaces, due to interface pinning. This differs from previous visualisations of drainage, where distal snap-off and oil-filling events were observed [25,27,45].
Thirdly, Fig. 3 demonstrates that the order in which pores were invaded differs from what had been previously observed during either imbibition or drainage, as throats with a wide range of  size were invaded throughout the displacement: there was no filling preference based on throat radius ( Fig. 1 and Movie S1).
Finally, local pinning of the oil-water interface, see Fig. 4, provided evidence of a large contact angle hysteresis. Unlike in drainage [25], this pinning prevented the recession of the injected phase after invasion of a wide region of the pore space.
After pore invasion, the contact line found an equilibrium position and the contact points (where oil and water are in contact with the solid, shown in grey in Fig. 4) did not move. The reason for this is the adhesion of surface-active components of the crude oil to the solid combined with roughness which limits the movement of the contact line [1]. However, the pressure of the water increased as it was injected. This caused a change in curvature and interfacial area (described next) and an increase in the local contact angle. Once the contact angle overcomes a certain threshold value, the interface is unpinned and it moves further in the pore space [38,39]. Our system was characterized by contact angle hysteresis. In the example of Fig. 4 contact angle increased by about 11 • without unpinning and interface movement.
A number of pore-scale descriptors provide a complete physical and topological description of multiphase flow in porous media [11,50]. We use these to deepen our understanding of the observed invasion patterns, and ultimately to understand what is controlling flow in mixedwet porous media. (i) The geometric contact angle was computed to define the wettability in comparison with previous work (Fig. 5A). (ii) Saturation, interfacial area, curvature and capillary pressure were measured (Figs. 6 and 7). (iii) The Gaussian curvature was estimated to assess connectivity (Fig. 8). (iv) Finally, the thermodynamic contact angle was computed using an energy balance (Fig. 9) [40].

(b) Order of throat invasion
As mentioned before, the classic invasion-percolation theory requires throats to be filled in decreasing order of size, as bigger throats require lower capillary pressure to be invaded (Eq. 1.1). Pore-network models have been grounded on this basis and are able to predict the displacement sequence in water-wet media [51]. However, the bottom row of Fig 3 and Movie S1 seem to contradict this hypothesis for this mixed-wet porous medium. To quantify this observation we used the Pearson correlation coefficient and tested the correlation between the radius of the invaded throats and the time at which they were filled. The Pearson correlation coefficient was -0.03, which means that there is no correlation between throat radius and the order in which

(c) Geometric contact angle
The in situ geometric contact angle, θg, computed inside the pore space using 3D images at high resolution, can be used to define the wettability [2]. θg is usually defined at the end of waterflooding, imposing the constraint of constant curvature and computing the geometric angle between the oil-water interface and the solid [17,49]. We computed contact angles, using the method developed in [49] on the images at the end of water injection. The resulting distribution is shown in Fig. 5B: 96% of the values lie between 72 • and 146 • and the mean contact angle is 109 • . This indicates that the sample is indeed mixed-wet such that the solid does not display a strong preference for either water or oil, consistent with previous measurements on reservoir rocks [1].

(d) Saturation, interfacial area, curvature and capillary pressure
The saturation of water and oil was computed from the segmented images at each time step. Fig. 6B shows that the water saturation linearly increased until breakthrough (28.3 minutes after the onset of water invasion in the imaged domain) and then it did not change further. The final oil saturation is related to the very low flow rate in the experiment, which was chosen to be able to follow water invasion pore by pore. The behaviour of saturation over time defines two stages of the injection: the first stage, from the beginning to breakthrough, with noticeable changes in volume fractions, and the second stage, where the injected water flows through the sample with little additional displacement, with pinned three-phase contact lines, as shown in Fig. 4.
We extracted the oil-water interface which was smoothed to avoid voxelization artefacts [41]. The resulting surfaces were used to compute the specific interfacial area between oil and water (interfacial area per unit volume), as a function of time. The principal curvatures κ 1 and κ 2 were also found: the mean curvature is defined as κ = (κ 1 + κ 2 )/2. Fig. 6B and Fig. 7A show that, while during the second stage volumes did not change, there was some relaxation of the fluid interfaces leading to an increase in curvature and interfacial area. The negative values of mean curvature show that on average it is water which bulges into oil, indicating slightly oil-wet or hydrophobic conditions on average, consistent with an average contact angle, Fig. 5, above 90 • .
The capillary pressure was found from the Young-Laplace equation, Pc = 2σκ, using the measured interfacial tension, σ = 47 mN/m [43] and plotted as a function of saturation in Fig. 7B. The values are slightly lower than the one obtained in a sandstone sample whose contact angles  were closer to 90 • [41]. The shape of the capillary pressure-saturation relationship is in line with the expected behaviour for a slightly oil-wet medium, starting from values approaching zero for low water saturation and plateauing afterwards, with a gradual decrease with saturation. After breakthrough (stage 2 of water invasion, blue crosses), the capillary pressure increases slightly, due to local relaxation of the interfaces.

(e) Gaussian curvature
We computed the Gaussian curvature G = κ 1 × κ 2 , shown in Fig. 8 as the average over the entire oil-water interface. Remarkably, we observe that the Gaussian curvature is negative and follows the same trend as κ in Fig. 7A: in most cases the curvature has opposite signs in orthogonal directions. This observation of negative Gaussian curvature has some interesting consequences for flow. A negative value indicates a well-connected object [50] implying that oil and water can both flow, providing an explanation for the favourable recoveries seen in many mixed-wet systems [1,2,41]. Minimal surfaces are a special case with a mean curvature of zero: these form to minimize energy at pinned contacts in a range of circumstances from soap films, to foams and cell structures [41,52]. In our case we indeed have pinned contacts, which drives the interfaces to  be approximately minimal surfaces; however, displacement at a contact angle of greater than 90 • forces the curvature to be slightly negative to allow the water to displace oil in weakly oil-wet regions of the pore space.

(f) Thermodynamic contact angle controls interface movement
The geometric contact angle θg shown in Fig. 5 characterizes the wettability of the system at rest after waterflooding. Since the fluid-fluid interfaces can hinge at fixed contact points, Fig. 4, θg does not necessarily indicate the contact angles associated with displacement, or those values that should be used in a pore-scale numerical model [53].
In contrast, the thermodynamic contact angle θ t is computed from an energy balance, considering the changes in saturation and interfacial areas and assuming that there is little viscous dissipation caused by interface recession and rearrangement, which is valid for this experiment [40]: ∆aws cos θ t = κφ∆Sw + ∆awo, (3.1) where φ is the porosity, and ∆Sw, ∆awo and ∆aws are the differences, between two subsequent time steps, in water saturation and in specific interfacial areas between water and oil, and water and solid. In our experimental dataset θ t can be computed only during the first stage of water invasion -before breakthrough -when both saturations and interfacial areas experience significant differences. Figure 9 shows that θ t has a value of approximately 110 • at the beginning of waterflooding. While water invades the pore space, an increasing trend is noticed, with a value close to 130 • at breakthrough. With respect to θg, the values of θ t are in the upper region of the probability distribution, higher than the mean geometric contact angle at the end of waterflooding. Previous work has shown that the agreement between simulation and experiment is improved by using contact angles in oil-wet pores that are higher than the geometric value. [54].
During a displacement in a three-dimensional mixed-wet porous medium with a wide range of contact angle, it is the advancing contact angle which determines the threshold capillary pressure at which water can displace oil. Contact angle hysteresis causes this angle to be higher than θg, which is measured at the end of waterflooding, when the fluids are at rest [38,39]  for the large contact angle hysteresis is interface pinning, as described previously and shown in Fig. 4. This contact angle hysteresis is why we did not observe interface recession and consequent distal and Roof snap-off events [27,45]. On the other hand, interface pinning explains why, while the invasion progresses, θ t has to rise ( Figure 9). An increase in the local energy is required to overcome the interfacial forces caused by interface pinning, with a consequent increase of the thermodynamic contact angle as water invades more oil-wet pores.
This shows that, in mixed-wet systems, the dominant parameter which controls water invasion is the contact angle θ, and that the contact angle to be considered is θ t , as this encapsulates the energy required for the movement of the interface.

Conclusions
We have studied two-phase flow invasion patterns in a mixed-wet porous medium, using dynamic high-resolution X-ray synchrotron imaging. Water invades the pores through their centres, as a connected phase, without evidence of wetting layer flow. We identify a key signature of invasion patterns in three-dimensional mixed-wet media -a wide range of non-uniformly distributed local contact angles. We observe that the movement of water in the initially oil-filled medium is limited by interface pinning, responsible for contact angle hysteresis. This prevents interface recession and snap-off during the displacement. Water invasion does not happen in decreasing order of throat size, meaning that other parameters must control the filling sequence. The thermodynamic contact angle, which encapsulates an energy balance for pore invasion, increases until breakthrough, showing that it constrains pore filling in mixed-wet media. This new finding will be crucial for increasing the predictive abilities of pore-network models which simulate the flow in such mixed-wet porous media.
The presence of pinned interfaces drives the oil-water interfaces to become nearly minimal surfaces with a low mean curvature and a negative Gaussian curvature, meaning that the oil bulges into the water in one direction while water bulges into oil in the other. This leads to well-connected phases and is the topological origin of high displacement efficiency in mixed-wet media [1,41].
We suggest that we could engineer a mixed-wet state in either natural or artificial materials to facilitate the simultaneous flow of two immiscible phases over a wide range of saturation. in porous materials, from oil recovery or CO 2 storage in rocks, to favourable drying of fabrics, the manufacturing of nano devices and DNA stretching [42].
Data Accessibility. All the 3D images of the sample and the fluids within it during invasion have been uploaded to the Digital Rocks Portal (www.digitalrocksportal.org/projects/253) [55]. The scripts for image processing have been made open-access via GitHub (github.com/alessioscanziani).
Authors' Contributions. All authors were involved in the conceptualization of the research. BB and MJB supervised the research. AS, QL, and AA performed the investigations. AS, QL, BB and MJB were involved in the formal analysis of the data. AS wrote the initial draft of the article while all authors contributed to its review and editing.
Funding. Abu Dhabi National Oil Company has contributed in funding this research.