Energy-Exergy Analysis Engine [TEST]¶
Comprehensive thermodynamic modeling for diverse energy systems through unified energy-exergy analysis
This Python library enables simultaneous energy (first-law) and exergy (second-law) analysis of various energy conversion systems. Built for researchers, engineers, and educators who need to understand not just how much energy flows through a system, but also the quality and potential of that energy.
New to the library? Start here for installation and quick start guides.
Comprehensive guides and tutorials for using the library.
Practical examples demonstrating real-world applications.
Complete API documentation for all classes and functions.
Why Energy-Exergy Analysis?¶
Traditional energy analysis tells you how much energy is used, but not how well it’s used. Exergy analysis reveals the true thermodynamic efficiency by accounting for energy quality and identifying where irreversibilities occur. Together, energy-exergy analysis provides:
✓ Complete thermodynamic picture: Understand both quantity (energy) and quality (exergy) of energy flows
✓ Inefficiency identification: Pinpoint where and why energy is being destroyed
✓ Technology comparison: Fair comparison between different energy conversion technologies
✓ Optimization guidance: Identify the most promising areas for system improvement
Core Capabilities¶
Unified Balance Calculations¶
Every component model automatically calculates three balances:
Energy Balance (First Law of Thermodynamics): Identifies energy flows and losses
\[\begin{split}\\sum \\dot{E}_{in} = \\sum \\dot{E}_{out} + \\dot{E}_{loss}\end{split}\]Entropy Balance (Second Law of Thermodynamics): Quantifies irreversibilities
\[\begin{split}\\sum \\dot{S}_{in} + \\dot{S}_{gen} = \\sum \\dot{S}_{out}\end{split}\]Exergy Balance (Both First and Second Law): Reveals thermodynamic inefficiencies
\[\begin{split}\\sum \\dot{X}_{in} = \\sum \\dot{X}_{out} + \\dot{X}_{destroyed}\end{split}\]where exergy destruction is related to entropy generation:
\[\begin{split}\\dot{X}_{destroyed} = T_0 \\cdot \\dot{S}_{gen}\end{split}\]
Quick Start Example¶
Here’s a simple example to get you started:
import enex_analysis_engine as enex
# Create an electric boiler instance
EB = enex.ElectricBoiler()
# Set the reference temperature (in Celsius)
EB.T0 = 10
EB.T_w_tank = 60
EB.T_w_sup = 10
EB.T_w_serv = 45
EB.dV_w_serv = 1.2 # L/min
# Update the system calculations
EB.system_update()
# Print the exergy balance
enex.print_balance(EB.exergy_balance)
# Access results
print(f"Electric power input: {EB.E_heater:.2f} W")
print(f"Exergy efficiency: {EB.X_eff:.4f}")
Energy Systems Supported¶
The library provides models for a wide range of energy conversion systems:
Domestic Hot Water (DHW) Systems
ElectricBoiler- Electric resistance heatingGasBoiler- Natural gas combustion boilerHeatPumpBoiler- Air-source heat pumpSolarAssistedGasBoiler- Hybrid solar+gas systemGroundSourceHeatPumpBoiler- Ground-source heat pump
Heat Pump Systems
Air-source and ground-source heat pumps in both heating and cooling modes
Dynamic System Models
ElectricHeater- Transient heat transfer analysis
Auxiliary Components