Skip to content

Commit 60375fb

Browse files
committed
bug fixes for run_time.inf
1 parent 49c194f commit 60375fb

File tree

5 files changed

+72
-33
lines changed

5 files changed

+72
-33
lines changed

src/common/m_mpi_common.fpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,8 @@ contains
453453
end if
454454
455455
if (surface_tension) then
456-
call MPI_REDUCE(Rc_min_loc, Rc_min_glb, 1, &
457-
mpi_p, MPI_MIN, 0, &
456+
call MPI_REDUCE(ccfl_max_loc, ccfl_max_glb, 1, &
457+
mpi_p, MPI_MAX, 0, &
458458
MPI_COMM_WORLD, ierr)
459459
end if
460460

src/pre_process/include/3dHardcodedIC.fpp

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,28 @@
4646
end if
4747
end if
4848

49+
if (patch_icpp(patch_id)%hcid == 304) then
50+
allocate(ih(0:n_glb, 0:0))
51+
if (interface_file == '.') then
52+
call s_mpi_abort("Error: interface_file must be specified for hcid=304")
53+
else
54+
inquire (file=trim(interface_file), exist=file_exist)
55+
if (file_exist) then
56+
open(unit=10, file=trim(interface_file), status="old", action="read")
57+
do i = 0, n_glb
58+
read(10, '(A)') line ! Read a full line as a string
59+
value = trim(line)
60+
read(value, *) ih(i, 0) ! Convert string to numeric value
61+
if (.not. f_is_default(normMag)) ih(i, 0) = ih(i, 0) * normMag
62+
if (.not. f_is_default(normFac)) ih(i, 0) = ih(i, 0) + normFac
63+
end do
64+
close(10)
65+
else
66+
call s_mpi_abort("Error: interface_file specified for hcid=304 does not exist")
67+
end if
68+
end if
69+
end if
70+
4971
eps = 1e-9_wp
5072

5173
#:enddef
@@ -125,10 +147,27 @@
125147

126148
q_prim_vf(E_idx)%sf(i, j, k) = p_th*f_cut_on(r - r_th, eps_smooth)*f_cut_on(x_cc(i), eps_smooth) + p_am
127149

128-
case (303) ! 3D Interface from file
150+
case (303) ! 3D Interface from file cartesian
151+
152+
alph = 0.5_wp * (1 + (1._wp - 2._wp * eps) * &
153+
tanh((ih(start_idx(1) + i,start_idx(3) + k) - y_cc(j))*(0.5_wp / dx)))
154+
155+
q_prim_vf(advxb)%sf(i,j,k) = alph
156+
q_prim_vf(advxe)%sf(i,j,k) = 1._wp - alph
157+
158+
q_prim_vf(contxb)%sf(i,j,k) = q_prim_vf(advxb)%sf(i,j,k) * 1._wp
159+
q_prim_vf(contxe)%sf(i,j,k) = q_prim_vf(advxe)%sf(i,j,k) * (1._wp / 950._wp)
160+
161+
q_prim_vf(E_idx)%sf(i,j,k) = p0 + &
162+
(q_prim_vf(contxb)%sf(i,j,k) + q_prim_vf(contxe)%sf(i,j,k)) * g0 * &
163+
(ih(start_idx(1) + i, start_idx(3) + k) - y_cc(j))
164+
165+
if (surface_tension) q_prim_vf(c_idx)%sf(i,j,k) = alph
166+
167+
case (304) ! 3D Interface from file axisymmetric
129168

130169
alph = 0.5_wp * (1 + (1._wp - 2._wp * eps) * &
131-
tanh((ih(start_idx(1) + i,start_idx(3) + k) - y_cc(j))*0.1_wp))
170+
tanh((ih(start_idx(2) + j,0) - x_cc(i))*(0.01_wp / dx)))
132171

133172
q_prim_vf(advxb)%sf(i,j,k) = alph
134173
q_prim_vf(advxe)%sf(i,j,k) = 1._wp - alph

src/pre_process/m_assign_variables.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ contains
684684
685685
if (surface_tension) then
686686
q_prim_vf(c_idx)%sf(j, k, l) = eta*patch_icpp(patch_id)%cf_val + &
687-
(1._wp - eta)*patch_icpp(smooth_patch_id)%cf_val
687+
(1._wp - eta)*orig_prim_vf(c_idx)
688688
end if
689689
690690
! Updating the patch identities bookkeeping variable

src/simulation/m_data_output.fpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ contains
157157
write (3, '(A)') ''; write (3, '(A)') ''
158158

159159
! Generating table header for the stability criteria to be outputted
160-
write (3, '(13X,A8,13X,A10,13X,A10,13X,A10,)', advance="no") &
161-
trim('Time-steps'), trim('dt'), trim('Time'), trim('ICFL Max')
160+
write (3, '(13X,A9,13X,A10,13X,A10,13X,A10,)', advance="no") &
161+
trim('Time-step'), trim('dt'), trim('Time'), trim('ICFL Max')
162162

163163
if (viscous) then
164164
write(3, '(13X,A10,13X,A16)', advance="no") &
@@ -309,7 +309,7 @@ contains
309309

310310
! Determining local stability criteria extrema at current time-step
311311

