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.

🚀 Getting Started

New to the library? Start here for installation and quick start guides.

Getting Started
📚 User Guides

Comprehensive guides and tutorials for using the library.

User Guides
💡 Examples

Practical examples demonstrating real-world applications.

Examples
🔧 API Reference

Complete API documentation for all classes and functions.

API Reference

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:

  1. 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}\]
  2. Entropy Balance (Second Law of Thermodynamics): Quantifies irreversibilities

    \[\begin{split}\\sum \\dot{S}_{in} + \\dot{S}_{gen} = \\sum \\dot{S}_{out}\end{split}\]
  3. 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

Heat Pump Systems

  • Air-source and ground-source heat pumps in both heating and cooling modes

Dynamic System Models

Auxiliary Components

  • Fan - Air handling fans with performance curves

  • Pump - Fluid circulation pumps

Indices and tables