porespy
porespy copied to clipboard
Add flux tolerance as argument to `tortuosity_fd` (and possibly other effective solvers in the future)
Currently, tortuosity_fd
accepts residual tolerance, but internally once the solve phase finishes it checks whether the inlet and outlet fluxes match within a hardcoded tolerance of 1e-4
. I think it makes sense for our effective property solvers (tortuosity for now, but permeability in the future) to accept flux tolerance rather than residual tolerance. Here's how I think it can be implemented:
- Choose an initial residual tolerance
tol0=1e-1
that's not very stringent - Pass
tol=tol0
to PyAMG solver and solveAx = b
- Calculate rate at inlet and outlet, i.e.,
fd.rate(...)
- Check convergence based on flux tolerance (user-defined)
- If satisfied, end, if not halve the residual tolerance and go to Step 2.
This is actually a good idea...like a physically meaningful tolerance rather than an abstract mathematical one. Given this wrapper is meant to be helpful, this seems a step in that direction.