Compare commits

...

3 Commits

View File

@@ -130,7 +130,7 @@ class Reactor {
const eventName = `${measurementType}.measured.${position}`; const eventName = `${measurementType}.measured.${position}`;
// Register event listener for measurement updates // Register event listener for measurement updates
this.measurements.emitter.on(eventName, (eventData) => { measurement.measurements.emitter.on(eventName, (eventData) => {
this.logger.debug(`${position} ${measurementType} from ${eventData.childName}: ${eventData.value} ${eventData.unit}`); this.logger.debug(`${position} ${measurementType} from ${eventData.childName}: ${eventData.value} ${eventData.unit}`);
// Store directly in parent's measurement container // Store directly in parent's measurement container
@@ -322,13 +322,14 @@ class Reactor_PFR extends Reactor {
_updateMeasurement(measurementType, value, position, context) { _updateMeasurement(measurementType, value, position, context) {
switch(measurementType) { switch(measurementType) {
case "Quantity (oxygen)": case "quantity (oxygen)":
grid_pos = Math.round(position / this.config.length * this.n_x); grid_pos = Math.round(position / this.config.length * this.n_x);
this.state[grid_pos][S_O_INDEX] = value; // naive approach for reconciling measurements and simulation this.state[grid_pos][S_O_INDEX] = value; // naive approach for reconciling measurements and simulation
break; break;
} default:
super._updateMeasurement(measurementType, value, position, context); super._updateMeasurement(measurementType, value, position, context);
} }
}
/** /**
* Apply boundary conditions to the reactor state. * Apply boundary conditions to the reactor state.