Flowelements
A list of the available flowelements.
Index
BioChemicalTreatment.ProcessSimulator.FlowConnector
BioChemicalTreatment.ProcessSimulator.FlowPump
BioChemicalTreatment.ProcessSimulator.FlowSeparator
BioChemicalTreatment.ProcessSimulator.FlowUnifier
BioChemicalTreatment.ProcessSimulator.IdealClarifier
BioChemicalTreatment.ProcessSimulator.Influent
BioChemicalTreatment.ProcessSimulator.Sensor
Models
BioChemicalTreatment.ProcessSimulator.Influent
— FunctionInfluent(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 validRealOutput
port. All Source blocks from theModelingToolkitStandardLibrary
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 tonothing
if included in the states or to take the default. If provided in the states and as parameter directly, the parameter takes precedencedefault
: The default for non-specified sources. Only has an effect on the flow rate, or ifsources
is provided as a dictionary.
Connectors:
outflow
: The outflow provided by theInfluent
BioChemicalTreatment.ProcessSimulator.FlowConnector
— FunctionFlowConnector(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 flowsn_in
: The number of inflowsn_out
: The number of outflows
Connectors:
inflow_i
: The i-th inflow of theFlowConnector
(if only one inflow, the_i
is omitted and the resulting name isinflow
)outflow_i
: The i-th outflow of theFlowConnector
(if only one inflow, the_i
is omitted and the resulting name isoutflow
)
BioChemicalTreatment.ProcessSimulator.FlowSeparator
— FunctionFlowSeparator(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 flowsn_out
: The number of outflows, defaults to 2
Connectors:
inflow
: The inflow of theFlowSeparator
outflow_i
: The i-th outflow of theFlowSeparator
BioChemicalTreatment.ProcessSimulator.FlowUnifier
— FunctionFlowUnifier(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 flowsn_in
: The number of inflows, defaults to 2
Connectors:
inflow_i
: The i-th inflow of theFlowUnifier
outflow
: The outflow of theFlowUnifier
BioChemicalTreatment.ProcessSimulator.FlowPump
— FunctionFlowPump(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.
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.
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 flowsflowrate
: The flowrate to pump. Ifnothing
(default) an input is added for setting it dynamically
Connectors:
inflow
: The inflow of the Pumpoutflow
: The outflow of the Pumpq_pumped
: Optional:ModelingToolkitStandardLibrary.Blocks.RealInput
to provide the pumped flow rate. Added only if the parameterflowrate
isnothing
, otherwise the flowrate is considered fixed at the given value.
BioChemicalTreatment.ProcessSimulator.IdealClarifier
— FunctionIdealClarifier(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 havef_ns
: The unsettlable fraction of solids
Connectors:
inflow
: The inflow of the IdealClarifiereffluent
: The effluent of the IdealClarifiersludge
: The the sludge outflow of the IdealClarifier
BioChemicalTreatment.ProcessSimulator.Sensor
— FunctionSensor(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.
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 valuestates
: The components in the Flows.flowrate
: Named parameter to specify the flowrate. Set tonothing
if included in the states.
Connectors:
inflow
: The inflow to the sensoroutflow
: The outflow of the sensor (equal to the inflow)- one exogenous_output for each sensed state. Named after the state.