-
Notifications
You must be signed in to change notification settings - Fork 106
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,6 +135,7 @@ | |
|
||
real(wp) :: pres_IP, coeff | ||
real(wp), dimension(3) :: vel_IP, vel_norm_IP | ||
real(wp) :: c_IP | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldn't each There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added "ip" where
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice, assuming it works of course |
||
real(wp), dimension(num_fluids) :: alpha_rho_IP, alpha_IP | ||
real(wp), dimension(nb) :: r_IP, v_IP, pb_IP, mv_IP | ||
real(wp), dimension(nb*nmom) :: nmom_IP | ||
|
@@ -170,19 +171,19 @@ | |
!Interpolate primitive variables at image point associated w/ GP | ||
if (bubbles_euler .and. .not. qbmm) then | ||
call s_interpolate_image_point(q_prim_vf, gp, & | ||
alpha_rho_IP, alpha_IP, pres_IP, vel_IP, & | ||
alpha_rho_IP, alpha_IP, pres_IP, vel_IP, c_IP, & | ||
r_IP, v_IP, pb_IP, mv_IP) | ||
else if (qbmm .and. polytropic) then | ||
call s_interpolate_image_point(q_prim_vf, gp, & | ||
alpha_rho_IP, alpha_IP, pres_IP, vel_IP, & | ||
alpha_rho_IP, alpha_IP, pres_IP, vel_IP, c_IP, & | ||
r_IP, v_IP, pb_IP, mv_IP, nmom_IP) | ||
else if (qbmm .and. .not. polytropic) then | ||
call s_interpolate_image_point(q_prim_vf, gp, & | ||
alpha_rho_IP, alpha_IP, pres_IP, vel_IP, & | ||
alpha_rho_IP, alpha_IP, pres_IP, vel_IP, c_IP, & | ||
r_IP, v_IP, pb_IP, mv_IP, nmom_IP, pb, mv, presb_IP, massv_IP) | ||
else | ||
call s_interpolate_image_point(q_prim_vf, gp, & | ||
alpha_rho_IP, alpha_IP, pres_IP, vel_IP) | ||
alpha_rho_IP, alpha_IP, pres_IP, vel_IP, c_IP) | ||
end if | ||
|
||
dyn_pres = 0._wp | ||
|
@@ -194,6 +195,10 @@ | |
q_prim_vf(advxb + q - 1)%sf(j, k, l) = alpha_IP(q) | ||
end do | ||
|
||
if (surface_tension) then | ||
q_prim_vf(c_idx)%sf(j, k, l) = c_IP | ||
end if | ||
|
||
if (model_eqns /= 4) then | ||
! If in simulation, use acc mixture subroutines | ||
if (elasticity) then | ||
|
@@ -234,6 +239,11 @@ | |
q_cons_vf(advxb + q - 1)%sf(j, k, l) = alpha_IP(q) | ||
end do | ||
|
||
! Set color function | ||
if (surface_tension) then | ||
q_cons_vf(c_idx)%sf(j, k, l) = c_IP | ||
end if | ||
|
||
! Set Energy | ||
if (bubbles_euler) then | ||
q_cons_vf(E_idx)%sf(j, k, l) = (1 - alpha_IP(1))*(gamma*pres_IP + pi_inf + dyn_pres) | ||
|
@@ -309,6 +319,10 @@ | |
q_prim_vf(advxb + q - 1)%sf(j, k, l) = alpha_IP(q) | ||
end do | ||
|
||
if (surface_tension) then | ||
q_prim_vf(c_idx)%sf(j, k, l) = c_IP | ||
end if | ||
|
||
call s_convert_species_to_mixture_variables_acc(rho, gamma, pi_inf, qv_K, alpha_IP, & | ||
alpha_rho_IP, Re_K, j, k, l) | ||
|
||
|
@@ -725,16 +739,18 @@ | |
|
||
!> Function that uses the interpolation coefficients and the current state | ||
!! at the cell centers in order to estimate the state at the image point | ||
subroutine s_interpolate_image_point(q_prim_vf, gp, alpha_rho_IP, alpha_IP, pres_IP, vel_IP, r_IP, v_IP, pb_IP, mv_IP, nmom_IP, pb, mv, presb_IP, massv_IP) | ||
subroutine s_interpolate_image_point(q_prim_vf, gp, alpha_rho_IP, alpha_IP, pres_IP, vel_IP, c_IP, r_IP, v_IP, pb_IP, mv_IP, nmom_IP, pb, mv, presb_IP, massv_IP) | ||
!$acc routine seq | ||
type(scalar_field), & | ||
dimension(sys_size), & | ||
intent(IN) :: q_prim_vf !< Primitive Variables | ||
|
||
real(wp), optional, dimension(idwbuff(1)%beg:, idwbuff(2)%beg:, idwbuff(3)%beg:, 1:, 1:), intent(INOUT) :: pb, mv | ||
|
||
type(ghost_point), intent(IN) :: gp | ||
real(wp), intent(INOUT) :: pres_IP | ||
real(wp), dimension(3), intent(INOUT) :: vel_IP | ||
real(wp), intent(INOUT) :: c_IP | ||
real(wp), dimension(num_fluids), intent(INOUT) :: alpha_IP, alpha_rho_IP | ||
real(wp), optional, dimension(:), intent(INOUT) :: r_IP, v_IP, pb_IP, mv_IP | ||
real(wp), optional, dimension(:), intent(INOUT) :: nmom_IP | ||
|
@@ -758,6 +774,8 @@ | |
pres_IP = 0._wp | ||
vel_IP = 0._wp | ||
|
||
if (surface_tension) c_IP = 0._wp | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
||
if (bubbles_euler) then | ||
r_IP = 0._wp | ||
v_IP = 0._wp | ||
|
@@ -801,6 +819,10 @@ | |
q_prim_vf(advxb + l - 1)%sf(i, j, k) | ||
end do | ||
|
||
if (surface_tension) then | ||
c_IP = c_IP + coeff*q_prim_vf(c_idx)%sf(i, j, k) | ||
end if | ||
|
||
if (bubbles_euler .and. .not. qbmm) then | ||
!$acc loop seq | ||
do l = 1, nb | ||
|
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.
can we just do
eqn_idx%<whatever>
where<whatever> -> {color,energy,alpha,...}
please open a PR for it.Uh oh!
There was an error while loading. Please reload this page.
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.
Just the variables at line 230?
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.
i meant all of the equations @mohdsaid497566 . you will see there are many other _idx variables (i think?)