godunov Function

public pure function godunov(f, vm, vp, x, t) result(res)

Monotone Godunov flux. It is less dissipative than the Lax-Friedrichs method, but computationally more demanding because of the if constructs. Source: Equation 2.70, page 21.

Note

See note about elemental in 'lax_friedrichs'.

Arguments

Type IntentOptional Attributes Name
procedure(flux) :: f

flux function,

real(kind=rk), intent(in) :: vm

left (minus) reconstruction,

real(kind=rk), intent(in) :: vp

right (plus) reconstruction,

real(kind=rk), intent(in) :: x(:)

at flux interface,

real(kind=rk), intent(in) :: t

time,

Return Value real(kind=rk)


Called by

proc~~godunov~~CalledByGraph proc~godunov godunov proc~rhs rhs proc~rhs->proc~godunov proc~rhs~2 rhs proc~rhs~2->proc~godunov

Source Code

   pure real(rk) function godunov(f, vm, vp, x, t) result(res)
    !!   Monotone Godunov flux. It is less dissipative than the Lax-Friedrichs method, but
    !! computationally more demanding because of the if constructs.
    !!   Source: Equation 2.70, page 21.
    !!
    !! @note
    !!   See note about *elemental* in 'lax_friedrichs'.
      procedure(flux) :: f
        !! flux function, \( f(v, x, t) \)
      real(rk), intent(in) :: vm
        !! left (minus) reconstruction, \( v_{i+1/2}^- \)
      real(rk), intent(in) :: vp
        !! right (plus) reconstruction, \( v_{i+1/2}^+ = v_{(i+1)-1/2}^- \)
      real(rk), intent(in) :: x(:)
        !! \(x\) at flux interface, \( x_{i+1/2} \)
      real(rk), intent(in) :: t
        !! time, \( t \)

      real(rk) :: fm, fp

      fm = f(vm, x, t)
      fp = f(vp, x, t)

      if (vm <= vp) then
         res = min(fm, fp)
      else
         res = max(fm, fp)
      end if

   end function godunov