def LimiterG3forDYS(dU1, dU2, dU3):
    """Return the limiter for Davis-Yee Symmetric TVD limiter function.

    This limiter is further used to calculate the flux limiter
    function given by Equation 6-141.
    Calculated using Equation 6-144 in CFD Vol. 1 by Hoffmann.
    """
    if dU1 != 0:
        S = dU1/abs(dU1)
    else:
        S = 0.0
    term11 = abs(dU1)  # term 1 in 1st minmod
    term12 = S*dU2  # term 2 in 1st minmod
    term21 = abs(dU1)  # term 1 in 2nd minmod
    term22 = S*dU3  # term 2 in 2nd minmod
    term3 = S*dU2
    # Equation 6-144
    G = S*max(0.0, min(term11, term12)) +\
        S*max(0.0, min(term21, term22)) - term3

    return G