Fluid Pickup

Lets the passing through agents pick up fluid or bulk matter. Serves as an interface block between the Process Modeling Library (on any other library based on it) and the Fluid Library. Each agent is assumed to need a certain amount of fluid to pick up, and, upon arrival of the agent at the block, the block starts accumulating the fluid. The amount can be specified explicitly and may depend on the agent (pickup by amount mode), or pick up can be executed by batch. In the latter case, the agent is released once the block has accumulated a non-zero amount of fluid of one batch and the new different batch shows up. The block does not modify the agent anyhow, it is up to you to implement how the fluid picked up affects the agent.

Similarly to FluidDispose and FluidToAgent, this block can accept flow at any rate. When there is no agent in the block, the block contains no fluid and the fluid is not allowed to flow in. FluidPickup may contain only one agent at a time, and the next agent will not be let in until the current agent has left the block.

Demo model: FluidPickup

Parameters

Pickup
Defines the fluid pickup mode:
Amount of fluid - the agent picks up the specified amount of fluid.
By batch - the agent picks up any non-empty batch (the agent is released when the new batch shows up at this block).
Syntax: boolean pickupByAmount
Set new value at runtime: set_pickupByAmount(new value)
Valid values: true  - Amount of fluid
           false - By batch
Fluid to pickup [dynamic]
[Visible and applies only if the Amount of fluid option is set] Determines the amount of fluid to be picked up by the agent. This is a dynamic parameter re-evaluated upon arrival of each agent.
Type of value:  double
Local variable:  Agent agent - the agent
Agent location
Space markup shape where the agent that currently is in the internal Delay block is animated.
Get value: agentLocation
Set new value at runtime: set_agentLocation(new value)
Animation
Storage tank
Here you can specify the name of Storage tank space markup shape used to animate FluidPickup (both in 2D and 3D animation). The storage tank animates the fluid the block currently contains.
Syntax: StorageTank storageTank
Show batches in flowchart
If set, the block icon will display the current batch color.
Syntax: boolean showBatchesInFlowchart
Set new value at runtime: set_showBatchesInFlowchart(new value)
Actions
On enter [code]
Action executed upon arrival of the agent at the block, before Fluid to pickup is evaluated and the block starts accepting the fluid.
Local variable:  Agent agent - the agent
On exit [code]
Action executed when an agent has picked up the fluid and leaves the block. You can access the agent, the amount picked up, and the batch.
Local variables:  Agent agent - the agent
                          double amount - the amount
                          Object batch - the batch
On rate change [code]
Action executed when the flow rate changes. Please note that changing something in the action may result in another immediate rate change and immediately following another call of On rate change, so the user can possibly create a livelock.
Local variable:  double inrate - the current input rate

Functions

double amountPassed() - Returns the total amount of fluid passed through the inFluid port of the block since the start of the simulation.

double amountPassed(AmountUnits units) - Returns the total amount of fluid (in given units) passed through the inFluid port of the block since the start of the simulation.

double amount() - Returns the amount of fluid currently accumulated in the block. This amount is less than the total amount of fluid required to release an agent.

double amount(AmountUnits units) - Returns the amount of fluid (in given units) currently accumulated in the block. This amount is less than the total amount of fluid required to release an agent.

void resetStats() - Resets statistics collected for this block, including the statistics collected for its ports.

Object getBatch() - Returns the batch currently flowing into the block.

double currentRate() - Returns the current flow rate of fluid that comes in.

double currentRate(FlowRateUnits units) - Returns the current flow rate (in given units) of fluid that comes in.

Ports

inFluid
The fluid input port.
in
The agent input port.
out
The agent output port.