Clean up unused code

This commit is contained in:
2025-11-06 15:46:43 +01:00
parent 4578667a96
commit 5c41dc44a3
7 changed files with 2 additions and 2096 deletions

View File

@@ -1,57 +0,0 @@
<script type="text/javascript">
RED.nodes.registerType("recirculation-pump", {
category: "WWTP",
color: "#e4a363",
defaults: {
name: { value: "" },
F2: { value: 0, required: true },
inlet: { value: 1, required: true }
},
inputs: 1,
outputs: 2,
outputLabels: ["Main effluent", "Recirculation effluent"],
icon: "font-awesome/fa-random",
label: function() {
return this.name || "Recirculation pump";
},
oneditprepare: function() {
$("#node-input-F2").typedInput({
type:"num",
types:["num"]
});
$("#node-input-inlet").typedInput({
type:"num",
types:["num"]
});
},
oneditsave: function() {
let debit = parseFloat($("#node-input-F2").typedInput("value"));
if (isNaN(debit) || debit < 0) {
RED.notify("Debit is not set correctly", {type: "error"});
}
let inlet = parseInt($("#node-input-n_inlets").typedInput("value"));
if (inlet < 1) {
RED.notify("Number of inlets not set correctly", {type: "error"});
}
}
});
</script>
<script type="text/html" data-template-name="recirculation-pump">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-F2"><i class="fa fa-tag"></i> Recirculation debit [m3 d-1]</label>
<input type="text" id="node-input-F2" placeholder="m3 s-1">
</div>
<div class="form-row">
<label for="node-input-inlet"><i class="fa fa-tag"></i> Assigned inlet recirculation</label>
<input type="text" id="node-input-inlet" placeholder="#">
</div>
</script>
<script type="text/html" data-help-name="recirculation-pump">
<p>Recirculation-pump for splitting streams</p>
</script>

View File

@@ -1,40 +0,0 @@
module.exports = function(RED) {
function recirculation(config) {
RED.nodes.createNode(this, config);
var node = this;
let name = config.name;
let F2 = parseFloat(config.F2);
const inlet_F2 = parseInt(config.inlet);
node.on('input', function(msg, send, done) {
switch (msg.topic) {
case "Fluent":
// conserve volume flow debit
let F_in = msg.payload.F;
let F1 = Math.max(F_in - F2, 0);
let F2_corr = F_in < F2 ? F_in : F2;
let msg_F1 = structuredClone(msg);
msg_F1.payload.F = F1;
let msg_F2 = {...msg};
msg_F2.payload.F = F2_corr;
msg_F2.payload.inlet = inlet_F2;
send([msg_F1, msg_F2]);
break;
case "clock":
break;
default:
console.log("Unknown topic: " + msg.topic);
}
if (done) {
done();
}
});
}
RED.nodes.registerType("recirculation-pump", recirculation);
};

View File

@@ -1,57 +0,0 @@
<script type="text/javascript">
RED.nodes.registerType("settling-basin", {
category: "WWTP",
color: "#e4a363",
defaults: {
name: { value: "" },
TS_set: { value: 0.1, required: true },
inlet: { value: 1, required: true }
},
inputs: 1,
outputs: 2,
outputLabels: ["Main effluent", "Sludge effluent"],
icon: "font-awesome/fa-random",
label: function() {
return this.name || "Settling basin";
},
oneditprepare: function() {
$("#node-input-TS_set").typedInput({
type:"num",
types:["num"]
});
$("#node-input-inlet").typedInput({
type:"num",
types:["num"]
});
},
oneditsave: function() {
let TS_set = parseFloat($("#node-input-TS_set").typedInput("value"));
if (isNaN(TS_set) || TS_set < 0) {
RED.notify("TS is not set correctly", {type: "error"});
}
let inlet = parseInt($("#node-input-n_inlets").typedInput("value"));
if (inlet < 1) {
RED.notify("Number of inlets not set correctly", {type: "error"});
}
}
});
</script>
<script type="text/html" data-template-name="settling-basin">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-TS_set"><i class="fa fa-tag"></i> Total Solids set point [g m-3]</label>
<input type="text" id="node-input-TS_set" placeholder="">
</div>
<div class="form-row">
<label for="node-input-inlet"><i class="fa fa-tag"></i> Assigned inlet return line</label>
<input type="text" id="node-input-inlet" placeholder="#">
</div>
</script>
<script type="text/html" data-help-name="settling-basin">
<p>Settling tank</p>
</script>

View File

@@ -1,57 +0,0 @@
module.exports = function(RED) {
function settler(config) {
RED.nodes.createNode(this, config);
var node = this;
let name = config.name;
let TS_set = parseFloat(config.TS_set);
const inlet_sludge = parseInt(config.inlet);
node.on('input', function(msg, send, done) {
switch (msg.topic) {
case "Fluent":
// conserve volume flow debit
let F_in = msg.payload.F;
let C_in = msg.payload.C;
let F2 = (F_in * C_in[12]) / TS_set;
let F1 = Math.max(F_in - F2, 0);
let F2_corr = F_in < F2 ? F_in : F2;
let msg_F1 = structuredClone(msg);
msg_F1.payload.F = F1;
msg_F1.payload.C[7] = 0;
msg_F1.payload.C[8] = 0;
msg_F1.payload.C[9] = 0;
msg_F1.payload.C[10] = 0;
msg_F1.payload.C[11] = 0;
msg_F1.payload.C[12] = 0;
let msg_F2 = {...msg};
msg_F2.payload.F = F2_corr;
if (F2_corr > 0) {
msg_F2.payload.C[7] = F_in * C_in[7] / F2;
msg_F2.payload.C[8] = F_in * C_in[8] / F2;
msg_F2.payload.C[9] = F_in * C_in[9] / F2;
msg_F2.payload.C[10] = F_in * C_in[10] / F2;
msg_F2.payload.C[11] = F_in * C_in[11] / F2;
msg_F2.payload.C[12] = F_in * C_in[12] / F2;
}
msg_F2.payload.inlet = inlet_sludge;
send([msg_F1, msg_F2]);
break;
case "clock":
break;
default:
console.log("Unknown topic: " + msg.topic);
}
if (done) {
done();
}
});
}
RED.nodes.registerType("settling-basin", settler);
};

File diff suppressed because it is too large Load Diff

119
package-lock.json generated
View File

@@ -1,119 +0,0 @@
{
"name": "reactor",
"version": "0.0.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "reactor",
"version": "0.0.1",
"license": "SEE LICENSE",
"dependencies": {
"generalFunctions": "git+https://gitea.centraal.wbd-rd.nl/RnD/generalFunctions.git",
"mathjs": "^14.5.2"
}
},
"node_modules/@babel/runtime": {
"version": "7.28.4",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.4.tgz",
"integrity": "sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==",
"license": "MIT",
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/complex.js": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/complex.js/-/complex.js-2.4.2.tgz",
"integrity": "sha512-qtx7HRhPGSCBtGiST4/WGHuW+zeaND/6Ld+db6PbrulIB1i2Ev/2UPiqcmpQNPSyfBKraC0EOvOKCB5dGZKt3g==",
"license": "MIT",
"engines": {
"node": "*"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/rawify"
}
},
"node_modules/decimal.js": {
"version": "10.6.0",
"resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.6.0.tgz",
"integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==",
"license": "MIT"
},
"node_modules/escape-latex": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/escape-latex/-/escape-latex-1.2.0.tgz",
"integrity": "sha512-nV5aVWW1K0wEiUIEdZ4erkGGH8mDxGyxSeqPzRNtWP7ataw+/olFObw7hujFWlVjNsaDFw5VZ5NzVSIqRgfTiw==",
"license": "MIT"
},
"node_modules/fraction.js": {
"version": "5.3.4",
"resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-5.3.4.tgz",
"integrity": "sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ==",
"license": "MIT",
"engines": {
"node": "*"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/rawify"
}
},
"node_modules/generalFunctions": {
"version": "1.0.0",
"resolved": "git+https://gitea.centraal.wbd-rd.nl/RnD/generalFunctions.git#efc97d6cd17399391b011298e47e8c1b1599592d",
"license": "SEE LICENSE"
},
"node_modules/javascript-natural-sort": {
"version": "0.7.1",
"resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz",
"integrity": "sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==",
"license": "MIT"
},
"node_modules/mathjs": {
"version": "14.8.0",
"resolved": "https://registry.npmjs.org/mathjs/-/mathjs-14.8.0.tgz",
"integrity": "sha512-DN4wmAjNzFVJ9vHqpAJ3vX0UF306u/1DgGKh7iVPuAFH19JDRd9NAaQS764MsKbSwDB6uBSkQEmgVmKdgYaCoQ==",
"license": "Apache-2.0",
"dependencies": {
"@babel/runtime": "^7.26.10",
"complex.js": "^2.2.5",
"decimal.js": "^10.4.3",
"escape-latex": "^1.2.0",
"fraction.js": "^5.2.1",
"javascript-natural-sort": "^0.7.1",
"seedrandom": "^3.0.5",
"tiny-emitter": "^2.1.0",
"typed-function": "^4.2.1"
},
"bin": {
"mathjs": "bin/cli.js"
},
"engines": {
"node": ">= 18"
}
},
"node_modules/seedrandom": {
"version": "3.0.5",
"resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz",
"integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==",
"license": "MIT"
},
"node_modules/tiny-emitter": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
"integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==",
"license": "MIT"
},
"node_modules/typed-function": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/typed-function/-/typed-function-4.2.1.tgz",
"integrity": "sha512-EGjWssW7Tsk4DGfE+5yluuljS1OGYWiI1J6e8puZz9nTMM51Oug8CD5Zo4gWMsOhq5BI+1bF+rWTm4Vbj3ivRA==",
"license": "MIT",
"engines": {
"node": ">= 18"
}
}
}
}

View File

@@ -11,6 +11,7 @@
"activated sludge",
"wastewater",
"biological model",
"EVOLV",
"node-red"
],
"license": "SEE LICENSE",
@@ -21,9 +22,7 @@
},
"node-red": {
"nodes": {
"reactor": "reactor.js",
"recirculation-pump": "additional_nodes/recirculation-pump.js",
"settling-basin": "additional_nodes/settling-basin.js"
"reactor": "reactor.js"
}
},
"dependencies": {