312-
#ifdef _CRAYFTN
312+
!#ifdef _CRAYFTN
313313
$:GPU_UPDATE(host='[icfl_sf]')
314314
icfl_max_loc = maxval(icfl_sf)
315315

@@ -323,23 +323,23 @@ contains
323323
$:GPU_UPDATE(host='[ccfl_sf]')
324324
ccfl_max_loc = maxval(ccfl_sf)
325325
end if
326-
#else
327-
#:call GPU_PARALLEL(copyout='[icfl_max_loc]', copyin='[icfl_sf]')
328-
icfl_max_loc = maxval(icfl_sf)
329-
#:endcall GPU_PARALLEL
330-
if (viscous) then
331-
#:call GPU_PARALLEL(copyout='[vcfl_max_loc, Rc_min_loc]', copyin='[vcfl_sf,Rc_sf]')
332-
vcfl_max_loc = maxval(vcfl_sf)
333-
Rc_min_loc = minval(Rc_sf)
334-
#:endcall GPU_PARALLEL
335-
end if
336-
337-
if (surface_tension) then
338-
#:call GPU_PARALLEL(copyout='[ccfl_max_loc]', copyin='[ccfl_sf]')
339-
ccfl_max_loc = maxval(ccfl_sf)
340-
#:endcall GPU_PARALLEL
341-
end if
342-
#endif
326+
!#else
327+
!#:call GPU_PARALLEL(copyout='[icfl_max_loc]', copyin='[icfl_sf]')
328+
!icfl_max_loc = maxval(icfl_sf)
329+
!#:endcall GPU_PARALLEL
330+
!if (viscous) then
331+
!#:call GPU_PARALLEL(copyout='[vcfl_max_loc, Rc_min_loc]', copyin='[vcfl_sf,Rc_sf]')
332+
!vcfl_max_loc = maxval(vcfl_sf)
333+
!Rc_min_loc = minval(Rc_sf)
334+
!#:endcall GPU_PARALLEL
335+
!end if
336+
337+
!if (surface_tension) then
338+
!#:call GPU_PARALLEL(copyout='[ccfl_max_loc]', copyin='[ccfl_sf]')
339+
!ccfl_max_loc = maxval(ccfl_sf)
340+
!#:endcall GPU_PARALLEL
341+
!end if
342+
!#endif
343343

344344
! Determining global stability criteria extrema at current time-step
345345
if (num_procs > 1) then
@@ -372,8 +372,8 @@ contains
372372

373373
! Outputting global stability criteria extrema at current time-step
374374
if (proc_rank == 0) then
375-
write (3, '(13X,I8,13X,F10.6,13X,F10.6,13X,F10.6)', advance="no") &
376-
t_step, dt, t_step*dt, icfl_max_glb
375+
write (3, '(13X,I9,13X,F10.6,13X,F10.6,13X,F10.6)', advance="no") &
376+
t_step, dt, mytime, icfl_max_glb
377377

378378
if (viscous) then
379379
write (3, '(13X,F10.6,13X,ES16.6)', advance="no") &

src/simulation/m_sim_helpers.fpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,12 @@ contains
235235
if (p > 0) then ! 3D
236236
if (grid_geometry == 3) then
237237
fltr_dtheta = f_compute_filtered_dtheta(k, l)
238-
ccfl_sf(j, k, l) = dt/sqrt(rho * max(dx(j), dy(k), fltr_dtheta)**3._wp / sigma)
238+
ccfl_sf(j, k, l) = dt/sqrt(rho * min(dx(j), dy(k), fltr_dtheta)**3._wp / sigma)
239239
else
240-
ccfl_sf(j, k, l) = dt/sqrt(rho * max(dx(j), dy(k), dz(l))**3._wp / sigma)
240+
ccfl_sf(j, k, l) = dt/sqrt(rho * min(dx(j), dy(k), dz(l))**3._wp / sigma)
241241
end if
242242
elseif (n > 0) then ! 2D
243-
ccfl_sf(j, k, l) = dt/sqrt(rho * max(dx(j), dy(k))**3._wp / sigma)
243+
ccfl_sf(j, k, l) = dt/sqrt(rho * min(dx(j), dy(k))**3._wp / sigma)
244244
end if
245245
end if
246246

@@ -296,12 +296,12 @@ contains
296296
if (p > 0) then ! 3D
297297
if (grid_geometry == 3) then
298298
fltr_dtheta = f_compute_filtered_dtheta(k, l)
299-
ccfl_dt = cfl_target*sqrt(rho * max(dx(j), dy(k), fltr_dtheta)**3._wp / sigma)
299+
ccfl_dt = cfl_target*sqrt(rho * min(dx(j), dy(k), fltr_dtheta)**3._wp / sigma)
300300
else
301-
ccfl_dt = cfl_target*sqrt(rho * max(dx(j), dy(k), dz(l))**3._wp / sigma)
301+
ccfl_dt = cfl_target*sqrt(rho * min(dx(j), dy(k), dz(l))**3._wp / sigma)
302302
end if
303303
elseif (n > 0) then ! 2D
304-
ccfl_dt = cfl_target*sqrt(rho * max(dx(j), dy(k))**3._wp / sigma)
304+
ccfl_dt = cfl_target*sqrt(rho * min(dx(j), dy(k))**3._wp / sigma)
305305
end if
306306
end if
307307

0 commit comments

Comments
 (0)