Returns maximum local signal speed |v_n| + c_f (fast magnetosonic) from primitive state u in direction flux_dim; used in LLF/TVDLF flux estimation.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | u(nw_phys) | |||
| real(kind=dp), | intent(in) | :: | x(1:ndim) | |||
| integer, | intent(in) | :: | flux_dim |
pure real(dp) function get_cmax(u, x, flux_dim) result(wC) real(dp), intent(in) :: u(nw_phys) real(dp), intent(in) :: x(1:ndim) integer, intent(in) :: flux_dim real(dp) :: inv_rho, b2, cfast2 inv_rho=1.0_dp/u(iw_rho) wC=mhd_gamma*u(iw_e)*inv_rho cfast2=(u(iw_mag(1))**2+u(iw_mag(2))**2+u(iw_mag(3))**2)*inv_rho+wC b2=cfast2**2-4.0_dp*wC*u(iw_mag(flux_dim))**2*inv_rho if(b2<0.d0) b2=0.d0 wC=sqrt(0.5_dp*(cfast2+sqrt(b2)))+abs(u(iw_mom(flux_dim))) end function get_cmax