***************************** Full Morphology Method ***************************** The **Full Morphology Method (FMM)** simulates pressure-driven fluid displacement using morphological operations. The method assumes: - zero capillary number, - strong wettability of the displaced fluid, - immiscible fluids, - a quasi-static process, such that equilibrium is achieved between consecutive iterations. The saturation map is generated by **sphere intrusion**. It is based on the simplified **Young–Laplace equation**, which assumes cylindrical throats. This equation relates the capillary pressure to the invaded radius: .. math:: :nowrap: $$ P_c = \frac{2 \gamma \cos(\theta)}{R}, $$ where $\gamma$ is the interfacial tension, $\theta$ is the contact angle, and $R$ is the invaded radius. For a given radius, the algorithm consists of three main steps: **erosion**, **connectivity check** and **dilation**. During the **erosion** step, voxels within the pore space whose Euclidean Distance Transform (EDT) is greater than or equal to the current radius are identified. These voxels represent candidate sphere centers that the injected fluid can occupy. From this set, the **connectivity check** retains only the voxels that are connected to the inlet. This step prevents invasion from occurring within isolated regions in the interior of the domain, ensuring that the displacement process remains physically consistent. Finally, **dilation** is applied to this filtered set of sphere centers. Voxels located within a distance equal to the radius from these centers are relabeled as invaded, completing the algorithm for the given radius. This process can be repeated for a set of decreasing radii, which gives the relation between saturation and pressure. The Young-Laplace equation translates this relation into $P_c$-saturation data, resulting in a capillary curve or MICP (mercury injection capillary curve) depending on the protocol adopted, as described below. **Protocols** The algorithm employed in this routine is adapted from **ZABOT** and has two protocols: **drainage** and **micp**. The **drainage** protocol simulates an incompressible displacement with intrusion from a single face, chosen by the user. Because the displaced fluid is incompressible, regions of trapped fluid may remain within the pore space. Protocol **micp** invades the sample from all faces, and the displaced fluid is set as compressible. As a result, all pores connected to the exterior are filled with a sufficiently small radius. This protocol mimics a porosimetry experiment, in which mercury is injected in a porous media under vacuum conditions. .. ***************************** .. Digital mercury injection capillary curves .. ***************************** .. LBPM includes a routine to perform digital mercury injection capillary curves (MICP) experiments through the Full Morphology method. The ``ylm-comp`` algorithm performs non-wetting fluid intrusion by introducing spheres with progressively decreasing radius in the porous media. .. The invaded fluid connection to the inlet faces is checked to simulate the invasion as it happens on the physical experiment, so bigger pores which are disconnected to the inlet are not invaded until a smaller throat connects them to the inlet. .. Input .. ----- .. The input file format is given by .. .. code:: c .. Domain { .. Filename = "example.raw" .. N = 100, 100, 100 // domain size .. VoxelLabels = 0, 1, 2, 3 // solid, vacuum, injected, pore (PORE NÃO FAZ SENTIDO, TIRAR DO CÓDIGO) .. } .. YLM { .. Diameters = 2, 50, 1 // smallest, biggest, step .. ImageRoot = "img" // name files .. ImageDir = "folder" // folder in which data is saved .. WhichImage = "all" // which image to save: all, last, none .. Direction = 0, 0, 1 // axis of intrusion (accepts negative values) (não precisa para MICP, tirar do código) .. Surround = true // Surrounds the sample with injected fluid if needed (acho que dá pra deixar true default) .. } .. Once this has been set, ``ylm-comp`` routine is launched via .. .. code:: bash .. mpirun -np 1 $LBPM_DIR/tests/ylm-comp input.db .. Note that this routine does not run in parallel computation. .. Output .. ------ .. The expected output is a folder which contains the ``.raw`` files specified on the input file, and a ``.dat`` file which gives information about the saturations versus diameter points: .. .. code:: bash .. # ################################################################## .. # Arquivo criado com o comando: /home/bernardo.gehlen/zabot/build2/ylm 4 ./config40-1.cfg .. # No diretorio: /home/bernardo.gehlen/bentheimer1600/ylm-results/stat-comp .. # Em: 15:32:09 Jun 13 2025 .. # .. # * Image width (x) (px) : 555 (disconsidering surrounding layers) .. # * Image height (y) (px) : 555 (disconsidering surrounding layers) .. # * Image planes (z) (px) : 987 (disconsidering surrounding layers) .. # * Number of porous pixels : 69049068 (disconsidering surrounding layers) .. # .. # Coluna 1: Step .. # Coluna 2: Diameter (px) .. # Coluna 3: Number of pixels occupied by inlet fluid. .. # Coluna 4: Number of pixels occupied by inlet fluid / Number of porous pixels .. # Coluna 5: Number of pixels occupied by outlet fluid. .. # Coluna 6: Number of pixels occupied by outlet fluid / Number of porous pixels .. # ################################################################## .. 0 50 3464082 0.0501684 65584986 0.949832 .. 1 49 3563377 0.0516064 65485691 0.948394 .. 2 48 5721685 0.082864 63327383 0.917136 .. 3 47 5901939 0.0854746 63147129 0.914525 .. ....... .. 46 4 68512339 0.992227 536729 0.00777315 .. 47 3 68747860 0.995638 301208 0.00436223 .. 48 2 69049068 1 0 0 .. 49 1 69049068 1 0 0 .. .. 4 46 6150977 0.0890812 62898091 0.910919 .. .. 5 45 6366279 0.0921993 62682789 0.907801 .. .. 6 44 6606985 0.0956854 62442083 0.904315 .. .. 7 43 6801845 0.0985074 62247223 0.901493 .. .. 8 42 7289334 0.105567 61759734 0.894433 .. .. 9 41 7558732 0.109469 61490336 0.890531 .. .. 10 40 7946581 0.115086 61102487 0.884914 .. .. 11 39 8401003 0.121667 60648065 0.878333 .. .. 12 38 8665975 0.125505 60383093 0.874495 .. .. 13 37 9055144 0.131141 59993924 0.868859 .. .. 14 36 9489752 0.137435 59559316 0.862565 .. .. 15 35 9894633 0.143299 59154435 0.856701 .. .. 16 34 10696624 0.154913 58352444 0.845087 .. .. 17 33 11065048 0.160249 57984020 0.839751 .. .. 18 32 12827694 0.185776 56221374 0.814224 .. .. 19 31 13470595 0.195087 55578473 0.804913 .. .. 20 30 14097791 0.204171 54951277 0.795829 .. .. 21 29 14596550 0.211394 54452518 0.788606 .. .. 22 28 16812589 0.243488 52236479 0.756512 .. .. 23 27 17436354 0.252521 51612714 0.747479 .. .. 24 26 18933469 0.274203 50115599 0.725797 .. .. 25 25 20109559 0.291236 48939509 0.708764 .. .. 26 24 21965542 0.318115 47083526 0.681885 .. .. 27 23 22804079 0.330259 46244989 0.669741 .. .. 28 22 26476115 0.383439 42572953 0.616561 .. .. 29 21 28582847 0.41395 40466221 0.58605 .. .. 30 20 31515673 0.456424 37533395 0.543576 .. .. 31 19 32984441 0.477696 36064627 0.522304 .. .. 32 18 36640562 0.530645 32408506 0.469355 .. .. 33 17 39466628 0.571574 29582440 0.428426 .. .. 34 16 44424457 0.643375 24624611 0.356625 .. .. 35 15 46646505 0.675556 22402563 0.324444 .. .. 36 14 50074024 0.725195 18975044 0.274805 .. .. 37 13 51736309 0.749269 17312759 0.250731 .. .. 38 12 54951228 0.795829 14097840 0.204171 .. .. 39 11 56509677 0.818399 12539391 0.181601 .. .. 40 10 59332540 0.859281 9716528 0.140719 .. .. 41 9 60881068 0.881707 8168000 0.118293 .. .. 42 8 63254136 0.916075 5794932 0.0839248 .. .. 43 7 64584596 0.935343 4464472 0.0646565 .. .. 44 6 66656663 0.965352 2392405 0.0346479 .. .. 45 5 67447188 0.976801 1601880 0.0231992 .. Comparisons .. ----------- .. This routine is similar to the ``lbpm_morphdrain_pp`` (read more about it `here <./morphOpen.html>`__), except the latter relies solely on the Euclidian distance transform, injecting from the biggest pores even though they might be disconnected to the inlet. .. An IBS sandstone sample was used to compare both routines to experimental data . Both curves were reescaled to match the saturation of the minimal diameter to the experimental one. The figure bellow presents such curves. .. .. figure:: ../../_static/images/ylm-lbpm.png .. :width: 600 .. :alt: morphdrain .. Digital MICP (blue) and lbpm_morphdrain_pp (orange) compared to experimental data (black dashed). .. The saturation on the ``ylm-comp`` curves are higher on bigger diameters because this method interprets reservoirs on all faces, allowing semi-sphere intrusions. ``lbpm_morphdrain_pp`` simulations were performed with periodic boundaries.