aquakin.MixerUnit#

class aquakin.MixerUnit(name, input_port_names, model)[source]#

Bases: StatelessUnit

Combines two or more input streams into a single output stream by mass balance: Q_out = sum(Q_in_i), C_out = sum(Q_in_i * C_in_i) / Q_out.

Stateless. All input streams must reference the same kinetic model (translators are applied upstream by the plant).

Parameters:
  • name (str) – Unit identifier.

  • input_port_names (list[str]) – Names of the input ports. Order is not significant for the computation, but the plant uses them when wiring connections.

  • model (CompiledModel) – Model of all input streams and the single output stream.

__init__(name, input_port_names, model)#
Parameters:
Return type:

None

Methods

__init__(name, input_port_names, model)

compute_outputs(t, state, inputs, params[, ...])

coupling_pattern()

No state -> no structural Jacobian contribution.

flow_outputs(input_flows, params[, ctx])

Output port flows from input port flows (the linear flow rule).

initial_state()

rhs(t, state, inputs, params[, signals])

Attributes

input_ports

output_ports

state_size

name

input_port_names

model

flow_outputs(input_flows, params, ctx=None)[source]#

Output port flows from input port flows (the linear flow rule).

Used by Plant to resolve the recycle-flow network cheaply and exactly, decoupled from the (expensive) concentration computation.

Parameters:
  • input_flows (dict)

  • params (Array)

Return type:

dict