Flowelements

A list of the available flowelements.

Index

Models

BioChemicalTreatment.ProcessSimulator.InfluentFunction
Influent(sources, states=default_states(); name, flowrate=nothing, default=nothing)

A component to provide an influent for a simulation.

The sources argument can be a vector an element for each state in states or it can be a dict (vector of pairs...) from state name to the source. In the latter case, if the argument default has a value, all states that are not set are set to the default.

There are three possibilities for each single source:

  • Numeric constant
  • Function taking a single numeric time argument
  • ODESystem with source.output evaluating to a valid RealOutput port. All Source blocks from the ModelingToolkitStandardLibrary fulfill this property, but other systems would be thinkable as well.

Parameters:

  • sources: The vector of sources defining the values.
  • states: The components in the Flows.
  • flowrate: Named parameter to specify the flowrate. Set to nothing if included in the states or to take the default. If provided in the states and as parameter directly, the parameter takes precedence
  • default: The default for non-specified sources. Only has an effect on the flow rate, or if sources is provided as a dictionary.

Connectors:

  • outflow: The outflow provided by the Influent
source
BioChemicalTreatment.ProcessSimulator.FlowConnectorFunction
FlowConnector(state = default_states(); n_in, n_out, name)

A component for connecting multiple flows.

This system takes an arbitrary number of inputs and splits it into a number of outputs. Thereby, it is ensuring mass conservation and assumes ideal mixing between the incoming flows such that the concentrations in all outflows are equal. The flow rates of the outflows are to be provided by the following systems, e.g. using a FlowPump system. The flow rates have to be provided for all except one outflow, the last one is determined from a mass balance.

Specifically, it has the following equations ($C$ always stands for an arbitrary component):

  • Conservation of mass:

\[\begin{aligned} \sum_{i = 0}^{n_{in}}q_{in,i} &= \sum_{i=0}^{n_{out}}q_{out,i}\\ \sum_{i = 0}^{n_{in}}C_{in,i}q_{in,i} &= \sum_{i=0}^{n_{out}}C_{out,i}q_{out,i} \end{aligned}\]

  • Ideal mixing:

\[C_{out,i} = C_{out,j} \quad \forall i,j\in \{1 ... n_{out}\}\]

Parameters:

  • states: The components in the flows
  • n_in: The number of inflows
  • n_out: The number of outflows

Connectors:

  • inflow_i: The i-th inflow of the FlowConnector (if only one inflow, the _i is omitted and the resulting name is inflow)
  • outflow_i: The i-th outflow of the FlowConnector (if only one inflow, the _i is omitted and the resulting name is outflow)
source
BioChemicalTreatment.ProcessSimulator.FlowSeparatorFunction
FlowSeparator(state = default_states(); n_out=2, name)

A component for separating a single flow into multiple. It is an alias for the FlowConnector having only one inflow.

The flow rates along which the flow is to be split have to be provided by the following systems, e.g. a FlowPump. Connect e.g. a FlowPump to all except one outflow, the last one is then already fixed by the mass balance.

Parameters:

  • states: The components in the flows
  • n_out: The number of outflows, defaults to 2

Connectors:

  • inflow: The inflow of the FlowSeparator
  • outflow_i: The i-th outflow of the FlowSeparator
source
BioChemicalTreatment.ProcessSimulator.FlowUnifierFunction
FlowUnifier(state = default_states(); n_in=2, name)

A component for unifying multiple flows into a single one. It is an alias for the FlowConnector having only one outflow.

Parameters:

  • states: The components in the flows
  • n_in: The number of inflows, defaults to 2

Connectors:

  • inflow_i: The i-th inflow of the FlowUnifier
  • outflow: The outflow of the FlowUnifier
source
BioChemicalTreatment.ProcessSimulator.FlowPumpFunction
FlowPump(state = default_states(); flowrate=nothing, name)

A component modeling a flow pump. It models an ideal flow pump, where a provided flow is pumped through.

The FlowPump has one inflow and one outflow and it merely specifies the flow passing through.

Warning

If the flow pumped by a FlowPump does not match what is incoming, the flow will need to find another way. This can either be that the flow takes another route (through a FlowSeparator), or that it is accumulated/depleted in a previous system that can do so (i.e. has a variable volume). If none of this is possible, the created system can not be successfully simulated, as the equations will be inconsistent.

Note

The FlowPump does not split the flow in any way. If you intend to extract a sidestream from a main flow, use a combination of a FlowSeparator (to split the flows) and a FlowPump at one outlet (to specify the flowrate there).

Parameters:

  • states: The components in the flows
  • flowrate: The flowrate to pump. If nothing (default) an input is added for setting it dynamically

Connectors:

  • inflow: The inflow of the Pump
  • outflow: The outflow of the Pump
  • q_pumped: Optional: ModelingToolkitStandardLibrary.Blocks.RealInput to provide the pumped flow rate. Added only if the parameter flowrate is nothing, otherwise the flowrate is considered fixed at the given value.
source
BioChemicalTreatment.ProcessSimulator.IdealClarifierFunction
IdealClarifier(states = default_states(); f_ns = 0, name)

An Ideal Clarifier. This system defines an ideal clarifier. It is a static system that ensures mass conservation and ideally settles all particulate compounds: a parameter for the unsettlable fraction of solids can be given. The flow rates of the outflows (effluent or sludge) are to be provided by the following systems, e.g. using a FlowPump system.

Parameters:

  • states: The components that the clarifier should have
  • f_ns: The unsettlable fraction of solids

Connectors:

  • inflow: The inflow of the IdealClarifier
  • effluent: The effluent of the IdealClarifier
  • sludge: The the sludge outflow of the IdealClarifier
source
BioChemicalTreatment.ProcessSimulator.SensorFunction
Sensor(sensed, states = default_states(); name)

A component to provide certain states as real outputs. Is convenient if certain states are to be extracted for control.

Note

This system does not include any measurement model nor noise. It simply gets the information out.

Parameters:

  • sensed: The sources defining the values. Either a vector or a single value
  • states: The components in the Flows.
  • flowrate: Named parameter to specify the flowrate. Set to nothing if included in the states.

Connectors:

  • inflow: The inflow to the sensor
  • outflow: The outflow of the sensor (equal to the inflow)
  • one exogenous_output for each sensed state. Named after the state.
source