Table of Contents

Class SeqPhysicsState

Namespace
Hi.Physics
Assembly
HiMech.dll

The state the sequential physics stage carries from one step to the next – the temperatures of the cutter body, the cutter surface, the workpiece surface and the chip, the cutter's flute and shank temperature nodes, the spindle temperature and the two spindle energies, the three accumulated wear values and the two carries the thermal step reads back – with what the step's own thermal step wrote beside it (the instant crater wear, the thermal-stress flag). Each step's state is copied from the previous step's (SeqPhysicsState(SeqPhysicsState)) and advanced by the thermal step (BuildCuttingTemperatureAndWear(SeqPhysicsState, MachineMotionStep, MachineMotionStep, double, SpindleCapability, IMachiningTool, Workpiece, int, Substraction, LayerMillingEngagement, MillingForceBrief, CoolantHeatCondition, CoolantMode, bool, MillingToolPhysicsPack, Action<string>)), the spindle temperature (BuildSpindleTemperatureAndRatio(MachineMotionStep, MillingForceBrief, double, SpindleCapability, SpindleSpeedCache, double)) and the spindle meter energy: a state, not a summary of the step (most of the record is what the next step starts from), which is why the type is a State and not a Brief like MillingForceBrief. Named SeqPhysicsBrief until 2026-10-27; a session script may keep the old name (ScriptRenameBridge), and MachiningStep.TryGetSeqPhysicsBrief still answers. Persisted as one record (WriteBin(BinaryWriter), SeqPhysicsState(BinaryReader)).

public class SeqPhysicsState : IGetQuantityByKey, IWriteBin
Inheritance
SeqPhysicsState
Implements
Inherited Members
Extension Methods

Constructors

SeqPhysicsState(SeqPhysicsState)

Creates a new instance by copying from an existing SeqPhysicsState.

public SeqPhysicsState(SeqPhysicsState src)

Parameters

src SeqPhysicsState

The source object to copy from.

SeqPhysicsState(double, double)

Initializes a new instance of the SeqPhysicsState class.

public SeqPhysicsState(double ambientTemperature_K, double spindleTemperature_K)

Parameters

ambientTemperature_K double

The ambient temperature in Kelvin.

spindleTemperature_K double

The spindle temperature in Kelvin.

SeqPhysicsState(BinaryReader)

Reads a state written by WriteBin(BinaryWriter). The version byte is judged before a byte of the payload is read.

public SeqPhysicsState(BinaryReader reader)

Parameters

reader BinaryReader

The reader positioned at the record's first byte.

Exceptions

InvalidDataException

The record's version is not this build's.

Properties

AccumulatedCraterWear_um

Gets or sets the accumulated crater wear in micrometers: the wear of the tool now mounted, which starts from zero at each tool change.

public double AccumulatedCraterWear_um { get; set; }

Property Value

double

AccumulatedFlankWearDepth_um

Gets or sets the accumulated flank wear depth in micrometers: the wear of the tool now mounted, which starts from zero at each tool change.

public double AccumulatedFlankWearDepth_um { get; set; }

Property Value

double

AccumulatedFlankWearWidth_um

Gets or sets the accumulated flank wear width in micrometers: the wear of the tool now mounted, which starts from zero at each tool change.

public double AccumulatedFlankWearWidth_um { get; set; }

Property Value

double

ChipTemperature_C

Gets or sets the chip temperature in Celsius.

[NotMapped]
public double ChipTemperature_C { get; set; }

Property Value

double

ChipTemperature_K

Gets or sets the chip temperature in Kelvin.

public double ChipTemperature_K { get; set; }

Property Value

double

CutterBodyTemperature_C

Gets or sets the cutter body temperature in Celsius.

[NotMapped]
public double CutterBodyTemperature_C { get; set; }

Property Value

double

CutterBodyTemperature_K

Gets or sets the cutter body temperature in Kelvin.

public double CutterBodyTemperature_K { get; set; }

Property Value

double

CutterFluteTemperatureList

