NU_CONV_INT

Excel Usage

=NU_CONV_INT(Re, Pr, eD, Di, x, fd, Method)
  • Re (float, required): Reynolds number (-)
  • Pr (float, required): Prandtl number (-)
  • eD (float, optional, default: 0): Relative roughness (-). Default 0.
  • Di (float, optional, default: null): Inside diameter (m). Optional.
  • x (float, optional, default: null): Length from inlet (m). Optional.
  • fd (float, optional, default: null): Darcy friction factor (-). Optional.
  • Method (str, optional, default: null): Specific correlation name. Optional.

Returns (float): Nusselt number (-)

Examples

Example 1: Turbulent pipe flow

Inputs:

Re Pr
100000 0.7

Excel formula:

=NU_CONV_INT(100000, 0.7)

Expected output:

183.71058

Example 2: Laminar pipe flow

Inputs:

Re Pr
1000 0.7

Excel formula:

=NU_CONV_INT(1000, 0.7)

Expected output:

3.66

Example 3: Developing laminar flow

Inputs:

Re Pr Di x
1000 0.7 0.1 0.5

Excel formula:

=NU_CONV_INT(1000, 0.7, 0.1, 0.5)

Expected output:

8.15944

Example 4: Specific method (Gnielinski)

Inputs:

Re Pr Method
100000 0.7 Gnielinski

Excel formula:

=NU_CONV_INT(100000, 0.7, "Gnielinski")

Expected output:

178.59894

Python Code

from ht.conv_internal import Nu_conv_internal

def nu_conv_int(Re, Pr, eD=0, Di=None, x=None, fd=None, Method=None):
    """
    Nusselt number for internal convection in a circular pipe.

    See: https://ht.readthedocs.io/en/latest/ht.conv_internal.html#ht.conv_internal.Nu_conv_internal

    This example function is provided as-is without any representation of accuracy.

    Args:
        Re (float): Reynolds number (-)
        Pr (float): Prandtl number (-)
        eD (float, optional): Relative roughness (-). Default 0. Default is 0.
        Di (float, optional): Inside diameter (m). Optional. Default is None.
        x (float, optional): Length from inlet (m). Optional. Default is None.
        fd (float, optional): Darcy friction factor (-). Optional. Default is None.
        Method (str, optional): Specific correlation name. Optional. Default is None.

    Returns:
        float: Nusselt number (-)
    """
    try:
      def to_optional_float(value):
        if value is None:
          return None
        if isinstance(value, str) and value.strip() == "":
          return None
        return float(value)

      Re = float(Re)
      Pr = float(Pr)
      eD = float(eD)

      if Re <= 0:
        return "Error: Re must be positive"
      if Pr <= 0:
        return "Error: Pr must be positive"
      if eD < 0:
        return "Error: eD must be non-negative"

      Di = to_optional_float(Di)
      x = to_optional_float(x)
      fd = to_optional_float(fd)

      if Di is not None and Di <= 0:
        return "Error: Di must be positive"
      if x is not None and x <= 0:
        return "Error: x must be positive"
      if fd is not None and fd <= 0:
        return "Error: fd must be positive"

      Method = None if Method in (None, "") else str(Method)

      return float(Nu_conv_internal(Re=Re, Pr=Pr, eD=eD, Di=Di, x=x, fd=fd, Method=Method))
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator