Skip to main content
Log in

A Unified Algorithm for the Young–Laplace Method Applied to Porous Media

  • General and Applied Physics
  • Published:
Brazilian Journal of Physics Aims and scope Submit manuscript

Abstract

Young–Laplace equation-based algorithms for simulating capillary-driven flow have been used in porous media research for more than two decades. However, the lack of a uniform mathematical description hinders a wider application of these algorithms, as well as impede their comparison. After conducting a detailed review of the most important publications in the area, we propose a unified algorithm. This resulting framework is capable of handling four distinct physical situations: drainage and imbibition with either compressible or incompressible displacement fluid. Additionally, there is no restriction regarding the geometry or the initial fluid distribution used. The proposed algorithm can simulate variable or mixed wettability, even for imbibition, which has not already been described in the literature. Finally, at the end of the manuscript, we provide an efficient open-source C +  + code for the proposed unified algorithm and also many examples of its use.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8

Similar content being viewed by others

Availability of Data and Material

Not applicable.

Code Availability

An open-source C +  + code for the proposed unified algorithm is available at: https://github.com/alexandrezabot/ylm.

References

  1. V.P. Schulz, J. Becker, A. Wiegmann, P.P. Mukherjee, C.-Y. Wang, J. Electrochem. Soc. 154, B419 (2007)

    Article  Google Scholar 

  2. H.-J. Vogel, J. Tölke, V.P. Schulz, M. Krafczyk, K. Roth, Vadose Zo. J. 4, 380 (2005)

    Article  Google Scholar 

  3. D. Adalsteinsson, M. Hilpert, Transp. Porous Media 65, 337 (2006)

    Article  MathSciNet  Google Scholar 

  4. M. Hilpert, C.T. Miller, Adv. Water Resour. 24, 243 (2001)

    Article  ADS  Google Scholar 

  5. V.P. Schulz, E.A. Wargo, E.C. Kumbur, Transp. Porous Media 107, 13 (2015)

    Article  Google Scholar 

  6. I. Shikhov, C.H. Arns, Transp. Porous Media 107, 623 (2015)

    Article  Google Scholar 

  7. P. Mohammadmoradi, A. Kantzas, Adv. Water Resour. 94, 200 (2016)

    Article  ADS  Google Scholar 

  8. Y. Mu, R. Sungkorn, J. Toelke, Adv. Water Resour. 95, 16 (2016)

    Article  ADS  Google Scholar 

  9. S. Berg, M. Rücker, H. Ott, A. Georgiadis, H. van der Linde, F. Enzmann, M. Kersten, R.T. Armstrong, S. de With, J. Becker, A. Wiegmann, Adv. Water Resour. 90, 24 (2016)

    Article  ADS  Google Scholar 

  10. P. Mostaghimi, R.T. Armstrong, A. Gerami, Y. Hu, Y. Jing, F. Kamali, M. Liu, Z. Liu, X. Lu, H.L. Ramandi, A. Zamani, Y. Zhang, J. Nat. Gas Sci. Eng. 39, 143 (2017)

    Article  Google Scholar 

  11. S.N. Apourvari, C.H. Arns, Adv. Water Resour. 95, 161 (2016)

    Article  ADS  Google Scholar 

  12. R.D. Hazlett, Transp. Porous Media 20, 21 (1995)

    Article  Google Scholar 

  13. F.S. Magnani, Determinação Das Configurações de Equilíbrio Em Meios Porosos Indeformáveis, Universidade Federal De Santa Catarina, 1996

  14. F.S. Magnani, P.C. Philippi, Z.R. Liang, C.P. Fernandes, Int. J. Multiph. Flow 26, 99 (2000)

    Article  Google Scholar 

  15. P. Mohammadmoradi, A. Kantzas, in Day 3 Tue, April 25, 2017 (SPE, 2017)

  16. S.P. Mohammadmoradi, Pore morphological multi-phase digital rock physics models, UNIVERSITY OF CALGARY, 2016

  17. D. Tiab, E.C. Donaldson, Petrophysics: Theory and Practice of Measuring Reservoir Rock and Fluid Transport Properties, 4th edn. (Gulf Professional Publishing, 2015)

  18. M.A. Celia, P.C. Reeves, L.A. Ferrand, Rev. Geophys. 33, 1049 (1995)

    Article  ADS  Google Scholar 

  19. J.Y. Zuo, X. Guo, Y. Liu, S. Pan, J. Canas, O.C. Mullins, Energy Fuels 32, 4705 (2018)

    Article  Google Scholar 

  20. A. Mehmani, M. Prodanović, Adv. Water Resour. 63, 104 (2014)

    Article  ADS  Google Scholar 

  21. T. Zhang, S. Sun, Energies 14, 7724 (2021)

    Article  Google Scholar 

  22. H. Huang, D.T. Thorne, M.G. Schaap, M.C. Sukop, Phys. Rev. E 76, 066701 (2007)

    Article  ADS  Google Scholar 

  23. X. Shan, H. Chen, Phys. Rev. E 47, 1815 (1993)

    Article  ADS  Google Scholar 

  24. X. Shan, G. Doolen, J. Stat. Phys. 81, 379 (1995)

    Article  ADS  Google Scholar 

  25. F.G. Wolf, D.N. Siebert, R. Surmas, Phys. Fluids 32, 052008 (2020)

    Article  ADS  Google Scholar 

  26. J. Zhang, Microfluid. Nanofluidics 10, 1 (2011)

    Article  Google Scholar 

  27. S.A. Galindo-Torres, A. Scheuermann, L. Li, D.M. Pedroso, D.J. Williams, Comput. Phys. Commun. 184, 1086 (2013)

    Article  ADS  MathSciNet  Google Scholar 

  28. C.J. Landry, Z.T. Karpyn, O. Ayala, Water Resour. Res. 50, 3672 (2014)

    Article  ADS  Google Scholar 

  29. I. Zacharoudiou, E.S. Boek, Adv. Water Resour. 92, 43 (2016)

    Article  ADS  Google Scholar 

  30. J. Wang, L. Chen, Q. Kang, S.S. Rahman, Fuel 181, 478 (2016)

    Article  Google Scholar 

  31. Q. Liu, Y.-L. He, Phys. A Stat. Mech. Its Appl. 465, 742 (2017)

    Article  ADS  Google Scholar 

  32. Z. Li, S. Galindo-Torres, G. Yan, A. Scheuermann, L. Li, Adv. Water Resour. 116, 153 (2018)

    Article  ADS  Google Scholar 

  33. Z. Peng, S. Liu, S. Tang, Y. Zhao, Y. Li, Geofluids 2018, 1 (2018)

    Google Scholar 

  34. T. Zhang, S. Sun, Fuel 246, 196 (2019)

    Article  Google Scholar 

  35. J. Zhao, F. Qin, D. Derome, J. Carmeliet, J. Hydrol. 588, 125080 (2020)

    Article  Google Scholar 

  36. P. Soille, Morphological Image Analysis (Springer, Berlin Heidelberg, Berlin, Heidelberg, 2004)

    Book  Google Scholar 

  37. T. Saito, J.-I. Toriwaki, Pattern Recognit. 27, 1551 (1994)

    Article  ADS  Google Scholar 

  38. A. Zabot, (2022)

  39. C.A. Glasbey, G.W. Horgan, Image Analysis for the Biological Sciences, 1st edn. (Wiley, 1995)

  40. L.-F. He, Y.-Y. Chao, K. Suzuki, J. Comput. Sci. Technol. 28, 468 (2013)

    Article  Google Scholar 

  41. M.A. Camargo, F.A.M. Cássaro, L.F. Pires, Bull. Eng. Geol. Environ. 81, 137 (2022)

    Article  Google Scholar 

