porespy.simulations.tortuosity_fd#

porespy.simulations.tortuosity_fd(im, axis, solver=None, tol=None, ftol=0.001)#

Calculates the tortuosity of image in the specified direction.

Parameters:
  • im (ndarray) – The binary image to analyze with True indicating phase of interest

  • axis (int) – The axis along which to apply boundary conditions

  • solver (openpnm Solver, optional) – A pre-built OpenPNM solver. When given, a single solve is performed and ftol is used only as a post-hoc convergence check.

  • tol (float, optional) – Residual relative tolerance passed to the default PyAMG solver. If given, a single solve at this tolerance is performed (no iterative tightening) and ftol is used only as a post-hoc check. Ignored when solver is given.

  • ftol (float, optional) – Target relative inlet/outlet flux mismatch. When neither solver nor tol is given, the residual tolerance is tightened iteratively until the achieved flux balance falls under ftol. Default is 1e-3.

Returns:

results – The following values are computed and returned as attributes:

Attribute

Description

tortuosity

Calculated using the effective_porosity as \(\tau = \frac{D_{AB}}{D_{eff}} \cdot \varepsilon\).

effective_porosity

Porosity of the image after applying trim_nonpercolating_paths. This removes disconnected voxels which cause singular matrices.

original_porosity

Porosity of the as-received the image

formation_factor

found as \(D_{AB}/D_{eff}\).

im_conc

An image containing the concentration values from the simulation.

converged

Whether the achieved inlet/outlet flux mismatch falls under ftol. Users who need a finer picture (e.g. layer-by-layer flux constancy) can run porespy.beta.flux on im_conc.

Return type:

Results object

Examples

Click here to view online example.