Gets or sets the list of cutter dermis temperatures at different depths. [0] represents the temperature at the rake surface.

public List<double> CutterFluteTemperatureList { get; set; }

Property Value

List<double>

CutterShankTemperatureList

Gets or sets the list of cutter body temperatures at different points.

public List<double> CutterShankTemperatureList { get; set; }

Property Value

List<double>

CutterSurfaceTemperature_C

Gets or sets the cutter surface temperature in Celsius.

[NotMapped]
public double CutterSurfaceTemperature_C { get; set; }

Property Value

double

CutterSurfaceTemperature_K

Gets or sets the cutter surface temperature in Kelvin.

public double CutterSurfaceTemperature_K { get; set; }

Property Value

double

InstantCraterWear_um

Gets or sets the instant crater wear in micrometers.

public double InstantCraterWear_um { get; set; }

Property Value

double

IsThermalStressEvaluated

Whether the thermal step of this state ran to its thermal-stress evaluation. The thermal step (BuildCuttingTemperatureAndWear(SeqPhysicsState, MachineMotionStep, MachineMotionStep, double, SpindleCapability, IMachiningTool, Workpiece, int, Substraction, LayerMillingEngagement, MillingForceBrief, CoolantHeatCondition, CoolantMode, bool, MillingToolPhysicsPack, Action<string>)) sets it on every step it is run for, once past NoThermalChain, to whether the cutter has a flute material (FluteMaterial): a step that cuts nothing reads true as a cutting step does, and so does a step no kernel served (a thermal constant not given, a physics input missing other than the flute material, a model unavailable). The play and the step-physics recompute run the thermal step only with the physics on (EnablePhysics) and for the step's tool as the tool house holds it, a MillingCutter with a flute envelope (ShaperProfileRefusesGeometry false). So the flag is false on a step played with the physics off, on a step whose tool has no thermal chain (a cutter that is not a milling cutter, a flute profile that refuses its geometry, a tool id the tool house lacks) and on a step whose cutter has no flute material. GetThermalStress_MPa(MillingCutter, double) and GetThermalYieldRatio(MillingCutter, double) read 0 while this is false. Not carried over by the copy constructor: each step's thermal step sets it anew.

public bool IsThermalStressEvaluated { get; }

Property Value

bool

SpindleEnergyConsumption_kJ

Accumulation of Spindle input energy.

public double SpindleEnergyConsumption_kJ { get; }

Property Value

double

SpindleMeterEnergyConsumption_kJ

Accumulated spindle meter energy in kilojoules: the running sum over the steps of the spindle meter power times the step duration, dry-run power in air included (see GetMeterPower_W(double, double)). A step whose meter power is not known (no spindle capability, or a step that cuts without a physics result) adds nothing.

public double SpindleMeterEnergyConsumption_kJ { get; }

Property Value

double

SpindleTemperature_C

Gets or sets the spindle temperature in Celsius.

public double SpindleTemperature_C { get; }

Property Value

double

SpindleTemperature_K

Gets or sets the spindle temperature in Kelvin.

public double SpindleTemperature_K { get; }

Property Value

double

WorkpieceSurfaceTemperature_C

Gets or sets the workpiece surface temperature in Celsius.

[NotMapped]
public double WorkpieceSurfaceTemperature_C { get; set; }

Property Value

double

WorkpieceSurfaceTemperature_K

Gets or sets the workpiece surface temperature in Kelvin.

public double WorkpieceSurfaceTemperature_K { get; set; }

Property Value

double

Methods

AddToCsvDictionary(Dictionary<string, string>)

Adds physical quantities to a CSV dictionary representation.

public void AddToCsvDictionary(Dictionary<string, string> dst)

Parameters

dst Dictionary<string, string>

The destination dictionary to add values to.

AddToQuantityDictionary(Dictionary<string, double>)

Adds physical quantities to a numeric dictionary representation.

public void AddToQuantityDictionary(Dictionary<string, double> dst)

Parameters

dst Dictionary<string, double>

The destination dictionary to add values to.