Download references

Acknowledgements

The authors are grateful to the Brazilian Petroleum Company (Petrobras) for the financial support.

Funding

Fabiano G. Wolf, Diogo Siebert, and Rodrigo Surmas report financial support provided by the Brazilian Petroleum Company (Petrobras) (project numbers 4600386529 and 2015/00388–4).

Author information

Authors and Affiliations

Authors

Contributions

A.M.Z.: conceptualization, methodology, software, and writing–original draft; M.A.C.: writing–review and editing; F.G.W.: validation, resources, writing–review and editing, and funding acquisition; D.N.S.: resources, writing–review and editing, and funding acquisition; R.S.: software, resources, and funding acquisition; L.O.E.S.: conceptualization, writing–review and editing; T.R.F., L.F.P., and F.A.M.C: writing–review and editing.

Corresponding author

Correspondence to Mario Augusto Camargo.

Ethics declarations

Conflict of Interest

The authors declare no competing interests.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Appendices

Appendix 1. Mathematical Morphology Applied to YLM

Figure 9 illustrates how the region occupied by the invading fluid is found using Mathematical Morphology (MM) operations. In the YLM, it is considered that the image is exclusively formed by the union between the solid and pore (\(P\)) related pixels and that the MM operations will not expand the image beyond its original dimensions.

