pc_map_to_pc_curve#

This single method can convert either (a) images containing invasion size or (b) invasion pressure results, such as those produced by injection, imbibition and drainage, respectively.

import porespy as ps
import numpy as np
import matplotlib.pyplot as plt

ps.visualization.set_mpl_style()

Generate an image and apply the drainage function:

np.random.seed(0)
im = ps.generators.blobs(shape=[200, 200], porosity=0.6)
pc = ps.filters.capillary_transform(im, sigma=0.01, theta=180, voxel_size=1e-5)
drn = ps.simulations.drainage(im, pc=pc, steps=25)

fig, ax = plt.subplots(figsize=[4, 4])
ax.imshow(np.log10(drn.im_pc))
ax.axis(False);
../../../_images/14a8827a86a580171ef76846f6a7b431c4b2bbb81c68b94b1a4775d410e506f1.png

pc#

The function can accept an image of invasion pressures, such as that produced by drainage or injection:

pc_curve = ps.metrics.pc_map_to_pc_curve(im=im, pc=drn.im_pc)

The function returns an object with pc and snwp as attributes which can be plotted directly:

plt.semilogx(pc_curve.pc, pc_curve.snwp, "b-o")
plt.xlabel("Capillary Pressure [Pa]")
plt.ylabel("Non-wetting Phase Saturation");
../../../_images/e21460179791c812ad88bab6171ef7cd7d76560c51db22a670ad4a6bc6b428ee.png