pc_to_satn
#
Convert a capillary pressure map to saturation map.
import matplotlib.pyplot as plt
import numpy as np
import porespy as ps
ps.visualization.set_mpl_style()
/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/openpnm/algorithms/_invasion_percolation.py:358: NumbaDeprecationWarning: The 'nopython' keyword argument was not supplied to the 'numba.jit' decorator. The implicit default value for this argument is currently False, but it will be changed to True in Numba 0.59.0. See https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit for details.
def _find_trapped_pores(inv_seq, indices, indptr, outlets): # pragma: no cover
The arguments and their defaults are:
import inspect
inspect.signature(ps.filters.pc_to_satn)
<Signature (pc, im, mode='drainage')>
The capillary pressure map, such as that computed by ps.simulations.drainage
im = ps.generators.blobs(shape=[200, 200], porosity=0.6)
drn = ps.simulations.drainage(im=im, voxel_size=1, g=0)
pc
and im
#
satn = ps.filters.pc_to_satn(pc=drn.im_pc, im=im)
fig, ax = plt.subplots(1, 2, figsize=[12, 6])
ax[0].imshow(drn.im_pc/im, interpolation='none', origin='lower')
ax[0].axis(False)
ax[1].imshow(satn/im, interpolation='none', origin='lower')
ax[1].axis(False);

The saturation image allows for easy determination of a desired fluid configuration:
fig, ax = plt.subplots(1, 2, figsize=[12, 6])
ax[0].imshow((satn < 0.3)*(satn > 0)/im, interpolation='none', origin='lower')
ax[0].axis(False)
ax[1].imshow((satn < 0.8)*(satn > 0)/im, interpolation='none', origin='lower')
ax[1].axis(False);
