Functioning code, requires improved sequencing
This commit is contained in:
@@ -46,7 +46,7 @@ class Reactor {
|
|||||||
|
|
||||||
this.currentTime = Date.now(); // milliseconds since epoch [ms]
|
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.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 = this._arrayClip2Zero(stateNew);
|
||||||
|
this.state.forEach((row, i) => this.extendedState[i+BC_PADDING] = row);
|
||||||
return stateNew;
|
return stateNew;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -347,8 +348,6 @@ class Reactor_PFR extends Reactor {
|
|||||||
* for outlet, apply regular Danckwerts BC (Neumann BC with no flux)
|
* for outlet, apply regular Danckwerts BC (Neumann BC with no flux)
|
||||||
*/
|
*/
|
||||||
_applyBoundaryConditions() {
|
_applyBoundaryConditions() {
|
||||||
this.state.forEach((row, i) => this.extendedState[i+BC_PADDING] = row);
|
|
||||||
|
|
||||||
if (this.upstreamReactor) {
|
if (this.upstreamReactor) {
|
||||||
for (let i = 0; i < BC_PADDING; i++) {
|
for (let i = 0; i < BC_PADDING; i++) {
|
||||||
this.extendedState[i] = this.upstreamReactor.state.at(i-BC_PADDING);
|
this.extendedState[i] = this.upstreamReactor.state.at(i-BC_PADDING);
|
||||||
|
|||||||
Reference in New Issue
Block a user