porespy icon indicating copy to clipboard operation
porespy copied to clipboard

Add flux tolerance as argument to `tortuosity_fd` (and possibly other effective solvers in the future)

Open ma-sadeghi opened this issue 1 year ago • 1 comments

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:

  1. Choose an initial residual tolerance tol0=1e-1 that's not very stringent
  2. Pass tol=tol0 to PyAMG solver and solve Ax = b
  3. Calculate rate at inlet and outlet, i.e., fd.rate(...)
  4. Check convergence based on flux tolerance (user-defined)
  5. If satisfied, end, if not halve the residual tolerance and go to Step 2.

ma-sadeghi avatar Jun 28 '23 14:06 ma-sadeghi

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.

jgostick avatar Jun 24 '24 15:06 jgostick