Fluid Select Output
Routes the flow from the input to one of the
At design time you can choose the initially selected output. It can be changed at runtime by calling the functions
and select(). For
example, the block is named selectOutput.
select output 1 at runtime, call: selectOutput.select(1). To
select output 2: selectOutput.select(2).
In addition, you have an option of selecting output based on the incoming
is a zero-capacity block, it does not contain any amount of fluid. The
output batch at the selected output of the FluidSelectOutput
block is the same as the one at the input. The On new batch
… action can be used to switch the output depending on the
- Select output
- Here you define how the output will be selected. There are two alternative options:
By calling select() function - the output can be changed at runtime by calling the block functions
Conditionally, on each batch - the output will be selected by evaluating the boolean condition specified in the Condition
(true is Output 1)
field below. The condition is evaluated for each new batch and the output is selected based on the
Syntax: boolean selectOnCondition
Set new value
at runtime: set_selectOnCondition(new value)
Valid values: true - Conditionally, on each batch
false - By calling select() function
- Condition (true is Output 1) [dynamic]
- [Visible and applies only if Select output
is set to Conditionally,
on each batch] Here you specify the boolean condition that
will be evaluated for each new batch. If the result is true, output 1 is selected,
otherwise - output 2.
Type of value: boolean
- the batch
- Initial selection
- If the option is selected (the value is equal to true),
the flow from the
input will be initially routed to the output 1, if false - to output 2.
The initially selected output can be changed at runtime by calling select() function, or by evaluating the boolean condition for each new batch, depending on the Select output parameter value.
Syntax: boolean selectOutput1
- Limited output rate
- If the option is selected (the value is equal to true), you are able to specify
a custom upper limit of the output rate, per output.
Change the value
at runtime: set_limitRateOut(true or false)
- Maximum output rate
- [Visible and applies only if the Limited
output rate option is set] Custom upper limit of
the output rate, at each output. The default value is 10 cubic meters per second.
Syntax: double maxRateOut
new value at runtime: set_maxRateOut(new value)
- Show batches in flowchart
- If set, the block icon will display the current batch
Syntax: boolean showBatchesInFlowchart
- On new batch
- Action executed when a new batch appears at the input. It
not necessarily start flowing into the block. You can, for example,
change the selected output in this action.
Local variable: Object batch - the batch
- On rate change [code]
- Action executed when any of the flow rates
changes. Please note that changing something in the action may
immediate rate change and immediately following another call of On rate change,
so the user can possibly create a livelock.
- the current input rate
double out1rate - the current output
rate at port out1
double out2rate - the current output
rate at port out2
- Returns the total amount passed through the input port since
the start of
double amountPassed(AmountUnits units) - Returns the total amount of fluid (in given units), which passed through the in port of the block since the start of the simulation.
void resetStats() - Resets statistics collected for this block, including the statistics collected for its ports.
- Returns the current flow rate of fluid that goes in.
double currentRate(FlowRateUnits units) - Returns the current flow rate (in given units) of fluid at the block input.
Selects the output different to the one currently selected. Returns 1 if output 1 becomes selected or 2 if output 2 becomes selected.
- Selects the specified output (output
argument must be 1 or 2).
- The input port.
- The upper output port, output 1.
- The lower output port, output 2.