diff --git a/src/post_process/m_data_input.f90 b/src/post_process/m_data_input.f90 index a3e3f22886..6eee4e3f8b 100644 --- a/src/post_process/m_data_input.f90 +++ b/src/post_process/m_data_input.f90 @@ -312,6 +312,10 @@ impure subroutine s_read_serial_data_files(t_step) STATUS='old', ACTION='read') read (1) q_cons_vf(i)%sf(0:m, 0:n, 0:p) close (1) + else if (bubbles_lagrange .and. i == beta_idx) then + ! beta (Lagrangian void fraction) is not written by pre_process + ! for t_step_start; initialize to zero. + q_cons_vf(i)%sf(0:m, 0:n, 0:p) = 0._wp else call s_mpi_abort('File q_cons_vf'//trim(file_num)// & '.dat is missing in '//trim(t_step_dir)// & diff --git a/src/simulation/m_data_output.fpp b/src/simulation/m_data_output.fpp index 5051d5e15d..096b16d91d 100644 --- a/src/simulation/m_data_output.fpp +++ b/src/simulation/m_data_output.fpp @@ -476,6 +476,19 @@ contains write (2) q_cons_vf(i)%sf(0:m, 0:n, 0:p); close (2) end do + ! Lagrangian beta (void fraction) written as q_cons_vf(sys_size+1) to + ! match the parallel I/O path and allow post_process to read it. + if (bubbles_lagrange) then + write (file_path, '(A,I0,A)') trim(t_step_dir)//'/q_cons_vf', & + sys_size + 1, '.dat' + + open (2, FILE=trim(file_path), & + FORM='unformatted', & + STATUS='new') + + write (2) beta%sf(0:m, 0:n, 0:p); close (2) + end if + if (qbmm .and. .not. polytropic) then do i = 1, nb do r = 1, nnode