BuildCuttingTemperatureAndWear(SeqPhysicsState, MachineMotionStep, MachineMotionStep, double, SpindleCapability, IMachiningTool, Workpiece, int, Substraction, LayerMillingEngagement, MillingForceBrief, CoolantHeatCondition, CoolantMode, bool, MillingToolPhysicsPack, Action<string>)

Builds cutting temperature and wear calculations for the current step. No thermal step runs — the temperatures and the wear then stay where the tool change, or the last step the model ran on, left them — for a cutter that is not a milling cutter or whose APT refuses its geometry (the method returns); for a tool whose flute, shank or coating-layer material, or the workpiece material, is present with a thermal constant not given (HasThermalConstants, a material file without the element: treated as a missing material, named where the thermal constants are checked, nothing said here); for a step that lacks a physics input (named at the session begin or the tool change, nothing said here); or where neither the native session nor the managed reference chain serves the configuration (nothing said here either: the answer says it, and the play announces it once per tool). What became of the step is the answer (ThermalStepOutcome).

public ThermalStepOutcome BuildCuttingTemperatureAndWear(SeqPhysicsState preSeqPhysicsState, MachineMotionStep preMachineMotionStep, MachineMotionStep curMachineMotionStep, double ambientTemperature_K, SpindleCapability spindleCapability, IMachiningTool machiningTool, Workpiece workpiece, int stepIndex, Substraction substraction, LayerMillingEngagement layerMillingEngagement, MillingForceBrief millingForceBrief, CoolantHeatCondition coolantHeatCondition, CoolantMode coolantMode, bool enableWearEffect, MillingToolPhysicsPack physicsPack = null, Action<string> onWarning = null)

Parameters

preSeqPhysicsState SeqPhysicsState

The previous step's state, which this state was copied from (SeqPhysicsState(SeqPhysicsState)). Not read: the step starts from this state — the copied values, or on a tool change the reseeded temperatures and the wear started from zero.

preMachineMotionStep MachineMotionStep

The previous machine motion step.

curMachineMotionStep MachineMotionStep

The current machine motion step.

ambientTemperature_K double

The ambient temperature in Kelvin.

spindleCapability SpindleCapability

The spindle capability information.

machiningTool IMachiningTool

The machining tool.

workpiece Workpiece

The workpiece.

stepIndex int

The step index.

substraction Substraction

The substraction data.

layerMillingEngagement LayerMillingEngagement

The layer milling engagement.

millingForceBrief MillingForceBrief

The milling force brief.

coolantHeatCondition CoolantHeatCondition

The coolant heat condition.

coolantMode CoolantMode

Current coolant delivery mode — selects which convection coefficient in coolantHeatCondition is used by the temperature FEM. Callers must supply the per-step mode (e.g. from CoolantMode) so the FEM sees the real runtime state rather than a silent default.

enableWearEffect bool

Whether to enable wear effect calculations.

physicsPack MillingToolPhysicsPack

The frozen per-session physics pack of machiningTool; null computes the tool's scalar derivations on use.

onWarning Action<string>

The thermal loop's own warning, with its text: a non-physical step duration that trips the tooth-cycle cap (the play says it as Spindle-Speed–Capped). Whether the step ran, and why not, is the answer, not a warning.

Returns

ThermalStepOutcome

What became of the thermal step (ThermalStepOutcome).

BuildSpindleTemperatureAndRatio(MachineMotionStep, MillingForceBrief, double, SpindleCapability, SpindleSpeedCache, double)

Internal Use Only. Builds SpindleTemperature_K of this step from the previous step's temperature and the spindle heat model; the working temperature ratio is no longer stored but read through GetSpindleWorkingTemperatureRatio(double, SpindleCapability) (the method keeps its name).

public void BuildSpindleTemperatureAndRatio(MachineMotionStep machiningStep, MillingForceBrief rakeFacePhysicsBrief, double ambientTemperature_K, SpindleCapability spindleCapability, SpindleSpeedCache spindleSpeedCache, double preSpindleTemperature_K)

Parameters

