Skip to content

Implement the complete single-phase Valvatne-Blunt conductance model#33

Merged
volpatto merged 17 commits intomainfrom
32-implement-the-complete-single-phase-valvatne-blunt
Mar 9, 2026
Merged

Implement the complete single-phase Valvatne-Blunt conductance model#33
volpatto merged 17 commits intomainfrom
32-implement-the-complete-single-phase-valvatne-blunt

Conversation

@volpatto
Copy link
Copy Markdown
Collaborator

@volpatto volpatto commented Mar 9, 2026

This PR adds the complete Valvatne-Blunt conductance model to single-phase flow, with a bunch of benchmarks, including against pnextract and pnflow.

volpatto added 9 commits March 8, 2026 21:14
This notebook compares the default circular `generic_poiseuille` conductance with new shape-factor-aware Valvatne-Blunt models. It includes a synthetic Cartesian network and a real extracted Ketton rock network to evaluate the impact on absolute permeability estimation. Key findings include the recovery of the circular limit for throat-only shape-factor closure and the quantification of changes in throat conductance and absolute permeability for non-circular ducts.
… conductance models

- Updated binary images for permeability and porosity scatter plots.
- Modified CSV files for Stokes case results and limit representative data to reflect new calculations.
- Expanded background documentation with detailed explanations of the equivalent duct concept and shape-aware conductance models.
- Clarified hydraulic geometry fields and their significance in single-phase conductance models in the concepts documentation.
- Revised verification documentation to reflect the transition from `valvatne_blunt_baseline` to the complete `valvatne_blunt` model.
@volpatto volpatto linked an issue Mar 9, 2026 that may be closed by this pull request
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 9, 2026

Coverage

  • Overall line coverage on Ubuntu: 99.87%
  • Diff coverage: 100%
  • Required diff coverage: 99%
  • Result: ✅ passed
diff-cover output
-------------
Diff Coverage
Diff: origin/main...HEAD, staged and unstaged changes
-------------
src/voids/geom/hydraulic.py (100%)
src/voids/image/network_extraction.py (100%)
src/voids/io/porespy.py (100%)
-------------
Total:   204 lines
Missing: 0 lines
Coverage: 100%
-------------

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

volpatto added 7 commits March 8, 2026 21:54
This notebook compares the `voids` workflow against a committed reference dataset produced with the Imperial College `pnextract` and `pnflow` workflow. It includes functionality to load reference data, run the `voids` extraction, and generate comparative metrics and visualizations for permeability and porosity. The results are saved for documentation and review.
…ct/pnflow benchmark, including new figures and CSV results
@volpatto volpatto marked this pull request as ready for review March 9, 2026 01:54
Copilot AI review requested due to automatic review settings March 9, 2026 01:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates voids’ single-phase hydraulic conductance modeling to implement the full Valvatne–Blunt-style shape-factor closure, and aligns the image-extraction/import pipeline and verification artifacts (benchmarks, docs, notebooks, and reference datasets) with that model.

Changes:

  • Implement Valvatne–Blunt single-phase conductance with shape-dependent coefficients and add explicit model names (valvatne_blunt, valvatne_blunt_throat), while keeping valvatne_blunt_baseline as a compatibility alias.
  • Add “Imperial export” (pnextract-style) geometry repair heuristics to the PoreSpy importer, and enable those repairs by default in the image extraction workflow.
  • Add/refresh verification reports, notebooks, and a committed external pnextract/pnflow reference dataset; update benchmark expectations and documentation accordingly.

Reviewed changes

