Skip to content

Implement Darcy Physics - #620

Merged
mmegally merged 37 commits into
SimVascular:mainfrom
mmegally:darcy-solver
Sep 17, 2026
Merged

mmegally merged 37 commits into
SimVascular:mainfrom
mmegally:darcy-solver

Conversation

@mmegally

@mmegally mmegally commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Current situation

See issue #616 on introducing darcy physics.

Release Notes

Code of Conduct & Contributing Guidelines

@ktbolt

ktbolt commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

@mmegally You've changed 47 files for this PR. It would be helpful to describe at a high level in #616 the implementation, how this is used (XML) and any related issues for data files, linear solver, etc.

@zasexton

Copy link
Copy Markdown
Collaborator

@ktbolt i think the majority of these file changes have to do with adding any new physics into the current procedural framework. Unfortunate but expected at this point in my opinion. @mmegally I'll do my review in a few hours when I have some time. From my first glance id say that you should remove the sbatch slurm scripts from the commits. These shouldn't be in the testing infrastructure. I'll give a more formal review in a bit though

@mmegally

Copy link
Copy Markdown
Contributor Author

@ktbolt I went ahead and added a new comment to issue #616 with some details on the file change split, implementation, and XML usage. Let me know if there is anything else I can clarify. To reiterate my comment from there, 31/47 of the file changes are related to the test cases. I will also go ahead and remove the SLURMs from the test folder as zack mentioned right now

@ktbolt

ktbolt commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

@mmegally Got it, thanks for adding the Issue comments !

@ktbolt

ktbolt commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

@mmegally The darcy_convergence tests are not part of the CI tests so shouldn't they be stored somewhere else ?

Also rename the svFSI.xml files to solver.xml.

@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 51.48515% with 245 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.08%. Comparing base (8c2975f) to head (ae99df4).

Files with missing lines Patch % Lines
Code/Source/solver/darcy.cpp 0.00% 142 Missing ⚠️
Code/Source/solver/post.cpp 37.73% 33 Missing ⚠️
Code/Source/solver/set_equation_props.h 85.34% 17 Missing ⚠️
Code/Source/solver/read_files.cpp 67.74% 10 Missing ⚠️
Code/Source/solver/stokes.cpp 41.66% 7 Missing ⚠️
Code/Source/solver/eq_assem.cpp 0.00% 5 Missing ⚠️
Code/Source/solver/l_elas.cpp 54.54% 5 Missing ⚠️
Code/Source/solver/shells.cpp 66.66% 5 Missing ⚠️
Code/Source/solver/ustruct.cpp 54.54% 5 Missing ⚠️
Code/Source/solver/heats.cpp 50.00% 3 Missing ⚠️
... and 6 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #620      +/-   ##
==========================================
- Coverage   73.45%   73.08%   -0.37%     
==========================================
  Files         267      268       +1     
  Lines       40041    40270     +229     
  Branches     6706     6738      +32     
==========================================
+ Hits        29413    29433      +20     
- Misses      10385    10594     +209     
  Partials      243      243              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zasexton zasexton left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested changes for Darcy equation initialization and fiber-flux reconstruction.

Comment thread Code/Source/solver/consts.h
Comment thread Code/Source/solver/post.cpp Outdated
Comment thread Code/Source/solver/darcy.cpp Outdated
Comment thread Code/Source/solver/set_equation_props.h Outdated
Comment thread Code/Source/solver/set_equation_props.h Outdated
@mmegally
mmegally requested a review from zasexton August 27, 2026 22:26

@michelebucelli michelebucelli left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you @mmegally! I left a few comments.

Comment thread Code/Source/solver/CMakeLists.txt Outdated
Comment thread Code/Source/solver/consts.h Outdated
Comment thread Code/Source/solver/consts.h Outdated
Comment thread Code/Source/solver/consts.h
Comment thread Code/Source/solver/consts.h Outdated
Comment thread Code/Source/solver/darcy.cpp Outdated
Comment thread Code/Source/solver/darcy.cpp Outdated
Comment thread Code/Source/solver/darcy.cpp Outdated
Comment thread Code/Source/solver/darcy.cpp Outdated
Comment thread Code/Source/solver/darcy.cpp
@zasexton

zasexton commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

About to push some commits to this fork then we can elevate this draft to a full PR. in the meantime @mmegally can you resolve the active comments that you have addressed along with their appropriate commit tags? you've been doing a great job at fixing up the code so far :)

Comment thread Code/Source/solver/initialize.cpp

@zasexton zasexton left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In my opinion we only piece requiring a bit more review is the zero initialization for the 2D cases to make sure that we are not getting heap error allocations and out-of-bounds. I'll fork this branch and double-check now to make any appropriate changes, if necessary.

@zasexton
zasexton self-requested a review September 10, 2026 18:30

@michelebucelli michelebucelli left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks! I did a second pass, I only have a few minor suggestions left.

Comment thread Code/Source/solver/darcy.cpp Outdated
Comment thread Code/Source/solver/darcy.cpp Outdated
Comment thread Code/Source/solver/darcy.h
Comment thread Code/Source/solver/darcy.cpp Outdated
Comment thread Code/Source/solver/Parameters.cpp Outdated
Comment thread Code/Source/solver/post.cpp Outdated
Comment thread Code/Source/solver/post.cpp Outdated

@zasexton zasexton left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We are getting very close to closing this PR I believe. I'll make one more fork to address a comment I made about the post.cpp file for higher-order elements. Ultimately I don't think this is a show-stopper for the regular use case of this physics but we should guarantee that it produces expected values if higher-order meshes are ever used with the darcy physics.

Fix higher-order Darcy flux recovery

@zasexton zasexton left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I believe this PR is in a good position to merge

@michelebucelli michelebucelli left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for addressing my previous comments! Just a few very minor leftovers, but otherwise approved.

Comment thread Code/Source/solver/darcy.cpp
Comment thread Code/Source/solver/darcy.cpp Outdated
@zasexton

Copy link
Copy Markdown
Collaborator

Great! Thanks @michelebucelli for the review. @mmegally after making a few minor edits to address the lingering comments I think you should feel free to merge this code :)

@mmegally
mmegally merged commit c3f0bb8 into SimVascular:main Sep 17, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add implementation for darcy flow problem Tissue perfusion model

4 participants