Add checks for NaN values in Reactor_PFR calculations and update hydrolysis rate calculation to handle division by zero

This commit is contained in:
2025-06-28 19:19:38 +02:00
parent 0cc6538003
commit 8215c5ed9a
2 changed files with 27 additions and 8 deletions

View File

@@ -99,7 +99,7 @@ class ASM3 {
const { k_H, K_X, k_STO, nu_NO, K_O, K_NO, K_S, K_STO, mu_H_max, K_NH, K_HCO, b_H_O, b_H_NO, b_STO_O, b_STO_NO, mu_A_max, K_A_NH, K_A_O, K_A_HCO, b_A_O, b_A_NO } = this.kin_params;
// Hydrolysis
rates[0] = k_H * this._monod(X_S / X_H, K_X) * X_H;
rates[0] = X_H == 0 ? 0 : k_H * this._monod(X_S / X_H, K_X) * X_H;
// Heterotrophs
rates[1] = k_STO * this._monod(S_O, K_O) * this._monod(S_S, K_S) * X_H;