Fig. 9
figure 9

Examples of the fundamental MM operations. a The porous region P is shown in beige. b and c The beige region represents the set of points resulting from the operations of erosion and dilation, respectively. d The final result

In MM, the opening operation (\(\circ\)) is defined using the combination of two fundamental operations: erosion and dilation. In the erosion operation, denoted by \(\ominus\), a structuring element with a disk shape \(D\) is applied over the region \(P\) (Fig. 9a), resulting in region \(E=P\ominus D\), as shown in Fig. 9b. Region \(E\) comprises all the points in \(P\), where the structuring element can be centered without overlapping the solid region. Notice that although no segment can overlap over the solid region, it is allowed for part of the structuring element to be outside of the boundary image.

Figure 9c exemplifies the dilation operation of \(E\) by a structuring element \(D\) (denoted by \(E\oplus D\)), resulting in region \(O\) with all the points intersected by the disk \(D\) as its center moves around the \(E\) region. It is important to notice that the result includes only points originally belonging to \(P\); otherwise, the final image would be expanded.

Lastly, Fig. 9c is also the region \(O\) obtained directly as a result of the opening operation of \(P\) by the structuring element \(D\) (\(O=P\circ D\)), which comprises all the points of \(D\), as this element moves around \(P\) without extending over the solid region. As the case shown in Fig. 9b, the structuring element is allowed to lay over regions outside the image. Moreover, as in Fig. 9c, the resulting region \(O\) contains only points belonging initially to \(P\). Figure 9d shows the final results after relabeling the porous region.

As one can realize from Fig. 9, the erosion of \(P\) by \(D\) followed by the dilation by \(D\) is identical to the opening of \(P\) by \(D\), i.e.,

$$O=P\;\circ\; D=E\oplus D=(P\ominus D)\oplus D$$
(4)

Actually, it is possible to prove that it represents a general result, which is of great practical importance because it allows performing the opening operation using the combination of dilation and erosion operations. Furthermore, dilation can be obtained by applying erosion to the negative of an image. The negative is retrieved by swapping the image foreground and background, which in our case are porous and solid regions, respectively. Denoting the negative by an overbar, one can show that

$$E\oplus D=\overline{\left(\overline E\ominus D\right)}$$
(5)

The right-hand side operation is shown in Fig. 10a–d, which gives the same result already displayed in Fig. 9, which depicts the operation of the left-hand side. Using Eq. (5), the opening operation in Eq. (4) is written solely in terms of erosions

$$O=\overline{\left(\overline E\ominus D\right)}=\overline{\left[\overline{\left(P\ominus D\right)}\ominus D\right]}$$
(6)
Fig. 10
figure 10

The opening operation of P is performed by two erosion operations. This is possible because the negative of the dilation is equal to the erosion of the negative. a Results from the negative of the E region in Fig. 9b. b and c The beige region represents the set of points resulting from the operations of erosion and the negative of the N region, respectively. d The final result

