Skip to content

Fix #797 #813

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

Draft
wants to merge 24 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 3 additions & 18 deletions src/simulation/m_bubbles_EL.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
end do
close (94)
else
stop "if you include lagrange bubbles, you have to initialize them in input/lag_bubbles.dat"
stop "Lagrange bubbles: you have to initialize them in input/lag_bubbles.dat"

Check warning on line 254 in src/simulation/m_bubbles_EL.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_bubbles_EL.fpp#L254

Added line #L254 was not covered by tests
end if
else
if (proc_rank == 0) print *, 'Restarting lagrange bubbles at save_count: ', save_count
Expand Down Expand Up @@ -366,17 +366,15 @@
gas_mv(bub_id, 1) = pv*volparticle*(1._wp/(R_v*Tw))*(massflag) ! vapermass
gas_mg(bub_id) = (gas_p(bub_id, 1) - pv*(massflag))*volparticle*(1._wp/(R_n*Tw)) ! gasmass
if (gas_mg(bub_id) <= 0._wp) then
stop 'the initial mass of gas inside the bubble is negative. Check your initial conditions'
stop "The initial mass of gas inside the bubble is negative. Check your initial conditions."

Check warning on line 369 in src/simulation/m_bubbles_EL.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_bubbles_EL.fpp#L369

Added line #L369 was not covered by tests
end if
totalmass = gas_mg(bub_id) + gas_mv(bub_id, 1) ! totalmass

! Bubble natural frequency
concvap = gas_mv(bub_id, 1)/(gas_mv(bub_id, 1) + gas_mg(bub_id))
omegaN = (3._wp*(gas_p(bub_id, 1) - pv*(massflag)) + 4._wp*(1._wp/Web)/bub_R0(bub_id))/rhol
if (pv*(massflag) > gas_p(bub_id, 1)) then
print *, 'Not allowed: bubble initially located in a region with pressure below the vapor pressure'
print *, 'location:', mtn_pos(bub_id, 1:3, 1)
stop
stop "Lagrange bubble initially located in a region with pressure below the vapor pressure."

Check warning on line 377 in src/simulation/m_bubbles_EL.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_bubbles_EL.fpp#L377

Added line #L377 was not covered by tests
end if
omegaN = sqrt(omegaN/bub_R0(bub_id)**2._wp)

Expand Down Expand Up @@ -904,12 +902,8 @@

else if (lag_params%cluster_type >= 2) then
! Bubble dynamic closure from Maeda and Colonius (2018)

! Range of cells included in Omega
if (lag_params%smooth_type == 1) then
mapCells_pinf = mapCells
else
stop "lag_params%cluster_type: 2 requires lag_params%smooth_type: 1."
end if

! Include the cell that contains the bubble (mapCells+1+mapCells)
Expand Down Expand Up @@ -987,9 +981,6 @@
f_pinfl = charpres2/charvol2
vol = charvol
dc = (3._wp*abs(vol)/(4._wp*pi))**(1._wp/3._wp)
else

stop "Check cluterflag. Exiting."

end if

Expand Down Expand Up @@ -1038,7 +1029,6 @@
mtn_vel(k, 1:3, 1) = mtn_vel(k, 1:3, 1) + dt*mtn_dveldt(k, 1:3, 1)
gas_p(k, 1) = gas_p(k, 1) + dt*gas_dpdt(k, 1)
gas_mv(k, 1) = gas_mv(k, 1) + dt*gas_dmvdt(k, 1)
if (intfc_rad(k, 1) <= 0._wp) stop "Negative bubble radius encountered, please reduce dt"
end do

call s_transfer_data_to_tmp()
Expand All @@ -1061,7 +1051,6 @@
mtn_vel(k, 1:3, 2) = mtn_vel(k, 1:3, 1) + dt*mtn_dveldt(k, 1:3, 1)
gas_p(k, 2) = gas_p(k, 1) + dt*gas_dpdt(k, 1)
gas_mv(k, 2) = gas_mv(k, 1) + dt*gas_dmvdt(k, 1)
if (intfc_rad(k, 2) <= 0._wp) stop "Negative bubble radius encountered, please reduce dt"
end do

elseif (stage == 2) then
Expand All @@ -1074,7 +1063,6 @@
mtn_vel(k, 1:3, 1) = mtn_vel(k, 1:3, 1) + dt*(mtn_dveldt(k, 1:3, 1) + mtn_dveldt(k, 1:3, 2))/2._wp
gas_p(k, 1) = gas_p(k, 1) + dt*(gas_dpdt(k, 1) + gas_dpdt(k, 2))/2._wp
gas_mv(k, 1) = gas_mv(k, 1) + dt*(gas_dmvdt(k, 1) + gas_dmvdt(k, 2))/2._wp
if (intfc_rad(k, 1) <= 0._wp) stop "Negative bubble radius encountered, please reduce dt"
end do

