ISENTROPIC_T_RISE
Overview
Calculate the temperature rise for isentropic compression or expansion.
Excel Usage
=ISENTROPIC_T_RISE(temp_init, p_inlet, p_outlet, k_isentropic, efficiency)
temp_init(float, required): Initial temperature of gas [K]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) [-]efficiency(float, optional, default: 1): Isentropic efficiency of the process [-]
Returns (float): Final temperature of gas after compression/expansion [K]
Examples
Example 1: Compression with 8x pressure ratio
Inputs:
| temp_init | p_inlet | p_outlet | k_isentropic |
|---|---|---|---|
| 286.8 | 54050 | 432400 | 1.4 |
Excel formula:
=ISENTROPIC_T_RISE(286.8, 54050, 432400, 1.4)
Expected output:
519.5230938217768
Example 2: Compression with 80% efficiency
Inputs:
| temp_init | p_inlet | p_outlet | k_isentropic | efficiency |
|---|---|---|---|---|
| 300 | 100000 | 500000 | 1.4 | 0.8 |
Excel formula:
=ISENTROPIC_T_RISE(300, 100000, 500000, 1.4, 0.8)
Expected output:
518.9323532874671
Example 3: Expansion cooling
Inputs:
| temp_init | p_inlet | p_outlet | k_isentropic |
|---|---|---|---|
| 500 | 1000000 | 100000 | 1.4 |
Excel formula:
=ISENTROPIC_T_RISE(500, 1000000, 100000, 1.4)
Expected output:
258.9737339615606
Example 4: Small pressure ratio
Inputs:
| temp_init | p_inlet | p_outlet | k_isentropic |
|---|---|---|---|
| 300 | 100000 | 150000 | 1.3 |
Excel formula:
=ISENTROPIC_T_RISE(300, 100000, 150000, 1.3)
Expected output:
329.4258681436649
Python Code
import micropip
await micropip.install(["fluids"])
from fluids.compressible import isentropic_T_rise_compression as fluids_t_rise
def isentropic_t_rise(temp_init, p_inlet, p_outlet, k_isentropic, efficiency=1):
"""
Calculate the temperature rise for isentropic compression or expansion.
See: https://fluids.readthedocs.io/fluids.compressible.html#fluids.compressible.isentropic_T_rise_compression
This example function is provided as-is without any representation of accuracy.
Args:
temp_init (float): Initial temperature of gas [K]
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) [-]
efficiency (float, optional): Isentropic efficiency of the process [-] Default is 1.
Returns:
float: Final temperature of gas after compression/expansion [K]
"""
# Validate and convert inputs
try:
temp_init = float(temp_init)
except (ValueError, TypeError):
return "Invalid input: temp_init must be a number."
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:
efficiency = float(efficiency)
except (ValueError, TypeError):
return "Invalid input: efficiency must be a number."
# Validation
if temp_init <= 0:
return "Invalid input: temp_init must be positive."
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 efficiency <= 0 or efficiency > 1:
return "Invalid input: efficiency must be between 0 and 1."
try:
result = fluids_t_rise(T1=temp_init, P1=p_inlet, P2=p_outlet, k=k_isentropic, eta=efficiency)
return float(result)
except Exception as e:
return f"Error: Failed to compute isentropic temperature rise: {str(e)}"