Refactor advanced-reactor node to improve input handling and initialize reactor properties
This commit is contained in:
15
dependencies/reactor_class.js
vendored
15
dependencies/reactor_class.js
vendored
@@ -9,14 +9,23 @@ class Reactor_CSTR {
|
||||
this.asm = new ASM3();
|
||||
|
||||
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]
|
||||
this.F = 0.0; // fluid debit [m3 d-1]
|
||||
this.C_in = Array(13).fill(0.0); // composition influent
|
||||
this.OTR = 0.0; // oxygen transfer rate [g O2 d-1]
|
||||
|
||||
this.currentTime = Date.now(); // milliseconds since epoch [ms]
|
||||
this.timeStep = 1/(24*60*15) // time step [d]
|
||||
}
|
||||
|
||||
set setInflux(input) { // setter for C_in (WIP)
|
||||
this.F = input.payload.F;
|
||||
this.C_in = input.payload.C_in;
|
||||
}
|
||||
|
||||
set setOTR(input) { // setter for OTR (WIP) [g O2 d-1]
|
||||
this.OTR = input.payload;
|
||||
}
|
||||
|
||||
// expect update with timestamp
|
||||
updateState(input) {
|
||||
let newTime = input.payload;
|
||||
|
||||
Reference in New Issue
Block a user