rk4_step Subroutine

private subroutine rk4_step(state)

Advance the solution by one time step using the classic RK4 scheme.

Four-stage, fourth-order Runge-Kutta (not SSP):

k1 = R(Q^n) k2 = R(Q^n + dt/2 * k1) k3 = R(Q^n + dt/2 * k2) k4 = R(Q^n + dt * k3) Q^{n+1} = Q^n + dt/6 * (k1 + 2k2 + 2k3 + k4)

Storage: ub0 holds Q^n; k_sum accumulates (dt/6)(k1+2k2+2*k3+k4) incrementally after each compute_resid() call; ub is overwritten with the next stage input between calls.

WARNING: Classic RK4 is not strong-stability preserving. Near shocks it may amplify oscillations at large CFL numbers. Keep CFL <= 1 with WENO spatial discretisation to avoid spurious artefacts. Also computes the global L2 residual norm for convergence monitoring.

Arguments

Type IntentOptional Attributes Name
type(solver_state_t), intent(inout) :: state