machiningStep MachineMotionStep
rakeFacePhysicsBrief MillingForceBrief
ambientTemperature_K double
spindleCapability SpindleCapability
spindleSpeedCache SpindleSpeedCache
preSpindleTemperature_K double

GetCutterDermisAvgTemperature_K(double, IList<ThermalLayer1D>)

Gets the average cutter dermis temperature up to a specific depth.

public double GetCutterDermisAvgTemperature_K(double depth, IList<ThermalLayer1D> thermalLayerList)

Parameters

depth double

The depth to calculate the average temperature to

thermalLayerList IList<ThermalLayer1D>

The list of thermal layers

Returns

double

The average temperature in Kelvin up to the specified depth

GetCutterDermisTemperature_K(double, IList<ThermalLayer1D>)

Gets the cutter dermis temperature at a specified depth.

public double GetCutterDermisTemperature_K(double depth_mm, IList<ThermalLayer1D> thermalLayerList)

Parameters

depth_mm double

The depth in millimeters.

thermalLayerList IList<ThermalLayer1D>

The thermal layer list.

Returns

double

The temperature in Kelvin.

GetFluteTemperatureUnderCoating_K(MillingCutter)

The flute temperature under the coating layers of millingCutter: CutterFluteTemperatureList at the cutter's coating layer count — the node the thermal stress and the thermal yield ratio read; NaN without a milling cutter, a flute list, or a node at that index.

public double GetFluteTemperatureUnderCoating_K(MillingCutter millingCutter)

Parameters

millingCutter MillingCutter

The cutter the temperature is read for; null yields NaN.

Returns

double

The temperature in Kelvin, or NaN.

GetQuantityByKey(string)

Gets a quantity value associated with the specified key.

public double GetQuantityByKey(string key)

Parameters

key string

The key to look up

Returns

double

The quantity value associated with the key

GetSpindleWorkingTemperatureRatio(double, SpindleCapability)

Gets the ratio of the current spindle temperature to its working temperature range, computed on read: (SpindleTemperature_K − ambient) over (WorkingTemperatureUpperBoundary_K − ambient).

public double GetSpindleWorkingTemperatureRatio(double ambientTemperature_K, SpindleCapability spindleCapability)

Parameters

ambientTemperature_K double

The ambient temperature in Kelvin.

spindleCapability SpindleCapability

The spindle capability the ratio is read against.

Returns

double

NaN when the spindle heat model is unknown — no spindle capability, or one without its continuous condition (InfInsistentSpindleSpeedToTorque_cycleDs_Nm / InfInsistentSpindleSpeedToPower_cycleDs_kW): the two cases under which the play's cache chain, seeded with no cache, never gets a SpindleSpeedCache and BuildSpindleTemperatureAndRatio(MachineMotionStep, MillingForceBrief, double, SpindleCapability, SpindleSpeedCache, double) only carries the temperature over; else the ratio. A step whose speed leaves the capability without a heat model has its temperature carried over too, but its ratio is read like any other: the capability and its working range are there.

GetSpindleWorkingTemperatureRatio(double, double, SpindleCapability)

