Skip to content

Commit 35b2134

Browse files
authored
Fix serial I/O missing beta for bubbles_lagrange in post_process (#1274)
1 parent 33ab04e commit 35b2134

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

src/post_process/m_data_input.f90

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,10 @@ impure subroutine s_read_serial_data_files(t_step)
312312
STATUS='old', ACTION='read')
313313
read (1) q_cons_vf(i)%sf(0:m, 0:n, 0:p)
314314
close (1)
315+
else if (bubbles_lagrange .and. i == beta_idx) then
316+
! beta (Lagrangian void fraction) is not written by pre_process
317+
! for t_step_start; initialize to zero.
318+
q_cons_vf(i)%sf(0:m, 0:n, 0:p) = 0._wp
315319
else
316320
call s_mpi_abort('File q_cons_vf'//trim(file_num)// &
317321
'.dat is missing in '//trim(t_step_dir)// &

src/simulation/m_data_output.fpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,19 @@ contains
476476
write (2) q_cons_vf(i)%sf(0:m, 0:n, 0:p); close (2)
477477
end do
478478

479+
! Lagrangian beta (void fraction) written as q_cons_vf(sys_size+1) to
480+
! match the parallel I/O path and allow post_process to read it.
481+
if (bubbles_lagrange) then
482+
write (file_path, '(A,I0,A)') trim(t_step_dir)//'/q_cons_vf', &
483+
sys_size + 1, '.dat'
484+
485+
open (2, FILE=trim(file_path), &
486+
FORM='unformatted', &
487+
STATUS='new')
488+
489+
write (2) beta%sf(0:m, 0:n, 0:p); close (2)
490+
end if
491+
479492
if (qbmm .and. .not. polytropic) then
480493
do i = 1, nb
481494
do r = 1, nnode

0 commit comments

Comments
 (0)