Thermodynamics for CAE Engineers
Laws, Entropy, Thermodynamic Cycles & Exergy Analysis
Thermodynamics is the science of energy, its transformations, and its fundamental limits. For CAE engineers working on internal combustion engines, gas turbines, HVAC systems, or any energy-converting device, thermodynamics sets the hard ceiling on what is physically achievable — no simulation can violate the second law. Understanding these principles deeply transforms how you interpret simulation results and design more efficient systems.
1. The Four Laws of Thermodynamics
I've heard there are actually four laws, numbered 0, 1, 2, and 3. Why does it start at zero? Did someone forget one?
Classic question. The zeroth law was actually recognized after the first and second, but physicists realized it was so fundamental it had to logically precede them — so they numbered it zero. It establishes that thermal equilibrium is transitive: if body A is in equilibrium with body C, and body B is also in equilibrium with body C, then A and B are in equilibrium with each other. That's what makes temperature a consistent, measurable quantity at all. Without it, thermometers wouldn't work.
1.1 Zeroth Law — Thermal Equilibrium
If $A \sim C$ and $B \sim C$ (where $\sim$ denotes thermal equilibrium), then $A \sim B$. This defines temperature as an equivalence class and justifies the use of thermometers.
1.2 First Law — Conservation of Energy
Energy cannot be created or destroyed, only converted between forms. For a closed system:
For an open system (control volume), the steady-flow energy equation is:
where $h = u + pv$ is the specific enthalpy, $\dot{W}_s$ is shaft work, and kinetic/potential energy terms are often negligible in most engineering devices except nozzles and pumps.
In a CFD simulation of a gas turbine, how does the first law actually show up? The solver doesn't explicitly write $Q - W$...
In CFD, the first law becomes the energy transport equation. The solver solves for total energy $E = u + V^2/2$ (internal plus kinetic) at each cell. The flux of this energy across cell faces — including pressure-work terms — plus viscous dissipation and heat conduction are all included. When you specify an adiabatic wall in Fluent or OpenFOAM, you're setting the heat flux $q = 0$, enforcing the first law boundary condition. The temperature you see in post-processing is a result of solving this energy equation consistently with mass and momentum.
1.3 Second Law — Irreversibility and Entropy
Every spontaneous process increases the total entropy of the universe:
The equality holds only for reversible (idealized) processes. This law dictates that heat cannot spontaneously flow from cold to hot, and that no heat engine can be 100% efficient.
1.4 Third Law — Absolute Zero
The entropy of a perfect crystal at absolute zero is zero:
This provides the absolute reference for entropy calculations and explains why achieving exactly 0 K is impossible — it would require infinite work to remove the last quantum of thermal energy.
| Law | Statement | CAE Implication |
|---|---|---|
| Zeroth | Thermal equilibrium is transitive | Justifies temperature boundary conditions |
| First | Energy is conserved | Energy equation in CFD/FEM solvers |
| Second | Entropy of universe always increases | Sets efficiency limits; direction of processes |
| Third | Entropy → 0 as T → 0 K | Low-temperature material property baseline |
2. Entropy: The Second Law in Depth
Entropy is always described as "disorder," but that feels too vague. In an engine simulation, how do I actually think about entropy generation?
Forget "disorder" — that's a pop-science simplification. In engineering, entropy generation is directly proportional to lost work. Every irreversibility in your system — viscous friction in the fluid, heat transfer across a finite temperature difference, mixing of two different fluids — creates entropy, and that created entropy represents useful work that you've permanently lost. In an engine, the big entropy generators are: combustion (irreversible chemical reaction), heat transfer through the cylinder walls, exhaust blow-down, and throttle losses. A second-law analysis tells you exactly which of these costs you the most efficiency.
2.1 Clausius Inequality and Entropy
For any cycle, the Clausius inequality states:
This leads to the definition of entropy as a state function. For a reversible process:
For any real (irreversible) process between states 1 and 2:
2.2 Entropy Generation Rate
The volumetric entropy generation rate $\dot{s}_{\text{gen}}$ in a fluid is:
The first term comes from viscous dissipation (velocity gradients) and the second from heat conduction through a temperature gradient. Both are always non-negative, confirming the second law locally. Modern CFD post-processors can compute $\dot{s}_{\text{gen}}$ field maps to visualize where losses are concentrated — a powerful design optimization tool.
2.3 The T–s Diagram
The $T$–$s$ diagram is the engineer's lens for cycle analysis. On a $T$–$s$ diagram:
- Area under a process curve = heat transfer: $q = \int T\,ds$
- A reversible adiabatic (isentropic) process is a vertical line ($ds = 0$)
- Cycle efficiency = (enclosed area) / (heat input area)
- Irreversibilities shift processes rightward, reducing the enclosed area
3. Ideal Gas & Real Gas Models
When does the ideal gas assumption break down in practice? I'm working on a high-pressure hydrogen storage simulation and someone said I need a real gas model.
Good instinct to question it. The ideal gas law assumes molecules have zero volume and zero interaction forces. For hydrogen at 700 bar (typical for vehicle tanks), those assumptions fail badly — the compressibility factor Z deviates from 1 by 20–40%. You'd need a real-gas equation like Peng-Robinson or the Redlich-Kwong. The rule of thumb: if reduced pressure $P_r = P/P_c > 0.1$ or reduced temperature $T_r = T/T_c < 2$, real-gas effects are significant. For air at atmospheric conditions, $T_r \approx 10$ and $P_r \approx 0.001$, so ideal gas is perfectly fine.
3.1 Ideal Gas Law
where $\bar{R} = 8.314$ J/(mol·K) is the universal gas constant and $M$ is the molar mass. For air: $R_{\text{air}} = 287$ J/(kg·K).
Internal energy and enthalpy of an ideal gas depend only on temperature:
For air: $\gamma \approx 1.4$, $c_p \approx 1005$ J/(kg·K), $c_v \approx 718$ J/(kg·K).
3.2 Isentropic Relations
For a reversible adiabatic process with an ideal gas:
These relations govern the isentropic efficiency of compressors and turbines. For an axial compressor stage with pressure ratio $\pi$:
3.3 Van der Waals & Peng-Robinson Equations
The Van der Waals equation accounts for molecular volume ($b$) and attraction ($a$):
The more accurate Peng-Robinson equation used in industrial CFD (ANSYS Fluent, STAR-CCM+ real-gas models):
4. Thermodynamic Cycles
I'm simulating a car engine in GT-Power. The software mentions the Otto cycle as the "ideal" reference. But real engines look nothing like an Otto cycle on a P-V diagram. Why bother with the ideal cycles?
Ideal cycles give you two things: an upper bound on efficiency (so you know how far from ideal your real engine is) and analytical formulas for quick parameter studies. When you find your GT-Power simulation gives 38% thermal efficiency and Otto theory predicts 57% at the same compression ratio, that gap of 19 points tells you exactly how much irreversibility — heat losses, friction, non-instantaneous combustion — costs you. It's a structured way to assign blame to different loss mechanisms. Without the ideal reference, you're just looking at a number with no context.
4.1 Carnot Cycle — The Theoretical Maximum
The Carnot cycle operates between two thermal reservoirs at $T_H$ and $T_L$ and achieves the maximum possible efficiency for any heat engine:
For a modern gas turbine with $T_H = 1600$ K and $T_L = 300$ K: $\eta_{\text{Carnot}} = 81.25\%$. Real turbines achieve 40–45% — the gap represents irreversibilities that thermodynamic analysis helps quantify and reduce.
The Carnot cycle on a $T$–$s$ diagram is a perfect rectangle: two isothermal processes (horizontal) and two isentropic processes (vertical).
4.2 Otto Cycle — Spark-Ignition Engines
The ideal Otto cycle models gasoline engines with four internally reversible processes: isentropic compression, constant-volume heat addition, isentropic expansion, constant-volume heat rejection.
where $r_c = V_{\text{BDC}}/V_{\text{TDC}}$ is the compression ratio. For $r_c = 10$ and $\gamma = 1.4$: $\eta_{\text{Otto}} = 60.2\%$. Real engines achieve 30–38% due to heat transfer, friction, and imperfect combustion.
| Process | Type | Description |
|---|---|---|
| 1→2 | Isentropic | Piston compression |
| 2→3 | Isochoric | Combustion (heat addition at constant volume) |
| 3→4 | Isentropic | Power stroke expansion |
| 4→1 | Isochoric | Exhaust blow-down (heat rejection) |
4.3 Diesel Cycle — Compression-Ignition Engines
In the Diesel cycle, heat is added at constant pressure (fuel injected as piston moves), not constant volume. The cutoff ratio $r_c$ characterizes the degree of constant-pressure combustion:
where $r = V_1/V_2$ is the compression ratio (typically 14–22 for Diesels). For the same compression ratio, $\eta_{\text{Diesel}} < \eta_{\text{Otto}}$, but Diesel engines use higher compression ratios, so in practice they often achieve better efficiency.
4.4 Brayton Cycle — Gas Turbines
The Brayton cycle underpins jet engines and industrial gas turbines. Processes: isentropic compression, constant-pressure heat addition (combustion), isentropic expansion in turbine, constant-pressure heat rejection (exhaust).
where $\Pi = P_3/P_2$ is the pressure ratio. For $\Pi = 20$ and $\gamma = 1.4$: $\eta_{\text{Brayton}} = 57.5\%$.
For a combined cycle power plant, I see efficiencies above 60%. How does that beat the Brayton cycle limit?
The Brayton cycle rejects hot exhaust at 500–600°C — a massive waste. A combined cycle plant adds a Heat Recovery Steam Generator (HRSG) and a Rankine steam cycle to capture that waste heat. The overall system operates between the combustor temperature (~1600°C) and the steam condenser temperature (~30°C), getting much closer to Carnot. The efficiency formula becomes $\eta_{\text{combined}} = \eta_{\text{Brayton}} + (1 - \eta_{\text{Brayton}})\eta_{\text{Rankine}}$. This is why modern combined cycle plants reach 62–65% — it's not magic, it's stacking two cycles to use the full temperature range.
5. Exergy Analysis
Exergy (also called availability or work potential) is the maximum useful work obtainable from a system as it comes to equilibrium with its environment at the dead state $(T_0, P_0)$. While energy is always conserved, exergy is destroyed by irreversibilities.
5.1 Specific Exergy
The term $(h - h_0) - T_0(s - s_0)$ is the thermomechanical (flow) exergy. For heat transfer from a reservoir at $T_R$, the exergy associated with heat $Q$ is:
This is the Carnot factor — heat at 1000°C has exergy equal to 77% of the heat itself; heat at 50°C has only 8% exergy relative to a 20°C environment.
5.2 Exergy Destruction
The Gouy-Stodola theorem relates exergy destruction directly to entropy generation:
This is enormously powerful: wherever your CFD simulation shows high entropy generation — shock waves, separated flow regions, high-gradient combustion zones — that is exactly where you're destroying exergy and losing performance.
5.3 Second-Law Efficiency
| Component | Typical $\eta_{\text{II}}$ | Main Loss Mechanism |
|---|---|---|
| Modern axial compressor stage | 88–92% | Viscous blade boundary layer, tip clearance |
| Combustion chamber | 65–75% | Chemical irreversibility, heat transfer |
| Turbine stage | 88–93% | Tip clearance, secondary flows, cooling |
| Heat exchanger (industrial) | 50–80% | Heat transfer through finite ΔT |
| Throttle valve | 0% (pure destruction) | Pressure drop with no work recovery |
6. CAE Applications of Thermodynamics
In my CFD setup for a gas turbine combustor, how do I make sure the energy equation is physically correct? I'm worried about whether my combustion model conserves the right quantities.
Great question. First, check your enthalpy formulation — combustion CFD should use total enthalpy (static enthalpy plus kinetic energy) as the transported quantity, not static temperature. The heat release from combustion must be included as a source term based on the species consumption rates. Post-simulation, do an energy balance: integrate heat flux through all boundaries and check it matches the fuel heat input minus the work output. A mismatch of more than 1–2% suggests a setup error. Also verify your specific heat $c_p(T)$ curves are accurate — for combustion gases above 1000 K, $c_p$ increases significantly and using a constant value introduces substantial error.
6.1 Compressible Flow: Stagnation Properties
For high-speed flows, CAE engineers work with stagnation (total) properties that account for kinetic energy:
The stagnation temperature is conserved in adiabatic flows (even with friction). Stagnation pressure is conserved only in isentropic flows — any irreversibility reduces $P_0$. Total pressure loss is therefore a direct measure of flow irreversibility in compressors, turbines, and duct systems.
6.2 Engine Simulation (1D Thermodynamics)
Tools like GT-Power, Ricardo WAVE, and AVL BOOST model internal combustion engines as networks of control volumes connected by pipes. Each cylinder is modeled using the first law applied to the open system:
The Wiebe function models the rate of heat release (mass fraction burned) during combustion:
where $\theta$ is crank angle, $\theta_0$ is the start of combustion, $\Delta\theta$ is the combustion duration, and typical values are $a = 5$, $m = 2$ for SI engines.
6.3 Turbocharger Matching
Turbocharger matching uses thermodynamic relations to select the optimal compressor and turbine. The compressor power must equal turbine power (minus bearing losses):
Operating points are plotted on compressor maps ($\Pi$ vs. corrected mass flow $\dot{m}\sqrt{T_0}/P_0$) to verify surge margin and choke avoidance over the entire engine speed range.
6.4 Thermodynamic Consistency Checks for CFD
- Global energy balance: Sum of heat fluxes through all walls + power output = fuel heat input. Tolerance: < 1%.
- Entropy audit: Compute $\int \dot{s}_{\text{gen}}\,dV$ over the domain; verify it's positive and matches the second-law prediction.
- Adiabatic wall temperature: For high-speed compressible flows, the adiabatic wall temperature $T_{aw} = T_\infty(1 + r\frac{\gamma-1}{2}M^2)$ where $r$ is the recovery factor (~0.85 for turbulent flow). Use this to validate your wall boundary condition setup.
- Pressure ratio conservation: Total pressure should be conserved through isentropic sections; monitor $P_0$ along streamlines to locate loss sources.