The defaults and checks of a nonlinear or contact study, and the time steps and loads of a thermal stress history.
How the precision is kept
These functions build the inputs and read the results of solvers that live in other files. The arithmetic here is small and 64-bit. The solver tolerance and step counts set the accuracy of the results.
Calculations under this policy
4 calculations in 2 source files. The code is read from the released app when this page loads. It is the calculation people run, not a copy kept for this page.
Chooses which time steps of the heat run get a stress solve.
stepᵢ = round(i × steps ÷ (n − 1)), i = 0…n−1
Integer steps from one 64-bit division and rounding, with duplicates removed. n is limited to 2 to 51.
thermal-history.js
lines 31 to 37
PartCraft 0.8.1
/** The time steps solved for stress: [step] for 'time', else `solves` steps evenly over the run, 0 (the start) and the end included. */
export function stressSteps(tr, tl) {
if ((tl.at || 'worst') === 'time') return [stepAt(tr, tl.time).step];
const n = Math.max(2, Math.min(MAX_SOLVES, Math.round(tl.solves || 21)));
const out = new Set(); for (let i = 0; i < n; i++) out.add(Math.round(i * tr.steps / (n - 1)));
return [...out].sort((a, b) => a - b);
}
Thermal load per step
64-bit
The load vector of each stress step and the temperature range of the worst step.
ΔT = T − Tref; f = f_mech + ft(ΔT)
ΔT and f are Float64Array. Frames of T come from the heat run, so their type is whatever thermal.js gives (not read here). The reported temperature range is taken from the 64-bit ΔT copy of the worst step.
thermal-history.js
lines 87 to 89
PartCraft 0.8.1
for (let n = 0; n < s.nn; n++) dT[n] = s.active[n] ? T[n] - Tref : 0;
const ft = TH.thermalLoadVector(s.mesh, s.mat, dT);
for (let k = 0; k < f.length; k++) f[k] = fm[k] + ft[k];
In detail
Method
Default tangent modulus Et = E ÷ 100; thermal load vector uses ΔT = T − Tref per node; time steps spread evenly over the run.
Number types
64-bit arrays (Float64Array for the load and temperature difference). The temperature frames are read from the thermal run, whose storage type is set in thermal.js (not read here).
Tolerances
Nonlinear tol is 1e-6 by default and must be 1e-10 to 1e-2; a penetration over 1 percent of the element size is a problem; the stress solve tolerance defaults to 1e-8; contact penalty factor 1 to 1e4 (20 by default).
Checked by
tools/partcraft-test/test-thermal.mjs is named in the file header as the check of linear superposition and the steady limit; it was not run here.
Approach: 64-bit, stated limit
The arithmetic is 64-bit, but the method or the data sets the accuracy: a solver tolerance, a mesh, a step size, a datum shift, a table. The limit is stated where the result is shown.