Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Classes | Namespaces | Functions
iterative.hpp File Reference

Iterative Riemann solver for GSPH (van Leer 1997) More...

#include "shambackends/math.hpp"
#include "shambackends/sycl.hpp"
+ Include dependency graph for iterative.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  shammodels::gsph::riemann::RiemannResult< Tscal >
 Result of Riemann solver. More...
 

Namespaces

namespace  shammodels
 namespace for models
 

Functions

template<class Tscal >
RiemannResult< Tscal > shammodels::gsph::riemann::iterative_solver (Tscal u_L, Tscal rho_L, Tscal p_L, Tscal u_R, Tscal rho_R, Tscal p_R, Tscal gamma, Tscal tol=Tscal{1.0e-6}, u32 max_iter=20)
 Iterative Riemann solver (van Leer 1997)
 
template<class Tscal >
RiemannResult< Tscal > shammodels::gsph::riemann::hllc_solver (Tscal u_L, Tscal rho_L, Tscal p_L, Tscal u_R, Tscal rho_R, Tscal p_R, Tscal gamma)
 HLL approximate Riemann solver.
 

Detailed Description

Iterative Riemann solver for GSPH (van Leer 1997)

Author
Guo Yansong (guo.y.nosp@m.anso.nosp@m.ng.ng.nosp@m.y@gm.nosp@m.ail.c.nosp@m.om)
Timothée David–Cléris (tim.s.nosp@m.hamr.nosp@m.ock@p.nosp@m.roto.nosp@m.n.me)
Yona Lapeyre (yona..nosp@m.lape.nosp@m.yre@e.nosp@m.ns-l.nosp@m.yon.f.nosp@m.r)

Implements the van Leer (1997) iterative Riemann solver for ideal gas. Uses Newton-Raphson iteration to find the exact solution (p*, v*) at particle interfaces.

References:

Definition in file iterative.hpp.

Function Documentation

◆ hllc_solver()

template<class Tscal >
RiemannResult< Tscal > shammodels::gsph::riemann::hllc_solver ( Tscal  u_L,
Tscal  rho_L,
Tscal  p_L,
Tscal  u_R,
Tscal  rho_R,
Tscal  p_R,
Tscal  gamma 
)
inline

HLL approximate Riemann solver.

Harten-Lax-van Leer approximate solver following the reference implementation. Uses Roe-averaged wave speeds for better wave speed estimates.

Template Parameters
TscalScalar type (f32 or f64)
Parameters
u_LLeft state velocity
rho_LLeft state density
p_LLeft state pressure
u_RRight state velocity
rho_RRight state density
p_RRight state pressure
gammaAdiabatic index
Returns
RiemannResult with p_star and v_star

Definition at line 190 of file iterative.hpp.

+ Here is the call graph for this function:

◆ iterative_solver()

template<class Tscal >
RiemannResult< Tscal > shammodels::gsph::riemann::iterative_solver ( Tscal  u_L,
Tscal  rho_L,
Tscal  p_L,
Tscal  u_R,
Tscal  rho_R,
Tscal  p_R,
Tscal  gamma,
Tscal  tol = Tscal{1.0e-6},
u32  max_iter = 20 
)
inline

Iterative Riemann solver (van Leer 1997)

Solves the Riemann problem exactly for an ideal gas using Newton-Raphson iteration. Returns the interface pressure and velocity (p*, v*).

The left/right convention is:

  • Left state (L): particle on the "minus" side of the interface
  • Right state (R): particle on the "plus" side of the interface
  • Positive velocity points from L to R
Template Parameters
TscalScalar type (f32 or f64)
Parameters
u_LLeft state velocity (normal component)
rho_LLeft state density
p_LLeft state pressure
u_RRight state velocity (normal component)
rho_RRight state density
p_RRight state pressure
gammaAdiabatic index
tolConvergence tolerance (default: 1e-6)
max_iterMaximum iterations (default: 20)
Returns
RiemannResult with p_star and v_star

Definition at line 69 of file iterative.hpp.

+ Here is the call graph for this function: