reflect_velocity_2d Function

private pure function reflect_velocity_2d(q, nrm) result(qr)

Reflect the velocity of a conserved state about unit normal nrm, preserving density and total energy (|v| is unchanged). Inviscid no-penetration wall. The density is floored to eps (matching limit_pos_2d): the halo fill runs BEFORE any residual-side positivity guard can fire, so a transient non-positive boundary-adjacent state (near-vacuum off a strong expansion) must not divide-by-zero / SIGFPE here (audit 2026-07-06 N2); the residual guards still abort cleanly on the interior state itself.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: q(:)
real(kind=wp), intent(in) :: nrm(2)

Return Value real(kind=wp), (size(q))