The output rate of this block always equals the input rate multiplied by a given "conversion factor". The factor can be both greater than 1, or less than 1, or 1, so
FluidConvert
can both amplify or diminish the flow. Note, that if the rate value falls below the value of
Utils.RATE_TOLERANCE
constant, i.e. 1.0e-9, it will be snapped to 0.
The block can be used to model, for example, packaging or unpackaging fluid or items. Typically, this assumes change of flow units.
FluidConvert is a zero-capacity block, it does not contain any amount of fluid.
The output batch can be the same as the input batch, or a custom batch (which may depend on the input batch).
As any other block the FluidConvert block allows you to react to new batches appearing at the input.
Demo model: FluidConvert
double amountPassedIn() - Returns the total amount of fluid passed through the input port of the pipeline since the start of the simulation.
double amountPassedIn(AmountUnits units) - Returns the total amount of fluid (in given units) passed through the in port of the block since the start of the simulation.
double amountPassedOut() - Returns the total amount of fluid passed through the output port of the pipeline since the start of the simulation.
double amountPassedOut(AmountUnits units) - Returns the total amount of fluid (in given units) passed through the out port of the block since the start of the simulation.
double currentRateIn() - Returns the current flow rate of fluid that goes in.
double currentRateIn(FlowRateUnits units) - Returns the current flow rate (in given units) of fluid at the block input.
double currentRateOut() - Returns the current flow rate of fluid that goes out.
double currentRateOut(FlowRateUnits units) - Returns the current flow rate (in given units) of fluid at the block output.
void resetStats() - Resets statistics collected for this block, including the statistics collected for its ports.
setBatchOut(Object batch, Color color)- Changes the output batch and color while the input batch stays the same. When the new input batch arrives, the output batch will be recalculated according to the FluidConvert block settings.
setBatchOut(Object batch) - Same as setBatchOut(batch, color), but does not change the batch color.
double updateOutputBatch() - Forces immediate recalculation of the output batch and its color according to the current parameters settings.