call s_transfer_data_to_tmp()
Expand All @@ -1099,7 +1087,6 @@
mtn_vel(k, 1:3, 2) = mtn_vel(k, 1:3, 1) + dt*mtn_dveldt(k, 1:3, 1)
gas_p(k, 2) = gas_p(k, 1) + dt*gas_dpdt(k, 1)
gas_mv(k, 2) = gas_mv(k, 1) + dt*gas_dmvdt(k, 1)
if (intfc_rad(k, 2) <= 0._wp) stop "Negative bubble radius encountered, please reduce dt"
end do

elseif (stage == 2) then
Expand All @@ -1112,7 +1099,6 @@
mtn_vel(k, 1:3, 2) = mtn_vel(k, 1:3, 1) + dt*(mtn_dveldt(k, 1:3, 1) + mtn_dveldt(k, 1:3, 2))/4._wp
gas_p(k, 2) = gas_p(k, 1) + dt*(gas_dpdt(k, 1) + gas_dpdt(k, 2))/4._wp
gas_mv(k, 2) = gas_mv(k, 1) + dt*(gas_dmvdt(k, 1) + gas_dmvdt(k, 2))/4._wp
if (intfc_rad(k, 2) <= 0._wp) stop "Negative bubble radius encountered, please reduce dt"
end do
elseif (stage == 3) then
!$acc parallel loop gang vector default(present) private(k)
Expand All @@ -1124,7 +1110,6 @@
mtn_vel(k, 1:3, 1) = mtn_vel(k, 1:3, 1) + (2._wp/3._wp)*dt*(mtn_dveldt(k, 1:3, 1)/4._wp + mtn_dveldt(k, 1:3, 2)/4._wp + mtn_dveldt(k, 1:3, 3))
gas_p(k, 1) = gas_p(k, 1) + (2._wp/3._wp)*dt*(gas_dpdt(k, 1)/4._wp + gas_dpdt(k, 2)/4._wp + gas_dpdt(k, 3))
gas_mv(k, 1) = gas_mv(k, 1) + (2._wp/3._wp)*dt*(gas_dmvdt(k, 1)/4._wp + gas_dmvdt(k, 2)/4._wp + gas_dmvdt(k, 3))
if (intfc_rad(k, 1) <= 0._wp) stop "Negative bubble radius encountered, please reduce dt"
end do

call s_transfer_data_to_tmp()
Expand Down
12 changes: 0 additions & 12 deletions src/simulation/m_bubbles_EL_kernels.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,31 +319,23 @@ contains
if (bc_x%beg == -2 .and. (cell(1) <= mapCells - 1)) then
if (cell(1) >= 0) then
cellaux(1) = abs(cellaux(1)) - 1
else
stop "Lagrangian bubbles must not be located in the ghost cells of a symmetric boundary (bc_x%beg)."
end if
end if
if (bc_x%end == -2 .and. (cell(1) >= m + 1 - mapCells)) then
if (cell(1) <= m) then
cellaux(1) = cellaux(1) - (2*(cellaux(1) - m) - 1)
else
stop "Lagrangian bubbles must not be located in the ghost cells of a symmetric boundary (bc_x%end)."
end if
end if

!y-dir
if (bc_y%beg == -2 .and. (cell(2) <= mapCells - 1)) then
if (cell(2) >= 0) then
cellaux(2) = abs(cellaux(2)) - 1
else
stop "Lagrangian bubbles must not be located in the ghost cells of a symmetric boundary (bc_y%beg)."
end if
end if
if (bc_y%end == -2 .and. (cell(2) >= n + 1 - mapCells)) then
if (cell(2) <= n) then
cellaux(2) = cellaux(2) - (2*(cellaux(2) - n) - 1)
else
stop "Lagrangian bubbles must not be located in the ghost cells of a symmetric boundary (bc_y%end)."
end if
end if

Expand All @@ -352,15 +344,11 @@ contains
if (bc_z%beg == -2 .and. (cell(3) <= mapCells - 1)) then
if (cell(3) >= 0) then
cellaux(3) = abs(cellaux(3)) - 1
else
stop "Lagrangian bubbles must not be located in the ghost cells of a symmetric boundary (bc_z%beg)."
end if
end if
if (bc_z%end == -2 .and. (cell(3) >= p + 1 - mapCells)) then
if (cell(3) <= p) then
cellaux(3) = cellaux(3) - (2*(cellaux(3) - p) - 1)
else
stop "Lagrangian bubbles must not be located in the ghost cells of a symmetric boundary (bc_z%end)."
end if
end if
end if
Expand Down
Loading