aquakin.ThresholdSplitter#
- class aquakin.ThresholdSplitter(name, model, threshold, threshold_port, remainder_port)[source]#
Bases:
_SplitterBaseDiverts inlet flow above a threshold, passing the rest through.
Inlet flow above
thresholdgoes tothreshold_port(max(Q_in - threshold, 0)) and the rest (min(Q_in, threshold)) toremainder_port. This is the BSM2 hydraulic influent bypass (flow above a limit diverted around the treatment). The split is piecewise-linear (a kink atthreshold), so the exact recycle-flow solve (Plant._resolve_flows()) is only exact when the inlet flow is independent of the recycle flows – e.g. fed directly by an external influent, as inbuild_bsm2(). The threshold is aFlowSetpoint, so a plant is differentiable w.r.t. it.- Parameters:
name (str) – Unit identifier.
model (CompiledModel)
threshold (float) – Inlet-flow limit (m³/d).
threshold_port (str) – The output port carrying the above-threshold flow.
remainder_port (str) – The output port carrying the remaining (below-threshold) flow. Must differ from
threshold_port.
- __init__(name, model, threshold, threshold_port, remainder_port)#
- Parameters:
name (str)
model (CompiledModel)
threshold (float)
threshold_port (str)
remainder_port (str)
- Return type:
None
Methods
__init__(name, model, threshold, ...)compute_outputs(t, state, inputs, params[, ...])coupling_pattern()No state -> no structural Jacobian contribution.
flow_outputs(input_flows, params[, ctx])Output port flows: the above/below-threshold split (piecewise-linear).
flow_param_defaults()Ordered default setpoint values (the unit's flow-parameter block).
flow_param_local_names()Ordered setpoint names, used to address the flow parameters by name.
initial_state()rhs(t, state, inputs, params[, signals])Attributes
input_portsoutput_portsstate_sizethresholdthreshold_portremainder_portnamemodel