znetsixe 346a3ce2ab fix(reactor): X_A_init default 0.001 → 200; add timeStep-unit regression test
Two fixes for the reactor unit-confusion drift surfaced in the 2026-05-19
wiki uplift:

1. X_A_init default in reactor.html was 0.001 g COD/m³, which is
   effectively zero nitrifying biomass — the reactor cannot nitrify
   ammonia under that initial condition (per the project memory note,
   ~50 mg/L is the minimum). Aligned to the schema default of 200 in
   generalFunctions/src/configs/reactor.json. Same change in
   test/helpers/factories.js so the test factory mirrors the operational
   default; tests that need low-biomass scenarios already override.

2. New test/basic/timestep-units.basic.test.js locks in the
   `config.timeStep is interpreted as seconds` contract — verifies the
   engine's days-stored / seconds-input invariant and asserts the
   schema declares `unit: "s"`, `default: 1`. Companion to the schema
   fix in the generalFunctions submodule.

Full test suite: 49/49 pass (was 46/46 + 3 new).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 13:01:10 +02:00

reactor

Reactor: Advanced Hydraulic Tank & Biological Process Simulator

A comprehensive reactor class for wastewater treatment simulation featuring plug flow hydraulics, ASM1-ASM3 biological modeling, and multi-sectional concentration tracking. Implements hydraulic retention time calculations, dispersion modeling, and real-time biological reaction kinetics for accurate process simulation.

Key Features:

Plug Flow Hydraulics: Multi-section reactor with configurable sectioning factor and dispersion modeling ASM1 Integration: Complete biological nutrient removal modeling with 13 state variables (COD, nitrogen, phosphorus) Dynamic Volume Control: Automatic section management with overflow handling and retention time calculations Oxygen Transfer: Saturation-limited O2 transfer with Fick's law slowdown effects and solubility curves Real-time Kinetics: Continuous biological reaction rate calculations with configurable time acceleration Weighted Averaging: Volume-based concentration mixing for accurate mass balance calculations Child Registration: Integration with diffuser systems and upstream/downstream reactor networks Supports complex biological treatment train modeling with temperature compensation, sludge calculations, and comprehensive process monitoring for wastewater treatment plant optimization and regulatory compliance.

Description
No description provided
Readme EUPL-1.2 370 KiB
Languages
JavaScript 85.2%
HTML 14.8%