Skip to content

Questions about Differences Between HLLC Scheme and PDEBench Implementation #95

@WY-L7852

Description

@WY-L7852

Hi, I noticed some differences between the standard HLLC scheme and the implementation in /PDEBench/pdebench/data_gen/data_gen_NLE/CompressibleFluid/CFD_multi_Hydra.py.

According to Riemann Solvers and Numerical Methods for Fluid Dynamics by E. F. Toro, the wave speeds $S_L$ and $S_R$ can be computed using several commonly used estimates, such as:

$$S_L = \min\{u_L - a_L, u_R - a_R\}, \qquad S_R = \max\{u_L + a_L, u_R + a_R\}.$$

However, the implementation in the code uses:

Sfl = jnp.minimum(QL[iX, 2:-1], QR[iX, 1:-2]) - jnp.maximum(
    cfL[2:-1], cfR[1:-2]
)  # left-going wave
Sfr = jnp.maximum(QL[iX, 2:-1], QR[iX, 1:-2]) + jnp.maximum(
    cfL[2:-1], cfR[1:-2]
)  # right-going wave

I could not find a corresponding formulation for this version of $S_L$ and $S_R$ in Toro’s book or other standard references.

In addition, the middle-wave speed $S_M$ is usually computed as:

$$S_M = \frac{ p_R - p_L + \rho_L u_L (S_L - u_L) - \rho_R u_R (S_R - u_R) }{ \rho_L (S_L - u_L) - \rho_R (S_R - u_R) },$$

but in the code it is implemented as:

Va = (
    (Sfr - QL[iX, 2:-1]) * UL[iX, 2:-1]
    - (Sfl - QR[iX, 1:-2]) * UR[iX, 1:-2]
    - QL[4, 2:-1]
    + QR[4, 1:-2]
)
Va /= (Sfr - QL[iX, 2:-1]) * QL[0, 2:-1] - (Sfl - QR[iX, 1:-2]) * QR[0, 1:-2]

The expressions appear structurally different from the standard form, and similar discrepancies also show up in the computation of $\rho_{*L}, \rho_{*R}, p_{*L}$ and $p_{*R}$.

Could you please clarify the source of these differences?
Are they based on a specific variant of HLLC, an optimization for JAX/vectorization, or an intentional modification for stability or performance?

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