PLM (piecewise-linear) swept-average face value.
For u > 0 the upwind cell is q0; stencil: qm1 = i-1, q0 = i, qp1 = i+1. slope = minmod(q0 - qm1, qp1 - q0) face = q0 + (1 - sigma)/2 * slope
Reference: van Leer (1977) slope limiter.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | qm1 | |||
| real(kind=wp), | intent(in) | :: | q0 | |||
| real(kind=wp), | intent(in) | :: | qp1 | |||
| real(kind=wp), | intent(in) | :: | sigma |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | private | :: | d0 | ||||
| real(kind=wp), | private | :: | d1 | ||||
| real(kind=wp), | private | :: | slope |
pure function plm_face_swept(qm1, q0, qp1, sigma) result(face) !! PLM (piecewise-linear) swept-average face value. !! !! For u > 0 the upwind cell is q0; stencil: qm1 = i-1, q0 = i, qp1 = i+1. !! slope = minmod(q0 - qm1, qp1 - q0) !! face = q0 + (1 - sigma)/2 * slope !! !! Reference: van Leer (1977) slope limiter. !$acc routine seq real(wp), intent(in) :: qm1, q0, qp1, sigma real(wp) :: face real(wp) :: d0, d1, slope d0 = q0 - qm1 d1 = qp1 - q0 if (d0*d1 > 0.0_wp) then if (abs(d0) < abs(d1)) then slope = d0 else slope = d1 end if else slope = 0.0_wp end if face = q0 + 0.5_wp*(1.0_wp - sigma)*slope end function plm_face_swept