porespy.metrics.pc_map_to_pc_curve#
- porespy.metrics.pc_map_to_pc_curve(pc, im, seq=None, mode='drainage', pc_min=None, pc_max=None, fix_ends=True)#
Converts a pc map into a capillary pressure curve
- Parameters:
pc (ndarray) – A numpy array with each voxel containing the capillary pressure at which it was invaded. -inf indicates voxels which are filled with non-wetting fluid at all pressures, and +inf indicates voxels that are filled by wetting fluid at all pressures. Values in the solid phase are masked by im so are ignored.
im (ndarray) – A numpy array with True values indicating the void space and False elsewhere. This is necessary to define the total void volume of the domain when computing the saturation.
seq (ndarray, optional) – A numpy array with each voxel containing the sequence at which it was invaded. This is required when analyzing results from injection simulations since the pressures in pc do not correspond to the sequence in which they were filled.
mode (str) – Indicates whether the invasion was a drainage or an imbibition process. Options are ‘drainage’ and ‘imbibition’.
fix_ends (bool (default is True)) – If True (default) this puts values at + and - infinity corresponding to maximum and minimum non-wetting phase saturations. This helps when plotting as it adds plateaus.
pc_min (float) – Minimum and maximum values to clip the capillary pressures. This is useful if the minimum or maximum capillary pressure values are -/+ infinity, which means they do not show up when plotting. Using pc_min=1 and pc_max=1e6 for instance, will make plateaus render when plotting.
pc_max (float) – Minimum and maximum values to clip the capillary pressures. This is useful if the minimum or maximum capillary pressure values are -/+ infinity, which means they do not show up when plotting. Using pc_min=1 and pc_max=1e6 for instance, will make plateaus render when plotting.
- Returns:
results – A dataclass like object with the following attributes:
Attribute
Description
pc
The capillary pressure
snwp
The fraction of void space filled by non-wetting phase at each pressure in
pc- Return type:
dataclass-like
Notes
To use this function with the results of porosimetry or ibip the sizes map must be converted to a capillary pressure map first. drainage and invasion both return capillary pressure maps which can be passed directly as pc.
Examples
Click here to view online example.