As previously mentioned, to obtain an efficient algorithm, the erosion operations must be performed with the aid of the Euclidian Distance Transform (EDT). The result of the EDT is a map with the distance of each pore pixel to the closest solid pixel, and it can be computed using a very efficient and parallel algorithm proposed by Saito and Toriwaki [37].

If the structuring element is a circle of radius \(R\), then the erosion operation is given by the set of pixels whose distance to the solid is larger than \(R\) or, equivalently, \({{\text{EDT}}}_{ij}^{2}>{R}^{2}\) where \({{\text{EDT}}}_{ij}^{2}\) indicates the squared distance of the pixel located at the image position \(ij\) to the closest solid pixel [39]. Using the squared distance is advantageous since it allows for the computation to be handled solely by integers. Figure 11 depicts how the \({\text{EDT}}\) can be used to compute the opening operation of the porous region by a circle. The procedure starts from the \({\text{EDT}}\) result, shown in Fig. 11a. As explained, the values are the squared distance to the background (solid). By taking the negative of this result, i.e., setting it as background (Fig. 11b), the \({\text{EDT}}\) is once again applied from which a new erosion is performed. The negative result of this last operation (Fig. 11c) gives the opening of the porous region by the circle (Fig. 11d).

Fig. 11
figure 11

Opening operation of the porous region by a circle of 7 pixels in diameter (i.e., \({R}^{2}={3.5}^{2}=12.25\)) using the EDT (see Fig. 2). a EDT values used to erode the porous region. b EDT values used to erode the negative image of a. c The negative image of b is equivalent to the opening operation of the porous region directly. d Final image after opening operation of the porous region by a circle of 7 pixels in diameter

Figure 12 illustrates the bottom-up drainage through a narrow channel. The non-wetting fluid source is represented by the dark blue square (Fig. 12a). By the opening operation, and consequently, by the Young–Laplace equation, the upper region could be occupied by the non-wetting fluid; however, the circle cannot cross the constriction for this radius (Fig. 12b). From the morphological standpoint, this question is addressed by discarding the upper region since it is not connected to the source.

Fig. 12
figure 12

a A bottom-up drainage through a narrow channel with the wetting fluid in red, and the non-wetting fluid source represented by the dark blue square. b The opening operation identifies two regions (beige color) that could be occupied by c the invading non-wetting fluid (light blue), but the upper region is not connected to the fluid source (dark blue pixel), and hence cannot be filled in the current pressure step

The next step is the identification of the connection between the regions can be performed by using the algorithm of He et al. [40]. This technique assigns a label to each unconnected group of pixels, allowing us to ignore the pixels with labels different from that of the sources (Fig. 12c). This methodology already considers the possibility of multiple sources.

By using the MM notation discussed above, the YLM can be expressed as [4]:

$$s\left(r\right)=\frac{\sum {F}_{{{\text{I}}}_{{\text{v}}}}(P\;\circ \;D)}{\sum P}$$
(7)

where \(s(r)\) is the saturation of the invading fluid for a given circle radius (\(r\), and \(D\equiv D(r)\)), and the summation symbol represents the operation of counting the pixels of each region. As for the operator \({F}_{{I}_{{\text{v}}}}\), it denotes the process of filtering the pixels connected with the invading fluid source.

As described in Sect. 2, imbibition can be obtained in a similar way to the drainage processes. But actually, some implementation details distinguish these two processes. These differences were noticed by the earlier authors of the method [12,13,14], and they were discussed in Sect. 3.

Appendix 2. Main Improvements for Drainage Simulation with the YLM

Since the majority of the applications of the YLM are limited to drainage simulations, this process received greater attention from researchers over the years compared to imbibition. Consequently, important improvements were proposed in the literature for the drainage process, and here, we describe two significant changes to the original procedure summarized by Eq. (7).

