#!/usr/bin/env node 'use strict'; const lib = require('../index.js'); function runDemo() { const checks = [ lib.assertMassBalance({ inflowKgPerS: 12.5, outflowKgPerS: 12.5, accumulationKgPerS: 0, label: 'reactor-passthrough' }), lib.assertHydraulicBalance({ headerSuctionPa: 0, headerDischargePa: 110000, pumpHeadPa: 110000, label: 'station-A-headers' }), lib.assertHydraulicPower({ flowM3PerS: 0.030, headPa: 110000, shaftPowerW: 5000, efficiency: 0.66, label: 'pump-A' }), lib.assertOxygenTransfer({ klaPerS: 0.002, csMgPerL: 9.0, cMgPerL: 2.0, otrKgPerS: 2.8e-7, volumeM3: 20, label: 'diffuser-A' }), ]; for (const c of checks) process.stdout.write(lib.reportToString(c) + '\n'); const failed = checks.filter((c) => !c.ok).length; process.exit(failed > 0 ? 1 : 0); } if (require.main === module) runDemo();