docs: def size_control_valve_l(rho, Psat, Pc, mu, P1, P2, Q, D1=None, D2=None,
                           d=None, FL=0.9, Fd=1, allow_choked=True, 
                           allow_laminar=True, full_output=False):
      r'''Calculates flow coefficient of a control valve passing a liquid
      according to IEC 60534. Uses a large number of inputs in SI units. Note the
      return value is not standard SI. All parameters are required.
      This sizing model does not officially apply to liquid mixtures, slurries,
      non-Newtonian fluids, or liquid-solid conveyance systems. For details
      of the calculations, consult [1]_.
  
      Parameters
      ----------
      rho : float
          Density of the liquid at the inlet [kg/m^3]
      Psat : float
          Saturation pressure of the fluid at inlet temperature [Pa]
      Pc : float
          Critical pressure of the fluid [Pa]
      mu : float
          Viscosity of the fluid [Pa*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]
      Q : float
          Volumetric flow rate of the fluid [m^3/s]
      D1 : float, optional
          Diameter of the pipe before the valve [m]
      D2 : float, optional
          Diameter of the pipe after the valve [m]
      d : float, optional
          Diameter of 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; use default very cautiously!) []
      Fd : float, optional
          Valve style modifier (0.1 to 1; varies tremendously depending on the
          type of valve and position; do not use the default at all!) []
      allow_choked : bool, optional
          Overrides the automatic transition into the choked regime if this is
          False and returns as if choked flow does not exist
      allow_laminar : bool, optional
          Overrides the automatic transition into the laminar regime if this is
          False and returns as if laminar flow does not exist
      full_output : bool, optional
          If True, returns intermediate calculation values as
          well as Kv in the form of a dictionary containing 'Kv', 'Rev', 'choked',
          'FL', 'FLP', 'FR', 'FP', and 'laminar'. Some may be None if they are 
          not used in the calculation.
  
      Returns
      -------
      Kv : float
          Metric Kv valve flow coefficient (flow rate of water at a pressure drop  
          of 1 bar) [m^3/hr]
          
      Notes
      -----
      It is possible to use this model without any diameters specified; in that
      case, turbulent flow is assumed. Choked flow can still be modeled. This is
      not recommended. All three diameters need to be None for this to work. 
      `FL` and `Fd` are not used by the models when the diameters are not 
      specified.
  
      Examples
      --------
      From [1]_, matching example 1 for a globe, parabolic plug,
      flow-to-open valve.
  
      >>> size_control_valve_l(rho=965.4, Psat=70.1E3, Pc=22120E3, mu=3.1472E-4,
      ... P1=680E3, P2=220E3, Q=0.1, D1=0.15, D2=0.15, d=0.15,
      ... FL=0.9, Fd=0.46)
      164.9954763704956
  
      From [1]_, matching example 2 for a ball, segmented ball,
      flow-to-open valve.
  
      >>> size_control_valve_l(rho=965.4, Psat=70.1E3, Pc=22120E3, mu=3.1472E-4,
      ... P1=680E3, P2=220E3, Q=0.1, D1=0.1, D2=0.1, d=0.1,
      ... FL=0.6, Fd=0.98)
      238.05817216710483
      
      References
      ----------
      .. [1] IEC 60534-2-1 / ISA-75.01.01-2007
      '''
      if full_output:
          ans = {'FLP': None, 'FP': None, 'FR': None}
      # Pa to kPa, according to constants in standard
      P1, P2, Psat, Pc = P1/1000., P2/1000., Psat/1000., Pc/1000.
      Q = Q*3600. # m^3/s to m^3/hr, according to constants in standard
      nu = mu/rho # kinematic viscosity used in standard
  
      dP = P1 - P2
      FF = FF_critical_pressure_ratio_l(Psat=Psat, Pc=Pc)
      choked = is_choked_turbulent_l(dP=dP, P1=P1, Psat=Psat, FF=FF, FL=FL)
      if choked and allow_choked:
          # Choked flow, equation 3
          C = Q/N1/FL*(rho/rho0/(P1 - FF*Psat))**0.5
      else:
          # non-choked flow, eq 1
          C = Q/N1*(rho/rho0/dP)**0.5
      if D1 is None and D2 is None and d is None:
          # Assume turbulent if no diameters are provided, no other calculations
          Rev = 1e5
      else:
          # m to mm, according to constants in standard
          D1, D2, d = D1*1000., D2*1000., d*1000.
          Rev = Reynolds_valve(nu=nu, Q=Q, D1=D1, FL=FL, Fd=Fd, C=C)
          # normal calculation path
          if (Rev > 10000 or not allow_laminar) and (D1 != d or D2 != d):
              # liquid, using Fp and FLP
              FP = 1
              Ci = C
              def iterate_piping_turbulent(Ci):
                  loss = loss_coefficient_piping(d, D1, D2)
                  FP = (1 + loss/N2*(Ci/d**2)**2)**-0.5
                  loss_upstream = loss_coefficient_piping(d, D1)
                  FLP = FL*(1 + FL**2/N2*loss_upstream*(Ci/d**2)**2)**-0.5
                  choked = is_choked_turbulent_l(dP, P1, Psat, FF, FLP=FLP, FP=FP)
                  if choked:
                      # Choked flow with piping, equation 4
                      C = Q/N1/FLP*(rho/rho0/(P1-FF*Psat))**0.5
                  else:
                      # Non-Choked flow with piping, equation 4
                      C = Q/N1/FP*(rho/rho0/dP)**0.5
                  if Ci/C < 0.99:
                      C = iterate_piping_turbulent(C)
                      
                  if full_output:
                      ans['FLP'] = FLP
                      ans['FP'] = FP
                  return C
      
              C = iterate_piping_turbulent(Ci)
          elif Rev <= 10000 and allow_laminar:
              # Laminar
              def iterate_piping_laminar(C):
                  Ci = 1.3*C
                  Rev = Reynolds_valve(nu=nu, Q=Q, D1=D1, FL=FL, Fd=Fd, C=Ci)                
                  if Ci/d**2 > 0.016*N18:
                      FR = Reynolds_factor(FL=FL, C=Ci, d=d, Rev=Rev, full_trim=False)
                  else:
                      FR = Reynolds_factor(FL=FL, C=Ci, d=d, Rev=Rev, full_trim=True)
                  if C/FR >= Ci:
                      Ci = iterate_piping_laminar(Ci) # pragma: no cover
                      
                  if full_output:
                      ans['Rev'] = Rev
                      ans['FR'] = FR
                  return Ci
              C = iterate_piping_laminar(C)
      if full_output:
          ans['FF'] = FF
          ans['choked'] = choked
          ans['Kv'] = C
          ans['laminar'] = Rev <= 10000
          
          # For the laminar case this is already set and needs to not be overwritten
          if 'Rev' not in ans:
              ans['Rev'] = Rev
          return ans
      else:
          return C