include/pops/numerics/fv/numerical_flux.hpp File ReferenceΒΆ

adc_cpp: include/pops/numerics/fv/numerical_flux.hpp File Reference
adc_cpp 0.3.0
Model-free C++23 core for coupled hyperbolic-elliptic systems on adaptive (AMR) meshes, with MPI and GPU (Kokkos) backends
numerical_flux.hpp File Reference

Single-interface numerical flux policies: Rusanov, HLL, HLLC, Roe. More...

#include <pops/core/state/state.hpp>
#include <pops/core/foundation/types.hpp>
#include <cmath>
#include <concepts>
+ Include dependency graph for numerical_flux.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  pops::RusanovFlux
 RusanovFlux (local Lax-Friedrichs): robust flux, compatible with any minimal PhysicalModel. More...
 
struct  pops::HLLFlux
 HLLFlux (Harten-Lax-van Leer): 2 signal speeds, less diffusive than Rusanov. More...
 
struct  pops::HLLCFlux
 HLLCFlux (HLL + Contact wave, Toro): 3 waves, resolves the contact discontinuity. More...
 
struct  pops::RoeFlux
 RoeFlux: Roe linearization + Harten entropy fix (acoustic waves). More...
 

Namespaces

namespace  pops
 

Concepts

concept  pops::HasHLLCStructure
 HLLC capability: the model provides the CONTACT wave speed and the STAR STATE on side k.
 
concept  pops::HasRoeDissipation
 Roe capability: the model provides its FULL Roe dissipation d = |A_roe(UL, UR)| (UR - UL) – Roe average, wave decomposition, entropy fix included (these are properties of the physical system, not the core).
 

Typedefs

using pops::EulerHLLCFlux2D = HLLCFlux
 VALIDITY-DOMAIN aliases naming the canonical Euler 2D fallback (n_vars == 4, rho/m_x/m_y/E layout, ideal-gas pressure).
 
using pops::EulerRoeFlux2D = RoeFlux
 

Functions

template<class Model >
POPS_HD void pops::hll_speeds (const Model &m, const typename Model::State &UL, const Aux &AL, const typename Model::State &UR, const Aux &AR, int dir, Real &sL, Real &sR)
 hll_speeds: Davis estimates for the signal speeds of the HLL/HLLC solvers.
 
template<class Model >
POPS_HD Model::State pops::hll_flux_with_speeds (const Model &m, const typename Model::State &UL, const Aux &AL, const typename Model::State &UR, const Aux &AR, int dir, Real sL, Real sR)
 hll_flux_with_speeds: HLL flux from ALREADY estimated signal speeds (sL, sR).
 

Variables

constexpr Real pops::kRoeEntropyFixFraction = Real(0.1)
 Width of the RoeFlux Harten entropy-fix smoothing, as a fraction of the Roe sound speed (eps = kRoeEntropyFixFraction * c).
 

Detailed Description

Single-interface numerical flux policies: Rusanov, HLL, HLLC, Roe.

Each policy is a stateless POPS_HD functor satisfying the contract: operator()(model, UL, AL, UR, AR, dir) -> Model::State which returns the numerical flux at the interface between the left state (UL, aux AL) and the right state (UR, AR) along direction dir (0 = x, 1 = y). States and auxiliaries are passed by value; no virtuals.

Accuracy hierarchy (intermediate-wave resolution) AND generality: RusanovFlux: minimal GENERIC; only needs max_wave_speed (any PhysicalModel). HLLFlux: GENERIC with signed waves; requires model.wave_speeds (sL, sR). HLLCFlux: GENERIC contact-resolving solver when the model supplies HasHLLCStructure (contact_speed + hllc_star_state); otherwise a canonical Euler 2D fallback (n_vars == 4, rho/m/E layout, pressure) – alias EulerHLLCFlux2D. RoeFlux: GENERIC Roe-like solver when the model supplies HasRoeDissipation (full d = |A_roe| (UR - UL)); otherwise an ideal-gas Euler 2D fallback (eigenstructure hard-coded, gamma-1 from the EOS, Harten entropy fix eps = 0.1*c – an entropy policy SPECIFIC to Euler/Roe) – alias EulerRoeFlux2D.

For a NON-Euler model (moment system, isothermal, scalar...), the generic path is RusanovFlux, or HLLFlux as soon as the model exposes wave_speeds.

RIEMANN CAPABILITIES (2026-06 audit, long-term generalization): HLLC and Roe are no longer Euler-only algorithms DISGUISED as generic – they are GENERIC algorithms whose PHYSICAL STRUCTURE is supplied by the model through optional traits:

  • HasHLLCStructure: the model provides contact_speed (contact wave speed) and hllc_star_state (its star state). HLLCFlux then becomes a GENERIC contact-resolving solver (the algorithm F* = F_k + s_k (U*_k - U_k) no longer knows the layout).
  • HasRoeDissipation: the model provides its full Roe dissipation d = |A_roe| (U_R - U_L) (linearization, eigenstructure and entropy fix INCLUDED, which are properties of the MODEL, not the core). RoeFlux then becomes F = 1/2 (F_L + F_R) - 1/2 d. The canonical Euler 2D path (n_vars == 4 + pressure, no hooks) remains the BIT-IDENTICAL historical implementation: the capabilities only OPEN these solvers to other systems.

device INVARIANT: no vtable, no std:: in the critical paths (std::sqrt is allowed in RoeFlux for the Roe average, device-clean under Kokkos/nvcc).