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
-
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
-
Heat of reaction
The enthalpy change per mole of extent at a temperature, on the ideal-gas formation basis.
ΔH = Σ νᵢ H_ig,ᵢ(T)
Reactors process/reactor.js64-bit- CadCraft
- BimCraft
-
Equilibrium constant
ln K of a reaction at a temperature from formation data and heat capacities.
ΔG⁰(T) ÷ RT from ΔH⁰₀, ΔG⁰₀ and the integrated ΔC_p polynomial; ln K = −ΔG⁰ ÷ RT
Reactors process/reactor.js64-bit- CadCraft
- BimCraft
-
Conversion reactor
The outlet molar flows for reactions with a given conversion of a key component.
ξ = X × n_key ÷ |ν_key|; nᵢ ← nᵢ + νᵢ ξ, one reaction after another
Reactors process/reactor.js64-bit- CadCraft
- BimCraft
-
Equilibrium condition
How far a set of extents is from chemical equilibrium.
Σᵢ νᵢⱼ (ln(nᵢ ÷ F) + ln φᵢ + ln(P ÷ P₀)) − ln Kⱼ = 0
Reactors process/reactor.js64-bit- CadCraft
- BimCraft
-
Extent of a single equilibrium reaction
The extent of reaction between the limits where a species runs out.
lo = max over products of −n₀ᵢ ÷ νᵢ; hi = min over reactants of −n₀ᵢ ÷ νᵢ; root of the equilibrium condition on (lo + ε, hi − ε), ε = 1e-12 max(1, F)
Reactors process/reactor.js64-bit- CadCraft
- BimCraft
-
Adiabatic equilibrium temperature
The outlet temperature at which the equilibrium mixture has the feed's enthalpy.
F_out H(T) − F_in H_in = 0 on [250 K, 3500 K]
Reactors process/reactor.js64-bit- CadCraft
- BimCraft
-
Reaction rates
The rate of each reaction from Arrhenius constants and concentrations.
r = k₀ exp(−E_a ÷ RT) Π Cᵢ^order; gas: Cᵢ = (nᵢ ÷ F) P ÷ RT; liquid: Cᵢ = nᵢ ÷ volumetric flow
Reactors process/reactor.js64-bit- CadCraft
- BimCraft
-
Heat capacity of the reacting mixture
The heat capacity flow used in the adiabatic plug-flow balance.
gas: F Σ xᵢ C_p,ig,ᵢ; liquid: F (H(T + d) − H(T − d)) ÷ 2d, d = 0.001 T
Reactors process/reactor.js64-bit- CadCraft
- BimCraft
-
Plug-flow reactor
The molar flows and temperature along the reactor volume.
dnᵢ/dV = Σⱼ νᵢⱼ rⱼ; adiabatic: dT/dV = Σⱼ (−ΔH_j) rⱼ ÷ (F C_p)
Reactors process/reactor.js64-bit- CadCraft
- BimCraft
-
Stirred-tank reactor
The outlet flows and temperature of a continuous stirred tank.
(nᵢ − n₀ᵢ − V Σⱼ νᵢⱼ rⱼ) ÷ F = 0; adiabatic: (H_out − H_in) ÷ (F × 1e5) = 0
Reactors process/reactor.js64-bit- CadCraft
- BimCraft
-
Gas constant
R as used for rate constants, equilibrium constants and species energies in this file.
R = 8.31446261815324 J/(mol K)
Reaction mechanisms in a closed vessel process/mechanism.js64-bit- CadCraft
- BimCraft
-
Activation-energy units
The factor that turns the file's activation-energy unit into J/mol.
cal/mol = 4.184; kcal/mol = 4184; K = R; eV = 96485.33212
Reaction mechanisms in a closed vessel process/mechanism.js64-bit- CadCraft
- BimCraft
-
Species heat capacity, enthalpy and entropy
C_p ÷ R, H ÷ RT and S ÷ R of a species from its NASA 7 coefficients.
C_p⁄R = a₀ + a₁T + a₂T² + a₃T³ + a₄T⁴; H⁄RT = a₀ + a₁T⁄2 + a₂T²⁄3 + a₃T³⁄4 + a₄T⁴⁄5 + a₅⁄T; S⁄R = a₀ ln T + a₁T + a₂T²⁄2 + a₃T³⁄3 + a₄T⁴⁄4 + a₆
Reaction mechanisms in a closed vessel process/mechanism.js64-bit- CadCraft
- BimCraft
-
Pre-exponential factor to SI
The rate constant's pre-exponential factor in m³, mol and s.
A_SI = A × (L³ ÷ Q)^(order − 1); E_a (J/mol) = E_a × unit factor
Reaction mechanisms in a closed vessel process/mechanism.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.