Skip to content

Make surface tension compatible with the 5-eqn model and immersed boundaries #821

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

Merged
merged 3 commits into from
Apr 26, 2025

Conversation

wilfonba
Copy link
Contributor

@wilfonba wilfonba commented Apr 20, 2025

Description

This PR makes the resolved phase surface tension model compatible with the 5-equation model and immersed boundaries.

Type of change

  • New feature (non-breaking change which adds functionality)

Scope

  • This PR comprises a set of related changes with a common goal

How Has This Been Tested?

Recovering a circle on an immersed boundary:
https://github.com/user-attachments/assets/2b5d5618-10e6-4e89-83bd-f1ffe1fecf9c

Recovering a sphere in 3D:
https://github.com/user-attachments/assets/d23164c3-205b-4998-aca1-6b1f1195ce6d

Laplace pressure jump:
https://github.com/user-attachments/assets/d63d03cf-fffa-4c30-9e44-0343d67279a7

Checklist

  • I ran ./mfc.sh format before committing my code
  • New and existing tests pass locally with my changes, including with GPU capability enabled (both NVIDIA hardware with NVHPC compilers and AMD hardware with CRAY compilers) and disabled
  • This PR does not introduce any repeated code (it follows the DRY principle)
  • I cannot think of a way to condense this code and reduce any introduced additional line count

@wilfonba wilfonba requested a review from a team as a code owner April 20, 2025 16:40
Copy link

codecov bot commented Apr 20, 2025

Codecov Report

Attention: Patch coverage is 0% with 13 lines in your changes missing coverage. Please review.

Project coverage is 43.61%. Comparing base (068da2c) to head (9309268).
Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
src/simulation/m_ibm.fpp 0.00% 7 Missing and 1 partial ⚠️
src/simulation/m_riemann_solvers.fpp 0.00% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #821      +/-   ##
==========================================
- Coverage   43.63%   43.61%   -0.03%     
==========================================
  Files          66       66              
  Lines       19835    19846      +11     
  Branches     2433     2436       +3     
==========================================
  Hits         8655     8655              
- Misses       9688     9697       +9     
- Partials     1492     1494       +2     

☔ View full report in Codecov by Sentry.
📢 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.

@wilfonba wilfonba requested a review from sbryngelson as a code owner April 21, 2025 16:08
@@ -1212,7 +1212,7 @@ contains
chemxb = species_idx%beg
chemxe = species_idx%end

!$acc update device(momxb, momxe, advxb, advxe, contxb, contxe, bubxb, bubxe, intxb, intxe, sys_size, buff_size, E_idx, alf_idx, n_idx, adv_n, adap_dt, pi_fac, strxb, strxe, chemxb, chemxe)
!$acc update device(momxb, momxe, advxb, advxe, contxb, contxe, bubxb, bubxe, intxb, intxe, sys_size, buff_size, E_idx, alf_idx, n_idx, adv_n, adap_dt, pi_fac, strxb, strxe, chemxb, chemxe, c_idx)
Copy link
Member

Choose a reason for hiding this comment

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

can we just do eqn_idx%<whatever> where <whatever> -> {color,energy,alpha,...} please open a PR for it.

Copy link
Collaborator

@mohdsaid497566 mohdsaid497566 Jun 5, 2025

Choose a reason for hiding this comment

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

Just the variables at line 230?

eqn_idx%E_idx                                   !< Index of energy equation
eqn_idx%n_idx                                   !< Index of number density
eqn_idx%alf_idx                                 !< Index of void fraction
eqn_idx%gamma_idx                         !< Index of specific heat ratio func. eqn.
eqn_idx%pi_inf_idx                             !< Index of liquid stiffness func. eqn.
eqn_idx%b_size                                  !< Number of elements in the symmetric b tensor, plus one
eqn_idx%tensor_size                          !< Number of elements in the full tensor plus one
eqn_idx%c_idx                                    !< Index of color function
eqn_idx%damage_idx                         !< Index of damage state variable (D) for continuum 

Copy link
Member

Choose a reason for hiding this comment

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

i meant all of the equations @mohdsaid497566 . you will see there are many other _idx variables (i think?)

@@ -135,6 +135,7 @@ contains

real(wp) :: pres_IP, coeff
real(wp), dimension(3) :: vel_IP, vel_norm_IP
real(wp) :: c_IP
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't each IP be a derived type with components alpha_rho,alpha,pressure,vel,c,r,v,pb,mv,nmom,...?

Copy link
Collaborator

Choose a reason for hiding this comment

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

added "ip" where type(point_data) :: ip

type :: point_data
real(wp), dimension(:), allocatable :: alpha_rho  !< Partial densities
real(wp), dimension(:), allocatable :: alpha      !< Volume fractions
real(wp) :: pressure                              !< Pressure
real(wp), dimension(3) :: vel                     !< Velocity
real(wp) :: c                                     !< Color function (for surface tension)
real(wp), dimension(:), allocatable :: r          !< Bubble radii
real(wp), dimension(:), allocatable :: v          !< Bubble radial velocities
real(wp), dimension(:), allocatable :: pb         !< Bubble pressures
real(wp), dimension(:), allocatable :: mv         !< Mass of vapor
real(wp), dimension(:), allocatable :: nmom       !< Moments for QBMM
real(wp), dimension(:), allocatable :: presb      !< Node pressures for bubbles
real(wp), dimension(:), allocatable :: massv      !< Node masses for bubbles
end type point_data

Copy link
Member

Choose a reason for hiding this comment

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

nice, assuming it works of course

@@ -758,6 +774,8 @@ contains
pres_IP = 0._wp
vel_IP = 0._wp

if (surface_tension) c_IP = 0._wp
Copy link
Member

Choose a reason for hiding this comment

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

should c_IP be optional? if surface tension is optional, just like bubbles_euler

Copy link
Collaborator

Choose a reason for hiding this comment

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

good to have I guess even though it pertains to only surface tension. I added it to the ghost point variables for now.

@sbryngelson sbryngelson merged commit 16e51c9 into MFlowCode:master Apr 26, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants