Add fluid volume and initial component inputs to advanced-reactor node edit dialogue
This commit is contained in:
@@ -4,12 +4,38 @@
|
||||
color: '#c4cce0',
|
||||
defaults: {
|
||||
name: { value: "" },
|
||||
volume: { value: 0., required: true},
|
||||
S_O_init: { value: 0., required: true },
|
||||
S_I_init: { value: 30., required: true },
|
||||
S_S_init: { value: 100., required: true },
|
||||
S_NH_init: { value: 16., required: true },
|
||||
S_N2_init: { value: 0., required: true },
|
||||
S_NO_init: { value: 0., required: true },
|
||||
S_HCO_init: { value: 5., required: true },
|
||||
X_I_init: { value: 25., required: true },
|
||||
X_S_init: { value: 75., required: true },
|
||||
X_H_init: { value: 30., required: true },
|
||||
X_STO_init: { value: 0., required: true },
|
||||
X_A_init: { value: 0.001, required: true },
|
||||
X_TS_init: { value: 125., required: true }
|
||||
},
|
||||
inputs: 1,
|
||||
outputs: 1,
|
||||
icon: "font-awesome/fa-recycle",
|
||||
label: function() {
|
||||
return this.name||"advanced-reactor";
|
||||
},
|
||||
oneditprepare: function() {
|
||||
$(".typed-num").typedInput({
|
||||
type:"num",
|
||||
types:["num"]
|
||||
});
|
||||
},
|
||||
oneditsave: function() {
|
||||
let volume = parseFloat($("#node-input-volume").typedInput("value"));
|
||||
if (isNaN(volume) || volume <= 0) {
|
||||
RED.notify("Fluid volume not set correctly", {type: "error"});
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -19,6 +45,65 @@
|
||||
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
||||
<input type="text" id="node-input-name" placeholder="Name">
|
||||
</div>
|
||||
<h2> Reactor properties </h2>
|
||||
<div class="form-row">
|
||||
<label for="node-input-volume"><i class="fa fa-tag"></i> Fluid volume [m3]</label>
|
||||
<input type="text" id="node-input-volume" class="typed-num" placeholder="m3">
|
||||
</div>
|
||||
<h2> Dissolved components </h2>
|
||||
<div class="form-row">
|
||||
<label for="node-input-S_O_init"><i class="fa fa-tag"></i> Initial dissolved oxygen [g O2 m-3]</label>
|
||||
<input type="text" id="node-input-S_O_init">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-S_I_init"><i class="fa fa-tag"></i> Initial soluble inert organics [g COD m-3]</label>
|
||||
<input type="text" id="node-input-S_I_init" class="typed-num">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-S_S_init"><i class="fa fa-tag"></i> Initial readily biodegrable substrates [g COD m-3]</label>
|
||||
<input type="text" id="node-input-S_S_init" class="typed-num">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-S_NH_init"><i class="fa fa-tag"></i> Initial ammonium / ammonia [g N m-3]</label>
|
||||
<input type="text" id="node-input-S_NH_init" class="typed-num">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-S_N2_init"><i class="fa fa-tag"></i> Initial dinitrogen, released by denitrification [g N m-3]</label>
|
||||
<input type="text" id="node-input-S_N2_init" class="typed-num">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-S_NO_init"><i class="fa fa-tag"></i> Initial nitrite + nitrate [g N m-3]</label>
|
||||
<input type="text" id="node-input-S_NO_init" class="typed-num">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-S_HCO_init"><i class="fa fa-tag"></i> Initial alkalinity, bicarbonate [mole HCO3- m-3]</label>
|
||||
<input type="text" id="node-input-S_HCO_init" class="typed-num">
|
||||
</div>
|
||||
<h2> Particulate components </h2>
|
||||
<div class="form-row">
|
||||
<label for="node-input-X_I_init"><i class="fa fa-tag"></i> Initial inert particulate organics [g COD m-3]</label>
|
||||
<input type="text" id="node-input-X_I_init" class="typed-num">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-X_S_init"><i class="fa fa-tag"></i> Initial slowly biodegrable substrates [g COD m-3]</label>
|
||||
<input type="text" id="node-input-X_S_init" class="typed-num">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-X_H_init"><i class="fa fa-tag"></i> Initial heterotrophic biomass [g COD m-3]</label>
|
||||
<input type="text" id="node-input-X_H_init" class="typed-num">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-X_STO_init"><i class="fa fa-tag"></i> Initial Organics stored by heterotrophs [g COD m-3]</label>
|
||||
<input type="text" id="node-input-X_STO_init" class="typed-num">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-X_A_init"><i class="fa fa-tag"></i> Initial autotrophic, nitrifying biomass [g COD m-3]</label>
|
||||
<input type="text" id="node-input-X_A_init" class="typed-num">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-X_TS_init"><i class="fa fa-tag"></i> Initial total suspended solids [g TSS m-3]</label>
|
||||
<input type="text" id="node-input-X_TS_init" class="typed-num">
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/html" data-help-name="advanced-reactor">
|
||||
|
||||
@@ -7,7 +7,24 @@ module.exports = function(RED) {
|
||||
|
||||
const Reactor = require('./dependencies/reactor_class');
|
||||
|
||||
const reactor = new Reactor(Array(13).fill(0.001));
|
||||
const reactor = new Reactor(
|
||||
config.volume,
|
||||
[
|
||||
config.S_O_init,
|
||||
config.S_I_init,
|
||||
config.S_S_init,
|
||||
config.S_NH_init,
|
||||
config.S_N2_init,
|
||||
config.S_NO_init,
|
||||
config.S_HCO_init,
|
||||
config.X_I_init,
|
||||
config.X_S_init,
|
||||
config.X_H_init,
|
||||
config.X_STO_init,
|
||||
config.X_A_init,
|
||||
config.X_TS_init
|
||||
]
|
||||
);
|
||||
|
||||
node.on('input', function(msg, send, done) {
|
||||
if (msg.topic == "clock") {
|
||||
|
||||
4
dependencies/reactor_class.js
vendored
4
dependencies/reactor_class.js
vendored
@@ -3,12 +3,12 @@ const math = require('mathjs')
|
||||
|
||||
class Reactor_CSTR {
|
||||
|
||||
constructor(initial_state) {
|
||||
constructor(volume, initial_state) {
|
||||
this.state = initial_state;
|
||||
console.log(this.state);
|
||||
this.asm = new ASM3();
|
||||
|
||||
this.Vl = 10.0; // fluid volume reactor [m3]
|
||||
this.Vl = volume; // fluid volume reactor [m3]
|
||||
this.F = 1.0; // fluid debit [m3 d-1]
|
||||
this.C_in = [0., 30., 100., 16., 0., 0., 5., 25., 75., 30., 0., 0., 125.]; // composition influent
|
||||
this.OTR = 100.0; // oxygen transfer rate [g O2 d-1]
|
||||
|
||||
Reference in New Issue
Block a user