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

  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • 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.js
    • CadCraft
    • BimCraft
    64-bit
  • Rate constant

    The forward rate constant of a reaction at a temperature.

    k = A T^b exp(−E_a ÷ RT)

    Reaction mechanisms in a closed vessel process/mechanism.js
    • CadCraft
    • BimCraft
    64-bit
  • Equilibrium constant in concentration units

    K_c of a reaction, used to get the reverse rate from the forward one.

    K_c = exp(−Σ νᵢ gᵢ⁄RT) × (P₀ ÷ RT)^Δν

    Reaction mechanisms in a closed vessel process/mechanism.js
    • CadCraft
    • BimCraft
    64-bit
  • Net production rates

    The rate at which each species is made or used by all reactions together.

    rate = (k_f Π C^ν − k_f ÷ K_c Π C^ν) × third-body sum; ωᵢ = Σ νᵢ × rate

    Reaction mechanisms in a closed vessel process/mechanism.js
    • CadCraft
    • BimCraft
    64-bit
  • Closed-vessel reactor

    Concentrations, and temperature when adiabatic, over time.

    dCᵢ/dt = ωᵢ; adiabatic: dT/dt = −Σ uᵢ ωᵢ ÷ Σ Cᵢ c_v,ᵢ, u = RT (H⁄RT − 1), c_v = R (C_p⁄R − 1)

    Reaction mechanisms in a closed vessel process/mechanism.js
    • CadCraft
    • BimCraft
    64-bit
  • Standard gravity

    g, used for the liquid head across a valve.

    g = 9.80665 m/s²

    Dynamic simulation and controller tuning process/dynamics.js
    • CadCraft
    • BimCraft
    64-bit
  • Jacobian by differences

    The matrix of derivatives of the plant's rates with respect to its states.

    Jᵢⱼ = (fᵢ(y + h eⱼ) − fᵢ(y)) ÷ h, h = 1e-7 × max(|yⱼ|, 1e-3)

    Dynamic simulation and controller tuning process/dynamics.js
    • CadCraft
    • BimCraft
    64-bit
  • One implicit Euler step

    The state after one step of size h.

    x − y − h f(t + h, x) = 0, (I − hJ) Δx = −residual, repeated

    Dynamic simulation and controller tuning process/dynamics.js
    • CadCraft
    • BimCraft
    64-bit
  • Stiff integrator

    The state at the end time, with every accepted step on the way.

    y_new = 2 y_(two half steps) − y_(one full step); error = max |half − full| ÷ (atol + rtol max(|y|, |y_half|)); h ← h × clamp(0.9 ÷ √error, 0.2, 4)

    Dynamic simulation and controller tuning process/dynamics.js
    • CadCraft
    • BimCraft
    64-bit
  • Valve characteristic

    The fraction of full flow at a valve opening.

    linear: x; equal percentage: R^(x − 1), 0 at x = 0, R = 50 unless given; quick opening: √x

    Dynamic simulation and controller tuning process/dynamics.js
    • CadCraft
    • BimCraft
    64-bit
  • PID controller output

    The output of a controller between 0 and 1.

    e = ±(pv − sp) ÷ span; out = bias + K_c (e + I ÷ T_i + T_d (e − D_f) ÷ t_f), clamped to [0, 1]

    Dynamic simulation and controller tuning process/dynamics.js
    • CadCraft
    • BimCraft
    64-bit
  • Flow through a valve from a tank

    The volume flow through a valve from the liquid heads on its two sides.

    Δp = ρ g (h_from − h_to + Δz); q = k × f(x) × √(max(Δp, 0) ÷ ρ)

    Dynamic simulation and controller tuning process/dynamics.js
    • CadCraft
    • BimCraft
    64-bit
  • Tank level and gas pressure rates

    How fast a tank level and a gas vessel pressure change.

    dh/dt = (q_in − q_out) ÷ A; dP/dt = R T ÷ V × (n_in − n_out)

    Dynamic simulation and controller tuning process/dynamics.js
    • CadCraft
    • BimCraft
    64-bit
  • Stirred reactor balances

    The rate of change of each concentration and of the temperature in a constant-volume reactor.

    r = k₀ exp(−E ÷ RT) Π C^n; dC/dt = q⁄V (C_in − C) + ν r; dT/dt = q⁄V (T_in − T) − ΔH r ÷ (ρ c_p) − UA (T − T_j) ÷ (ρ c_p V) + Q ÷ (ρ c_p V)

    Dynamic simulation and controller tuning process/dynamics.js
    • CadCraft
    • BimCraft
    64-bit
  • Plant simulation

    The trends of every state and controller output from time zero to the end time.

    integrate from each output time to the next (end ÷ 200 apart, or the next scripted event) with rtol 1e-6, atol 1e-9

    Dynamic simulation and controller tuning process/dynamics.js
    • CadCraft
    • BimCraft
    64-bit
  • Process model from a step test

    Gain, time constant and dead time of a first-order model fitted to a step response.

    K = Δy ÷ Δu; τ = 1.5 (t₆₃ − t₂₈); θ = max(0, t₆₃ − τ)

    Dynamic simulation and controller tuning process/dynamics.js
    • CadCraft
    • BimCraft
    64-bit
  • Controller tuning rules

    P, PI or PID settings from the fitted gain, time constant and dead time.

    Ziegler–Nichols PI: K_c = 0.9 τ ÷ (K θ), T_i = 3.33 θ; IMC PI: K_c = (τ + θ⁄2) ÷ (K (λ + θ⁄2)), T_i = τ + θ⁄2; SIMC: K_c = τ ÷ (K (τ_c + θ)), T_i = min(τ, 4 (τ_c + θ))

    Dynamic simulation and controller tuning process/dynamics.js
    • CadCraft
    • BimCraft
    64-bit
  • Tear stream from the iteration vector

    A stream rebuilt from the component flows, temperature and pressure the recycle iteration is working on.

    nᵢ = max(xᵢ, 0); F = Σ nᵢ; z = n ÷ F; state from a PT flash

    Flowsheet solver and unit operations process/flowsheet.js
    • CadCraft
    • BimCraft
    64-bit
  • Recycle convergence test

    Whether the tear streams have stopped changing from one pass to the next.

    error = max |g(x)ᵢ − xᵢ| ÷ (|xᵢ| + scaleᵢ) < tol, scale = 1e-6 F_max (flows), 1 (T), 1000 (P)

    Flowsheet solver and unit operations process/flowsheet.js
    • CadCraft
    • BimCraft
    64-bit
  • Wegstein acceleration

    The next guess of each tear variable from its last two passes.

    s = (g − g_prev) ÷ (x − x_prev); q = clamp(s ÷ (s − 1), −5, 0); x_next = q x + (1 − q) g

    Flowsheet solver and unit operations process/flowsheet.js
    • CadCraft
    • BimCraft
    64-bit
  • Broyden acceleration

    The next guess of all tear variables together, from an updated inverse Jacobian.

    H ← H + (Δx − H ΔF) (Δxᵀ H) ÷ (Δxᵀ H ΔF); x_next = x − H F, F = x − g(x)

    Flowsheet solver and unit operations process/flowsheet.js
    • CadCraft
    • BimCraft
    64-bit
  • Design specifications

    The value of a unit parameter that makes a stream property hit its target.

    residual = (value − target) ÷ (|target| + 1e-6); one bounded spec: scan 48 intervals, then a bracketed root to 1e-12; otherwise Newton to 1e-10

    Flowsheet solver and unit operations process/flowsheet.js
    • CadCraft
    • BimCraft
    64-bit
  • Property a specification reads

    The stream or unit value a design specification is compared with.

    flow of a component = F × zᵢ

    Flowsheet solver and unit operations process/flowsheet.js
    • CadCraft
    • BimCraft
    64-bit
  • Feed stream

    A feed's total flow and mole fractions from component flows, mass flows or a total with fractions.

    F = Σ nᵢ; zᵢ = nᵢ ÷ F; from mass: nᵢ = mᵢ ÷ Mᵢ

    Flowsheet solver and unit operations process/stream.js
    • CadCraft
    • BimCraft
    64-bit
  • Mass flow of a stream

    The mass flow in kg/s from the molar flow and composition.

    ṁ = F × Σ zᵢ Mᵢ

    Flowsheet solver and unit operations process/stream.js
    • CadCraft
    • BimCraft
    64-bit
  • Volume flow of a stream

    The volume flow in m³/s, phase by phase.

    Q = Σ_phases F × fraction × V_molar(T, P, x)

    Flowsheet solver and unit operations process/stream.js
    • CadCraft
    • BimCraft
    64-bit
  • Mixer

    The outlet of several streams mixed at the lowest inlet pressure.

    nᵢ = Σ F zᵢ; H_flow = Σ F H; outlet from a flash at that enthalpy

    Flowsheet solver and unit operations process/stream.js
    • CadCraft
    • BimCraft
    64-bit
  • Splitter

    Outlets that share one stream by given fractions.

    F_k = F × f_k ÷ Σ f

    Flowsheet solver and unit operations process/stream.js
    • CadCraft
    • BimCraft
    64-bit
  • Pump

    The shaft work and outlet state of a pump.

    w = V_liquid (P_out − P_in) ÷ η; W = F w; outlet at H_in + w

    Flowsheet solver and unit operations process/stream.js
    • CadCraft
    • BimCraft
    64-bit
  • Compressor and expander

    The work and outlet state from an isentropic step and an efficiency.

    h_s from a flash at P_out and the inlet entropy; compressor: h = H_in + (h_s − H_in) ÷ η; expander: h = H_in + η (h_s − H_in)

    Flowsheet solver and unit operations process/stream.js
    • CadCraft
    • BimCraft
    64-bit
  • Component splitter

    Two outlets that each take a set fraction of every component.

    aᵢ = F zᵢ fᵢ; bᵢ = F zᵢ (1 − fᵢ); Q = F_a H_a + F_b H_b − F H

    Flowsheet solver and unit operations process/stream.js
    • CadCraft
    • BimCraft
    64-bit
  • Two-stream heat exchanger

    The outlet states, duty, log-mean temperature difference, UA and smallest approach of a counter-current exchanger.

    duty = F_hot (H_in − H_out); LMTD = (ΔT₁ − ΔT₂) ÷ ln(ΔT₁ ÷ ΔT₂), or ΔT₁ when |ΔT₁ − ΔT₂| < 1e-9; UA = duty ÷ LMTD

    Flowsheet solver and unit operations process/stream.js
    • CadCraft
    • BimCraft
    64-bit
  • Inside diameter of a pipe size

    The inside diameter in meters of a nominal pipe size or a size in millimeters.

    D = (OD − 2 × wall) × 0.0254 (inches from the schedule 40 table); D = mm ÷ 1000

    Line sizing and pressure drop process/hydraulics.js
    • CadCraft
    • BimCraft
    64-bit
  • Colebrook–White friction factor

    The turbulent Darcy friction factor from the implicit Colebrook–White equation.

    1 ÷ √f = −2 log₁₀(ε ÷ (3.7D) + 2.51 ÷ (Re √f))

    Line sizing and pressure drop process/hydraulics.js
    • CadCraft
    • BimCraft
    64-bit
  • Swamee–Jain friction factor

    The turbulent Darcy friction factor from an explicit formula.

    f = 0.25 ÷ (log₁₀(ε ÷ (3.7D) + 5.74 ÷ Re^0.9))²

    Line sizing and pressure drop process/hydraulics.js
    • CadCraft
    • BimCraft
    64-bit
  • Friction factor

    The Darcy friction factor for any Reynolds number.

    Re < 2300: 64 ÷ Re; Re ≥ 4000: Swamee–Jain; between: (1 − w) × 64 ÷ 2300 + w × f(4000), w = (Re − 2300) ÷ 1700

    Line sizing and pressure drop process/hydraulics.js
    • CadCraft
    • BimCraft
    64-bit
  • Erosional velocity

    The velocity above which API RP 14E warns of erosion, in m/s.

    v_e = C × 0.3048 ÷ √(ρ × 0.062427961), C = 100

    Line sizing and pressure drop process/hydraulics.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.