STAGNATION_ENERGY
Overview
Calculate the increase in enthalpy due to fluid velocity.
Excel Usage
=STAGNATION_ENERGY(velocity)
velocity(float, required): Velocity of the fluid [m/s]
Returns (float): Increase in enthalpy due to fluid velocity [J/kg]
Examples
Example 1: High speed flow (125 m/s)
Inputs:
| velocity |
|---|
| 125 |
Excel formula:
=STAGNATION_ENERGY(125)
Expected output:
7812.5
Example 2: Low speed flow (10 m/s)
Inputs:
| velocity |
|---|
| 10 |
Excel formula:
=STAGNATION_ENERGY(10)
Expected output:
50
Example 3: Supersonic flow (400 m/s)
Inputs:
| velocity |
|---|
| 400 |
Excel formula:
=STAGNATION_ENERGY(400)
Expected output:
80000
Example 4: Subsonic flow (50 m/s)
Inputs:
| velocity |
|---|
| 50 |
Excel formula:
=STAGNATION_ENERGY(50)
Expected output:
1250
Python Code
from fluids.compressible import stagnation_energy as fluids_stag_e
def stagnation_energy(velocity):
"""
Calculate the increase in enthalpy due to fluid velocity.
See: https://fluids.readthedocs.io/fluids.compressible.html#fluids.compressible.stagnation_energy
This example function is provided as-is without any representation of accuracy.
Args:
velocity (float): Velocity of the fluid [m/s]
Returns:
float: Increase in enthalpy due to fluid velocity [J/kg]
"""
try:
velocity = float(velocity)
if velocity == 0:
return 0.0
result = fluids_stag_e(V=abs(velocity))
return float(result)
except Exception as e:
return f"Error: {str(e)}"