Refactor reactor constructors to accept a config object for improved clarity and maintainability

This commit is contained in:
2025-07-04 13:16:49 +02:00
parent 348307d999
commit c239b71ad8
2 changed files with 17 additions and 29 deletions

View File

@@ -99,22 +99,10 @@ class nodeClass {
switch (this.config.reactor_type) {
case "CSTR":
new_reactor = new Reactor_CSTR(
this.config.volume,
this.config.n_inlets,
this.config.kla,
this.config.initialState
);
new_reactor = new Reactor_CSTR(this.config);
break;
case "PFR":
new_reactor = new Reactor_PFR(
this.config.volume,
this.config.length,
this.config.resolution_L,
this.config.n_inlets,
this.config.kla,
this.config.initialState
);
new_reactor = new Reactor_PFR(this.config);
break;
default:
console.warn("Unknown reactor type: " + uiConfig.reactor_type);