Skip to content

HLL axisymmetric: volume fraction solved in conservative form (missing Kapila source) after PR #800 #1402

@sbryngelson

Description

@sbryngelson

Summary

PR #800 changed one line in the HLL solver's cyl_coord block for the radial (y) direction:

! m_riemann_solvers.fpp, HLL cyl_coord block, NORM_DIR == 2
- flux_gsrc_rs${XYZ}$_vf(j, k, l, i) = 0._wp
+ flux_gsrc_rs${XYZ}$_vf(j, k, l, i) = flux_rs${XYZ}$_vf(j, k, l, i)

This fixed a real issue (HLL was not applying any cylindrical correction to α), but the fix introduced a different error: HLL now solves the volume fraction equation in pure conservative form rather than the quasi-conservative form required by the Kapila/Allaire 5-equation model.

The math

The Kapila volume fraction equation is:

∂α/∂t + ∇·(αu) = α∇·u

In cylindrical coordinates (r, z), the geometric terms cancel:

∇·(αu) - α∇·u  =  u_r ∂α/∂r

So the physically correct equation is the material-derivative form, identical to Cartesian:

∂α/∂t + ∂(αu_r)/∂r = α ∂u_r/∂r

After PR #800, HLL sets flux_gsrc(adv) = flux_rs(adv) and flux_src(adv) = 0, giving:

Term Value
Flux divergence -∂(αu_r)/∂r
Geometric correction -(αu_r)/r
Non-conservative source 0
Net ∂α/∂t + (1/r)∂(rαu_r)/∂r = 0

This is the purely conservative form with no Kapila source, which will generate spurious pressure oscillations at material interfaces (the original motivation for the quasi-conservative approach).

HLL may appear to work despite this because numerical diffusion masks the interface error, but it is solving the wrong equation.

Correct HLL fix

The right approach mirrors what HLLC already does:

  • Keep flux_gsrc(adv) = 0 (geometric terms cancel analytically)
  • Supply flux_src(adv) with a velocity estimate so the non-conservative source α ∂u_r/∂r is applied

For HLL, there is no contact wave, but a natural estimate is the HLL-averaged normal velocity:

u_HLL = (s_L * u_R - s_R * u_L) / (s_L - s_R)

Setting flux_src(adv) = u_HLL would make HLL produce:

∂α/∂t = -∂(αu_r)/∂r + α ∂u_r/∂r = -u_r ∂α/∂r   ✓

The cylindrical K·∇·u correction (already present in s_add_directional_advection_source_terms for the alt_soundspeed path) would then also apply correctly for HLL, since it keys off flux_src.

Context

This issue was identified during the analysis for #801. The HLLC solver does not share this problem — its flux_gsrc(adv) = 0 is correct because it compensates via flux_src(adv) = s_S. See the comment at #801 (comment) for the full derivation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working or doesn't seem right

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions