code wiki / (root) / nx_vessel_twin.nx

nx_vessel_twin.nx

buildroot/runtime/nx_vessel_twin.nx

2772 B60 linesdepth 7pulls 13 transitivereach 2 importersview sourcekind librarytopic vessel
docsdependenciesstructsconstsfunctions

about

nx_vessel_twin.nx -- CAPSTONE of the HARDWARE-IN-THE-LOOP ladder: the full DIGITAL TWIN sign-off. Given a candidate device (thermal mass, heater, insulation, thermal-cutoff) and a target recipe, it certifies the COMPLETE system end-to-end in software: 1. HARDWARE (H3 = H0 sizing + H1 control + H2 faults): the device can reach, hold, and fail safe. 2. PROCESS (R3 kinetics): at the recipe's hold temperature the ferment actually acidifies to a safe pH within the never-poison window. 3. SAFETY (H2): a stuck heater is contained by the independent fuse. Only if all three pass is the (device, recipe) pair CERTIFIED for build. This is the model-based "iron-bird + flight-sim" certification a fighter programme completes before the first metal is cut -- here for a fermenter so the hardware is the LAST, de-risked step. genealogy_id: nishi_hil_h3 + nishi_ferment_kinetics_r3 + nishi_ferment_recipes_r4

dependencies 8 imports · 2 importers

nx_syscalls.nx nx_ferment_safety.nx nx_ferment_kinetics.nx nx_ferment_recipes.nx nx_vessel_thermal.nx nx_vessel_io.nx nx_vessel_faults.nx nx_vessel_design.nx nx_vessel_twin.nx nx_vessel_geometry_test.nx nx_vessel_twin_test.nx

imports: nx_syscalls.nxnx_ferment_safety.nxnx_ferment_kinetics.nxnx_ferment_recipes.nxnx_vessel_thermal.nxnx_vessel_io.nxnx_vessel_faults.nxnx_vessel_design.nx

imported by: nx_vessel_geometry_test.nxnx_vessel_twin_test.nx

structs

none

consts

27const NX_MAGIC_2000: i64 = 2000
29const NX_TWIN_CERTIFIED: i64 = 0
30const NX_TWIN_FAIL_DESIGN: i64 = 1 // hardware design rejected (H3)
31const NX_TWIN_FAIL_WONT_FERMENT:i64 = 2 // won't acidify in the window (R3)
32const NX_TWIN_FAIL_UNSAFE_FAULT:i64 = 3 // not contained under a fault (H2)

functions

34func nx_vessel_twin_certify(env: *NxFermentSafetyEnvelope, twin: *NxVesselThermal,