diff --git a/pumpingStation.html b/pumpingStation.html index 74506a9..f9472b3 100644 --- a/pumpingStation.html +++ b/pumpingStation.html @@ -173,6 +173,32 @@ setNumberField('node-input-flowSetpoint', this.flowSetpoint); setNumberField('node-input-flowDeadband', this.flowDeadband); + // Live-compute derived safety levels so the operator can see + // what the % will actually trip at. Mirrors the code formula + // in specificClass._validateThresholdOrdering. + const fNum = (id) => parseFloat(document.getElementById(`node-input-${id}`)?.value); + const updateDerivedLevels = () => { + const basedOn = document.getElementById('node-input-minHeightBasedOn')?.value || 'outlet'; + const refLow = basedOn === 'inlet' ? fNum('inflowLevel') : fNum('outflowLevel'); + const dryRunPct = fNum('dryRunThresholdPercent'); + const overfillPct = fNum('overfillThresholdPercent'); + const overflow = fNum('overflowLevel'); + const dryRunLvl = Number.isFinite(refLow) && Number.isFinite(dryRunPct) + ? refLow * (1 + dryRunPct / 100) : null; + const overfillLvl = Number.isFinite(overflow) && Number.isFinite(overfillPct) + ? overflow * (overfillPct / 100) : null; + const dryEl = document.getElementById('derived-dryRunLevel'); + const ovfEl = document.getElementById('derived-overfillLevel'); + if (dryEl) dryEl.textContent = dryRunLvl != null ? `→ dryRunLevel ≈ ${dryRunLvl.toFixed(2)} m` : '→ dryRunLevel ≈ — m'; + if (ovfEl) ovfEl.textContent = overfillLvl != null ? `→ overfillLevel ≈ ${overfillLvl.toFixed(2)} m` : '→ overfillLevel ≈ — m'; + }; + ['inflowLevel','outflowLevel','overflowLevel','minHeightBasedOn','dryRunThresholdPercent','overfillThresholdPercent'] + .forEach((id) => { + const el = document.getElementById(`node-input-${id}`); + if (el) { el.addEventListener('input', updateDerivedLevels); el.addEventListener('change', updateDerivedLevels); } + }); + setTimeout(updateDerivedLevels, 50); + //------------------- END OF CUSTOM config UI ELEMENTS ------------------- // }, oneditsave: function () { @@ -225,6 +251,7 @@

Basin Geometry

+

All heights measured from the basin floor (0 m).

@@ -236,15 +263,15 @@
- +
- +
- +
@@ -306,7 +333,7 @@
- +
@@ -329,7 +356,8 @@
- + + → dryRunLevel ≈ — m
@@ -341,7 +369,8 @@
- + + → overfillLevel ≈ — m

diff --git a/wiki/diagrams/basin-model.drawio.svg b/wiki/diagrams/basin-model.drawio.svg index 0279225..cf97656 100644 --- a/wiki/diagrams/basin-model.drawio.svg +++ b/wiki/diagrams/basin-model.drawio.svg @@ -1,6 +1,6 @@ -
5. overflowLevel
4. maxLevel
3. startLevel
Sewage + Tank buffer
2. minLevel
Spare volume before spilling
Notes: 
  • All levels should be dynamic. It could also very well be that at a certain time we want to dynamically move the startLevel up or down depending on the situation the weather or incoming flow is in.
  • All level heights are measured from the ref at bottom of basin
1. dryRunLevel
  1. At this level pumps cant pump anymore they will run dry. 
  2. This is the minimum level that should be obtained to protect the pumps from dry-running. Again minLevel and dryLevel can theoretically be the same but isnt advisable seeing there are mechanical delays and other system effects which could harm the pumps.
  3. System is active and pumps flow away.
  4. Flow goes out in the basin or somewhere else in the system. This is the height where gray water will spill over to the river without being cleaned.
  5. MaxLevel is up to where we can "store water" maxLevel and OverflowLevel can theoretically be the same. Its always smart to have a minimum buffer of n %. Its important to factor in measurement deviation in repeatability and accuracy in determining this.
Tank buffer
Inlet Level 
Bottom Of Pipe
(m)
Outlet Level 
Top of pipe
(m)
Tank buffer
Dead volume
Volume (m3)
-----------------------------
Basin height (m)
0 meter (Ref height)
Bottom of pipe 
(m)
\ No newline at end of file