This commit is contained in:
znetsixe
2026-03-11 11:13:51 +01:00
parent 460b872053
commit 2c69a5a0c1
5 changed files with 143 additions and 2 deletions

View File

@@ -41,7 +41,7 @@ class Reactor {
this.currentTime = Date.now(); // milliseconds since epoch [ms]
this.timeStep = 1 / (24*60*60) * this.config.timeStep; // time step in seconds, converted to days.
this.speedUpFactor = 60; // speed up factor for simulation, 60 means 1 minute per simulated second
this.speedUpFactor = config.speedUpFactor ?? 1; // speed up factor for simulation
}
/**
@@ -91,6 +91,8 @@ class Reactor {
return { topic: "Fluent", payload: { inlet: 0, F: math.sum(this.Fs), C: this.state }, timestamp: this.currentTime };
}
get getGridProfile() { return null; }
/**
* Calculate the oxygen transfer rate (OTR) based on the dissolved oxygen concentration and temperature.
* @param {number} S_O - Dissolved oxygen concentration [g O2 m-3].
@@ -275,6 +277,18 @@ class Reactor_PFR extends Reactor {
assertNoNaN(this.D2_op, "Second derivative operator");
}
get getGridProfile() {
return {
grid: this.state.map(row => row.slice()),
n_x: this.n_x,
d_x: this.d_x,
length: this.length,
species: ['S_O','S_I','S_S','S_NH','S_N2','S_NO','S_HCO',
'X_I','X_S','X_H','X_STO','X_A','X_TS'],
timestamp: this.currentTime
};
}
/**
* Setter for axial dispersion.
* @param {object} input - Input object (msg) containing payload with dispersion value [m2 d-1].