-
Notifications
You must be signed in to change notification settings - Fork 119
Add rotating mibms #1014
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add rotating mibms #1014
Conversation
…ifying rotated markers and velocity calculations
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
High-level Suggestion
The logic for updating Immersed Boundary (IB) motion is duplicated across several time-stepping subroutines in m_time_steppers.fpp
. This should be refactored into a single, parameterized subroutine to improve code maintainability. [High-level, importance: 7]
Solution Walkthrough:
Before:
subroutine s_tvd_rk2(...)
...
! Step 1
if (moving_immersed_boundary_flag) then
do i = 1, num_ibs
if (patch_ib(i)%moving_ibm == 1) then
! ... save state and perform Euler step ...
end if
end do
call s_update_mib(...)
end if
...
! Step 2
if (moving_immersed_boundary_flag) then
do i = 1, num_ibs
if (patch_ib(i)%moving_ibm == 1) then
! ... perform RK2 update step ...
end if
end do
call s_update_mib(...)
end if
end subroutine
After:
subroutine s_update_ib_position(rk_stage, rk_order)
! Logic to update IB position based on RK stage and order
if (moving_immersed_boundary_flag) then
do i = 1, num_ibs
if (patch_ib(i)%moving_ibm == 1) then
! ... unified update logic using rk_stage/order ...
end if
end do
call s_update_mib(...)
end if
end subroutine
subroutine s_tvd_rk2(...)
...
call s_update_ib_position(rk_stage=1, rk_order=2)
...
call s_update_ib_position(rk_stage=2, rk_order=2)
end subroutine
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1014 +/- ##
==========================================
+ Coverage 41.82% 42.11% +0.28%
==========================================
Files 70 70
Lines 19921 19936 +15
Branches 2490 2485 -5
==========================================
+ Hits 8332 8396 +64
+ Misses 10043 9996 -47
+ Partials 1546 1544 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
It should be noted that even if this passes the final test (which I think it will), it is not ready to be merged. I realized that there are two changes for the actual MIBM code corrections that must be implemented which won't affect current test suite. I will make another comment when this is ready to merge. |
… shift and rotate the grid cell into their local frame and then compute validity from the local frame. This is true for all IB patches except for circles and spheres, as rotational symetry solves the problem for me in those cases.
…ment has been left.
… with multiple MPI ranks
I checked twice, and the this most-recent commit does build on frontier for CPU when I sign into a login node and run it manually. The failure message is rather non-descript. Does anyone have thoughtss on why the CPU build would suddenly fail like this? |
…to add-rotating-mibms
CPU frontier test suite timed out after 23 hours without printing logs. Not really sure what to make of that one. I will try to run something locally tomorrow if I can get an allocation. I wasn't able to get an interactive session on frontier all day today. |
That just means it wasn't able to get a node to run the tests. I restarted it. |
We can have 2D and 3D IBMs, so I suppose we need test cases for both? We also need examples for moving IBMs in 2D and 3D, also an update to the readme. |
I was planning on adding that (examples and documentation) with a follow up
PR getting 2D and 3D cases from literature. Would you prefer that I do that
into this PR?
…On Wed, Oct 15, 2025, 3:24 PM Spencer Bryngelson ***@***.***> wrote:
*sbryngelson* left a comment (MFlowCode/MFC#1014)
<#1014 (comment)>
We can have 2D and 3D IBMs, so I suppose we need test cases for both?
We also need examples for moving IBMs in 2D and 3D, also an update to the
readme.
—
Reply to this email directly, view it on GitHub
<#1014 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/BMWYI3XSNSTCJ3IU2FFRMP33X2NQLAVCNFSM6AAAAACIRBVD4GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTIMBXHE2DKNRTG4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
A simple example in this PR is needed (and tests). You can modify the example to be 'better' later if you want, or just add another example. I just don't want dangling features. |
That sounds fair enough. I have a couple that I have been playing with anyways. I can add a couple. |
User description
Description
This PR improves on the previous MIBM PR in that it adds higher-order time stepping of the IB centroids/angles (supporting RK1-3, as opposed to only RK1) and it adds rotation of IBs.
Type of change
Please delete options that are not relevant.
Scope
If you cannot check the above box, please split your PR into multiple PRs that each have a common goal.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Provide instructions so we can reproduce.
Please also list any relevant details for your test configuration
Test Configuration:
Checklist
docs/
)examples/
that demonstrate my new feature performing as expected.They run to completion and demonstrate "interesting physics"
./mfc.sh format
before committing my codeIf your code changes any code source files (anything in
src/simulation
)To make sure the code is performing as expected on GPU devices, I have:
nvtx
ranges so that they can be identified in profiles./mfc.sh run XXXX --gpu -t simulation --nsys
, and have attached the output file (.nsys-rep
) and plain text results to this PR./mfc.sh run XXXX --gpu -t simulation --rsys --hip-trace
, and have attached the output file and plain text results to this PR.PR Type
Enhancement
Description
Add rotation support for immersed boundaries (IBs)
Implement higher-order time stepping (RK1-3) for IB motion
Add angular velocity and rotation matrix calculations
Update ghost point velocity calculations with rotational effects
Diagram Walkthrough
File Walkthrough
6 files
Add rotation and time stepping fields
Add rotation matrix calculation and coordinate transformation
Initialize rotation matrices and angular velocity
Add rotation matrix initialization call
Update ghost point velocity with rotation
Implement RK1-3 time stepping for IB motion
2 files
Remove redundant MIB update call
Add debug print for IB parameters
1 files
Add angular velocity parameters to case dictionaries