Hilpert and Miller [4] identified an error in Eq. (7) which led to an overestimation of the saturation value in some situations. As displayed in Fig. 13a, for a drainage process of the wetting fluid (red) from the bottom to the top in a selected geometry with two large pore regions separated by a short channel (like an ink bottle geometry), the opening operation results in the two regions being connected (Fig. 13c). Nevertheless, during a real invasion, the non-wetting fluid (blue) would not reach the upper section for the value of pressure related to the circle radius indicated in Fig. 13b, since it cannot cross the channel. This would only be possible if the entire circle could cross the channel.

Fig. 13
figure 13

a A drainage process of the wetting fluid (red) from the bottom to the top in a selected geometry with two large pore regions separated by a short channel. Common to both cases, the erosion operations are performed in b. c, e, and g The original YLM drainage algorithm as proposed by Hazlett [12] and also by Magnani [13] and Magnani et al. [14]. d, f, and h The correction of Hilpert and Miller [4]. The non-wetting invading fluid (blue) source is represented by a dark blue square

To avoid this error, Hilpert and Miller [4] proposed a simple correction (Fig. 13d) that consists of identifying the regions connected to the fluid source between the erosion (Fig. 13b) and the dilation (Fig. 13f) processes instead of after the dilation (Fig. 13e). Figure 13g, h shows the difference between the original YLM drainage and Hilpert’s correction YLM drainage, respectively. Considering this correction, Eq. (7) is replaced by

$$s\left(r\right)=\frac{\sum \left\{\left[{F}_{{{\text{I}}}_{{\text{v}}}}(P\ominus D)\right]\oplus D\right\}}{\sum P}$$
(8)

The drainage process described by Eq. (8) is limited to the simulation of the invasion of a fully non-wetting fluid, or equivalently, the value for the contact angle in Fig. 1a is always zero. Schulz et al. [5] presented a small modification to this algorithm, allowing different values to be set. The concept used by the authors is depicted in Fig. 14. It shows that if a circle with a different radius is used (\({R}^{\prime}\) for erosion and \(R\) for dilation); then, a final interface with a radius of curvature \({R}^{\prime}\) and contact angle \(\theta\), given by

$${R}^{\prime}=R\;{\text{cos}}\theta$$
(9)

is achieved. Including this improvement, Eq. (8) is modified to Eq. (2) in which the structuring element \({D}^{\prime}\) is associated with a circle with a radius \({R}^{\prime}\). Even though this generalization enables more realistic applications of the YLM, a fact that it is not yet widely known by the research community, as recent works still point out the inability to change the contact angle [10, 41].

Fig. 14
figure 14

The sequence of MM operations proposed by Schulz et al. [5] to enable drainage simulations with different contact angles. The disks \(D^{\prime}\) and \(D\) are associated with \({R}^{\prime}\) for erosion and \(R\) for dilation, respectively

One main advantage of this approach is concerning to its implementation easiness. Since just the radius of the erosion needs to be modified, it is easily incorporated into an existing YLM code. Moreover, as the erosion is computed pixel by pixel using the \({\text{EDT}}\) result, a case of mixed wettability could be readily performed by assigning an individual contact angle to each pixel [5].

On the other hand, since the porous media surface is, in general, curved, the contact angle will depend on this curvature. Also, if the larger circle used in the dilation extends beyond the wall to a near pore, this region can be incorrectly assigned as occupied by the invading fluid. Although, for it to happen, this region must also have a connection with the fluid source. This situation is shown in Fig. 14, where the circle with a radius \({R}^{\prime}\) extends to a bottom channel.

As mentioned by the authors, in petrophysics applications, these two drawbacks do not present a serious problem if \(\theta \lesssim 40^\circ\) as the rock samples generally have low porosity and a large number of small pores.

As shown in Sect. 4, an appropriate membrane makes Schulz’s proposed modification suitable even for imbibition.

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Zabot, A.M., Camargo, M.A., Wolf, F.G. et al. A Unified Algorithm for the Young–Laplace Method Applied to Porous Media. Braz J Phys 54, 63 (2024). https://doi.org/10.1007/s13538-024-01442-w

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s13538-024-01442-w

Keywords

Navigation