def K_diaphragm_valve_Crane(D=None, fd=None, style=0):
    r'''Returns the loss coefficient for a diaphragm valve of either weir
    (`style` = 0) or straight-through (`style` = 1) as shown in [1]_.
        
    .. math::
        K = K_1 = K_2 = N\cdot f_d
        
    For style 0 (weir), N = 149; for style 1 (straight through), N = 39.
    
    Parameters
    ----------
    D : float, optional
        Diameter of the pipe section the valve in mounted in; the
        same as the line size [m]
    fd : float, optional
        Darcy friction factor calculated for the actual pipe flow in clean 
        steel (roughness = 0.0018 inch) in the fully developed turbulent 
        region; do not specify this to use the original Crane friction factor!,
        [-]
    style : int, optional
        Either 0 (weir type valve) or 1 (straight through weir valve) [-]
        
    Returns
    -------
    K : float
        Loss coefficient with respect to the pipe inside diameter [-]

    Notes
    -----    
    This method is not valid in the laminar regime and the pressure drop will
    be underestimated in those conditions.

    Examples
    --------
    >>> K_diaphragm_valve_Crane(D=.1, style=0)
    2.4269804835982565
    
    References
    ----------
    .. [1] Crane Co. Flow of Fluids Through Valves, Fittings, and Pipe. Crane,
       2009.
    '''
    if D is None and fd is None:
        raise ValueError('Either `D` or `fd` must be specified')
    if fd is None:
        fd = ft_Crane(D)
    try:
        K = diaphragm_valve_Crane_coeffs[style]*fd
    except KeyError:
        raise KeyError('Accepted valve styles are 0 (weir) or 1 (straight through) only')
    return K
r'''Returns the loss coefficient for a diaphragm valve of either weir
    (`style` = 0) or straight-through (`style` = 1) as shown in [1]_.
        
    .. math::
        K = K_1 = K_2 = N\cdot f_d
        
    For style 0 (weir), N = 149; for style 1 (straight through), N = 39.
    
    Parameters
    ----------
    D : float, optional
        Diameter of the pipe section the valve in mounted in; the
        same as the line size [m]
    fd : float, optional
        Darcy friction factor calculated for the actual pipe flow in clean 
        steel (roughness = 0.0018 inch) in the fully developed turbulent 
        region; do not specify this to use the original Crane friction factor!,
        [-]
    style : int, optional
        Either 0 (weir type valve) or 1 (straight through weir valve) [-]
        
    Returns
    -------
    K : float
        Loss coefficient with respect to the pipe inside diameter [-]

    Notes
    -----    
    This method is not valid in the laminar regime and the pressure drop will
    be underestimated in those conditions.

    Examples
    --------
    >>> K_diaphragm_valve_Crane(D=.1, style=0)
    2.4269804835982565
    
    References
    ----------
    .. [1] Crane Co. Flow of Fluids Through Valves, Fittings, and Pipe. Crane,
       2009.