molding_warpage_submit
Submit an injection-molding warpage analysis to predict whether a cooled part bows out of flat. Derives differential shrinkage from a cooling case or through-thickness temperature difference.
Instructions
Injection-molding WARPAGE / residual distortion, asynchronous — the FEM
thermo-elastic post-step of the cooling solve (GitHub issue #113 Part B; the
higher-fidelity twin of the #104 CTE shrinkage screen). Answers will the part bow
out of flat once it cools and is ejected. Requires the ccx (CalculiX) binary;
when none resolves this returns {ok:false, reason, install} rather than raising.
The physics: a moulding shrinks as it cools (CTE); uniform shrinkage just makes
it smaller, but differential shrinkage warps it. The dominant driver is the
asymmetric frozen-in through-thickness temperature field at ejection (an unbalanced
cooling layout, one mould half hotter, a rib on one face). Pass that as
dT_through_k (K, the through-thickness differential: T at the thin-face minimum
minus the maximum). The worker meshes body, imposes the field as a thermal
eigenstrain, pins a statically-determinate 3-2-1 constraint, and solves the free
linear-elastic distortion in ccx. A balanced field (dT_through_k≈0) warps ~0; an
asymmetric one bows to the analytic plate curvature (κ=α·ΔT/h), directionally
correct.
Backend: CalculiX (ccx), driven by a deck the worker writes directly (the GPL
solver is held at the subprocess boundary, never imported). Units mm / MPa / 1/K /
°C, so warp comes back in mm.
Coupled cooling hand-off (issue #116): instead of hand-passing dT_through_k,
pass cooling_case_dir (a molding_fill_submit(stages="fill_pack") result's
case_dir) with cooling_nx/cooling_ny (the cooling case mesh; defaults 60/8) and
optional cooling_nz/cooling_time — the worker reads that cooling solve's cell-
centre temperature field and auto-derives the antisymmetric (bending) through-
thickness differential. The result reports dT_through_k and dT_source.
Params: body (a shape handle — the part), and either dT_through_k or
cooling_case_dir (one is required). Material
elastic props from material (corpus card) or explicit youngs_mpa/poisson/
cte_per_k — solidified-resin defaults are used with a warning otherwise (the
corpus rheology cards don't carry structural props). ref_temp_c is the stress-
free / solidification temperature (warp is invariant to it — it only scales the
reported residual stress). char_length_mm sets the mesh size; thickness_axis
('x'|'y'|'z') overrides the auto-detected through-thickness axis; flatness_tol_mm
or flatness_tol_frac (default 0.2 % of span) set the gate tolerance.
Fidelity caveat: a one-way, linear-elastic, loose coupling — it ignores
viscoelastic stress relaxation, flow-induced anisotropy, and the packing-pressure
residual; it captures the dominant differential-shrinkage warp and its direction,
not a calibrated absolute. fidelity="solve" with a conservative band_pct; read
the band.
Returns the degradation dict, or {job_id, status, cache_hit}; poll job_result for {ok, returncode, solver, case_dir, nodes, tets, warp_axis, span_mm, thickness_mm, dT_through_k, dT_source, analytic_bow_mm, gate} where gate is {pass (on flatness), score, fidelity:"solve", band_pct, max_warp_mm, flatness_tol_mm, warp_per_span, max_disp_mm, warp_faithful, analytic_bow_mm, warnings}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | ||
| poisson | No | ||
| material | No | ||
| cte_per_k | No | ||
| cooling_nx | No | ||
| cooling_ny | No | ||
| cooling_nz | No | ||
| ref_temp_c | No | ||
| youngs_mpa | No | ||
| cooling_time | No | ||
| dT_through_k | No | ||
| char_length_mm | No | ||
| thickness_axis | No | ||
| flatness_tol_mm | No | ||
| cooling_case_dir | No | ||
| flatness_tol_frac | No |