Summary
ptil is allocated and read but never assigned anywhere in the codebase. The probe output path reads it and writes the result to disk, so Euler-Euler bubble runs with probes enabled have been emitting undefined values in the ptilde and ptot columns.
Trace
Declared and allocated, never written:
src/simulation/m_global_parameters.fpp:246 declaration
src/simulation/m_global_parameters.fpp:247 GPU_DECLARE
src/simulation/m_global_parameters.fpp:929 ALLOCATE
src/simulation/m_global_parameters.fpp:1047 DEALLOCATE
src/simulation/m_start_up.fpp:1049 GPU data clause
Read and written to output:
src/simulation/m_data_output.fpp:1300 ptilde = ptil(j - 2, k, l)
src/simulation/m_data_output.fpp:1301 ptot = pres - ptilde
src/simulation/m_data_output.fpp:1471 both are passed through s_mpi_allreduce_sum
src/simulation/m_data_output.fpp:1509 both are written to the probe file
$ grep -rn 'ptil\b' src/ | grep -v ptilde
returns only the declaration, allocate, deallocate, GPU clause, and the read at m_data_output.fpp:1300. No assignment exists.
Impact
Affects bubbles_euler = T with probe_wrt = T and num_fluids = 3, which is the branch at m_data_output.fpp:1509 that writes the two columns. The undefined values are MPI-reduced before being written, so they are not reproducible across runs or rank counts.
Solver results are unaffected. ptil feeds output only.
Cause
The Euler-Euler pressure correction is applied inside the HLLC Riemann solver, which folds it into pres_L and pres_R on reconstructed face states (m_riemann_solver_hllc.fpp:739). Nothing ever evaluates the correction at cell centers, which is what ptil would need.
Options
- Compute the cell-centered correction, most naturally where the bubble moments are already available in
m_bubbles_EE.fpp, and store it in ptil.
- Drop the
ptilde and ptot columns from probe output and remove ptil.
Related
While tracing this: ptilde_L and ptilde_R are used in the bubbles_euler momentum and energy fluxes of m_riemann_solver_hll.fpp (lines 453, 454, 498, 499) and m_riemann_solver_lf.fpp (lines 376, 377, 411, 412) but are never assigned in either file. Those branches are unreachable, since case_validator.py:990 requires riemann_solver = 2 for any bubble model, so this is dead code rather than a live defect. m_riemann_solver_hllc.fpp:106 declares the same two variables and never uses them.
Found while reviewing #1739.
Summary
ptilis allocated and read but never assigned anywhere in the codebase. The probe output path reads it and writes the result to disk, so Euler-Euler bubble runs with probes enabled have been emitting undefined values in theptildeandptotcolumns.Trace
Declared and allocated, never written:
src/simulation/m_global_parameters.fpp:246declarationsrc/simulation/m_global_parameters.fpp:247GPU_DECLAREsrc/simulation/m_global_parameters.fpp:929ALLOCATEsrc/simulation/m_global_parameters.fpp:1047DEALLOCATEsrc/simulation/m_start_up.fpp:1049GPU data clauseRead and written to output:
src/simulation/m_data_output.fpp:1300ptilde = ptil(j - 2, k, l)src/simulation/m_data_output.fpp:1301ptot = pres - ptildesrc/simulation/m_data_output.fpp:1471both are passed throughs_mpi_allreduce_sumsrc/simulation/m_data_output.fpp:1509both are written to the probe filereturns only the declaration, allocate, deallocate, GPU clause, and the read at
m_data_output.fpp:1300. No assignment exists.Impact
Affects
bubbles_euler = Twithprobe_wrt = Tandnum_fluids = 3, which is the branch atm_data_output.fpp:1509that writes the two columns. The undefined values are MPI-reduced before being written, so they are not reproducible across runs or rank counts.Solver results are unaffected.
ptilfeeds output only.Cause
The Euler-Euler pressure correction is applied inside the HLLC Riemann solver, which folds it into
pres_Landpres_Ron reconstructed face states (m_riemann_solver_hllc.fpp:739). Nothing ever evaluates the correction at cell centers, which is whatptilwould need.Options
m_bubbles_EE.fpp, and store it inptil.ptildeandptotcolumns from probe output and removeptil.Related
While tracing this:
ptilde_Landptilde_Rare used in thebubbles_eulermomentum and energy fluxes ofm_riemann_solver_hll.fpp(lines 453, 454, 498, 499) andm_riemann_solver_lf.fpp(lines 376, 377, 411, 412) but are never assigned in either file. Those branches are unreachable, sincecase_validator.py:990requiresriemann_solver = 2for any bubble model, so this is dead code rather than a live defect.m_riemann_solver_hllc.fpp:106declares the same two variables and never uses them.Found while reviewing #1739.