ISENTROPIC_EFF
Overview
Convert between isentropic and polytropic efficiency for compression.
Excel Usage
=ISENTROPIC_EFF(p_inlet, p_outlet, k_isentropic, eta_poly)
p_inlet(float, required): Initial pressure of gas [Pa]p_outlet(float, required): Final pressure of gas [Pa]k_isentropic(float, required): Isentropic exponent of the gas (Cp/Cv) [-]eta_poly(float, required): Polytropic efficiency of the process [-]
Returns (float): Isentropic efficiency calculated from polytropic efficiency [-]
Examples
Example 1: 10x compression with 78% polytropic efficiency
Inputs:
| p_inlet | p_outlet | k_isentropic | eta_poly |
|---|---|---|---|
| 100000 | 1000000 | 1.4 | 0.78 |
Excel formula:
=ISENTROPIC_EFF(100000, 1000000, 1.4, 0.78)
Expected output:
0.7027614191263858
Example 2: 5x compression with 85% polytropic efficiency
Inputs:
| p_inlet | p_outlet | k_isentropic | eta_poly |
|---|---|---|---|
| 100000 | 500000 | 1.4 | 0.85 |
Excel formula:
=ISENTROPIC_EFF(100000, 500000, 1.4, 0.85)
Expected output:
0.8134564953798419
Example 3: High efficiency compressor
Inputs:
| p_inlet | p_outlet | k_isentropic | eta_poly |
|---|---|---|---|
| 100000 | 300000 | 1.3 | 0.92 |
Excel formula:
=ISENTROPIC_EFF(100000, 300000, 1.3, 0.92)
Expected output:
0.9094730418849563
Example 4: Different gas (lower k)
Inputs:
| p_inlet | p_outlet | k_isentropic | eta_poly |
|---|---|---|---|
| 100000 | 400000 | 1.2 | 0.8 |
Excel formula:
=ISENTROPIC_EFF(100000, 400000, 1.2, 0.8)
Expected output:
0.7762548175131004
Python Code
import micropip
await micropip.install(["fluids"])
from fluids.compressible import isentropic_efficiency as fluids_isen_eff
def isentropic_eff(p_inlet, p_outlet, k_isentropic, eta_poly):
"""
Convert between isentropic and polytropic efficiency for compression.
See: https://fluids.readthedocs.io/fluids.compressible.html#fluids.compressible.isentropic_efficiency
This example function is provided as-is without any representation of accuracy.
Args:
p_inlet (float): Initial pressure of gas [Pa]
p_outlet (float): Final pressure of gas [Pa]
k_isentropic (float): Isentropic exponent of the gas (Cp/Cv) [-]
eta_poly (float): Polytropic efficiency of the process [-]
Returns:
float: Isentropic efficiency calculated from polytropic efficiency [-]
"""
# Validate and convert inputs
try:
p_inlet = float(p_inlet)
except (ValueError, TypeError):
return "Invalid input: p_inlet must be a number."
try:
p_outlet = float(p_outlet)
except (ValueError, TypeError):
return "Invalid input: p_outlet must be a number."
try:
k_isentropic = float(k_isentropic)
except (ValueError, TypeError):
return "Invalid input: k_isentropic must be a number."
try:
eta_poly = float(eta_poly)
except (ValueError, TypeError):
return "Invalid input: eta_poly must be a number."
# Validation
if p_inlet <= 0:
return "Invalid input: p_inlet must be positive."
if p_outlet <= 0:
return "Invalid input: p_outlet must be positive."
if k_isentropic <= 1:
return "Invalid input: k_isentropic must be greater than 1."
if eta_poly <= 0 or eta_poly > 1:
return "Invalid input: eta_poly must be between 0 and 1."
try:
result = fluids_isen_eff(P1=p_inlet, P2=p_outlet, k=k_isentropic, eta_p=eta_poly)
return float(result)
except Exception as e:
return f"Error: Failed to compute isentropic efficiency: {str(e)}"