MUSCL (primitive-variable) reconstruction with slope limiter; LLF/Rusanov numerical flux at faces. Robust and diffusive; uses local max wavespeed for upwinding. Adaptive diffusion (Rempel et al. 2009) is compiled in only when FLUX_AD is defined.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | u(nw_phys,5) | |||
| real(kind=dp), | intent(in) | :: | xlocC(1:ndim,2) | |||
| integer, | intent(in) | :: | flux_dim | |||
| real(kind=dp), | intent(out) | :: | flux(nw_flux,2) | |||
| integer, | intent(in) | :: | typelim |
subroutine reconflux_muscl_llf_prim(u, xlocC, flux_dim, flux, typelim) real(dp), intent(in) :: u(nw_phys, 5) real(dp), intent(in) :: xlocC(1:ndim, 2) integer, intent(in) :: flux_dim, typelim real(dp), intent(out) :: flux(nw_flux, 2) real(dp) :: uL(nw_phys,2), uR(nw_phys,2) integer :: iface real(dp) :: phi(nw_flux,2) real(dp) :: delta_rc, delta_ct, phi_v integer :: iw call muscl_reconstruct_prim(u, typelim, uL, uR) ! Rempel et al. (2009): reduce dissipation where reconstruction and cell-centre agree in sign phi = 1.0_dp do iface = 1, 2 do iw = 1, nw_flux delta_rc = uR(iw,iface) - uL(iw,iface) delta_ct = u(iw, iface+2) - u(iw, iface+1) if (delta_rc * delta_ct > 1.0e-18_dp) then phi_v = flux_ad_scale * delta_rc**2 / (delta_ct**2 + 1.0e-18_dp) phi(iw,iface) = max(flux_ad_min, min(phi_v, 1.0_dp)) end if end do end do do iface = 1, 2 call riemann_llf_prim(uL(:,iface), uR(:,iface), xlocC(:,iface), flux_dim, flux(:,iface), phi(:,iface)) end do end subroutine reconflux_muscl_llf_prim