Chemical Equilibrium Calculator - Professional thermodynamic analysis software with NASA CEA2 integration
Chemical Equilibrium Calculator
Professional Thermodynamic Analysis Software with NASA CEA2 Integration
📌 What is Chemical Equilibrium Calculator?
Chemical Equilibrium Calculator is a professional-grade desktop application for thermodynamic equilibrium calculations in chemical systems. Built with a modular MVC architecture, it provides precise equilibrium composition analysis, thermodynamic property calculations, and comprehensive performance evaluation.
The software integrates with NASA's CEA2 (Chemical Equilibrium with Applications) for high-precision calculations while maintaining a robust fallback ideal gas calculator when CEA2 is unavailable.
Target Users
- Chemists studying chemical equilibrium
- Chemical Engineers designing reactors
- Aerospace Engineers analyzing propulsion
- Researchers publishing thermodynamic data
- Python Developers building scientific apps
Key Metrics
- 129 Oxidizers + 397 Fuels database
- Real-time calculation in <1 second
- 25+ analysis tools included
- Export to CSV/Excel formats
- English & French interfaces
Architecture
Modular MVC architecture with separation of concerns:
Chemical-Equilibrium-Calculator/
├── main.py # Entry point
├── requirements.txt # Dependencies
├── config/ # Configuration files
├── database/ # Species database (129 oxidizers + 397 fuels)
├── engine/ # Calculation logic (CEA2 + fallback)
├── models/ # Data layer
└── ui/ # User interface
├── main_window.py # Main window controller
├── styles.py # QSS styling
├── widgets/ # UI components
│ ├── input_panel.py # Formulation input
│ ├── results_tabs.py # Results display
│ └── toast.py # Notifications
└── dialogs/ # Popup dialogs
├── user_defined_reactant_dialog.py
├── nozzle_dialog.py
└── batch_sweep_dialog.py
Equilibrium Calculations
Complex multi-species chemical equilibrium analysis using free-energy minimization. Supports both equilibrium and frozen chemistry modes.
Thermodynamic Properties
Calculate temperature, pressure, enthalpy, entropy, specific heat, molecular weight, and transport properties.
Nozzle Designer
Isentropic flow analysis, throat/exit diameter calculation, Mach number distribution, and nozzle contour generation.
Batch Sweep
Parametric studies across O/F ratios, chamber pressures, and area ratios. Identify optimal performance points.
Advanced Visualization
Interactive bar charts, radar plots, pie charts, and Isp vs O/F ratio graphs with Matplotlib.
User-Defined Reactants
Create custom chemical species with atomic composition, saved to database for reuse across sessions.
Export Capabilities
Export results to CSV and Excel formats with formatted tables and multi-sheet workbooks.
Multi-Language
English and French interfaces with real-time switching without application restart.
Analysis Tools (25+)
🚀 Nozzle & Geometry
- Nozzle Designer
- Chamber Sizer
- Contraction Ratio
🔥 Thermal & Cooling
- Heat Transfer (Bartz)
- Regenerative Cooling
- Instability Predictor
🌍 Mission & Performance
- Delta-V Calculator
- Orbit Insertion ΔV
- Staging Optimiser
📊 Advanced Analysis
- Sensitivity Analysis
- Design of Experiments
- Composition vs T
⚡ Chemical Equilibrium Fundamentals
Chemical equilibrium occurs when the forward and reverse reaction rates are equal, resulting in no net change in species concentrations.
ΔG° = -RT ln K
Equilibrium Constant:
K = exp(-ΔG°/RT)
Van't Hoff Equation:
d(ln K)/dT = ΔH°/(RT²)
📐 Rocket Performance Parameters
Characteristic Velocity: C* = Pc × At / ṁ
Thrust Coefficient: Cf = F / (Pc × At)
📊 Isentropic Flow Relations
A/A* = (1/M) × [(2/(γ+1)) × (1 + (γ-1)M²/2)]^((γ+1)/(2(γ-1)))
Temperature Ratio: T/T₀ = 1 / (1 + (γ-1)M²/2)
Pressure Ratio: P/P₀ = (T/T₀)^{γ/(γ-1)}
📋 System Requirements
| Requirement | Minimum | Recommended |
|---|---|---|
| Python | 3.11 | 3.13 |
| RAM | 2 GB | 4 GB |
| Disk | 200 MB | 500 MB |
| Display | 1280×720 | 1920×1080 |
🐍 Dependencies
🚀 Installation Commands
# Clone repository
git clone https://github.com/khadev/Chemical-Equilibrium-Calculator.git
cd Chemical-Equilibrium-Calculator
# Create virtual environment (optional)
python -m venv venv
# Windows: venv\Scripts\activate
# Linux/Mac: source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Run application
python main.py
# Optional: Install NASA CEA2 for high-precision calculations
pip install cea
📦 Standalone Executable (PyInstaller)
pip install pyinstaller
pyinstaller --windowed --onefile --name ChemicalEquilibrium main.py
# Output: dist/ChemicalEquilibrium.exe
🔧 CEAResult Class
class CEAResult:
# Performance
isp_vac: float # Vacuum specific impulse (s)
isp_ms: float # Specific impulse (m/s)
cstar: float # Characteristic velocity (m/s)
cf: float # Thrust coefficient
cf_vac: float # Vacuum thrust coefficient
ae_at: float # Area ratio Ae/At
# Thermodynamic
t_chamber: float # Chamber temperature (K)
t_throat: float # Throat temperature (K)
t_exit: float # Exit temperature (K)
p_chamber: float # Chamber pressure (bar)
p_exit: float # Exit pressure (bar)
gamma: float # Specific heat ratio
mw: float # Molecular weight (g/mol)
mach_exit: float # Exit Mach number
# Species
mass_fractions: Dict[str, float]
⚡ CEAWorker Thread
class CEAWorker(QThread):
result_ready = Signal(object) # CEAResult
data_parsed = Signal(object) # For plots
engine_error = Signal(str)
log_message = Signal(str)
def __init__(self, formulation: Formulation):
# Runs CEA or fallback in background thread
🗄️ Species Database
| Category | Count |
|---|---|
| Oxidizers | 129 species |
| Fuels | 397 species |
| Named Fuels | 10 presets (HTPB, MCCN, etc.) |
| Elements | 70+ elements |
📁 Database Files
database/
├── databasecea.txt # NASA CEA species database (immutable)
├── user_custom.json # User-defined custom species
└── saved_udrs.json # Saved user-defined reactants
config/
├── config.json # User settings (paths, units, language)
└── translations.json # English/French translations
🤝 Contribution Guidelines
- Fork the repository
- Create a feature branch (git checkout -b feature/amazing-feature)
- Commit changes (git commit -m 'Add amazing feature')
- Push to branch (git push origin feature/amazing-feature)
- Open a Pull Request
📝 Code Style
- Follow PEP 8 with 120 character line length
- Use type hints for all function signatures
- Add docstrings to all public methods (Google style)
- Maintain test coverage > 80%
📧 Commit Message Format
Types: feat, fix, docs, style, refactor, test, chore
Example:
feat(tafel): add automatic outlier detection

Post a Comment