docs: def control_valve_noise_l_2015(m, P1, P2, Psat, rho, c, Kv, d, Di, FL, Fd,
                                 t_pipe, rho_pipe=7800.0, c_pipe=5000.0, 
                                 rho_air=1.2, c_air=343.0, xFz=None, An=-4.6):
      r'''Calculates the sound made by a liquid flowing through a control valve
      according to the standard IEC 60534-8-4 (2015) [1]_.
  
      Parameters
      ----------
      m : float
          Mass flow rate of liquid through the control valve, [kg/s]
      P1 : float
          Inlet pressure of the fluid before valves and reducers [Pa]
      P2 : float
          Outlet pressure of the fluid after valves and reducers [Pa]
      Psat : float
          Saturation pressure of the fluid at inlet temperature [Pa]
      rho : float
          Density of the liquid at the inlet [kg/m^3]
      c : float
          Speed of sound of the liquid at the inlet conditions [m/s]
      Kv : float
          Metric Kv valve flow coefficient (flow rate of water at a pressure drop  
          of 1 bar) [m^3/hr]
      d : float
          Diameter of the valve [m]
      Di : float
          Internal diameter of the pipe before and after the valve [m]
      FL : float, optional
          Liquid pressure recovery factor of a control valve without attached 
          fittings (normally 0.8-0.9 at full open and decreasing as opened 
          further to below 0.5) [-]
      Fd : float, optional
          Valve style modifier [-]
      t_pipe : float
          Wall thickness of the pipe after the valve, [m]
      rho_pipe : float, optional
          Density of the pipe wall material at flowing conditions, [kg/m^3]
      c_pipe : float, optional
          Speed of sound of the pipe wall material at flowing conditions, [m/s]
      rho_air : float, optional
          Density of the air surrounding the valve and pipe wall, [kg/m^3]
      c_air : float, optional
          Speed of sound of the air surrounding the valve and pipe wall, [m/s]
      xFz : float, optional
          If specified, this value `xFz` is used instead of estimated; the 
          calculation is sensitive to this value, [-]
      An : float, optional
          Valve correction factor for acoustic efficiency
  
      Returns
      -------
      LpAe1m : float
          A weighted sound pressure level 1 m from the pipe wall, 1 m distance
          dowstream of the valve (at reference sound pressure level 2E-5), [dBA]
          
      Notes
      -----
      For formulas see [1]_. This takes on the order of 100 us to compute.
      This model can also tell if noise is being produced in a valve just due to
      turbulent flow, or cavitation. For values of `An`, see [1]_; it is
      normally -4.6 for globel valves, -4.3 for butterfly valves, and -4.0 for
      expanders.
      
      This model was checked against three examples in [1]_; they match to all
      given decimals.
      
      A formula is given in [1]_ for multihole trim valves to estimate `xFz`
      as well; this is not implemented here and `xFz` must be calculated by the
      user separately. The formula is
      
      .. math::
          x_{Fz} = \left(4.5 + 1650\frac{N_0d_H^2}{F_L}\right)^{-1/2}
          
      Where `N0` is the number of open channels and `dH` is the multihole trim
      hole diameter.
  
      Examples
      --------
      >>> control_valve_noise_l_2015(m=40, P1=1E6, P2=6.5E5, Psat=2.32E3, 
      ... rho=997, c=1400, Kv=77.848, d=0.1, Di=0.1071, FL=0.92, Fd=0.42, 
      ... t_pipe=0.0036, rho_pipe=7800.0, c_pipe=5000.0,rho_air=1.293, 
      ... c_air=343.0, An=-4.6)
      81.58200097996539
  
      References
      ----------
      .. [1] IEC 60534-8-4 : Industrial-Process Control Valves - Part 8-4: Noise 
         Considerations - Prediction of Noise Generated by Hydrodynamic Flow.
         (2015)
      '''
      # Convert Kv to Cv as C
      N34 = 1.17 # for Cv - conversion constant but not to many decimals
      N14 = 0.0046
      
      C = Kv_to_Cv(Kv)
      xF = (P1-P2)/(P1-Psat)
      dPc = min(P1-P2, FL*FL*(P1 - Psat))
      
      if xFz is None:
          xFz = 0.9*(1.0 + 3.0*Fd*(C/(N34*FL))**0.5)**-0.5
      xFzp1 = xFz*(6E5/P1)**0.125
      
      Dj = N14*Fd*(C*FL)**0.5
      
      Uvc = 1.0/FL*(2.0*dPc/rho)**0.5
      Wm = 0.5*m*Uvc*Uvc*FL*FL
      cavitating = False if xF <= xFzp1 else True
      
      eta_turb = 10.0**An*Uvc/c
      
      if cavitating:
      	eta_cav = 0.32*eta_turb*((P1 - P2)/(dPc*xFzp1))**0.5*exp(5.0*xFzp1)*((1.0 
                   - xFzp1)/(1.0 - xF))**0.5*(xF/xFzp1)**5*(xF - xFzp1)**1.5
      	Wa = (eta_turb+eta_cav)*Wm
      else:
      	Wa = eta_turb*Wm
      
      Lpi = 10.0*log10(3.2E9*Wa*rho*c/(Di*Di))
      Stp = 0.036*FL*FL*C*Fd**0.75/(N34*xFzp1**1.5*d*d)*(1.0/(P1 - Psat))**0.57
      f_p_turb = Stp*Uvc/Dj
      
      if cavitating:
          f_p_cav = 6*f_p_turb*((1.0 - xF)/(1.0 - xFzp1))**2*(xFzp1/xF)**2.5
          f_p_cav_inv = 1.0/f_p_cav
          eta_denom = 1.0/(eta_turb + eta_cav)
          t1 = eta_turb*eta_denom
          t2 = eta_cav*eta_denom
  
      fr = c_pipe/(pi*Di)    
      fr_inv = 1.0/fr
      TL_fr = -10.0 - 10.0*log10(c_pipe*rho_pipe*t_pipe/(c_air*rho_air*Di))
      
      t3 = - 10.0*log10((Di + 2.0*t_pipe + 2.0)/(Di + 2.0*t_pipe))
  
  #    F_cavs = []
  #    F_turbs = []
  #    LPis = []
  #    TL_fis = []
  #    L_pe1m_fis = []
      LpAe1m_sum = 0.0
      
      f_p_turb_inv = 1.0/f_p_turb
      
      
      
      for fi, A in zip(fis_l_2015, A_weights_l_2015):
          fi_inv = 1.0/fi
          fi_turb_ratio = fi*f_p_turb_inv
          F_turb = -8.0 - 10.0*log10(0.25*fi_turb_ratio*fi_turb_ratio*fi_turb_ratio
                                     + fi_inv*f_p_turb) 
  #        F_turbs.append(F_turb)
          if cavitating:
              fi_cav_ratio = (fi*f_p_cav_inv)**1.5
              F_cav = -9.0 - 10.0*log10(0.25*fi_cav_ratio + 1.0/fi_cav_ratio)
              LPif = (Lpi + 10.0*log10(t1*10.0**(0.1*F_turb)
                      + t2*10.0**(0.1*F_cav)))
          else:
              LPif = Lpi + F_turb
  #        LPis.append(LPif)
          TL_fi = TL_fr - 20.0*log10((fr*fi_inv) + (fi*fr_inv)**1.5)
  #        TL_fis.append(TL_fi)
          
          L_pe1m_fi = LPif + TL_fi + t3
  #        L_pe1m_fis.append(L_pe1m_fi)
          
          LpAe1m_sum += 10.0**(0.1*(L_pe1m_fi + A))
      LpAe1m = 10.0*log10(LpAe1m_sum)
      return LpAe1m