Skip to content

Numerical flux

# homemade_conslaws.NumericalFluxType.

NumericalFlux()

source

Dispatch functions

An implementation of NumericalFlux should provide the following functions:

# homemade_conslaws.stencil_sizeFunction.

stencil_size(::NumericalFlux)

Gives a tuple of the number of left and right cells needed to compute the numerical flux.

source

Implementations

Lax-Friedrichs flux

# homemade_conslaws.LaxFriedrichsFluxType.

LaxFriedrichsFlux()

Lax-Friedrichs numerical flux. It is a simple numerical flux that uses the average of the fluxes across the interfaces and adjusts by the maximum allowed wave speed \(\frac{\Dx}{\Dt}\).

\[ F^\text{LxF}(U_L, U_R) = \frac{1}{2} \Big(f(U_L) + f(U_R)\Big) - \frac{\Dx}{2\Dt} (U_R - U_L) \]

source


Rusanov flux

# homemade_conslaws.RusanovFluxType.

RusanovFlux()

An approximate Riemann solver that uses the average of the flux accross the interfaces and adjusting using the maximum eigenvalue of the flux function.

\[ F^\text{Rus}(U_L, U_R) = \frac{1}{2} \Big(F(U_L) + F(U_R)\Big) - \lambda (U_R - U_L) \]

source


Godunov flux

# homemade_conslaws.GodunovFluxType.

GodunovFlux{Float <: AbstractFloat}(ω::Float)

An exact Riemann solver assuming the flux function has a unique minimum at \(ω\).

\[ F^\text{God}(U_L, U_R) = \max\Big\{f\big(\max\{U_L, \omega\}\big), f\big(\min\{U_L, \omega\}\big)\Big\} \]

source


Central upwind flux

# homemade_conslaws.CentralUpwindType.

CentralUpwind()

Used for the shallow water equations. Well-balanced in the absence of dry land. Given by

\[ F(Q_L, Q_R) = \frac{a^+ F(Q_L) - a^- F(Q_R)}{a^+ - a^-} + \frac{a^+ a^- (Q_R - Q_L)}{a^+ - a^-}, \]

where \(a^+ = \max(\lambda(Q_L), \lambda(Q_R), 0)\) and \(a^- = \min(\lambda(Q_L), \lambda(Q_R), 0)\) are the maximum and minimum eigenvalues of the Jacobian matrix of the flux function.

source