CONTRACTION_ROUND
Overview
Calculate the loss coefficient (K) for a rounded pipe contraction (reducer).
Excel Usage
=CONTRACTION_ROUND(Di_large, Di_small, rc, con_rnd_method)
Di_large(float, required): Inside diameter of original (larger) pipe [m]Di_small(float, required): Inside diameter of following (smaller) pipe [m]rc(float, required): Radius of curvature of the contraction [m]con_rnd_method(str, optional, default: “Rennels”): Calculation method
Returns (float): Loss coefficient K for the rounded contraction [-]
Examples
Example 1: Basic rounded contraction
Inputs:
| Di_large | Di_small | rc |
|---|---|---|
| 1 | 0.4 | 0.04 |
Excel formula:
=CONTRACTION_ROUND(1, 0.4, 0.04)
Expected output:
| Result |
|---|
| 0.1783 |
Example 2: Rounded contraction with Miller method
Inputs:
| Di_large | Di_small | rc | con_rnd_method |
|---|---|---|---|
| 1 | 0.4 | 0.04 | Miller |
Excel formula:
=CONTRACTION_ROUND(1, 0.4, 0.04, "Miller")
Expected output:
| Result |
|---|
| 0.0857 |
Example 3: Large radius of curvature
Inputs:
| Di_large | Di_small | rc |
|---|---|---|
| 0.5 | 0.2 | 0.1 |
Excel formula:
=CONTRACTION_ROUND(0.5, 0.2, 0.1)
Expected output:
| Result |
|---|
| 0.0374 |
Example 4: Small radius of curvature
Inputs:
| Di_large | Di_small | rc |
|---|---|---|
| 0.5 | 0.2 | 0.01 |
Excel formula:
=CONTRACTION_ROUND(0.5, 0.2, 0.01)
Expected output:
| Result |
|---|
| 0.2672 |
Python Code
import micropip
await micropip.install(["fluids"])
from fluids.fittings import contraction_round as fluids_contraction_round
def contraction_round(Di_large, Di_small, rc, con_rnd_method='Rennels'):
"""
Calculate the loss coefficient (K) for a rounded pipe contraction (reducer).
See: https://fluids.readthedocs.io/fluids.fittings.html#fluids.fittings.contraction_round
This example function is provided as-is without any representation of accuracy.
Args:
Di_large (float): Inside diameter of original (larger) pipe [m]
Di_small (float): Inside diameter of following (smaller) pipe [m]
rc (float): Radius of curvature of the contraction [m]
con_rnd_method (str, optional): Calculation method Valid options: Rennels, Miller, Idelchik. Default is 'Rennels'.
Returns:
float: Loss coefficient K for the rounded contraction [-]
"""
try:
Di1 = float(Di_large)
Di2 = float(Di_small)
rc = float(rc)
except (ValueError, TypeError):
return "Error: Di_large, Di_small, and rc must be numbers."
if Di1 <= 0 or Di2 <= 0:
return "Error: Diameters must be positive."
if Di2 >= Di1:
return "Error: Di_small must be less than Di_large."
if rc < 0:
return "Error: Rc must be non-negative."
try:
result = fluids_contraction_round(Di1=Di1, Di2=Di2, rc=rc, method=con_rnd_method)
return float(result)
except Exception as e:
return f"Error: {str(e)}"