CD_GRAF

Overview

Calculate drag coefficient of a sphere using the Graf correlation.

Excel Usage

=CD_GRAF(Re)
  • Re (float, required): Particle Reynolds number [-]

Returns (float): Drag coefficient [-], or error message (str) if input is invalid.

Examples

Example 1: Reynolds number of 200

Inputs:

Re
200

Excel formula:

=CD_GRAF(200)

Expected output:

0.8521

Example 2: Reynolds number of 1000

Inputs:

Re
1000

Excel formula:

=CD_GRAF(1000)

Expected output:

0.4978

Example 3: Reynolds number of 10000

Inputs:

Re
10000

Excel formula:

=CD_GRAF(10000)

Expected output:

0.3247

Example 4: Reynolds number of 100

Inputs:

Re
100

Excel formula:

=CD_GRAF(100)

Expected output:

1.1536

Python Code

from fluids.drag import Graf as fluids_Graf

def cd_graf(Re):
    """
    Calculate drag coefficient of a sphere using the Graf correlation.

    See: https://fluids.readthedocs.io/fluids.drag.html#fluids.drag.Graf

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

    Args:
        Re (float): Particle Reynolds number [-]

    Returns:
        float: Drag coefficient [-], or error message (str) if input is invalid.
    """
    try:
      Re = float(Re)
      if Re <= 0:
        return "Error: Re must be positive."

      result = fluids_Graf(Re=Re)
      if result != result:  # NaN check
        return "Error: Calculation resulted in NaN."
      return float(result)
    except (ValueError, TypeError):
      return "Error: Re must be a number."
    except Exception as e:
      return f"Error: {str(e)}"

Online Calculator