Functioning code, requires improved sequencing

This commit is contained in:
2025-10-02 17:39:31 +02:00
parent cd3a19e66f
commit baecf2f599

View File

@@ -46,7 +46,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 = 100; // speed up factor for simulation, 60 means 1 minute per simulated second
}
/**
@@ -327,6 +327,7 @@ class Reactor_PFR extends Reactor {
}
this.state = this._arrayClip2Zero(stateNew);
this.state.forEach((row, i) => this.extendedState[i+BC_PADDING] = row);
return stateNew;
}
@@ -347,8 +348,6 @@ class Reactor_PFR extends Reactor {
* for outlet, apply regular Danckwerts BC (Neumann BC with no flux)
*/
_applyBoundaryConditions() {
this.state.forEach((row, i) => this.extendedState[i+BC_PADDING] = row);
if (this.upstreamReactor) {
for (let i = 0; i < BC_PADDING; i++) {
this.extendedState[i] = this.upstreamReactor.state.at(i-BC_PADDING);