PMEAL / OpenPNM

A Python package for performing pore network modeling of porous media
http://openpnm.org
MIT License
454 stars 174 forks source link

More robust conduit lengths #2853

Closed jgostick closed 10 months ago

jgostick commented 1 year ago

The spheres_and_cylinders conduit length model was not handling an edge case properly. When two spheres overlapped, AND the throat was larger than the area of overlap, it was ignoring the contribution of the throat. It was basically assuming that the throat was much smaller than the pores.

I also added an extra check to this function so it raises an exception if the spheres overlap TOO much. We have had some people noticing negative flows and other odd behavior if they weren't being careful about spacing and pore sizes, so I decided to add this check even though we wanted to avoid too much "hand holding". I think this check is general enough that its acceptable.

codecov[bot] commented 1 year ago

Codecov Report

Merging #2853 (6d663d7) into dev (00551ab) will increase coverage by 0.0%. Report is 2 commits behind head on dev. The diff coverage is 100.0%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #2853 +/- ## ===================================== Coverage 89.8% 89.8% ===================================== Files 148 148 Lines 8624 8636 +12 ===================================== + Hits 7747 7759 +12 Misses 877 877 ```
ma-sadeghi commented 1 year ago

@jgostick Should we instead add a health check to the run method? The very least, check if the conduit array (Nt by 3) is all positive.

jgostick commented 1 year ago

I think it'd be a good idea to have a robust "check_physics_health" function that reports on errors. I'd rather not call it on each run though, since it slows things.