RND_EDGE_GRILL
Overview
Calculate the loss coefficient for a rounded edge grill or perforated plate.
Excel Usage
=RND_EDGE_GRILL(alpha, l, Dh, fd)
alpha(float, required): Fraction of grill open to flow (must be 0.3-0.7), [-]l(float, optional, default: null): Thickness of the grill or plate, [m]Dh(float, optional, default: null): Hydraulic diameter of gap in grill, [m]fd(float, optional, default: null): Darcy friction factor, [-]
Returns (float): Loss coefficient K, [-], or error message (str) if input is invalid.
Examples
Example 1: Basic case (alpha=0.4)
Inputs:
| alpha |
|---|
| 0.4 |
Excel formula:
=RND_EDGE_GRILL(0.4)
Expected output:
1
Example 2: With friction correction (l, Dh, fd provided)
Inputs:
| alpha | l | Dh | fd |
|---|---|---|---|
| 0.4 | 0.15 | 0.002 | 0.0185 |
Excel formula:
=RND_EDGE_GRILL(0.4, 0.15, 0.002, 0.0185)
Expected output:
9.6719
Example 3: Mid-range open area (alpha=0.5)
Inputs:
| alpha |
|---|
| 0.5 |
Excel formula:
=RND_EDGE_GRILL(0.5)
Expected output:
0.6
Example 4: Higher alpha (alpha=0.7)
Inputs:
| alpha |
|---|
| 0.7 |
Excel formula:
=RND_EDGE_GRILL(0.7)
Expected output:
0.2
Python Code
from fluids.filters import round_edge_grill as fluids_round_edge_grill
def rnd_edge_grill(alpha, l=None, Dh=None, fd=None):
"""
Calculate the loss coefficient for a rounded edge grill or perforated plate.
See: https://fluids.readthedocs.io/fluids.filters.html#fluids.filters.round_edge_grill
This example function is provided as-is without any representation of accuracy.
Args:
alpha (float): Fraction of grill open to flow (must be 0.3-0.7), [-]
l (float, optional): Thickness of the grill or plate, [m] Default is None.
Dh (float, optional): Hydraulic diameter of gap in grill, [m] Default is None.
fd (float, optional): Darcy friction factor, [-] Default is None.
Returns:
float: Loss coefficient K, [-], or error message (str) if input is invalid.
"""
try:
# Validate and convert alpha
try:
alpha = float(alpha)
except (ValueError, TypeError):
return "Error: alpha must be a number."
# Validate alpha range (0.3 to 0.7 for round_edge_grill)
if alpha < 0.3 or alpha > 0.7:
return "Error: alpha must be between 0.3 and 0.7."
# Validate and convert optional parameters
if l is not None:
try:
l = float(l)
except (ValueError, TypeError):
return "Error: l must be a number."
if l <= 0:
return "Error: l must be positive."
if Dh is not None:
try:
Dh = float(Dh)
except (ValueError, TypeError):
return "Error: Dh must be a number."
if Dh <= 0:
return "Error: Dh must be positive."
if fd is not None:
try:
fd = float(fd)
except (ValueError, TypeError):
return "Error: fd must be a number."
if fd <= 0:
return "Error: fd must be positive."
result = fluids_round_edge_grill(alpha=alpha, l=l, Dh=Dh, fd=fd)
if result != result or result in (float('inf'), float('-inf')):
return "Error: Result is not finite."
return float(result)
except Exception as e:
return f"Error: {str(e)}"