Skip to content

Probe output writes uninitialized ptilde and ptot for Euler-Euler bubble cases #1741

Description

@sbryngelson

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

  1. Compute the cell-centered correction, most naturally where the bubble moments are already available in m_bubbles_EE.fpp, and store it in ptil.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions