code wiki / (root) / nx_vessel_thermal.nx

nx_vessel_thermal.nx

buildroot/runtime/nx_vessel_thermal.nx

3312 B72 linesdepth 2pulls 2 transitivereach 10 importersview sourcekind librarytopic vessel
docsdependenciesstructsconstsfunctions

about

nx_vessel_thermal.nx -- H0 of the VIRTUAL-PROTOTYPE / HARDWARE-IN-THE- LOOP ladder. A lumped-capacitance thermal model of the PHYSICAL fermentation vessel in REAL ENGINEERING UNITS, so the hardware can be sized and tested in software before a dollar is spent -- the way a fighter programme runs the digital twin before bending metal. THE PHYSICS (Newton's law of cooling + a heater): C * dT/dt = P*duty - U*(T - T_ambient) C = heat capacity of the contents [J/K] (= mass * specific heat) P = heater power [W] U = insulation conductance to ambient [W/K] (lower = better insulated) Equilibrium at full duty: T_eq = T_ambient + P/U. If T_eq < setpoint the heater is UNDERSIZED -- the design can NEVER reach target, caught here in software instead of after you buy the part. Integer units (no float): temp/ambient milli-C, P milli-W, U milli-(W/K), C J/K, dt seconds. Derivation: dT_mc = net_mw * dt_s / C_jk. THE EXCEED: R1's controller used abstract Q14 gains; H0 is PHYSICAL -- real watts and J/K and W/K -- so it answers "will a 50 W heater hold 4 L of milk at 43 C in a vessel that loses 1 W/K?" before building anything. genealogy_id: lumped_capacitance_thermal_model + newton_cooling_1701 + digital_twin_mbse

dependencies 1 imports · 10 importers

nx_syscalls.nx nx_vessel_thermal.nx nx_vessel_design.nx nx_vessel_design_test.nx nx_vessel_faults.nx nx_vessel_faults_test.nx nx_vessel_geometry.nx nx_vessel_geometry_test.nx nx_vessel_io_test.nx nx_vessel_thermal_test.nx nx_vessel_twin.nx nx_vessel_twin_test.nx

imports: nx_syscalls.nx

imported by: nx_vessel_design.nxnx_vessel_design_test.nxnx_vessel_faults.nxnx_vessel_faults_test.nxnx_vessel_geometry.nxnx_vessel_geometry_test.nxnx_vessel_io_test.nxnx_vessel_thermal_test.nxnx_vessel_twin.nxnx_vessel_twin_test.nx

structs

28struct NxVesselThermal

consts

none

functions

35func nx_vessel_thermal_new(heat_capacity_jk: i64, heater_power_mw: i64,
47func nx_vessel_thermal_step(v: *NxVesselThermal, temp_mc: i64,
58func nx_vessel_equilibrium_mc(v: *NxVesselThermal) -> i64
63func nx_vessel_can_reach(v: *NxVesselThermal, setpoint_mc: i64) -> i64
69func nx_vessel_hold_duty_milli(v: *NxVesselThermal, setpoint_mc: i64) -> i64
called by 1: main