Files
OpenNest/OpenNest.Core/CNC/Thermal/ThermalParameters.cs
T
ajandClaude Fable 5.2 85c4c8486e refactor(thermal): remove the graphics card heat map
With short steps only around the torch, the processor is faster than the
card at the quarter-inch cells full sheets use, and the card only gained
at a cell size they do not use. Drop OpenNest.Gpu, the ILGPU dependency
and the accelerator interface; the heat map runs the same on every
computer. The measured card timings stay in docs/plate-heat-map.md.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-12-02 20:35:50 -05:00

78 lines
3.4 KiB
C#

using OpenNest.Support;
namespace OpenNest.CNC.Thermal
{
/// <summary>Inputs to <see cref="PlateHeatSimulation"/>. Lengths are in the plate's units.</summary>
public sealed class ThermalParameters
{
/// <summary>
/// Parameters for a sheet of this stock material name and grade
/// (<see cref="ThermalMaterial.ForName"/>) and thickness, with the default power and loss.
/// </summary>
public static ThermalParameters For(string materialName, string grade, double thickness, Units units) =>
new()
{
Material = ThermalMaterial.ForName($"{materialName} {grade}"),
Thickness = thickness,
Units = units,
};
public ThermalMaterial Material { get; init; } = ThermalMaterial.MildSteel;
/// <summary>Sheet thickness in <see cref="Units"/>.</summary>
public double Thickness { get; init; }
public Units Units { get; init; }
/// <summary>
/// Watts that stay in the sheet while the torch is on: the share of the beam's power not
/// carried off in the melt, the gas or through the kerf. An estimate to calibrate.
/// </summary>
public double AbsorbedPower { get; init; } = 1000;
/// <summary>Heat loss to the air from both faces, in W/m²·K (still air is about 10-25).</summary>
public double SurfaceCoefficient { get; init; } = 20;
/// <summary>
/// Grid cell edge in <see cref="Units"/>. Zero picks one for the plate: 0.5 in (12 mm),
/// halved down to 1/16 in (1.5 mm) while the whole run stays quick to replay, so small
/// plates and short cuts get finer cells.
/// </summary>
public double CellSize { get; init; }
/// <summary>
/// The bed the sheet rests on (usually the plate's <c>SupportBed</c>), in
/// <see cref="Units"/>; null loses heat to the air alone. The sheet loses heat through its
/// bottom face into the bed wherever it lies over a slat or a grid point's pad.
/// </summary>
public SupportBed SupportBed { get; init; }
/// <summary>
/// Heat loss from the sheet into the bed where they touch, in W/m²·K through the bottom
/// face. Contact between a sheet and slats is poor (dry, rough, often slagged, a few
/// hundred W/m²·K), and the slats warm up themselves, which the model does not track, so
/// the default of 200 is an effective value below a cold contact's. An estimate to
/// calibrate.
/// </summary>
public double ContactCoefficient { get; init; } = 200;
/// <summary>
/// The square pad each point of a <c>SupportGrid</c> touches the sheet with, edge in
/// <see cref="Units"/>; zero picks 0.125 in (3 mm). A grid point has no area of its own,
/// so this is an estimate of the worn tip it rests on.
/// </summary>
public double GridContactSize { get; init; }
/// <summary>
/// Takes the short steps of cutting over the whole plate instead of only around the torch.
/// Slower; for comparing the two.
/// </summary>
internal bool WholePlateSteps { get; init; }
internal double MetersPerUnit => Units == Units.Millimeters ? 0.001 : 0.0254;
internal double EffectiveGridContactSize =>
GridContactSize > 0 ? GridContactSize : Units == Units.Millimeters ? 3 : 0.125;
}
}