RAYLEIGH
Excel Usage
=RAYLEIGH(Pr, Gr)
Pr(float, required): Prandtl number [-]Gr(float, required): Grashof number [-]
Returns (float): Rayleigh number [-]
Examples
Example 1: Simple example
Inputs:
| Pr | Gr |
|---|---|
| 1.2 | 4600000000 |
Excel formula:
=RAYLEIGH(1.2, 4600000000)
Expected output:
5520000000
Example 2: Moderate Pr and Gr values
Inputs:
| Pr | Gr |
|---|---|
| 0.71 | 1000000 |
Excel formula:
=RAYLEIGH(0.71, 1000000)
Expected output:
710000
Example 3: Large Prandtl number
Inputs:
| Pr | Gr |
|---|---|
| 10 | 1000000 |
Excel formula:
=RAYLEIGH(10, 1000000)
Expected output:
10000000
Example 4: Small Pr and Gr values
Inputs:
| Pr | Gr |
|---|---|
| 0.1 | 100 |
Excel formula:
=RAYLEIGH(0.1, 100)
Expected output:
10
Python Code
from fluids.core import Rayleigh as fluids_Rayleigh
def rayleigh(Pr, Gr):
"""
Calculate the Rayleigh number.
See: https://fluids.readthedocs.io/fluids.core.html#fluids.core.Rayleigh
This example function is provided as-is without any representation of accuracy.
Args:
Pr (float): Prandtl number [-]
Gr (float): Grashof number [-]
Returns:
float: Rayleigh number [-]
"""
try:
Pr_val = float(Pr)
Gr_val = float(Gr)
if Pr_val < 0 or Gr_val < 0:
return "Error: Pr and Gr must be non-negative values"
result = fluids_Rayleigh(Pr_val, Gr_val)
return float(result)
except Exception as e:
return f"Error: {str(e)}"