tortuosity_fd#
This function solves Fickian diffusion on the image using the voxel as the grid to find the tortuosity. The function uses finite differences hence the _fd suffix.
where \(D_{eff} = \frac{\varepsilon}{\tau}\)
im#
im defines the grid on which the simulation occurs. All voxels which are True are used as the grid. An image of all True values would return a tortuosity of 1.0 since there are no obstacles.
The function returns a Results object, with several pieces of information attached as attributes. Printing the object provides a formatted list of the attributes, which includes the computed tortuosity as well as the image of the computed concentration field:
import porespy as ps
import numpy as np
import matplotlib.pyplot as plt
ps.visualization.set_mpl_style()
im = np.ones([100, 100], dtype=bool)
fd = ps.simulations.tortuosity_fd(im, axis=0)
print(fd)
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[1], line 8
5 ps.visualization.set_mpl_style()
7 im = np.ones([100, 100], dtype=bool)
----> 8 fd = ps.simulations.tortuosity_fd(im, axis=0)
9 print(fd)
File ~/work/porespy/porespy/src/porespy/simulations/_dns.py:54, in tortuosity_fd(im, axis, solver)
16 def tortuosity_fd(im, axis, solver=None):
17 r"""
18 Calculates the tortuosity of image in the specified direction.
19
(...) 52
53 """
---> 54 import openpnm as op
55 ws = op.Workspace()
57 if axis > (im.ndim - 1):
ModuleNotFoundError: No module named 'openpnm'
axis#
You can specify the direction of the simulation using axis:
Notes#
The returned
Resultsobject has several attributes include both the original porosity and the effective porosity. The latter refers to the porosity after filling all pores which were not connected to either inlet or outlet faces. It is worth remembering that the reported tortuosity value is computed using the effective value, not the original value.The function uses an iterative solver to find the concentration values, and is limited to the CPU. For this reason the function can be rather slow on large images. We recommend TauFactor2 which is GPU accelerated, or our new Julia package Tortuosity.jl