Skip to content

bug: Lagrange bubble initial gas pressure omits the qv term from the stiffened-gas inversion #1706

Description

@sbryngelson

Summary

s_locate_bubbles/particle initialization in src/simulation/m_bubbles_EL.fpp open-codes the stiffened-gas pressure inversion and omits the qv (heat of formation) term. The resulting liquid pressure seeds the initial Lagrangian bubble gas pressure, so the error is in the physics, not in output.

Location

src/simulation/m_bubbles_EL.fpp:374

call s_convert_to_mixture_variables(q_cons_vf, cell(1), cell(2), cell(3), rhol, gamma, pi_inf, qv, Re)
dynP = 0._wp
do i = 1, num_dims
    dynP = dynP + 0.5_wp*q_cons_vf(eqn_idx%cont%end + i)%sf(cell(1), cell(2), cell(3))**2/rhol
end do
pliq = (q_cons_vf(eqn_idx%E)%sf(cell(1), cell(2), cell(3)) - dynP - pi_inf)/gamma

The canonical inversion in s_compute_pressure (src/common/m_variables_conversion.fpp:71) is

pres = (energy - dyn_p - pi_inf - qv)/gamma

qv is missing from the m_bubbles_EL expression.

Evidence that this is accidental

qv is an output argument of the s_convert_to_mixture_variables call on the line above, and it is never read anywhere else in that scope. The value is computed and discarded.

Impact

pliq is too large by qv/gamma. It flows directly into the initial bubble gas pressure:

gas_p(bub_id, 1) = pliq + 2._wp*(1._wp/Web)/bub_R0(bub_id)

so every Lagrangian bubble starts from a wrong internal pressure whenever qv /= 0.

Dormant when qv = 0, which is the default. It triggers for any case that sets fluid_pp(i)%qv, i.e. the phase-change and reactive-burn configurations — examples/2D_phasechange_bubble, examples/3D_phasechange_bubble, examples/1D_exp_tube_phasechange, examples/2D_shocktube_phasechange, examples/1D_reactive_burn all set it.

Suggested fix

Route the site through s_compute_pressure rather than adding - qv to the open-coded expression, so the definition cannot drift again. See the tracking issue for the broader deduplication.

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