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

  • Spalding's law of the wall

    y⁺ as a function of u⁺.

    y⁺ = u⁺ + e^(−κB) (e^(κu⁺) − 1 − κu⁺ − (κu⁺)² ÷ 2 − (κu⁺)³ ÷ 6)

    Flow study: turbulence model and wall functions flow-turb.js
    • PartCraft
    64-bit
  • Friction velocity

    Solves the wall law for the friction velocity from the speed at a distance from the wall.

    find u_τ with spalding(U ÷ u_τ) = y u_τ ÷ ν

    Flow study: turbulence model and wall functions flow-turb.js
    • PartCraft
    64-bit
  • Inverse wall law

    u⁺ as a function of y⁺.

    Flow study: turbulence model and wall functions flow-turb.js
    • PartCraft
    64-bit
  • Wall cells: normal and wall distance

    Each wall cell's wall normal and its true distance to the wall, and the model's starting fields.

    n = Σ wᵢ nᵢ ÷ |Σ wᵢ nᵢ|; y = Σ wᵢ c_n (q c_n) ÷ Σ wᵢ c_n over links with c_n > 0.3, y ≥ 0.05

    Flow study: turbulence model and wall functions flow-turb.js
    • PartCraft
    32-bit in part
  • Wall distance of every cell

    The distance from each fluid cell to the nearest wall point.

    d(m) = |v(n) − c| carried from a settled neighbor n along the link c

    Flow study: turbulence model and wall functions flow-turb.js
    • PartCraft
    64-bit
  • Model update in a cell

    The wall function in wall cells and one pseudo-time step of the model equation elsewhere.

    ν̃_new = (ν̃ + Δt × rhs) ÷ (1 + Δt c_w1 f_w ν̃ ÷ d²); wall cell: ν̃ = κ u_τ y

    Flow study: turbulence model and wall functions flow-turb.js
    • PartCraft
    64-bit
  • Pseudo-time step

    The model's time step from the advection and diffusion limits.

    Δt = max(0.05, min(every, 0.5 ÷ u_max, 0.8 σ ÷ (6 (ν + ν̃_max))))

    Flow study: turbulence model and wall functions flow-turb.js
    • PartCraft
    64-bit
  • First-cell y⁺ statistics

    The minimum, maximum, mean and percentiles of y⁺ over the wall cells.

    percentile p = sorted[⌊p × n⌋]

    Flow study: turbulence model and wall functions flow-turb.js
    • PartCraft
    64-bit
  • Wall force correction for slip

    The term added to the momentum-exchange force on walls that carry a slip velocity.

    F += Σ u_w (f_in − f_out)

    Flow study: turbulence model and wall functions flow-turb.js
    • PartCraft
    64-bit
  • Streamlines

    Traces lines along the flow from seed points for drawing.

    x ← x + ds × v(x + ½ ds v̂) ÷ |v|

    Simulation and flow result plots flow.js
    • PartCraft
    32-bit, display only
  • Slice of a field

    Copies one layer of cells of a field for the cut-plane picture.

    Simulation and flow result plots flow.js
    • PartCraft
    32-bit, display only
  • Field for coloring

    Picks the values and the color range for the cut plane.

    Simulation and flow result plots flow-ui.js
    • PartCraft
    32-bit, display only
  • Plot mesh

    Splits the part's triangles until no edge is longer than the cell size, for drawing a field.

    midpoint = (a + b) ÷ 2

    Simulation and flow result plots fea.js
    • PartCraft
    32-bit, display only
  • One subdivision step

    New face, edge and vertex points of the cage refined once.

    smooth vertex = Q ÷ n + 2R ÷ n + (n − 3) v ÷ n; crease vertex = (a + 6v + b) ÷ 8; edge = mean of its ends and the two face points

    Freeform bodies: subdivision surface and cage edits form.js
    • PartCraft
    64-bit
  • Limit position of a vertex

    Where a vertex ends up on the smooth surface.

    smooth: (n² v + 4 Σ e + Σ f) ÷ (n (n + 5)); crease: (a + 4v + b) ÷ 6; corner: v

    Freeform bodies: subdivision surface and cage edits form.js
    • PartCraft
    64-bit
  • Limit surface normal at a vertex

    The unit normal of the smooth surface at an interior vertex.

    A = 1 + cos(2π ÷ n) + cos(π ÷ n) √(2 (9 + cos(2π ÷ n))); normal = t₁ × t₂ ÷ |t₁ × t₂|

    Freeform bodies: subdivision surface and cage edits form.js
    • PartCraft
    64-bit
  • Bézier patch of one quad

    The 16 control points of the bicubic patch for one face of the refined cage.

    b = M G Mᵀ with rows of M: (1, 4, 1, 0) ÷ 6, (0, 4, 2, 0) ÷ 6, (0, 2, 4, 0) ÷ 6, (0, 1, 4, 1) ÷ 6; across a sharp edge: 2 × edge − inner

    Freeform bodies: subdivision surface and cage edits form.js
    • PartCraft
    64-bit
  • Point on a patch

    Evaluates a bicubic Bézier patch at (u, v).

    S(u, v) = Σᵢ Σⱼ Bᵢ(u) Bⱼ(v) b_ij, B = ((1 − u)³, 3u(1 − u)², 3u²(1 − u), u³)

    Freeform bodies: subdivision surface and cage edits form.js
    • PartCraft
    64-bit
  • Normal of a patch

    The unit normal of a patch at (u, v).

    n = ∂S/∂u × ∂S/∂v, normalized

    Freeform bodies: subdivision surface and cage edits form.js
    • PartCraft
    64-bit
  • Refinement level for conversion

    How many times the cage is refined before it is turned into patches.

    level = max(1 if any face is not a quad, ⌈largest semi-sharp weight − 1e-12⌉), at most 4

    Freeform bodies: subdivision surface and cage edits form.js
    • PartCraft
    Exact
  • How well the patches meet

    The largest gap and the largest angle between normals across shared patch edges.

    gap = max |p₀ − p₁|; angle = acos(clamp(n₀ · n₁, −1, 1)) × 180 ÷ π

    Freeform bodies: subdivision surface and cage edits form.js
    • PartCraft
    64-bit
  • Fitting a cage to a target surface

    Moves cage vertices until their limit points lie on a sphere or torus.

    p ← p + (proj(L) − L), L the vertex's limit point

    Freeform bodies: subdivision surface and cage edits form.js
    • PartCraft
    64-bit
  • Torus cage

    The vertices of a torus-shaped starting cage.

    ((R + r cos b) cos a, r sin b, (R + r cos b) sin a), a = 2π i ÷ n, b = 2π j ÷ m

    Freeform bodies: subdivision surface and cage edits form.js
    • PartCraft
    64-bit
  • Mirror partners

    Finds each vertex's partner across the symmetry plane.

    q = p mirrored; partner when |v − q| ≤ 1e-6 × size

    Freeform bodies: subdivision surface and cage edits form.js
    • PartCraft
    64-bit
  • Rebuilding the mirrored half

    Keeps one side of the symmetry plane and mirrors it.

    mirror: x' = 2 × at − x

    Freeform bodies: subdivision surface and cage edits form.js
    • PartCraft
    64-bit
  • Moving, rotating and scaling vertices

    Applies a 4 × 4 transform to the selected vertices, with an optional soft falloff and mirrored motion.

    p' = p + w (M p − p); soft weight w = (1 − (d ÷ R)²)²

    Freeform bodies: subdivision surface and cage edits form.js
    • PartCraft
    64-bit
  • Extruding faces

    Moves a region of faces along its averaged normals and adds side walls.

    new vertex = v + dist × (Σ face normals at v) ÷ |Σ face normals at v|

    Freeform bodies: subdivision surface and cage edits form.js
    • PartCraft
    64-bit
  • Face normal

    The area-weighted normal of a cage face with any number of corners.

    n_x = Σ (p_y − q_y)(p_z + q_z), and cyclic

    Freeform bodies: subdivision surface and cage edits form.js
    • PartCraft
    64-bit
  • Flattening vertices onto a plane

    Projects the selected vertices onto a given plane or their best-fit plane.

    p' = p − n ((p − o) · n)

    Freeform bodies: subdivision surface and cage edits form.js
    • PartCraft
    64-bit
  • Best-fit plane normal

    The direction in which a set of centered points varies least.

    A = Σ p pᵀ; normal = eigenvector of the smallest eigenvalue

    Freeform bodies: subdivision surface and cage edits form.js
    • PartCraft
    64-bit
  • Adding a face through points

    Adds a face, reusing existing vertices that are close to the given points.

    reuse a vertex when |q − p| ≤ 1e-6

    Freeform bodies: subdivision surface and cage edits form.js
    • PartCraft
    64-bit
  • Bridging two loops

    Joins two loops of equal size with rows of quads.

    offset = argmin Σ |aᵢ − b₍offset − i₎|²; row vertex = a + (b − a) × r ÷ segments

    Freeform bodies: subdivision surface and cage edits form.js
    • PartCraft
    64-bit
  • Smooth surface for display

    The limit positions of the refined cage as a triangle mesh.

    Freeform bodies: display mesh form.js
    • PartCraft
    32-bit, display only
  • Tolerance and roughness text

    The text of a tolerance value or an Ra value on the drawing.

    text = value rounded to 4 decimals

    Drawing annotations: tolerance frames, datums and surface finish gdt.js
    • PartCraft
    64-bit
  • Circle and arc points

    The points of a circle or arc in a symbol.

    (c_x + r cos t, c_y + r sin t), t = a₀ + sweep × i ÷ n

    Drawing annotations: tolerance frames, datums and surface finish gdt.js
    • PartCraft
    64-bit
  • Annotation layout

    The frame, compartments, leader, datum triangle and surface texture legs of one annotation.

    frame height = 2h; datum triangle height = side × √3 ÷ 2; texture legs at 60°: offset = leg ÷ tan(π ÷ 3)

    Drawing annotations: tolerance frames, datums and surface finish gdt.js
    • PartCraft
    64-bit
  • Point on a B-spline curve

    The point of a curve at a parameter, from its poles and knots.

    C(t) = Σ Nⱼ(t) × Pⱼ over the p + 1 poles of the span

    Surface through a network of curves gordon.js
    • PartCraft
    64-bit
  • Point on a B-spline surface

    The point of the surface at (u, v), from its pole grid and two knot vectors.

    S(u, v) = Σᵢ Σⱼ Nᵢ(u) × Nⱼ(v) × Pᵢⱼ

    Surface through a network of curves gordon.js
    • PartCraft
    64-bit
  • Interpolation knots by averaging

    The knot vector used to interpolate points at given parameters.

    inner knot j = (t_j + … + t_(j+p−1)) ÷ p

    Surface through a network of curves gordon.js
    • PartCraft
    64-bit
  • Band solve for interpolation

    Factors the collocation matrix once and solves for the poles of every curve that shares its parameters.

    N × P = Q, with N banded; LU without pivoting, then forward and back substitution

    Surface through a network of curves gordon.js
    • PartCraft
    64-bit
  • Degree raising and knot refinement

    Re-expresses a curve with a higher degree or more knots without changing its shape.

    new poles = solve(N_fine(g), C(g)), g = Greville points of the finer knot vector

    Surface through a network of curves gordon.js
    • PartCraft
    64-bit
  • Merged knot vector

    The smallest knot vector that contains the knot vectors of several curves.

    Surface through a network of curves gordon.js
    • PartCraft
    64-bit
  • Joining exact curves end to end

    Makes one B-spline from a chain of lines and splines, with a corner knot at each joint.

    knot = a + (b − a) × u for each piece's inner knots; joint knots repeated d times

    Surface through a network of curves gordon.js
    • PartCraft
    64-bit
  • Sketch chains as world curves

    Turns the chosen lines, arcs, circles and splines of a sketch into curves over 0 to 1, one per chain.

    share of a piece = its length ÷ total length; arc length = r × sweep; circle = 2π × r

    Surface through a network of curves gordon.js
    • PartCraft
    64-bit
  • Closest points of two segments

    The nearest pair of points on two straight segments, used to find where two curves may cross.

    s = (b·f − c·e) ÷ (a·e − b²), t = (b·s + f) ÷ e, both clamped to 0…1

    Surface through a network of curves gordon.js
    • PartCraft
    64-bit
  • Crossing of two curves

    The parameters on a profile and a guide where they meet, and the gap between them there.

    minimize |A(s) − B(t)|² by Gauss–Newton; point = (A(s) + B(t)) ÷ 2; gap = |A(s) − B(t)|

    Surface through a network of curves gordon.js
    • PartCraft
    64-bit
  • All crossings of a profile and a guide

    Finds every place two curves come within the gap tolerance, so the network can be checked to be a grid.

    Surface through a network of curves gordon.js
    • PartCraft
    64-bit
  • Common parameters of a curve family

    The shared parameter at which every profile (or guide) meets each curve of the other family.

    t_q = mean over the curves of (x_q − x_first) ÷ (x_last − x_first)

    Surface through a network of curves gordon.js
    • PartCraft
    64-bit
  • Monotone reparametrization

    A smooth increasing map from the common parameters to one curve's own crossing parameters.

    m_k = (w₁ + w₂) ÷ (w₁ ÷ d_(k−1) + w₂ ÷ d_k); cubic Hermite on each interval

    Surface through a network of curves gordon.js
    • PartCraft
    64-bit
  • Distance from a point to a curve

    How far a point of the fitted surface or curve is from the true curve near a given parameter range.

    golden-section search for the minimum of |g(t) − q|

    Surface through a network of curves gordon.js
    • PartCraft
    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.