GRASHOF

Excel Usage

=GRASHOF(L, beta, T_film, T_bulk, rho, mu, nu, g)
  • L (float, required): Characteristic length [m]
  • beta (float, required): Volumetric thermal expansion coefficient [1/K]
  • T_film (float, required): Temperature 1 (film temperature) [K]
  • T_bulk (float, optional, default: 0): Temperature 2 (bulk temperature or 0) [K]
  • rho (float, optional, default: null): Density [kg/m^3]
  • mu (float, optional, default: null): Dynamic viscosity [Pa*s]
  • nu (float, optional, default: null): Kinematic viscosity [m^2/s]
  • g (float, optional, default: 9.80665): Acceleration due to gravity [m/s^2]

Returns (float): Grashof number [-]

Examples

Example 1: Example with rho and mu

Inputs:

L beta T_film rho mu
0.9144 0.000933 178.2 1.1613 0.000019

Excel formula:

=GRASHOF(0.9144, 0.000933, 178.2, 1.1613, 0.000019)

Expected output:

4656936556.178915

Example 2: Example with nu and temperature difference

Inputs:

L beta T_film T_bulk nu
0.9144 0.000933 378.2 200 0.00001636

Excel formula:

=GRASHOF(0.9144, 0.000933, 378.2, 200, 0.00001636)

Expected output:

4657491516.530312

Example 3: Larger characteristic length

Inputs:

L beta T_film rho mu
1.5 0.0008 200 1.2 0.00002

Excel formula:

=GRASHOF(1.5, 0.0008, 200, 1.2, 0.00002)

Expected output:

19064127599.99999

Example 4: Smaller characteristic length

Inputs:

L beta T_film nu
0.1 0.001 150 0.000015

Excel formula:

=GRASHOF(0.1, 0.001, 150, 0.000015)

Expected output:

6537766.66667

Python Code

from fluids.core import Grashof as fluids_Grashof

def grashof(L, beta, T_film, T_bulk=0, rho=None, mu=None, nu=None, g=9.80665):
    """
    Calculate the Grashof number.

    See: https://fluids.readthedocs.io/fluids.core.html#fluids.core.Grashof

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

    Args:
        L (float): Characteristic length [m]
        beta (float): Volumetric thermal expansion coefficient [1/K]
        T_film (float): Temperature 1 (film temperature) [K]
        T_bulk (float, optional): Temperature 2 (bulk temperature or 0) [K] Default is 0.
        rho (float, optional): Density [kg/m^3] Default is None.
        mu (float, optional): Dynamic viscosity [Pa*s] Default is None.
        nu (float, optional): Kinematic viscosity [m^2/s] Default is None.
        g (float, optional): Acceleration due to gravity [m/s^2] Default is 9.80665.

    Returns:
        float: Grashof number [-]
    """
    try:
        L_val = float(L)
        beta_val = float(beta)
        T_film_val = float(T_film)
        T_bulk_val = float(T_bulk) if T_bulk is not None else 0
    except Exception:
        return "Error: L, beta, T_film, and T_bulk must be numeric values."

    # Validate physical meaning
    if L_val <= 0:
        return "Error: Characteristic length must be positive."
    if beta_val <= 0:
        return "Error: Volumetric thermal expansion coefficient must be positive."

    # Check if nu is provided
    if nu is not None:
        try:
            nu_val = float(nu)
        except Exception:
            return "Error: nu must be a numeric value."
        if nu_val <= 0:
            return "Error: Kinematic viscosity must be positive."
        try:
            g_val = float(g) if g is not None else 9.80665
            result = fluids_Grashof(L_val, beta_val, T_film_val, T_bulk_val, nu=nu_val, g=g_val)
            return float(result)
        except Exception as e:
            return f"Error: Failed to calculate Grashof number: {str(e)}"

    # Otherwise, need rho and mu
    if None in (rho, mu):
        return "Error: must provide either nu or both rho and mu."
    try:
        rho_val = float(rho)
        mu_val = float(mu)
        g_val = float(g) if g is not None else 9.80665
    except Exception:
        return "Error: rho, mu, and g must be numeric values."
    if rho_val <= 0 or mu_val <= 0:
        return "Error: rho and mu must both be positive."
    try:
        result = fluids_Grashof(L_val, beta_val, T_film_val, T_bulk_val, rho=rho_val, mu=mu_val, g=g_val)
        return float(result)
    except Exception as e:
        return f"Error: Failed to calculate Grashof number: {str(e)}"

Online Calculator