@@ -234,7 +234,7 @@ contains
234234 end do
235235 close (94 )
236236 else
237- stop " if you include lagrange bubbles, you have to initialize them in input/lag_bubbles.dat"
237+ stop " Lagrange bubbles: you have to initialize them in input/lag_bubbles.dat"
238238 end if
239239 else
240240 if (proc_rank == 0 ) print * , ' Restarting lagrange bubbles at save_count: ' , save_count
@@ -315,6 +315,16 @@ contains
315315 cell = - buff_size
316316 call s_locate_cell(mtn_pos(bub_id, 1 :3 , 1 ), cell, mtn_s(bub_id, 1 :3 , 1 ))
317317
318+ ! Check if the bubble is located in the ghost cell of a symmetric boundary
319+ if (bc_x%beg == - 2 .and. cell(1 ) < 0 ) stop " Lagrange bubble is in the ghost cells of a symmetric boundary (bc_x%beg)."
320+ if (bc_x%end == - 2 .and. cell(1 ) > m) stop " Lagrange bubble is in the ghost cells of a symmetric boundary (bc_x%end)."
321+ if (bc_y%beg == - 2 .and. cell(2 ) < 0 ) stop " Lagrange bubble is in the ghost cells of a symmetric boundary (bc_y%beg)."
322+ if (bc_y%end == - 2 .and. cell(2 ) > n) stop " Lagrange bubble is in the ghost cells of a symmetric boundary (bc_y%end)."
323+ if (p > 0 ) then
324+ if (bc_z%beg == - 2 .and. cell(3 ) < 0 ) stop " Lagrange bubble is in the ghost cells of a symmetric boundary (bc_z%beg)."
325+ if (bc_z%end == - 2 .and. cell(3 ) > p) stop " Lagrange bubble is in the ghost cells of a symmetric boundary (bc_z%end)."
326+ end if
327+
318328 ! If particle is in the ghost cells, find the closest non- ghost cell
319329 cell(1 ) = min (max (cell(1 ), 0 ), m)
320330 cell(2 ) = min (max (cell(2 ), 0 ), n)
@@ -343,17 +353,15 @@ contains
343353 gas_mv(bub_id, 1 ) = pv* volparticle* (1._wp / (R_v* Tw))* (massflag) ! vapermass
344354 gas_mg(bub_id) = (gas_p(bub_id, 1 ) - pv* (massflag))* volparticle* (1._wp / (R_n* Tw)) ! gasmass
345355 if (gas_mg(bub_id) <= 0._wp ) then
346- stop ' the initial mass of gas inside the bubble is negative. Check your initial conditions'
356+ stop ' The initial mass of gas inside the bubble is negative. Check your initial conditions'
347357 end if
348358 totalmass = gas_mg(bub_id) + gas_mv(bub_id, 1 ) ! totalmass
349359
350360 ! Bubble natural frequency
351361 concvap = gas_mv(bub_id, 1 )/ (gas_mv(bub_id, 1 ) + gas_mg(bub_id))
352362 omegaN = (3._wp * (gas_p(bub_id, 1 ) - pv* (massflag)) + 4._wp * (1._wp / Web)/ bub_R0(bub_id))/ rhol
353363 if (pv* (massflag) > gas_p(bub_id, 1 )) then
354- print * , ' Not allowed: bubble initially located in a region with pressure below the vapor pressure'
355- print * , ' location:' , mtn_pos(bub_id, 1 :3 , 1 )
356- stop
364+ stop " Lagrange bubble initially located in a region with pressure below the vapor pressure."
357365 end if
358366 omegaN = sqrt (omegaN/ bub_R0(bub_id)** 2._wp )
359367
@@ -794,7 +802,7 @@ contains
794802 real (wp) :: charvol, charpres, charvol2, charpres2
795803 integer , dimension (3 ) :: cellaux
796804 integer :: i, j, k
797- integer :: mapCells_pinf, smearGrid, smearGridz
805+ integer :: smearGrid, smearGridz
798806 logical :: celloutside
799807
800808 scoord = mtn_s(bub_id, 1 :3 , 2 )
@@ -882,15 +890,8 @@ contains
882890 else if (lag_params%cluster_type >= 2 ) then
883891 ! Bubble dynamic closure from Maeda and Colonius (2018 )
884892
885- ! Range of cells included in Omega
886- if (lag_params%smooth_type == 1 ) then
887- mapCells_pinf = mapCells
888- else
889- stop " lag_params%cluster_type: 2 requires lag_params%smooth_type: 1."
890- end if
891-
892893 ! Include the cell that contains the bubble (mapCells+1 + mapCells)
893- smearGrid = mapCells_pinf - (- mapCells_pinf ) + 1
894+ smearGrid = mapCells - (- mapCells ) + 1
894895 smearGridz = smearGrid
895896 if (p == 0 ) smearGridz = 1
896897
@@ -964,9 +965,6 @@ contains
964965 f_pinfl = charpres2/ charvol2
965966 vol = charvol
966967 dc = (3._wp * abs (vol)/ (4._wp * pi))** (1._wp / 3._wp )
967- else
968-
969- stop " Check cluterflag. Exiting."
970968
971969 end if
972970
@@ -1015,7 +1013,6 @@ contains
10151013 mtn_vel(k, 1 :3 , 1 ) = mtn_vel(k, 1 :3 , 1 ) + dt* mtn_dveldt(k, 1 :3 , 1 )
10161014 gas_p(k, 1 ) = gas_p(k, 1 ) + dt* gas_dpdt(k, 1 )
10171015 gas_mv(k, 1 ) = gas_mv(k, 1 ) + dt* gas_dmvdt(k, 1 )
1018- if (intfc_rad(k, 1 ) <= 0._wp ) stop " Negative bubble radius encountered, please reduce dt"
10191016 end do
10201017
10211018 call s_transfer_data_to_tmp()
@@ -1038,7 +1035,6 @@ contains
10381035 mtn_vel(k, 1 :3 , 2 ) = mtn_vel(k, 1 :3 , 1 ) + dt* mtn_dveldt(k, 1 :3 , 1 )
10391036 gas_p(k, 2 ) = gas_p(k, 1 ) + dt* gas_dpdt(k, 1 )
10401037 gas_mv(k, 2 ) = gas_mv(k, 1 ) + dt* gas_dmvdt(k, 1 )
1041- if (intfc_rad(k, 2 ) <= 0._wp ) stop " Negative bubble radius encountered, please reduce dt"
10421038 end do
10431039
10441040 elseif (stage == 2 ) then
@@ -1051,7 +1047,6 @@ contains
10511047 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
10521048 gas_p(k, 1 ) = gas_p(k, 1 ) + dt* (gas_dpdt(k, 1 ) + gas_dpdt(k, 2 ))/ 2._wp
10531049 gas_mv(k, 1 ) = gas_mv(k, 1 ) + dt* (gas_dmvdt(k, 1 ) + gas_dmvdt(k, 2 ))/ 2._wp
1054- if (intfc_rad(k, 1 ) <= 0._wp ) stop " Negative bubble radius encountered, please reduce dt"
10551050 end do
10561051
10571052 call s_transfer_data_to_tmp()
@@ -1076,7 +1071,6 @@ contains
10761071 mtn_vel(k, 1 :3 , 2 ) = mtn_vel(k, 1 :3 , 1 ) + dt* mtn_dveldt(k, 1 :3 , 1 )
10771072 gas_p(k, 2 ) = gas_p(k, 1 ) + dt* gas_dpdt(k, 1 )
10781073 gas_mv(k, 2 ) = gas_mv(k, 1 ) + dt* gas_dmvdt(k, 1 )
1079- if (intfc_rad(k, 2 ) <= 0._wp ) stop " Negative bubble radius encountered, please reduce dt"
10801074 end do
10811075
10821076 elseif (stage == 2 ) then
@@ -1089,7 +1083,6 @@ contains
10891083 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
10901084 gas_p(k, 2 ) = gas_p(k, 1 ) + dt* (gas_dpdt(k, 1 ) + gas_dpdt(k, 2 ))/ 4._wp
10911085 gas_mv(k, 2 ) = gas_mv(k, 1 ) + dt* (gas_dmvdt(k, 1 ) + gas_dmvdt(k, 2 ))/ 4._wp
1092- if (intfc_rad(k, 2 ) <= 0._wp ) stop " Negative bubble radius encountered, please reduce dt"
10931086 end do
10941087 elseif (stage == 3 ) then
10951088 !$acc parallel loop gang vector default(present) private(k)
@@ -1101,7 +1094,6 @@ contains
11011094 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 ))
11021095 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 ))
11031096 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 ))
1104- if (intfc_rad(k, 1 ) <= 0._wp ) stop " Negative bubble radius encountered, please reduce dt"
11051097 end do
11061098
11071099 call s_transfer_data_to_tmp()
0 commit comments