Internal Use Only. The spindle working temperature ratio of a spindle temperature: the formula GetSpindleWorkingTemperatureRatio(double, SpindleCapability) reads, for a reader that holds the temperature as a number (the plural strip charts' resident channels).

public static double GetSpindleWorkingTemperatureRatio(double spindleTemperature_K, double ambientTemperature_K, SpindleCapability spindleCapability)

Parameters

spindleTemperature_K double

The spindle temperature in Kelvin.

ambientTemperature_K double

The ambient temperature in Kelvin.

spindleCapability SpindleCapability

The spindle capability of the moment.

Returns

double

NaN without a capability or without its continuous condition; else the ratio.

GetThermalStress_MPa(MillingCutter, double)

Gets the thermal stress in megapascals, computed on read from the flute temperature under the coating (CutterFluteTemperatureList[CoatingLayerList.Count]) and the flute material's expansion coefficient, elastic modulus and Poisson ratio.

public double GetThermalStress_MPa(MillingCutter millingCutter, double ambientTemperature_K)

Parameters

millingCutter MillingCutter

The cutter the stress is read for.

ambientTemperature_K double

The ambient temperature in Kelvin.

Returns

double

0 while IsThermalStressEvaluated is false; NaN when the cutter passed in cannot state it (not a milling cutter, no flute material, no flute temperature under its coating layers); else the stress.

GetThermalStress_MPa(MillingCutter, double, double, bool)

Internal Use Only. The thermal stress of a flute temperature under the coating: the formula GetThermalStress_MPa(MillingCutter, double) reads, for a reader that holds the temperature and the evaluated flag as numbers (the plural strip charts' resident channels).

public static double GetThermalStress_MPa(MillingCutter millingCutter, double ambientTemperature_K, double fluteTemperatureUnderCoating_K, bool isThermalStressEvaluated)

Parameters

millingCutter MillingCutter

The cutter the stress is read for (its flute material).

ambientTemperature_K double

The ambient temperature in Kelvin.

fluteTemperatureUnderCoating_K double

The flute temperature under the coating in Kelvin; NaN when not known.

isThermalStressEvaluated bool

Whether the thermal step evaluated the stress (IsThermalStressEvaluated).

Returns

double

0 while not evaluated; NaN without a flute material or a temperature; else the stress in MPa.

GetThermalYieldRatio(MillingCutter, double)

Ratio between Thermal Stress and tensile strength, computed on read. The tensile strength is applied since the compressive strength is high. so assume if the material shrink back, there arise tensile stress.

public double GetThermalYieldRatio(MillingCutter millingCutter, double ambientTemperature_K)

Parameters

millingCutter MillingCutter

The cutter the stress is read for.

ambientTemperature_K double

The ambient temperature in Kelvin.

Returns

double

0 while IsThermalStressEvaluated is false; NaN when the cutter passed in cannot state it (not a milling cutter, no flute material, no flute temperature under its coating layers); else the stress.

GetThermalYieldRatio(MillingCutter, double, double, bool)

Internal Use Only. The thermal yield ratio of a flute temperature under the coating: the formula GetThermalYieldRatio(MillingCutter, double) reads, for a reader that holds the temperature and the evaluated flag as numbers (the plural strip charts' resident channels).

public static double GetThermalYieldRatio(MillingCutter millingCutter, double ambientTemperature_K, double fluteTemperatureUnderCoating_K, bool isThermalStressEvaluated)

Parameters

millingCutter MillingCutter

The cutter the stress is read for (its flute material).

ambientTemperature_K double

The ambient temperature in Kelvin.

fluteTemperatureUnderCoating_K double

The flute temperature under the coating in Kelvin; NaN when not known.

isThermalStressEvaluated bool

Whether the thermal step evaluated the stress (IsThermalStressEvaluated).

Returns

double

0 while not evaluated; NaN without a flute material or a temperature; else the stress in MPa.

SetByCsvDictionary(Dictionary<string, string>, bool)

Sets properties from a CSV dictionary.

public void SetByCsvDictionary(Dictionary<string, string> src, bool removeFromSource = false)

Parameters

src Dictionary<string, string>

The source dictionary containing values.

removeFromSource bool

Whether to remove keys from the source dictionary after reading.

WriteBin(BinaryWriter)

Writes this state as one record: [version], the thirteen stored doubles as their raw bits (NaN payloads and signed zeros survive) — the four temperatures of the cutter, the workpiece surface and the chip, the spindle temperature, the two spindle energies, the three accumulated wear values and the instant crater wear, the two carries of the thermal step — the IsThermalStressEvaluated flag (one byte), then the two cutter temperature lists, each an int32 count (-1 for a null list, which the bit-for-bit comparison of the step-physics recompute (BitEquals) tells from an empty one) and its doubles. Every stored value that comparison reads, so a state read back by SeqPhysicsState(BinaryReader) equals this one bit for bit. The layout is the contract a native step record will write one day.

public void WriteBin(BinaryWriter writer)

Parameters

writer BinaryWriter

The writer to write to.