API reference#
The complete curated top-level public API, generated from aquakin.__all__. Each domain also exposes its full surface as a subpackage (aquakin.plant, aquakin.integrate, aquakin.utils).
Classes#
The reactor volume and flows that realise an SRT/HRT design target. |
|
Aeration / dissolved-oxygen spec for a |
|
Sizing summary for one tank at one |
|
Diffuser + blower design for the mechanistic aeration energy / airflow. |
|
Instantaneous flow-weighted temperature (the default, historic behaviour). |
|
Headline BSM1 performance indices from a solved plant. |
|
Headline BSM2 performance indices from a solved plant. |
|
Stateless 0-D (batch) reactor. |
|
Solution returned by |
|
Stateless 1-D layered biofilm reactor (diffusion--reaction over depth). |
|
Solution returned by |
|
Vectorised batch reactor for CFD operator-splitting. |
|
A single continuous-flow stirred tank with kinetics + aeration. |
|
Result of |
|
A plant's greenhouse-gas footprint as a CO₂-equivalent mass flow. |
|
A chlorine contact tank: CT-driven log-removal with residual decay. |
|
Runtime representation of a reaction model. |
|
The closure of one conserved component over the simulation window. |
|
An inequality constraint on a design optimization. |
|
Unit prices for monetising a plant's operating cost. |
|
Result of |
|
How a gradient / sensitivity flows through a solve. |
|
A located discontinuity in a solve: a time or state trigger + a reset. |
|
Output of |
|
Result of |
|
Result of |
|
Free-initial-condition settings for calibration. |
|
Per-unit dynamic temperature via a completely-mixed first-order heat balance. |
|
Pass-through translator for when source and target models are the same — the only kind of translator BSM1 needs. |
|
Fractionation parameters for |
|
A time-series of influent data. |
|
The integrator / step-size configuration for a solve. |
|
A side-by-side KPI table over several named results. |
|
Laplace-posterior settings. |
|
Per-component closure of a plant over a simulation window. |
|
Combines two or more input streams into a single output stream by mass balance: |
|
Result of |
|
The plant has no ADM1 anaerobic digester, so it has no biogas. |
|
Operating conditions for the 0-D (single stirred tank) case. |
|
A plant's monetised cost as a per-day breakdown. |
|
Result of |
|
Optimiser and multistart settings for calibration. |
|
Solution returned by |
|
Integrate chemistry along a single particle track. |
|
A plant flowsheet of |
|
Result of |
|
Result of |
|
Steady-state plug-flow reactor. |
|
Posterior-predictive band from |
|
Result of |
|
Splits the inlet flow into fixed fractions: each output gets |
|
Result of |
|
Gradients of a scalar output with respect to parameters and conditions. |
|
Splits the inlet flow into fixed absolute setpoint flows plus a remainder. |
|
Activated-sludge operating metrics achieved by a solved plant. |
|
Container for spatially varying condition fields. |
|
Advisory: a |
|
Maps a concentration vector from one model's species ordering to another's. |
|
A flow stream — bulk volumetric rate plus a concentration vector. |
|
Strategy for how a plant resolves unit temperatures. |
|
Diverts inlet flow above a threshold, passing the rest through. |
|
A single particle track: condition fields sampled at successive times. |
|
Solution returned by |
|
A UV disinfection reactor (stateless): dose-driven log-inactivation. |
|
A plant unit operation. |
|
One dimensional-consistency finding for a rate expression. |
|
A known unit has no input/output port of the requested name. |
|
A referenced unit name is not present in the plant. |
|
A structurally invalid connection or an unsupported unit request. |
Functions#
Aeration energy (kWh/d) per Copp 2002 eq. |
|
Time-averaged total air flow over the window (m³/d), summed across tanks. |
|
Aeration energy (kWh/d) from the blower model, the mechanistic replacement for |
|
Blower shaft+motor power (kW) to compress |
|
MAP fit with optional Laplace posterior approximation. |
|
Per-species canonical content vector for one component, shape |
|
Assemble a |
|
External-carbon mass dose (kg COD/d), time-averaged. |
|
Build a constant |
|
Return the list of conservation violations |
|
Raise a friendly |
|
Run |
|
Return nitrogen-balance violations |
|
Clear the built-in-model cache (see |
|
Indirect CO₂e from electricity use (kg CO₂e/d). |
|
Run |
|
Build a |
|
The shipped COD / N / P composition table for a model. |
|
Log-removal from a CT value by a CT-based credit (Chick–Watson form). |
|
CT = disinfectant residual × T10 contact time (e.g. mg·min/L). |
|
BOD₅ proxy = 0.25 × (SS + XS + (1 - f_P) × (XB_H + XB_A)), Copp 2002. |
|
Total COD = SI + SS + XI + XS + XB_H + XB_A + XP. |
|
Total Kjeldahl Nitrogen = S_NH + S_ND + X_ND + i_XB × (XB_H + XB_A) + i_XP × (XP + XI). |
|
Total suspended solids from ASM1 particulate species. |
|
Size the air flow and blower power for one tank at a steady |
|
Derivative-based global sensitivity measure via autodiff + Sobol QMC. |
|
Direct N₂O stripped from the activated-sludge reactors (kg N₂O-N/d). |
|
Time-flow-weighted average effluent concentrations. |
|
EQI per Copp 2002 / Alex 2008. |
|
Cap-free reverse-mode gradient through a high-order ESDIRK solve. |
|
Compute the BSM1 performance indices from a solved plant. |
|
Compute the BSM2 performance indices from a solved plant. |
|
Least-squares fit of selected parameters to time-series observations. |
|
Return the diffrax adjoint that supports forward-mode autodiff. |
|
Forward-sensitivity solve through any reactor exposing |
|
Split influent aggregate measurements into ASM1 state values. |
|
Digester sludge-heating energy (kWh/d) per Gernaey et al. 2014. |
|
Integrate over |
|
Integrate the model along an ensemble of particle tracks. |
|
Tabulate KPIs from several named report objects side by side. |
|
Load a built-in model shipped with |
|
Load a model from a YAML file on disk. |
|
Results-level mass-balance closure for a solved plant. |
|
CO₂e of a methane mass flow (kg CO₂e/d). |
|
Mixing energy (kWh/d) per Gernaey et al. 2014. |
|
Propagate uncertain inputs through |
|
CO₂e of an N₂O emission given as an N₂O-N mass flow (kg CO₂e/d). |
|
Monetise a plant's operating cost from its physical flows. |
|
OCI (BSM1 form): |
|
Full BSM2 OCI (Gernaey et al. 2014):. |
|
Minimise (or maximise) an objective over a bounded design space subject to inequality constraints, using autodiff gradients. |
|
Parse a rate-expression string into an AST. |
|
Parse a unit string into a |
|
Profile-likelihood analysis of one parameter or initial condition. |
|
Pumping energy (kWh/d) per Copp 2002 eq. |
|
Pumping energy (kWh/d) for the full BSM2 pump set. |
|
Read a CSV influent file. |
|
Air flow rate (m³/d) that produces |
|
Compute gradients of a scalar output with respect to parameters and condition fields, via autodiff through |
|
Size an activated-sludge basin from SRT / HRT design targets. |
|
Achieved SRT / HRT / F:M from a solved activated-sludge plant. |
|
Integrate |
|
Time-averaged N₂O stripped from the aerated reactors (kg N₂O-N/d). |
|
T10 contact time from the baffling factor: |
|
T10 contact time from a measured/simulated residence-time distribution. |
|
Trapezoidal time-average of |
|
UV dose (fluence) = average fluence rate × exposure time. |
|
Log-inactivation from a UV dose by a log-linear dose-response. |