2026-04-22 16:49:41 +02:00
|
|
|
|
// Steady sewer inflow, level-based control, pumps should settle.
|
|
|
|
|
|
//
|
|
|
|
|
|
// Expectation: with a stable inflow of 0.008 m³/s and a pump bank with
|
|
|
|
|
|
// max capacity 0.012 m³/s, the level settles in the RAMP zone (between
|
2026-05-06 17:23:20 +02:00
|
|
|
|
// inflowLevel and maxLevel while filling) at roughly the point where demand matches
|
2026-04-22 16:49:41 +02:00
|
|
|
|
// inflow. No safety trips should fire.
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
|
|
name: 'levelbased-steady',
|
|
|
|
|
|
description: 'Constant sewer inflow below pump capacity; level converges inside the RAMP zone with demand matching inflow.',
|
2026-05-06 17:23:20 +02:00
|
|
|
|
durationSec: 3600,
|
2026-04-22 16:49:41 +02:00
|
|
|
|
|
|
|
|
|
|
config: {
|
|
|
|
|
|
general: { name: 'EvalSteady', id: 'eval-steady', unit: 'm3/h',
|
|
|
|
|
|
logging: { enabled: false, logLevel: 'error' } },
|
|
|
|
|
|
functionality: { softwareType: 'pumpingStation', role: 'stationcontroller', positionVsParent: 'atEquipment' },
|
2026-05-06 17:23:20 +02:00
|
|
|
|
basin: { volume: 50, height: 5, inflowLevel: 3, outflowLevel: 0.2, overflowLevel: 4.5, inletPipeDiameter: 0.4, outletPipeDiameter: 0.3 },
|
2026-04-22 16:49:41 +02:00
|
|
|
|
hydraulics: { refHeight: 'NAP', basinBottomRef: 0, minHeightBasedOn: 'outlet' },
|
|
|
|
|
|
control: {
|
|
|
|
|
|
mode: 'levelbased',
|
|
|
|
|
|
allowedModes: new Set(['levelbased']),
|
2026-05-06 17:23:20 +02:00
|
|
|
|
levelbased: { minLevel: 1, startLevel: 2, maxLevel: 4, curveType: 'linear', logCurveFactor: 9 },
|
2026-04-22 16:49:41 +02:00
|
|
|
|
},
|
|
|
|
|
|
safety: {
|
|
|
|
|
|
enableDryRunProtection: true,
|
|
|
|
|
|
dryRunThresholdPercent: 2,
|
2026-05-06 17:23:20 +02:00
|
|
|
|
enableHighVolumeSafety: true,
|
|
|
|
|
|
highVolumeSafetyThresholdPercent: 98,
|
2026-04-22 16:49:41 +02:00
|
|
|
|
timeleftToFullOrEmptyThresholdSeconds: 0,
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
setup: async (ps) => {
|
|
|
|
|
|
// Stub MGC: its pumps collectively deliver (demand/100) × MAX_OUTFLOW.
|
|
|
|
|
|
const MAX_OUTFLOW = 0.012; // m³/s
|
|
|
|
|
|
ps.machineGroups['mgc1'] = {
|
|
|
|
|
|
config: { general: { name: 'mgc1' } },
|
|
|
|
|
|
turnOffAllMachines: () => {
|
|
|
|
|
|
ps.measurements.type('flow').variant('predicted').position('out').child('mgc1').value(0, Date.now(), 'm3/s');
|
|
|
|
|
|
},
|
|
|
|
|
|
handleInput: async (_source, demand) => {
|
|
|
|
|
|
const d = Math.max(0, Math.min(100, Number(demand) || 0));
|
|
|
|
|
|
const outflow = (d / 100) * MAX_OUTFLOW;
|
|
|
|
|
|
ps.measurements.type('flow').variant('predicted').position('out').child('mgc1').value(outflow, Date.now(), 'm3/s');
|
|
|
|
|
|
},
|
|
|
|
|
|
};
|
2026-05-06 17:23:20 +02:00
|
|
|
|
ps.calibratePredictedLevel(2.0); // start at the mode start level, below the rising ramp
|
2026-04-22 16:49:41 +02:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
inputs: (t, ps) => {
|
|
|
|
|
|
ps.setManualInflow(0.008, Date.now(), 'm3/s'); // ≈ 29 m³/h
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
expectations: [
|
|
|
|
|
|
{ name: 'no safety trips', type: 'safety_trips_eq', value: 0 },
|
|
|
|
|
|
{ name: 'level stays below overflow', type: 'max_level_bounded', value: 4.5 },
|
|
|
|
|
|
{ name: 'level stays above outflow', type: 'min_level_bounded', value: 0.2 },
|
2026-05-06 17:23:20 +02:00
|
|
|
|
{ name: 'rising ramp engages after inlet level', type: 'max_demand_gt', value: 0 },
|
2026-04-22 16:49:41 +02:00
|
|
|
|
{ name: 'no threshold issues on init', type: 'threshold_issues_eq', value: 0 },
|
|
|
|
|
|
],
|
|
|
|
|
|
};
|