Rename repo
This commit is contained in:
248
reactor.html
Normal file
248
reactor.html
Normal file
@@ -0,0 +1,248 @@
|
||||
<script src="/advancedReactor/menu.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
RED.nodes.registerType("advancedReactor", {
|
||||
category: "WWTP",
|
||||
color: "#c4cce0",
|
||||
defaults: {
|
||||
name: { value: "" },
|
||||
reactor_type: { value: "CSTR", required: true },
|
||||
volume: { value: 0., required: true },
|
||||
length: { value: 0.},
|
||||
resolution_L: { value: 0.},
|
||||
alpha: {value: 0},
|
||||
n_inlets: { value: 1, required: true},
|
||||
kla: { value: null },
|
||||
|
||||
S_O_init: { value: 0., required: true },
|
||||
S_I_init: { value: 30., required: true },
|
||||
S_S_init: { value: 100., required: true },
|
||||
S_NH_init: { value: 16., required: true },
|
||||
S_N2_init: { value: 0., required: true },
|
||||
S_NO_init: { value: 0., required: true },
|
||||
S_HCO_init: { value: 5., required: true },
|
||||
X_I_init: { value: 25., required: true },
|
||||
X_S_init: { value: 75., required: true },
|
||||
X_H_init: { value: 30., required: true },
|
||||
X_STO_init: { value: 0., required: true },
|
||||
X_A_init: { value: 0.001, required: true },
|
||||
X_TS_init: { value: 125.0009, required: true },
|
||||
|
||||
timeStep: { value: 1, required: true },
|
||||
|
||||
enableLog: { value: false },
|
||||
logLevel: { value: "error" },
|
||||
|
||||
positionVsParent: { value: "" },
|
||||
},
|
||||
inputs: 1,
|
||||
outputs: 3,
|
||||
inputLabels: ["input"],
|
||||
outputLabels: ["process", "dbase", "parent"],
|
||||
icon: "font-awesome/fa-recycle",
|
||||
label: function() {
|
||||
return this.name || "advancedReactor";
|
||||
},
|
||||
oneditprepare: function() {
|
||||
// wait for the menu scripts to load
|
||||
const waitForMenuData = () => {
|
||||
if (window.EVOLV?.nodes?.advancedReactor?.initEditor) {
|
||||
window.EVOLV.nodes.advancedReactor.initEditor(this);
|
||||
} else {
|
||||
setTimeout(waitForMenuData, 50);
|
||||
}
|
||||
};
|
||||
waitForMenuData();
|
||||
|
||||
$("#node-input-volume").typedInput({
|
||||
type:"num",
|
||||
types:["num"]
|
||||
});
|
||||
$("#node-input-n_inlets").typedInput({
|
||||
type:"num",
|
||||
types:["num"]
|
||||
});
|
||||
$("#node-input-length").typedInput({
|
||||
type:"num",
|
||||
types:["num"]
|
||||
});
|
||||
$("#node-input-resolution_L").typedInput({
|
||||
type:"num",
|
||||
types:["num"]
|
||||
});
|
||||
$("#node-input-kla").typedInput({
|
||||
type:"num",
|
||||
types:["num"]
|
||||
});
|
||||
$(".concentrations").typedInput({
|
||||
type:"num",
|
||||
types:["num"]
|
||||
});
|
||||
$("#node-input-reactor_type").typedInput({
|
||||
types: [
|
||||
{
|
||||
value: "CSTR",
|
||||
options: [
|
||||
{ value: "CSTR", label: "CSTR"},
|
||||
{ value: "PFR", label: "PFR"}
|
||||
]
|
||||
}
|
||||
]
|
||||
})
|
||||
$("#node-input-reactor_type").on("change", function() {
|
||||
const type = $("#node-input-reactor_type").typedInput("value");
|
||||
if (type === "CSTR") {
|
||||
$(".PFR").hide();
|
||||
} else {
|
||||
$(".PFR").show();
|
||||
}
|
||||
});
|
||||
$("#node-input-alpha").typedInput({
|
||||
type:"num",
|
||||
types:["num"]
|
||||
})
|
||||
$("#node-input-timeStep").typedInput({
|
||||
type:"num",
|
||||
types:["num"]
|
||||
})
|
||||
// Set initial visibility on dialog open
|
||||
const initialType = $("#node-input-reactor_type").typedInput("value");
|
||||
if (initialType === "CSTR") {
|
||||
$(".PFR").hide();
|
||||
} else {
|
||||
$(".PFR").show();
|
||||
}
|
||||
},
|
||||
oneditsave: function() {
|
||||
// save logger fields
|
||||
if (window.EVOLV?.nodes?.['advancedReactor']?.loggerMenu?.saveEditor) {
|
||||
window.EVOLV.nodes['advancedReactor'].loggerMenu.saveEditor(this);
|
||||
}
|
||||
|
||||
// save position field
|
||||
if (window.EVOLV?.nodes?.measurement?.positionMenu?.saveEditor) {
|
||||
window.EVOLV.nodes.rotatingMachine.positionMenu.saveEditor(this);
|
||||
}
|
||||
|
||||
let volume = parseFloat($("#node-input-volume").typedInput("value"));
|
||||
if (isNaN(volume) || volume <= 0) {
|
||||
RED.notify("Fluid volume not set correctly", {type: "error"});
|
||||
}
|
||||
let n_inlets = parseInt($("#node-input-n_inlets").typedInput("value"));
|
||||
if (isNaN(n_inlets) || n_inlets < 1) {
|
||||
RED.notify("Number of inlets not set correctly", {type: "error"});
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/html" data-template-name="advancedReactor">
|
||||
<div class="form-row">
|
||||
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
||||
<input type="text" id="node-input-name" placeholder="Name">
|
||||
</div>
|
||||
<h2> Reactor properties </h2>
|
||||
<div class="form-row">
|
||||
<label for="node-input-reactor_type"><i class="fa fa-tag"></i> Reactor type</label>
|
||||
<input type="text" id="node-input-reactor_type">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-volume"><i class="fa fa-tag"></i> Fluid volume [m3]</label>
|
||||
<input type="text" id="node-input-volume" placeholder="m3">
|
||||
</div>
|
||||
<div class="form-row PFR">
|
||||
<label for="node-input-length"><i class="fa fa-tag"></i> Reactor length [m]</label>
|
||||
<input type="text" id="node-input-length" placeholder="m">
|
||||
</div>
|
||||
<div class="form-row PFR">
|
||||
<label for="node-input-resolution_L"><i class="fa fa-tag"></i> Resolution</label>
|
||||
<input type="text" id="node-input-resolution_L" placeholder="#">
|
||||
</div>
|
||||
<div class="PFR">
|
||||
<p> Inlet boundary condition parameter α (α = 0: Danckwerts BC / α = 1: Dirichlet BC) </p>
|
||||
<div class="form-row">
|
||||
<label for="node-input-alpha"><i class="fa fa-tag"></i>Adjustable parameter BC</label>
|
||||
<input type="text" id="node-input-alpha">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-n_inlets"><i class="fa fa-tag"></i> Number of inlets</label>
|
||||
<input type="text" id="node-input-n_inlets" placeholder="#">
|
||||
</div>
|
||||
<h3> Internal mass transfer calculation (optional) </h3>
|
||||
<div class="form-row">
|
||||
<label for="node-input-kla"><i class="fa fa-tag"></i> kLa [d-1]</label>
|
||||
<input type="text" id="node-input-kla" placeholder="d-1">
|
||||
</div>
|
||||
<h2> Dissolved components </h2>
|
||||
<div class="form-row">
|
||||
<label for="node-input-S_O_init"><i class="fa fa-tag"></i> Initial dissolved oxygen [g O2 m-3]</label>
|
||||
<input type="text" id="node-input-S_O_init" class="concentrations">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-S_I_init"><i class="fa fa-tag"></i> Initial soluble inert organics [g COD m-3]</label>
|
||||
<input type="text" id="node-input-S_I_init" class="concentrations">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-S_S_init"><i class="fa fa-tag"></i> Initial readily biodegrable substrates [g COD m-3]</label>
|
||||
<input type="text" id="node-input-S_S_init" class="concentrations">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-S_NH_init"><i class="fa fa-tag"></i> Initial ammonium / ammonia [g N m-3]</label>
|
||||
<input type="text" id="node-input-S_NH_init" class="concentrations">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-S_N2_init"><i class="fa fa-tag"></i> Initial dinitrogen, released by denitrification [g N m-3]</label>
|
||||
<input type="text" id="node-input-S_N2_init" class="concentrations">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-S_NO_init"><i class="fa fa-tag"></i> Initial nitrite + nitrate [g N m-3]</label>
|
||||
<input type="text" id="node-input-S_NO_init" class="concentrations">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-S_HCO_init"><i class="fa fa-tag"></i> Initial alkalinity, bicarbonate [mole HCO3- m-3]</label>
|
||||
<input type="text" id="node-input-S_HCO_init" class="concentrations">
|
||||
</div>
|
||||
<h2> Particulate components </h2>
|
||||
<div class="form-row">
|
||||
<label for="node-input-X_I_init"><i class="fa fa-tag"></i> Initial inert particulate organics [g COD m-3]</label>
|
||||
<input type="text" id="node-input-X_I_init" class="concentrations">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-X_S_init"><i class="fa fa-tag"></i> Initial slowly biodegrable substrates [g COD m-3]</label>
|
||||
<input type="text" id="node-input-X_S_init" class="concentrations">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-X_H_init"><i class="fa fa-tag"></i> Initial heterotrophic biomass [g COD m-3]</label>
|
||||
<input type="text" id="node-input-X_H_init" class="concentrations">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-X_STO_init"><i class="fa fa-tag"></i> Initial Organics stored by heterotrophs [g COD m-3]</label>
|
||||
<input type="text" id="node-input-X_STO_init" class="concentrations">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-X_A_init"><i class="fa fa-tag"></i> Initial autotrophic, nitrifying biomass [g COD m-3]</label>
|
||||
<input type="text" id="node-input-X_A_init" class="concentrations">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-X_TS_init"><i class="fa fa-tag"></i> Initial total suspended solids [g TSS m-3]</label>
|
||||
<input type="text" id="node-input-X_TS_init" class="concentrations">
|
||||
</div>
|
||||
<h2> Simulation parameters </h2>
|
||||
<div class="form-row">
|
||||
<label for="node-input-timeStep"><i class="fa fa-tag"></i> Time step [s]</label>
|
||||
<input type="text" id="node-input-timeStep" placeholder="s">
|
||||
</div>
|
||||
|
||||
<!-- Logger fields injected here -->
|
||||
<div id="logger-fields-placeholder"></div>
|
||||
|
||||
<!-- Position fields will be injected here -->
|
||||
<div id="position-fields-placeholder"></div>
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script type="text/html" data-help-name="advancedReactor">
|
||||
<p>New reactor node</p>
|
||||
</script>
|
||||
Reference in New Issue
Block a user