bond_number#

Computes the Bond number for an image. The Bond number is defined as:

\[ Bo = \frac{\Delta \rho g R^2}{\sigma} \]

The main challenge with finding \(Bo\) is determining the correct expression for \(R\). The bond_number function provides a lot of options.

im, g, sigma, voxel_size, and delta_rho#

Several mandatory arguments are required. Firstly, im is needed because it computes either the distance transform or the local thickness of the image in order to find the characteristic size R.

voxel_size is required to convert the value of R obtained from the image into proper size units instead of voxels.

g, sigma and delta_rho are needed since they are required by the definition of \(Bo\).

import porespy as ps

im = ps.generators.blobs([100, 100], porosity=0.8, seed=0)
ps.metrics.bond_number(
    im=im,
    g=9.81,
    sigma=0.01,
    voxel_size=1e-5,
    delta_rho=1000,
)
0.008817170868430176

source and method#

source can either be dt or lt meaning distance transform or local thickness. This controls which values of R are used to compute the characteristic size.

method indicates how the values in the dt or lt image are averaged to get a characteristic size. There are several options, including 'median', 'mean', 'min', 'max', etc. These are each described in the docstring for the function.

A good option is the median of the local thickness, which are the defaults.

ps.metrics.bond_number(
    im=im,
    g=9.81,
    sigma=0.01,
    voxel_size=1e-5,
    delta_rho=1000,
    source='lt',
    method='median',
)
0.008817170868430176

mask_source#

This option will compute the skeleton of the image and only consider values under the skeleton when applying the selected method to the selected source. This would weight the R to values far away from the walls.

ps.metrics.bond_number(
    im=im,
    g=9.81,
    sigma=0.01,
    voxel_size=1e-5,
    delta_rho=1000,
    source='dt',
    method='mean',
    mask_source=True,
)
0.0030404821622150796

use_diameter#

This boolean flag will convert the dt or lt from radius to diameters if True. The default is False.

ps.metrics.bond_number(
    im=im,
    g=9.81,
    sigma=0.01,
    voxel_size=1e-5,
    delta_rho=1000,
    source='dt',
    method='mean',
    mask_source=True,
    use_diameter=True,
)
0.012161928648860319