docs: def K_separator_demister_York(P, horizontal=False):
      r'''Calculates the Sounders Brown `K` factor as used in determining maximum 
      permissible gas velocity in a two-phase separator in either a horizontal or 
      vertical orientation, *with a demister*.
      This function is a curve fit to [1]_ published in [2]_ and is widely used. 
      
      For 1 < P < 15 psia:   
      
      .. math::
          K = 0.1821 + 0.0029P + 0.0460\ln P
  
      For 15 <= P <= 40 psia:   
      
      .. math::
          K = 0.35
          
      For P < 5500 psia:
      
      .. math::
          K = 0.430 - 0.023\ln P
          
      In the above equations, P is in units of psia.
  
      Parameters
      ----------
      P : float
          Pressure of separator, [Pa]
      horizontal : bool, optional
          Whether to use the vertical or horizontal value; horizontal is 1.25 
          times higher, [-]
  
      Returns
      -------
      K : float
          Sounders Brown Horizontal or vertical `K` factor for two-phase
          separator design with a demister, [m/s]
  
      Notes
      -----
      If the input pressure is under 1 psia, 1 psia is used. If the
      input pressure is over 5500 psia, 5500 psia is used.
  
      Examples
      --------
      >>> K_separator_demister_York(975*psi)
      0.08281536035331669
  
      References
      ----------
      .. [2] Otto H. York Company, "Mist Elimination in Gas Treatment Plants and 
         Refineries," Engineering, Parsippany, NJ.
      .. [1] Svrcek, W. Y., and W. D. Monnery. "Design Two-Phase Separators 
         within the Right Limits" Chemical Engineering Progress, (October 1, 
         1993): 53-60.
      '''
      P = P/psi # Correlation in terms of psia
      if P < 15:
          if P < 1: 
              P = 1 # Prevent negative K values, but as a consequence be  
              # optimistic for K values; limit is 0.185 ft/s but real values
              # should probably be lower
          K = 0.1821 + 0.0029*P + 0.0460*log(P)
      elif P < 40:
          K = 0.35
      else:
          if P > 5500:
              P = 5500 # Do not allow for lower K values above 5500 psia, as
              # the limit is stated to be 5500
          K = 0.430 - 0.023*log(P)
      K *= foot # Converts units of ft/s to m/s; the graph and all fits are in ft/s 
      if horizontal:
          # Watkins recommends a factor of 1.25 for horizontal separators over 
          # vertical separators as well
          K *= 1.25 
      return K