Conversation
The 'Adsorption v2.py' script is superseded by the proper _physisorption module, and the .mp4 was an animation artifact that should not be tracked in the repo.
Major refactor of the BET-style physisorption simulation: - Lift kelvin_cohan and harkins_jura helpers to module level so they are not redefined on every call. - Fix the unit inconsistency between the Kelvin-Cohan term (computed in metres) and the film-thickness sweep (in nm) by converting the capillary radius to nm before adding the film thickness. Without this fix, the Kelvin correction was numerically swamped by the thickness, effectively turning the simulation into a thickness sweep with no capillary condensation. - Add voxel_size, T, gamma, vm, and harkins_jura parameters so the function works for fluids other than N2 at 77 K. - Use the full float-valued EDT for the thickness sweep instead of an integer cast, giving a finer isotherm. - Filter the thickness sweep to keep only steps where Harkins-Jura returns p in (0, 1); pressures outside that range are unphysical and would crash the algorithm at p=0 or p>=1. - Mask new-voxel updates with the void mask to keep solid voxels at zero in im_ads and im_des. - Add a NumPy-style docstring with units and Cohan / Harkins-Jura references. - Drop the unused fill_closed_pores import.
The full visual demo (animation, hysteresis loop, parameter sweep) lives in the educational notebook. The __main__ block is just a quick sanity check now.
Without this, the function was unreachable as porespy.beta.physisorption even though the module file existed.
Cover the public physisorption API with 2D and 3D fixtures, and unit-test the Kelvin-Cohan and Harkins-Jura helpers directly to guard against future regressions in the underlying physics.
Users (and downstream visualisations) often want to filter the filling-thickness map at a specific step or annotate isotherm plots with the corresponding film thickness, both of which need the thickness sweep used internally. Surfacing them avoids forcing callers to recover them via Harkins-Jura inversion.
A short, high-signal walk through running physisorption on a 2D blobs image: hysteresis loop, filling-thickness map, snapshots along the adsorption branch, and a comparison between N2 at 77 K and Ar at 87 K showing the parameterisation in action.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #1132 +/- ##
=====================================
Coverage 70.4% 70.4%
=====================================
Files 45 45
Lines 6460 6460
=====================================
Hits 4554 4554
Misses 1906 1906 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.