Resources Numerical accuracy
Calculations
Every calculation under our calculation policies: what it works out, its formula and the precision it runs at. Open one to see its code as it is in the released app.
Calculations
-
Mixture parameters
a, da/dT and b of a mixture of given composition.
a = Σᵢ Σⱼ yᵢ yⱼ √(aᵢ aⱼ) (1 − kᵢⱼ); b = Σ yᵢ bᵢ
Cubic equations of state process/eos.js64-bit- CadCraft
- BimCraft
-
Compressibility roots
The physical compressibility factors of a mixture at a temperature and pressure.
β = bP ÷ RT; A = aP ÷ (RT)²; Z³ + c₂Z² + c₁Z + c₀ = 0 with c from β, A, ε, σ; keep Z > β (1 + 1e-12)
Cubic equations of state process/eos.js64-bit- CadCraft
- BimCraft
-
Fugacity coefficients
ln φ of every component for one compressibility root.
ln φᵢ = bᵢ⁄b (Z − 1) − ln(Z − β) − a ÷ (bRT) × (2 Σⱼ yⱼ aᵢⱼ ÷ a − bᵢ⁄b) × I, I = ln((Z + σβ) ÷ (Z + εβ)) ÷ (σ − ε)
Cubic equations of state process/eos.js64-bit- CadCraft
- BimCraft
-
Enthalpy and entropy departures
How far a real phase's enthalpy and entropy are from the ideal gas at the same temperature and pressure.
H − H_ig = RT (Z − 1) + (T da/dT − a) ÷ b × I; S − S_ig = R ln(Z − β) + (da/dT) ÷ b × I
Cubic equations of state process/eos.js64-bit- CadCraft
- BimCraft
-
Vapor pressure of a pure component
The pressure at which the liquid and vapor roots of one component have equal fugacity.
P ← P × exp(ln φ_L − ln φ_V) until |ln φ_L − ln φ_V| < 1e-12
Cubic equations of state process/eos.js64-bit- CadCraft
- BimCraft
-
Ideal-gas enthalpy
The ideal-gas enthalpy of a component, with its formation enthalpy, at a temperature.
H = h_f + R (A (T − T₀) + B⁄2 (T² − T₀²) + C⁄3 (T³ − T₀³) − D (1⁄T − 1⁄T₀))
Property package and flashes process/thermo.js64-bit- CadCraft
- BimCraft
-
Ideal-gas entropy
The ideal-gas entropy of a component at a temperature, relative to 298.15 K.
S = R (A ln(T ÷ T₀) + B (T − T₀) + C⁄2 (T² − T₀²) − D⁄2 (1⁄T² − 1⁄T₀²))
Property package and flashes process/thermo.js64-bit- CadCraft
- BimCraft
-
Vapor pressure for the ideal and activity models
The vapor pressure of a component from its Antoine constants, or an estimate when it has none.
P = exp(A − B ÷ (T + C)); without Antoine: P = P_c exp(5.373 (1 + ω)(1 − T_c ÷ T))
Property package and flashes process/thermo.js64-bit- CadCraft
- BimCraft
-
Heat of vaporization
The heat of vaporization of a component at a temperature.
ΔH(T) = ΔH(T_b) × ((1 − T⁄T_c) ÷ (1 − T_b⁄T_c))^0.38
Property package and flashes process/thermo.js64-bit- CadCraft
- BimCraft
-
Liquid molar volume
The saturated liquid volume of a component for the ideal and activity models.
V = R T_c ÷ P_c × Z_ra^(1 + (1 − T_r)^(2⁄7)), Z_ra = 0.29056 − 0.08775 ω
Property package and flashes process/thermo.js64-bit- CadCraft
- BimCraft
-
Enthalpy, entropy and volume of one phase
The molar enthalpy, entropy and volume of a liquid or vapor of given composition.
EOS: H = Σ xᵢ H_ig,ᵢ + departure; V = ZRT ÷ P. Activity liquid: H = Σ xᵢ (H_ig,ᵢ − ΔH_vap,ᵢ) + H^E, H^E = −RT² Σ xᵢ ∂ln γᵢ⁄∂T
Property package and flashes process/thermo.js64-bit- CadCraft
- BimCraft
-
K-values
ln K of every component between a liquid and a vapor composition.
EOS: ln Kᵢ = ln φᵢ(liquid) − ln φᵢ(vapor); activity: ln Kᵢ = ln γᵢ + ln(P_sat,ᵢ ÷ P), or ln(Hᵢ ÷ P) for a Henry solute
Property package and flashes process/thermo.js64-bit- CadCraft
- BimCraft
-
Vapor fraction (Rachford–Rice)
The vapor fraction that balances a feed for given K-values.
Σ zᵢ (Kᵢ − 1) ÷ (1 + V (Kᵢ − 1)) = 0, 0 ≤ V ≤ 1
Property package and flashes process/thermo.js64-bit- CadCraft
- BimCraft
-
Phase stability test
Whether a mixture at a temperature and pressure stays one phase or splits.
Yᵢ ← exp(ln zᵢ + ln φᵢ(z) − ln φᵢ(y)); unstable when ΣY > 1 + 1e-8
Property package and flashes process/thermo.js64-bit- CadCraft
- BimCraft
-
Two-phase flash iteration
The vapor fraction and the two compositions at a temperature and pressure.
V from Rachford–Rice; xᵢ = zᵢ ÷ (1 + V (Kᵢ − 1)); yᵢ = Kᵢ xᵢ; K ← exp(ln K(x, y)) until max |Δ ln K| < 1e-13
Property package and flashes process/thermo.js64-bit- CadCraft
- BimCraft
-
Liquid–liquid split
Two liquid phases and their fractions for an activity model.
trial phases from each component at 0.9; split when the tangent-plane distance < −1e-9; K ← exp(ln γ(x₂) − ln γ(x₁)) until max |Δ ln K| < 1e-12
Property package and flashes process/thermo.js64-bit- CadCraft
- BimCraft
-
Saturation residual
How far a mixture is from its bubble or dew point at a trial temperature or pressure.
bubble: Σ Kᵢ zᵢ − 1; dew: 1 − Σ zᵢ ÷ Kᵢ
Property package and flashes process/thermo.js64-bit- CadCraft
- BimCraft
-
Bubble and dew points
The bubble or dew temperature at a pressure, or pressure at a temperature.
scan a geometric grid for a sign change of the residual, then bisect on √(a b) until b ÷ a − 1 < 1e-13
Property package and flashes process/thermo.js64-bit- CadCraft
- BimCraft
-
Temperature for a given enthalpy or entropy
The temperature at which a PT flash has the wanted enthalpy or entropy.
false position inside a bracket; stop when b − a < 1e-10 K or |f| < 1e-9 (|target| + 1)
Property package and flashes process/thermo.js64-bit- CadCraft
- BimCraft
-
Flash at a vapor fraction
The state at a pressure and a wanted vapor fraction.
bisect T between the bubble and dew temperatures until the bracket is below 1e-9 K
Property package and flashes process/thermo.js64-bit- CadCraft
- BimCraft
-
Saturation temperature of a pure component
The temperature at which a pure component's vapor pressure equals the pressure.
bisect T on [20 K, T_c − 1e-6] until the bracket is below 1e-11 K
Property package and flashes process/thermo.js64-bit- CadCraft
- BimCraft
-
Gas constant
R, used by the property package, the equations of state, the reactors and the dynamic simulation.
R = 8.314462618 J/(mol K)
Property package and flashes process/data.js64-bit- CadCraft
- BimCraft
-
Component data to SI
A component's critical pressure, molar mass and Antoine constants in the units the engine works in.
P_c (Pa) = P_c (bar) × 1e5; M (kg/mol) = M ÷ 1000; A′ = A + ln 1000; C′ = C − 273.15
Property package and flashes process/data.js64-bit- CadCraft
- BimCraft
-
2×2 solve
The Newton step for the two phase fractions.
det = a d − b c; x = (r₁ d − b r₂) ÷ det; y = (a r₂ − c r₁) ÷ det
Three-phase flash process/vlle.js64-bit- CadCraft
- BimCraft
-
Phase fractions
The vapor and second-liquid fractions for the current K-values.
gⱼ = Σ zᵢ (Kⱼᵢ − 1) ÷ Dᵢ = 0, Dᵢ = 1 + β_v (K_v,ᵢ − 1) + β_l (K_l,ᵢ − 1)
Three-phase flash process/vlle.js64-bit- CadCraft
- BimCraft
-
Composition update
The liquid compositions and the new K-values after each pass.
x₁,ᵢ = zᵢ ÷ Dᵢ; x₂,ᵢ = x₁,ᵢ K_l,ᵢ; error = max |ln(K_new ÷ K)|
Three-phase flash process/vlle.js64-bit- CadCraft
- BimCraft
-
Residuals of a result
The largest iso-fugacity difference between the phases and the largest component-balance error, as the calculator reports them.
iso = max |ln(xᵢγᵢ)₁ − ln(xᵢγᵢ)₂|, |ln(yᵢP) − ln(xᵢγᵢP_sat,ᵢ)|; balance = max |Σ_phases frac × xᵢ − zᵢ|
Three-phase flash process/vlle.js64-bit- CadCraft
- BimCraft
-
Reference-state offsets
The shifts that put CoolProp's enthalpy and entropy on the engine's reference state.
ΔH = h_f − H(298.15 K, 1e-4 mol/m³); ΔS = −(S(298.15 K, 1e-4 mol/m³) − R ln(1e5 ÷ (1e-4 R T₀)))
Pure-fluid properties from CoolProp process/coolprop.js64-bit- CadCraft
- BimCraft
-
Properties at a temperature and pressure
Enthalpy, entropy, heat capacity, molar density, molar mass and phase of a pure fluid.
H = H_CoolProp + ΔH; S = S_CoolProp + ΔS; M (g/mol) = M (kg/mol) × 1000
Pure-fluid properties from CoolProp process/coolprop.js64-bit- CadCraft
- BimCraft
-
Saturation values
Vapor pressure, saturated liquid and vapor densities and heat of vaporization at a temperature.
ΔH_vap = H(T, vapor) − H(T, liquid)
Pure-fluid properties from CoolProp process/coolprop.js64-bit- CadCraft
- BimCraft
-
Ideal-gas heat-capacity fit
A quadratic C_p ÷ R = A + B T + C T² fitted to the dilute-gas enthalpy slope over a temperature range.
C_p(T) ≈ H(T + 0.5) − H(T − 0.5) at 13 temperatures; normal equations M s = v solved by 3×3 determinants
Pure-fluid properties from CoolProp process/coolprop.js64-bit- CadCraft
- BimCraft
-
Component from a fluid
A component for the property package from CoolProp's critical constants, acentric factor, boiling point and the heat-capacity fit.
P_c (bar) = P_c (Pa) ÷ 1e5; M (g/mol) = M × 1000; ΔH_vap(T_b) = H(1 atm, vapor) − H(1 atm, liquid)
Pure-fluid properties from CoolProp process/coolprop.js64-bit- CadCraft
- BimCraft
-
Minimum stages (Fenske)
The least number of stages at total reflux for a split of two key components.
N_min = ln((d_LK ÷ d_HK)(b_HK ÷ b_LK)) ÷ ln α
Distillation and absorption columns process/column.js64-bit- CadCraft
- BimCraft
-
Gilliland correlation (Eduljee)
The stage ratio Y for a reflux ratio X above the minimum.
Y = 0.75 (1 − X^0.5668)
Distillation and absorption columns process/column.js64-bit- CadCraft
- BimCraft
-
Gilliland correlation (Molokanov)
The same stage ratio by the fit of Molokanov and others.
Y = 1 − exp((1 + 54.4X) ÷ (11 + 117.2X) × (X − 1) ÷ √X)
Distillation and absorption columns process/column.js64-bit- CadCraft
- BimCraft
-
Number of stages
The stages needed at a reflux ratio, from the minimum stages and minimum reflux.
X = (R − R_min) ÷ (R + 1); N = (N_min + Y) ÷ (1 − Y)
Distillation and absorption columns process/column.js64-bit- CadCraft
- BimCraft
-
Minimum reflux (Underwood)
The Underwood root between the key volatilities and the minimum reflux ratio from it.
Σ αᵢ z_F,ᵢ ÷ (αᵢ − θ) = 1 − q; R_min = Σ αᵢ x_D,ᵢ ÷ (αᵢ − θ) − 1
Distillation and absorption columns process/column.js64-bit- CadCraft
- BimCraft
-
Kremser equation
The fraction of a component absorbed or stripped in N stages.
(A^(N+1) − A) ÷ (A^(N+1) − 1); N ÷ (N + 1) when |A − 1| < 1e-12
Distillation and absorption columns process/column.js64-bit- CadCraft
- BimCraft
-
Feed thermal condition
q of a feed: the fraction that joins the liquid below the feed stage.
q = (H_dew − H_feed) ÷ (H_dew − H_bubble)
Distillation and absorption columns process/column.js64-bit- CadCraft
- BimCraft
-
Shortcut split of the non-key components
How every component divides between distillate and bottoms, and the volatilities used for it.
dᵢ ÷ bᵢ = (d_HK ÷ b_HK) αᵢ^N_min; αᵢ = √((Kᵢ ÷ K_HK)_top (Kᵢ ÷ K_HK)_bottom)
Distillation and absorption columns process/column.js64-bit- CadCraft
- BimCraft
-
Feed stage and duties of the shortcut column
The split of stages above and below the feed (Kirkbride) and the condenser and reboiler duties.
N_R ÷ N_S = ((z_HK ÷ z_LK)(B ÷ D)(x_B,LK ÷ x_D,HK)²)^0.206; Q_c = (R + 1) D (H_liquid − H_vapor); Q_r from the overall enthalpy balance
Distillation and absorption columns process/column.js64-bit- CadCraft
- BimCraft
-
Component balances on every stage
The liquid flow of each component on each stage of the rigorous column.
l_{j−1} − (1 + S_j) l_j + S_{j+1} l_{j+1} = −f_j, S_j = K_j V_j ÷ L_j; solved by the Thomas algorithm
Distillation and absorption columns process/column.js64-bit- CadCraft
- BimCraft
-
Vapor and liquid flows from the energy balances
The vapor flow leaving each stage and the liquid flow below it, and the test that ends the iteration.
V_{j+1} = (V_j (H_j − h_j) − L_{j−1} (h_{j−1} − h_j) − (H_F,j − F_j h_j)) ÷ (H_{j+1} − h_j); stop when max |ΔT| < tol and max |ΔV| ÷ |V| < 1e-9
Distillation and absorption columns process/column.js64-bit- CadCraft
- BimCraft
-
Duties and closure of the rigorous column
The condenser and reboiler duties and how well the component and energy balances close.
Q_c = V₁ (H₁ − h₀); component closure = max |Σf − d − b| ÷ F; energy closure = |in − out| ÷ (|in| + 1)
Distillation and absorption columns process/column.js64-bit- CadCraft
- BimCraft
-
Tridiagonal solve
The solution of a tridiagonal system, used for the component balances.
forward: m = a_j ÷ b_{j−1}; b_j −= m c_{j−1}; r_j −= m r_{j−1}; back: x_j = (r_j − c_j x_{j+1}) ÷ b_j
Distillation and absorption columns process/column2.js64-bit- CadCraft
- BimCraft
-
Simple models fitted in the outer loop
The local K-value and enthalpy models the inner loop uses in place of the property package.
ln K_b = A + B ÷ T; B = (ln K_b(T + 0.5) − ln K_b(T)) ÷ (1 ÷ (T + 0.5) − 1 ÷ T); h = h_a + h_b T with h_b = (h(T + 0.5) − h(T)) ÷ 0.5
Distillation and absorption columns process/column2.js64-bit- CadCraft
- BimCraft
-
Stage temperatures in the inner loop
The temperature and vapor composition of each stage from the simple K model.
K_b = 1 ÷ Σ αᵢ xᵢ; T = B ÷ (ln K_b − A); yᵢ = αᵢ xᵢ, normalized
Distillation and absorption columns process/column2.js64-bit- CadCraft
- BimCraft
-
Inside-out stopping tests
When the inner and outer loops of the inside-out column end.
inner: max |ΔT| < 1e-10 K and max |ΔV| ÷ |V| < 1e-11; outer: max |ΔT| < tol and max |ΔV| ÷ |V| < 1e-8
Distillation and absorption columns process/column2.js64-bit- CadCraft
- BimCraft
-
Absorber flows by sum-rates
The vapor and liquid flow leaving each stage of an absorber or stripper.
V_j = Σᵢ l_ij K_ij V_j ÷ L_j; L_j = F(1..j) − V₁ + V_{j+1}
Distillation and absorption columns process/column2.js64-bit- CadCraft
- BimCraft
-
Absorber stage temperatures
The temperature of every stage from the stage energy balances.
E_j = L_{j−1} h_{j−1} + V_{j+1} H_{j+1} + H_F,j + Q_j − L_j h_j − V_j H_j = 0; J ΔT = −E with heat capacities by a 0.5 K difference
Distillation and absorption columns process/column2.js64-bit- CadCraft
- BimCraft
A calculation is added only after its source was read. Each statement can be checked in the code shown on its policy's page; the app repositories are public. When a release changes a calculation, its page says so until it has been read again.