Copilot reviewed 76 out of 109 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/test_workflows_porespy_volume.py Adds tests asserting default Imperial-export geometry repairs in image extraction and acceptance of the legacy pnextract alias.
tests/test_porespy_import_aliases.py Removes importer alias/derivation tests (file deleted).
tests/test_porespy_import.py Removes minimal importer tests (file deleted).
tests/test_legacy_solver_coverage.py Extends solver coverage tests to include the new model names and the new direct API function.
tests/test_benchmark_xlb.py Updates benchmark expectation from valvatne_blunt_baseline to valvatne_blunt.
tests/test_benchmark_segmented_volume.py Updates benchmark expectations and crosscheck assertions to use valvatne_blunt.
src/voids/io/porespy.py Adds Imperial-export geometry repair mode, legacy alias normalization, and additional geometry derivation/override logic during import.
src/voids/image/network_extraction.py Enables Imperial-export geometry repairs by default in the extraction workflow and threads seed/provenance through.
src/voids/geom/hydraulic.py Implements the complete Valvatne–Blunt single-phase closure (triangle/square/circle coefficients), adds throat-only and full-conduit variants, and expands geometry derivations (area/shape-factor inference).
src/voids/benchmarks/xlb.py Switches default benchmark options to valvatne_blunt.
src/voids/benchmarks/segmented_volume.py Switches default OpenPNM benchmark options/documentation to valvatne_blunt.
notebooks/14_mwe_shape_factor_conductance_comparison.py New notebook comparing generic Poiseuille vs shape-factor-aware conductance models on synthetic + extracted networks.
notebooks/13_mwe_synthetic_volume_xlb_benchmark.py Updates notebook options to valvatne_blunt.
notebooks/12_mwe_synthetic_volume_openpnm_benchmark.py Updates options to valvatne_blunt and adds report/asset export paths and saved figures/CSVs.
notebooks/09_mwe_image_based_vug_sensitivity_2d.py Updates options to valvatne_blunt.
notebooks/08_mwe_image_based_vug_shape_sensitivity.py Updates options and documentation text to valvatne_blunt.
notebooks/07_mwe_synthetic_vug_case.py Updates options to valvatne_blunt.
notebooks/06_mwe_real_porespy_extraction.py Updates options to valvatne_blunt.
notebooks/04_mwe_manufactured_porespy_extraction.py Updates options to valvatne_blunt.
mkdocs.yml Adds new verification pages for OpenPNM cross-check and external pnflow benchmark.
examples/data/external_pnflow_benchmark/README.md Adds documentation for the committed external reference dataset and its intent.
examples/data/external_pnflow_benchmark/manifest.csv Adds manifest describing committed external benchmark cases and file paths.
examples/data/external_pnflow_benchmark/phi041_b20/phi041_b20_upscaled.tsv Adds saved pnflow outputs for case phi041_b20.
examples/data/external_pnflow_benchmark/phi041_b20/phi041_b20_pnflow.prt Adds saved pnflow report for case phi041_b20.
examples/data/external_pnflow_benchmark/phi041_b20/phi041_b20_node2.dat Adds saved pnextract node data for case phi041_b20.
examples/data/external_pnflow_benchmark/phi041_b20/input_pnflow.dat Adds pnflow input deck for case phi041_b20.
examples/data/external_pnflow_benchmark/phi040_b18/phi040_b18_upscaled.tsv Adds saved pnflow outputs for case phi040_b18.
examples/data/external_pnflow_benchmark/phi040_b18/phi040_b18_pnflow.prt Adds saved pnflow report for case phi040_b18.
examples/data/external_pnflow_benchmark/phi040_b18/phi040_b18_node2.dat Adds saved pnextract node data for case phi040_b18.
examples/data/external_pnflow_benchmark/phi040_b18/input_pnflow.dat Adds pnflow input deck for case phi040_b18.
examples/data/external_pnflow_benchmark/phi038_b18/phi038_b18_upscaled.tsv Adds saved pnflow outputs for case phi038_b18.
examples/data/external_pnflow_benchmark/phi038_b18/phi038_b18_pnflow.prt Adds saved pnflow report for case phi038_b18.
examples/data/external_pnflow_benchmark/phi038_b18/phi038_b18_node2.dat Adds saved pnextract node data for case phi038_b18.
examples/data/external_pnflow_benchmark/phi038_b18/phi038_b18_node1.dat Adds saved pnextract node data for case phi038_b18.
examples/data/external_pnflow_benchmark/phi038_b18/input_pnflow.dat Adds pnflow input deck for case phi038_b18.
examples/data/external_pnflow_benchmark/phi035_b16/phi035_b16_upscaled.tsv Adds saved pnflow outputs for case phi035_b16.
examples/data/external_pnflow_benchmark/phi035_b16/phi035_b16_pnflow.prt Adds saved pnflow report for case phi035_b16.
examples/data/external_pnflow_benchmark/phi035_b16/phi035_b16_node2.dat Adds saved pnextract node data for case phi035_b16.
examples/data/external_pnflow_benchmark/phi035_b16/phi035_b16_node1.dat Adds saved pnextract node data for case phi035_b16.
examples/data/external_pnflow_benchmark/phi035_b16/input_pnflow.dat Adds pnflow input deck for case phi035_b16.
examples/data/external_pnflow_benchmark/phi032_b14/phi032_b14_upscaled.tsv Adds saved pnflow outputs for case phi032_b14.
examples/data/external_pnflow_benchmark/phi032_b14/phi032_b14_pnflow.prt Adds saved pnflow report for case phi032_b14.
examples/data/external_pnflow_benchmark/phi032_b14/phi032_b14_node2.dat Adds saved pnextract node data for case phi032_b14.
examples/data/external_pnflow_benchmark/phi032_b14/input_pnflow.dat Adds pnflow input deck for case phi032_b14.
examples/data/README.md Documents the new external pnflow benchmark dataset directory.
docs/verification/xlb.md Updates documentation to reference valvatne_blunt as the conductance model.
docs/verification/pnflow.md Adds a new narrative verification report for the external pnextract/pnflow benchmark.
docs/verification/openpnm.md Adds a new narrative verification report for the OpenPNM extracted-network cross-check.
docs/verification/index.md Expands verification index to include new reports and a comparison table.
docs/index.md Renames the top-level heading to “Overview”.
docs/examples.md Adds references to new verification reports and the external pnflow benchmark notebook/report.
docs/concepts.md Adds a section documenting hydraulic geometry fields and how the conductance models use them.
docs/background.md Adds substantial background documentation for equivalent-duct/shape-factor conductance and conduit decomposition, and updates assumptions accordingly.
docs/assets/verification/xlb_stokes_limit_representative.csv Updates stored representative benchmark results.
docs/assets/verification/xlb_stokes_15_case_results.csv Updates stored 15-case Stokes-limit results.
docs/assets/verification/xlb_15_case_results.csv Updates stored 15-case XLB results.
docs/assets/verification/pnflow_5_case_results.csv Adds stored 5-case external pnflow comparison results.
docs/assets/verification/openpnm_5_case_results.csv Adds stored 5-case OpenPNM cross-check results.
docs/assets/valvatne_equivalent_shape_factor.svg Adds an accessible SVG wrapper for the Valvatne equivalent-shape figure.
docs/assets/valvatne_conduit_series_model.svg Adds an accessible SVG schematic for the pore–throat–pore conduit decomposition.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@volpatto
Copy link
Copy Markdown
Collaborator Author

volpatto commented Mar 9, 2026

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 9, 2026

@volpatto I've opened a new pull request, #34, to work on those changes. Once the pull request is ready, I'll request review from you.

…py importer (#34)

* Initial plan

* Validate shape_factor and throat area before overriding area in porespy importer

Co-authored-by: volpatto <5941226+volpatto@users.noreply.github.com>

* Guard computed area against overflow; fix test throat_conns alignment; add coverage tests

Co-authored-by: volpatto <5941226+volpatto@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: volpatto <5941226+volpatto@users.noreply.github.com>
@volpatto volpatto enabled auto-merge (squash) March 9, 2026 02:47
@volpatto volpatto merged commit 5e875ab into main Mar 9, 2026
6 checks passed
@volpatto volpatto deleted the 32-implement-the-complete-single-phase-valvatne-blunt branch March 9, 2026 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement the complete single-phase Valvatne-Blunt

3 participants