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.

  • 6,917 calculations in 1,248 source files
  • 143 exact
  • 6,286 in 64-bit
  • 335 with a 32-bit step
  • Last reviewed

Calculations

  • Run results as component properties

    The liquid density and diffusion coefficient of a run in SI units for a process component.

    ρ (kg/m³) = ρ (g/cm³) × 1000; D (m²/s) = D (Ų/ps) × 1e-8

    Molecular dynamics molecular/props.js
    • CadCraft
    • BimCraft
    64-bit
  • Linear solve

    x from A x = b for a small dense system.

    Gaussian elimination with row exchange on the largest pivot, then back substitution

    Solvers shared by the process engine process/numeric.js
    • CadCraft
    • BimCraft
    64-bit
  • Newton iteration

    The solution of a set of nonlinear equations F(x) = 0.

    J Δx = −F, Jᵢⱼ ≈ (Fᵢ(x + h eⱼ) − Fᵢ(x)) ÷ h, h = 1e-7 × max(|xⱼ|, 1e-6); x ← x + λ Δx, λ halved until |F| falls

    Solvers shared by the process engine process/numeric.js
    • CadCraft
    • BimCraft
    64-bit
  • Adaptive Runge–Kutta integration

    y(x₁) for a system of ordinary differential equations, with the accepted points along the way.

    Dormand–Prince 5(4): error = max |h Σ(b₅ − b₄)k| ÷ (atol + rtol × max(|y|, |y_new|)) ≤ 1; h ← h × clamp(0.9 × error^(−0.2), 0.2, 5)

    Solvers shared by the process engine process/numeric.js
    • CadCraft
    • BimCraft
    64-bit
  • Bracketed root

    A root of one equation between two points where the function changes sign.

    c = (f_a b − f_b a) ÷ (f_a − f_b); the retained end's value is halved when the same side is kept twice

    Solvers shared by the process engine process/numeric.js
    • CadCraft
    • BimCraft
    64-bit
  • Temperature form of the parameters

    The interaction parameter of each pair at a temperature.

    pᵢⱼ = aᵢⱼ + bᵢⱼ ÷ T; 0 on the diagonal

    Activity coefficients and Henry's law process/activity.js
    • CadCraft
    • BimCraft
    64-bit
  • NRTL

    ln γ of every component by the NRTL model.

    ln γᵢ = Cᵢ ÷ Sᵢ + Σⱼ xⱼ Gᵢⱼ ÷ Sⱼ × (τᵢⱼ − Cⱼ ÷ Sⱼ), Gᵢⱼ = exp(−αᵢⱼ τᵢⱼ), Sⱼ = Σ xₖ Gₖⱼ, Cⱼ = Σ xₘ τₘⱼ Gₘⱼ

    Activity coefficients and Henry's law process/activity.js
    • CadCraft
    • BimCraft
    64-bit
  • Wilson

    ln γ of every component by the Wilson model.

    ln γᵢ = 1 − ln(Σⱼ xⱼ Λᵢⱼ) − Σₖ xₖ Λₖᵢ ÷ Σⱼ xⱼ Λₖⱼ

    Activity coefficients and Henry's law process/activity.js
    • CadCraft
    • BimCraft
    64-bit
  • UNIQUAC

    ln γ of every component by the UNIQUAC model.

    ln γᵢ = ln(φᵢ÷xᵢ) + z⁄2 qᵢ ln(θᵢ÷φᵢ) + lᵢ − φᵢ÷xᵢ Σ xⱼlⱼ + qᵢ (1 − ln Σ θⱼτⱼᵢ − Σ θⱼτᵢⱼ ÷ Σ θₖτₖⱼ)

    Activity coefficients and Henry's law process/activity.js
    • CadCraft
    • BimCraft
    64-bit
  • Infinite-dilution limits

    The closed-form ln γ of each component of a binary when it is infinitely dilute.

    NRTL: ln γ₁^∞ = τ₂₁ + τ₁₂ exp(−α τ₁₂); Wilson: ln γ₁^∞ = 1 − ln Λ₁₂ − Λ₂₁

    Activity coefficients and Henry's law process/activity.js
    • CadCraft
    • BimCraft
    64-bit
  • Henry's constant at temperature

    Henry's constant of a dissolved gas in pascals at a temperature.

    H(T) = H₂₉₈ (bar) × 1e5 × exp(slope × (1 ÷ T − 1 ÷ 298.15))

    Activity coefficients and Henry's law process/activity.js
    • CadCraft
    • BimCraft
    64-bit
  • Model constants

    The constants of the two equations of state and the correlation for κ(ω).

    PR: Ω_a = 0.45724, Ω_b = 0.07780, σ = 1 + √2, ε = 1 − √2; SRK: Ω_a = 0.42748, Ω_b = 0.08664

    Cubic equations of state process/eos.js
    • CadCraft
    • BimCraft
    64-bit
  • Real roots of a cubic

    The real roots of z³ + c₂z² + c₁z + c₀ = 0 in ascending order.

    p = c₁ − c₂² ÷ 3; q = 2c₂³ ÷ 27 − c₂c₁ ÷ 3 + c₀; disc = q² ÷ 4 + p³ ÷ 27; one root: ∛(−q⁄2 + √disc) + ∛(−q⁄2 − √disc) − c₂⁄3; three: 2√(−p⁄3) cos((acos(arg) − 2πk) ÷ 3) − c₂⁄3

    Cubic equations of state process/eos.js
    • CadCraft
    • BimCraft
    64-bit
  • Attraction parameter of each component

    a(T) and its temperature derivative for every pure component.

    aᵢ = a_c,ᵢ (1 + κᵢ (1 − √(T ÷ T_c,ᵢ)))²; daᵢ/dT = −a_c,ᵢ κᵢ (1 + κᵢ(1 − √(T÷T_c))) ÷ √(T T_c,ᵢ)

    Cubic equations of state process/eos.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit

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.