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
-
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.js64-bit- CadCraft
- BimCraft
-
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.js64-bit- CadCraft
- BimCraft
-
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.js64-bit- CadCraft
- BimCraft
-
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.js64-bit- CadCraft
- BimCraft
-
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.js64-bit- CadCraft
- BimCraft
-
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.js64-bit- CadCraft
- BimCraft
-
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.js64-bit- CadCraft
- BimCraft
-
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.js64-bit- CadCraft
- BimCraft
-
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.js64-bit- CadCraft
- BimCraft
-
Splitter
Outlets that share one stream by given fractions.
F_k = F × f_k ÷ Σ f
Flowsheet solver and unit operations process/stream.js64-bit- CadCraft
- BimCraft
-
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.js64-bit- CadCraft
- BimCraft
-
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.js64-bit- CadCraft
- BimCraft
-
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.js64-bit- CadCraft
- BimCraft
-
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.js64-bit- CadCraft
- BimCraft
-
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.js64-bit- CadCraft
- BimCraft
-
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.js64-bit- CadCraft
- BimCraft
-
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.js64-bit- CadCraft
- BimCraft
-
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.js64-bit- CadCraft
- BimCraft
-
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.js64-bit- CadCraft
- BimCraft
-
Pressure drop of one line
Velocity, Reynolds number, friction factor and the friction, fitting and static parts of the pressure drop.
A = πD² ÷ 4; v = ṁ ÷ (ρA); Re = ρvD ÷ μ; Δp = f (L ÷ D) ρv² ÷ 2 + K ρv² ÷ 2 + ρ g Δz
Line sizing and pressure drop process/hydraulics.js64-bit- CadCraft
- BimCraft
-
Fluid of a stream
The density, mass flow and phase of a solved stream for the line calculation.
ρ = mass flow ÷ volume flow; gas when vapor fraction ≥ 0.999, liquid when ≤ 0.001, else two-phase
Line sizing and pressure drop process/hydraulics.js64-bit- CadCraft
- BimCraft
-
Pipe in a flowsheet
The outlet pressure of a pipe unit, with the gas density taken at the mean pressure.
ρ_mean = ρ_in × (P_in + P_out) ÷ 2 ÷ P_in; repeat until |ΔP_out| < 1e-6 P_in
Line sizing and pressure drop process/hydraulics.js64-bit- CadCraft
- BimCraft
-
Length, rise and bends of a 3D pipe run
A pipe run's length and rise in meters and its count of elbows, from its points in millimeters.
L = Σ |pᵢ − pᵢ₋₁| ÷ 1000; Δz = (z_last − z_first) ÷ 1000; bend angle = acos(a·b ÷ (|a||b|))
Line sizing and pressure drop process/model.js64-bit- CadCraft
- BimCraft
-
Hydraulics of every linked line
The pressure drop, velocity and erosion screening of each stream that has a line or a pipe run.
Line sizing and pressure drop process/model.js64-bit- CadCraft
- BimCraft
-
Stream table
The table of streams drawn on the P&ID and exported: temperature, pressure, flows, velocity, line drop and composition.
T (°C) = T − 273.15; P (bar) = P ÷ 1e5; mass (kg/h) = ṁ × 3600; rounded with toPrecision to 5, 3 or 4 significant digits
Line sizing and pressure drop process/model.js64-bit- CadCraft
- BimCraft
-
Pipe size for a velocity target
The smallest nominal pipe size whose velocity is at or under the target.
v = (ṁ ÷ ρ) ÷ (πD² ÷ 4) ≤ v_max, sizes tried from smallest to largest
Line sizing and pressure drop process/synth.js64-bit- CadCraft
- BimCraft
-
Rescaling a plant to a production rate
The factor applied to the feed so a chosen stream carries the asked-for tonnes per day of a component.
k = (t/d × 1000 ÷ 86400) ÷ (F zᵢ Mᵢ)
Line sizing and pressure drop process/synth.js64-bit- CadCraft
- BimCraft
-
Purchased cost of one item
The purchased cost of an equipment item of a given size, in base-year dollars or scaled by a cost index.
C₀ = 10^(K₁ + K₂ log₁₀ A + K₃ (log₁₀ A)²); C = C₀ × I_now ÷ I_base
Capital and operating cost process/cost.js64-bit- CadCraft
- BimCraft
-
Six-tenths scaling
A known cost scaled to another size.
C₂ = C₁ (A₂ ÷ A₁)^n, n = 0.6 unless given
Capital and operating cost process/cost.js64-bit- CadCraft
- BimCraft
-
Installed cost
The installed plant cost from the purchased equipment total.
installed = purchased × Lang factor (3.10 solid, 3.63 solid–fluid, 4.74 fluid)
Capital and operating cost process/cost.js64-bit- CadCraft
- BimCraft
-
Energy cost
The cost of energy per hour and per year for a list of powers and prices.
per hour = Σ |P| ÷ 1000 × price; per year = per hour × hours (8000 unless given)
Capital and operating cost process/cost.js64-bit- CadCraft
- BimCraft
-
Equipment cost table
The cost of every item, the purchased total and the installed total.
purchased = Σ cost of the rows; installed = purchased × Lang factor
Capital and operating cost process/cost.js64-bit- CadCraft
- BimCraft
-
Atomic weights
The atomic weight of each element the structure reader knows.
H 1.008; C 12.011; N 14.007; O 15.999; S 32.06; Cl 35.45 …
Molar mass and group-contribution estimates process/env/cheminfo.js64-bit- CadCraft
- BimCraft
-
Molar mass
The molar mass of a molecule in g/mol.
M = Σ count × atomic weight
Molar mass and group-contribution estimates process/env/cheminfo.js64-bit- CadCraft
- BimCraft
-
Joback estimate
Boiling point, critical temperature, pressure and volume, melting point, formation enthalpy and Gibbs energy, heat capacity and acentric factor of a molecule.
T_b = 198 + Σ; T_c = T_b ÷ (0.584 + 0.965 Σ − Σ²); P_c = (0.113 + 0.0032 n_atoms − Σ)⁻²; ω = 3⁄7 × θ ÷ (1 − θ) × log₁₀(P_c ÷ 1.01325) − 1, θ = T_b ÷ T_c
Molar mass and group-contribution estimates process/env/cheminfo.js64-bit- CadCraft
- BimCraft
-
Component from a structure
A component for the property package from the Joback estimate, with a quadratic heat-capacity fit.
C_p ÷ R ≈ A + B T + C T² fitted at 11 temperatures from 300 to 800 K; h_f (J/mol) = H_f (kJ/mol) × 1000
Molar mass and group-contribution estimates process/env/cheminfo.js64-bit- CadCraft
- BimCraft
-
Dispersion coefficients
The crosswind and vertical spread of the plume at a distance downwind, for a stability class and terrain.
σy = ay·x·(1 + by·x)^ey; σz = az·x·(1 + bz·x)^ez
Gaussian plume concentration and contours process/env/plume.js64-bit- CadCraft
- BimCraft
-
Plume concentration at a point
The concentration at a point downwind, crosswind and above ground from a continuous release.
C = Q ÷ (2π·u·σy·σz) × exp(−y² ÷ 2σy²) × [exp(−(z − H)² ÷ 2σz²) + exp(−(z + H)² ÷ 2σz²)]
Gaussian plume concentration and contours process/env/plume.js64-bit- CadCraft
- BimCraft
-
Reach of a concentration level
The farthest downwind distance where the ground-level centerline concentration is still at or above an endpoint.
Gaussian plume concentration and contours process/env/plume.js64-bit- CadCraft
- BimCraft
-
Half-width of a contour
Half the crosswind width of a concentration level at a given distance.
w = σy × √(2 × ln(C₀ ÷ C_end))
Gaussian plume concentration and contours process/env/plume.js64-bit- CadCraft
- BimCraft
-
Height of a contour
The height above ground up to which the concentration stays at or above the endpoint at a given distance.
Gaussian plume concentration and contours process/env/plume.js64-bit- CadCraft
- BimCraft
-
Contour polygon in site coordinates
The outline of a concentration level as a polygon on the site plan, with its reach and greatest height.
(x, y) → (cx + x·cos t − y·sin t, cy + x·sin t + y·cos t)
Gaussian plume concentration and contours process/env/plume.js64-bit- CadCraft
- BimCraft
-
Gas density relative to air
Whether the released gas is heavier than air, which makes a Gaussian result untrustworthy.
ratio = (P·M ÷ R·T) ÷ (P·M_air ÷ R·T_air); dense when ratio > 1.1
Gaussian plume concentration and contours process/env/plume.js64-bit- CadCraft
- BimCraft
-
Wind speed at height
The wind speed at a height from the speed measured at 10 m.
u = u₁₀ × (max(z, 1) ÷ 10)^p
Stack plume rise and air dispersion screening process/env/dispersion.js64-bit- CadCraft
- BimCraft
-
Plume rise and effective height
How far the plume rises above the stack and the effective release height used by the plume equation.
Fb = g·vs·d²·(Ts − Ta) ÷ 4Ts; Δh = 21.425·Fb^0.75 ÷ u (Fb < 55) or 38.71·Fb^0.6 ÷ u; stable: Δh = 2.6·∛(Fb ÷ u·s)
Stack plume rise and air dispersion screening process/env/dispersion.js64-bit- CadCraft
- BimCraft
-
Stack from a flowsheet stream
Exit velocity, volume flow and the emission rate of each species from a process stream.
V̇ = F·R·T ÷ P; vs = V̇ ÷ (π·d² ÷ 4); Qᵢ = F·zᵢ·MWᵢ
Stack plume rise and air dispersion screening process/env/dispersion.js64-bit- CadCraft
- BimCraft
-
Concentration from one stack at one point
The ground concentration in µg/m³ from one source for one wind speed and stability class.
Stack plume rise and air dispersion screening process/env/dispersion.js64-bit- CadCraft
- BimCraft
-
Worst-case 1-hour concentration
The highest ground-level concentration over all stability classes, wind speeds and distances, and its longer-period estimates.
xᵢ = xMin × (xMax ÷ xMin)^(i ÷ steps); C_avg = C_max × factor
Stack plume rise and air dispersion screening process/env/dispersion.js64-bit- CadCraft
- BimCraft
-
Receptor position in the wind frame
The downwind and crosswind distance of a receptor from a source for one hour's wind direction, and the concentration there.
θ = (dirFrom + 180) mod 360; x_d = dx·sin θ + dy·cos θ; y_c = dx·cos θ − dy·sin θ
Stack plume rise and air dispersion screening process/env/dispersion.js64-bit- CadCraft
- BimCraft
-
Hour-by-hour statistics at receptors
The highest and second-highest hourly value, the period mean and the highest 24-hour mean at each receptor.
mean = Σ cₕ ÷ n; rolling₂₄ = max over windows of (Σ of 24 hours) ÷ 24
Stack plume rise and air dispersion screening process/env/dispersion.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.