Part scale¶
openwaam.partscale.ThermalConfig
dataclass
¶
Grid, boundary conditions, heat source and output settings of the part-scale thermal model. SI units.
Source code in openwaam/partscale/thermal.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |
openwaam.partscale.ThermalModel
¶
Transient temperature field of a build on a voxel grid.
The torch follows a Trajectory. Call run(), then read
summary(), history, probe_T and interpass, or write the
fields with to_vtk(path).
bead_direction()
¶
Unit vector (nx, ny, nz, 3) along the bead that laid each voxel; zero in the plate and where nothing was deposited. In the plate under the part it is the direction of the first bead above, which is what the distortion model needs for the plate's plastic strain.
fields()
¶
Thermal-history maps on the voxels of the part (plate excluded), as a dict of arrays.
born, layer, peak_temperature, time_liquid (time at or above the liquidus; thin edges can quench through it within one step and show zero), time_above_critical (since the last melting), reheat_peak (highest temperature after first cooling: tells whether the metal was remelted by its neighbours), solidification_time (time to cool from the solidus to solidus - window), cooling_rate (K/s over that window), landing_temperature (temperature of the metal below at the instant this voxel was deposited; it includes preheating by the approaching arc), t_act (time of deposition).
run(t_end=None, verbose=True, snapshot_times=(), snapshot_cb=None)
¶
Run to t_end (default: end of the trajectory plus final_cooling).
With cfg.interpass_temperature set, the torch waits before every
layer until the point where the arc will strike has cooled to that
temperature. Waiting stretches the build: t is wall-clock time,
t - t_shift is time along the trajectory, waits holds the
wait per layer.
stored_energy()
¶
Enthalpy in the active voxels relative to everything at ambient, J.
openwaam.partscale.InherentStrainModel
¶
Layer-wise inherent strain analysis on a structured hex mesh.
Parameters¶
active : bool array (ex, ey, ez), elements that exist at the end of the build
group : int array, activation step of each element (-1 = present from the start)
d : element edge lengths
inherent_strain : (exx, eyy, ezz) applied to every newly activated element,
or None for the default -(1 - nu) * yield / E in-plane (the strain that
leaves a fully restrained layer at yield), zero through the thickness.
It may also be a field, one strain per element, of shape (ex, ey, ez, 3)
or (ex, ey, ez, 6) with engineering shear (xy, yz, zx): this is how a
strain along the bead is given when beads run in different directions
(see along_direction).
substrate_strain : optional array (ex, ey, ez) of in-plane strain,
(ex, ey, ez, 3) of (exx, eyy, ezz), or (ex, ey, ez, 6), for elements that exist from the
start: the plate under the bead, which also yields. Applied when the
first layer is laid. See plastic_strain_from_peak_temperature.
yield_cap : if True the von Mises stress is capped at yield (elastic,
perfectly plastic), by initial-strain iterations in every step.
yield_field : optional array (ex, ey, ez) of yield stress per element
(plate and filler often differ); default is the material's.
along_direction(e, direction)
staticmethod
¶
Strain e along the unit vectors direction (..., 3) and none across them, as the six
components (xx, yy, zz, xy, yz, zx) with engineering shear: e d d^T. e may be an
array matching the leading shape. This is the strain of a bead that shrinks along its
length, for a bead in any direction.
from_thermal(thermal, material=None, coarsen=(3, 3, 1), layers_per_step=1, inherent_strain=None, setting=None, fractions=None, T_cut=1273.0, plate_yield=None, deposit_yield=None)
classmethod
¶
Build the mesh by coarsening a finished ThermalModel.
setting "wall", "block" or "isotropic" (see DISTORTION_SETTINGS), or None for the uniform elastic default of earlier versions. With a setting the deposit gets its thermal shrinkage along and across each bead in the fractions of that setting, taken from the direction the thermal model recorded for every voxel; the plate gets the plastic strain of its peak temperature, distributed the same way; and the stress is capped at yield. fractions (along, across, vertical) overrides the setting's.
plastic_strain_from_peak_temperature(T_peak, material, T_cut=1273.0, T0=300.0, yield_stress=None)
staticmethod
¶
Strain left in metal that was heated to T_peak while held by cold metal around it.
Held in its plane, it yields in compression once cte * dT exceeds yield / E and
keeps the excess as plastic strain: e = -(cte * dT - yield / E) in the plane,
-2 e through the thickness (plastic flow keeps volume). Zero where the plate
stayed cool. Returns an array (..., 3); use it as substrate_strain with
yield_cap=True, which handles the yielding back in tension on cooling.
run(clamp='bottom', verbose=False, release=True)
¶
clamp: "bottom" fixes every node on the underside of the plate during the build; "corners" fixes only the four bottom corner regions; a boolean array over the nodes (ex + 1, ey + 1, ez + 1) fixes those nodes. release: False keeps the clamp on, for a part measured in its fixture; the released state then equals the clamped one.
thermal_shrinkage(material, T_cut=1273.0, T0=300.0)
staticmethod
¶
Inherent strain (exx, eyy, ezz) of deposited metal as plain thermal contraction
from the temperature below which it carries stress (T_cut) to T0. It is several
times the yield strain, so use it with yield_cap=True: the cap, not the strain,
then sets the stress, as in a real bead.