Thermocalculator
How Thermocalculator Works
Overview
This calculator uses a two-part approach to determine thermodynamic properties of real gases and liquids:
- Ideal Gas Properties: Temperature-dependent correlations that describe how properties behave in the ideal (low-pressure) limit
- Departure Functions: Corrections from the Peng-Robinson Equation of State (PR-EOS) that account for real gas behavior at elevated pressures
The final property is calculated as: Real Property = Ideal Property + Departure Function
This approach is standard in chemical engineering because it separates temperature effects (which are well-described by polynomial correlations) from pressure effects (which require an equation of state).
Core Model: Peng-Robinson Equation of State
The Peng-Robinson (PR) Equation of State is a cubic equation that describes how real gases deviate from ideal behavior. It's particularly accurate for hydrocarbons and is widely used in the chemical industry.
What it Does
The PR-EOS relates pressure (P), temperature (T), and molar volume (v) through a cubic equation. Instead of solving for volume directly, we solve for the compressibility factor (Z), which is a dimensionless measure of how much a gas deviates from ideal behavior:
- Z = 1: Ideal gas behavior (low pressure, high temperature)
- Z < 1: Gas is more compressible than ideal (attractive forces dominate)
- Z > 1: Gas is less compressible than ideal (repulsive forces dominate)
Key Parameters
The PR-EOS requires three critical properties for each compound:
- Critical Temperature (Tc): The temperature above which a gas cannot be liquefied
- Critical Pressure (Pc): The pressure at the critical point
- Acentric Factor (ω): A measure of molecular asymmetry and polarity
These are stored in the database for each compound and used to calculate:
- a: Attraction parameter (related to intermolecular forces)
- b: Repulsion parameter (related to molecular volume)
- κ: Temperature correction factor (depends on acentric factor)
Compressibility Factor Calculation
The compressibility factor is found by solving a cubic equation:
Z³ + (B - 1)Z² + (-3B² - 2B + A)Z + (B³ + B² - AB) = 0
Where:
- A and B are dimensionless parameters that depend on pressure, temperature, and the compound's critical properties
- The equation can have 1 or 3 real roots:
- Gas phase: Use the largest root (highest Z)
- Liquid phase: Use the smallest root (lowest Z)
Temperature-Dependent Properties
These properties are calculated using empirical correlations (polynomial or exponential equations) that are fitted to experimental data. Each correlation has a specific temperature range where it's valid.
1. Vapor Pressure
What it is: The pressure at which a liquid and its vapor are in equilibrium at a given temperature.
Equations Used:
- Equation 10 (Antoine-type):
P = exp(A - B/(C + T)) - Equation 101:
P = exp(A + B/T + C·ln(T) + D·T^E) - Equation 200: A more complex form that includes critical temperature scaling
Limitations: Each compound has a specific temperature range (Tmin to Tmax) where the correlation is valid, typically from triple point to near critical temperature.
2. Heat Capacity (Ideal Gas and Liquid)
What it is: The amount of heat required to raise the temperature of one mole of substance by 1 Kelvin.
Ideal Gas Heat Capacity (used for gas phase):
- Equation 3:
Cp = A + B·T + C·T² - Equation 4:
Cp = A + B·T + C·T² + D·T³ - Equation 16:
Cp = A + exp(B/T + C + D·T + E·T²) - Equation 100:
Cp = A + B·T + C·T² + D·T³ + E·T⁴ - Equation 107:
Cp = A + B·((C/T)·sinh(C/T))² + E·((D/T)/cosh(D/T))²
Liquid Heat Capacity (used for liquid phase):
- Similar polynomial forms (Equations 3, 4, 16, 100)
Limitations: Each correlation has temperature limits. Ideal gas correlations typically work from ~50K to 1500K, while liquid correlations have narrower ranges (often 75K to 300K).
3. Heat of Vaporization
What it is: The energy required to convert one mole of liquid to vapor at a given temperature.
Equation Used: Equation 106 (Watson correlation):
ΔHvap = A·(1 - Tr)^(B + C·Tr + D·Tr² + E·Tr³)
Where Tr = T/Tc is the reduced temperature.
This correlation accounts for the fact that heat of vaporization decreases as temperature approaches the critical point (where it becomes zero).
Limitations: Valid from triple point to critical temperature.
Pressure-Dependent Properties (From PR-EOS)
These properties are calculated using departure functions that correct ideal gas values based on the compressibility factor and PR-EOS parameters.
1. Enthalpy (H)
Calculation:
H = H_ideal(T) - H_ideal(T_ref) + H_departure(P, T)
Ideal Enthalpy: Calculated by integrating heat capacity from reference temperature to T:
H_ideal(T) = ∫[T_ref to T] Cp_ideal(T) dT
Enthalpy Departure: Correction for real gas behavior:
H_departure = R·T·(Z - 1 - (A/(√8·B))·(1 + κ·√(Tr/α))·ln[(Z + (√2 + 1)·B)/(Z - (√2 - 1)·B)])
This accounts for:
- Work done against intermolecular forces (the Z - 1 term)
- Temperature-dependent attraction effects (the logarithmic term)
2. Entropy (S)
Calculation:
S = S_ideal(T) + S_departure(P, T)
Ideal Entropy: Includes temperature integration and pressure correction:
S_ideal(T) = ∫[T_ref to T] (Cp_ideal(T)/T) dT - R·ln(P/P_ref)
Entropy Departure:
S_departure = R·ln(Z - B) - (A·R)/(√8·B)·κ·√(Tr/α)·ln[(Z + (√2 + 1)·B)/(Z - (√2 - 1)·B)]
3. Heat Capacity at Constant Pressure (Cp)
Calculation:
Cp = Cp_ideal(T) + Cp_departure(P, T)
Departure Function: Includes derivatives of the compressibility factor with respect to temperature, accounting for how intermolecular forces change with temperature.
4. Density (ρ)
Calculation:
ρ = M / v = M·P / (Z·R·T)
Where:
- M = Molecular weight
- v = Molar volume = Z·R·T/P (from ideal gas law, corrected by Z)
5. Fugacity (f)
What it is: An "effective pressure" that accounts for non-ideal behavior. For ideal gases, fugacity equals pressure.
Calculation:
f = P·exp(Z - 1 - ln(Z - B) - (A/(√8·B))·ln[(Z + (√2 + 1)·B)/(Z - (√2 - 1)·B)])
Fugacity is crucial for phase equilibrium calculations and chemical reaction equilibria.
6. Internal Energy (U)
Calculation:
U = H - P·v = H - Z·R·T
The difference between enthalpy and the P·v work term.
7. Gibbs Free Energy (G)
Calculation:
G = H - T·S
Used for determining phase equilibria and chemical reaction directions.
8. Helmholtz Free Energy (A)
Calculation:
A = U - T·S
Used in closed-system thermodynamics and statistical mechanics.
Limitations and Validation
Temperature Limits
Each temperature-dependent correlation has specific validity ranges:
- Vapor Pressure: Typically from triple point (~50-100K) to near critical temperature
- Ideal Gas Heat Capacity: Usually 50K to 1500K
- Liquid Heat Capacity: Narrower ranges, often 75K to 300K
- Heat of Vaporization: From triple point to critical temperature
Why limits exist:
- Correlations are fitted to experimental data within specific ranges
- Extrapolation beyond these ranges can produce physically unrealistic or inaccurate results
- Near critical point, properties change rapidly and correlations may break down
Pressure Limits
Maximum Pressure: Limited to 10 × Critical Pressure
- Beyond this, the PR-EOS becomes less accurate
- Very high pressures may require more sophisticated equations of state
- The cubic equation may not have physically meaningful roots
Minimum Pressure: Must be greater than 0
- Negative pressures are unphysical
- At very low pressures, ideal gas behavior is recovered (Z → 1)
Model Limitations
-
PR-EOS Accuracy:
- Best for non-polar and slightly polar compounds (hydrocarbons, noble gases)
- Less accurate for highly polar compounds (water, alcohols) or associating molecules
- Accuracy decreases near critical point
-
Single-Phase Assumption:
- The model calculates properties for either gas OR liquid phase
- It does not automatically detect phase transitions
- User must specify the phase
-
Pure Component Only:
- Calculations are for pure substances
- Mixture properties would require mixing rules (not implemented)
-
No Chemical Reactions:
- Properties are for stable molecular forms only
- Does not account for decomposition or reaction at extreme conditions
Calculation Flow
- Load Compound Data: Critical properties, correlation coefficients, and temperature limits from database
- Calculate PR-EOS Parameters: a, b, κ from critical properties
- Calculate Compressibility Factor: Solve cubic equation for Z
- Calculate Temperature-Dependent Properties:
- Vapor pressure, heat capacity, heat of vaporization using correlations
- Calculate Ideal Gas Properties:
- Integrate heat capacity for enthalpy/entropy
- Calculate Departure Functions:
- Correct ideal values for real gas behavior
- Calculate Composite Properties:
- Density, fugacity, internal energy, Gibbs/Helmholtz free energy
Units
- Temperature: Kelvin (K)
- Pressure: Bar (bar) - input and output
- Enthalpy/Internal Energy: kJ/mol
- Entropy: kJ/(mol·K)
- Heat Capacity: kJ/(mol·K)
- Density: g/cm³
- Fugacity: Bar (dimensionless coefficient, multiplied by pressure)
- Vapor Pressure: Bar (converted from Pascal in database)
References
The equations and methodology follow standard chemical engineering thermodynamics textbooks, particularly:
- Peng-Robinson (1976) equation of state
- Standard correlations for vapor pressure (Antoine, extended forms)
- Watson correlation for heat of vaporization
- Polynomial correlations for heat capacity (Shomate, etc.)