You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
m_acoustic_src computes its own sound speed instead of calling s_compute_speed_of_sound. It is the
only site in the solver that does so. Under bubbles_euler the two disagree, which means the acoustic
source injects a wave at a different speed than the wave speeds the Riemann solver computes on the same
cells.
Attempting to unify them destabilizes the solver on Frontier CCE OpenACC, so the disagreement needs a
physics ruling before either form can be called correct. This issue records the derivation and the
measurements so none of it has to be rediscovered.
The two expressions are the same EOS
m_acoustic_src (src/simulation/m_acoustic_src.fpp) forms the mixture coefficients and then writes the
Tait form by hand:
With n = 1/Gamma + 1, (n - 1)/n = 1/(1 + Gamma), so this is exactly sqrt(((Gamma + 1)p + Pi)/(Gamma rho)) - i.e. f_bulk_modulus(p, Gamma, Pi)/rho, the plain branch of s_compute_speed_of_sound. The downstream c/(small_gamma - 1) is likewise a pure rename: n - 1 = 1/Gamma,
so it equals c*Gamma.
So there is no EOS disagreement. The entire behavioural delta is what s_compute_speed_of_sound adds
on top of the plain branch and the hand-rolled code never applied:
the bubble dilution c = c/(1 - adv(num_fluids)) under model_eqns_5eq .and. bubbles_euler
the alt_soundspeed Wood's-law harmonic mean
the model_eqns_6eq arithmetic mean
The open question is therefore specifically whether the dilution closure belongs in the acoustic source
term, not which EOS is right.
Evidence
Switching m_acoustic_src to s_compute_speed_of_sound:
moved the bubbly QBMM golden CE9DBA3F by 1.7% on AMD MI210 / amdflang OpenMP offload, which is the 1/(1 - alpha) dilution to within rounding (alpha = 4e-2 predicts ~2.1%). Non-bubbly acoustic goldens
were unaffected.
NaN'd at step 50 on Frontier CCE OpenACC in all three suites that combine an acoustic source with a
bubbly medium: B9553426 and 4A1BD9B8 (2D Lagrange bubbles, acoustic_source = T, mag = 2e04) and CE9DBA3F (1D QBMM bubbles). Reverting the change returns all three to green - 41 tests pass, 0 fail,
including the full Lagrange suite and a 28-case CCE-critical sweep.
The NaN mechanism is still open
An earlier version of this report attributed the NaN to the 1/(1 - alpha) dilution. That was wrong.
In MFC a 1/(1 - alpha) always denotes the dilute bubbly void fraction, and in these cases it is small:
the two Lagrange suites run bubbles_lagrange with bubbles_euler = F and so never enter that branch,
and the QBMM case has alpha = 4e-2, giving 1/0.96. That accounts for the 1.7% answer shift and nothing
more - it cannot produce Inf or NaN.
With model_eqns = 2, alt_soundspeed = F and mixture_err = F (the test base config), the new call
reduces for the Lagrange cases to the identical plain branch, f_bulk_modulus(p, Gamma, Pi)/rho. So the
arithmetic delta there is only floating-point re-association, which should not destabilize anything.
The remaining common factor across all three failures is structural rather than numerical: the change
passes myalpha - an array whose bound num_fluids is a device global - into s_compute_speed_of_sound,
a GPU_ROUTINE(parallelism='[seq]'), from inside the acoustic parallel loop. That is the same construct
class that has twice caused CCE-only failures in this codebase, once as a compile error
(ftn-7066 ... Global in accelerator routine without declare) and once as a runtime GPU memory fault
with a clean build (the m_thermochem case). Clean build plus runtime NaN on CCE only, with amdflang
OpenMP offload green on the same tree, fits that pattern.
This is a hypothesis, not a measurement. Discriminating it needs a variant that computes the mixture sound
speed without passing an array into a device routine from that loop.
What a fix needs
A ruling on whether an acoustic source in a bubbly medium should inject at the diluted mixture speed or
at the carrier-liquid speed. Note m_qbmm.fpp:775 deliberately goes the other way - it multiplies by (1 - alf) to recover the pure liquid speed from the partial density, which is correct for
Keller-Miksis. These are different physical quantities and neither should be folded into the other.
Summary
m_acoustic_srccomputes its own sound speed instead of callings_compute_speed_of_sound. It is theonly site in the solver that does so. Under
bubbles_eulerthe two disagree, which means the acousticsource injects a wave at a different speed than the wave speeds the Riemann solver computes on the same
cells.
Attempting to unify them destabilizes the solver on Frontier CCE OpenACC, so the disagreement needs a
physics ruling before either form can be called correct. This issue records the derivation and the
measurements so none of it has to be rediscovered.
The two expressions are the same EOS
m_acoustic_src(src/simulation/m_acoustic_src.fpp) forms the mixture coefficients and then writes theTait form by hand:
With
n = 1/Gamma + 1,(n - 1)/n = 1/(1 + Gamma), so this is exactlysqrt(((Gamma + 1)p + Pi)/(Gamma rho))- i.e.f_bulk_modulus(p, Gamma, Pi)/rho, the plain branch ofs_compute_speed_of_sound. The downstreamc/(small_gamma - 1)is likewise a pure rename:n - 1 = 1/Gamma,so it equals
c*Gamma.So there is no EOS disagreement. The entire behavioural delta is what
s_compute_speed_of_soundaddson top of the plain branch and the hand-rolled code never applied:
c = c/(1 - adv(num_fluids))undermodel_eqns_5eq .and. bubbles_euleralt_soundspeedWood's-law harmonic meanmodel_eqns_6eqarithmetic meanThe open question is therefore specifically whether the dilution closure belongs in the acoustic source
term, not which EOS is right.
Evidence
Switching
m_acoustic_srctos_compute_speed_of_sound:CE9DBA3Fby 1.7% on AMD MI210 / amdflang OpenMP offload, which is the1/(1 - alpha)dilution to within rounding (alpha = 4e-2predicts ~2.1%). Non-bubbly acoustic goldenswere unaffected.
bubbly medium:
B9553426and4A1BD9B8(2D Lagrange bubbles,acoustic_source = T,mag = 2e04) andCE9DBA3F(1D QBMM bubbles). Reverting the change returns all three to green - 41 tests pass, 0 fail,including the full Lagrange suite and a 28-case CCE-critical sweep.
The NaN mechanism is still open
An earlier version of this report attributed the NaN to the
1/(1 - alpha)dilution. That was wrong.In MFC a
1/(1 - alpha)always denotes the dilute bubbly void fraction, and in these cases it is small:the two Lagrange suites run
bubbles_lagrangewithbubbles_euler = Fand so never enter that branch,and the QBMM case has
alpha = 4e-2, giving1/0.96. That accounts for the 1.7% answer shift and nothingmore - it cannot produce
InforNaN.With
model_eqns = 2,alt_soundspeed = Fandmixture_err = F(the test base config), the new callreduces for the Lagrange cases to the identical plain branch,
f_bulk_modulus(p, Gamma, Pi)/rho. So thearithmetic delta there is only floating-point re-association, which should not destabilize anything.
The remaining common factor across all three failures is structural rather than numerical: the change
passes
myalpha- an array whose boundnum_fluidsis a device global - intos_compute_speed_of_sound,a
GPU_ROUTINE(parallelism='[seq]'), from inside the acoustic parallel loop. That is the same constructclass that has twice caused CCE-only failures in this codebase, once as a compile error
(
ftn-7066 ... Global in accelerator routine without declare) and once as a runtime GPU memory faultwith a clean build (the
m_thermochemcase). Clean build plus runtime NaN on CCE only, with amdflangOpenMP offload green on the same tree, fits that pattern.
This is a hypothesis, not a measurement. Discriminating it needs a variant that computes the mixture sound
speed without passing an array into a device routine from that loop.
What a fix needs
at the carrier-liquid speed. Note
m_qbmm.fpp:775deliberately goes the other way - it multiplies by(1 - alf)to recover the pure liquid speed from the partial density, which is correct forKeller-Miksis. These are different physical quantities and neither should be folded into the other.
void fraction approaches one.
Reverted in #1762 as
e07ee640; the rest of that PR stands and is CCE-validated without it.