AnyLogic
Expand
Font size

FluidDropoff

The FluidDropoff block drops off fluid from the agents passing through. This block serves as an interface between the Process Modeling Library (or any other library based on it) and the Fluid Library.

Each agent is assumed to have a certain amount of fluid or bulk matter to drop off. Upon the arrival of an agent, this block starts the outflow. Unlike the AgentToFluid block, this block does not delete the agent. Instead, the block delays the agent until the fluid has completely flowed out, releases the agent through the output port and lets it continue its operation.

Similar to FluidSource, this block has a desired output rate, and the actual rate may be less or equal the desired rate. The specified rate cannot be lower than the value of Utils.RATE_TOLERANCE constant, that is, 1.0e-9. If the rate value falls below this value after recalculation, it will be snapped to 0.

FluidDropoff can contain only one agent at a time, and the next agent will not be let in until the fluid of the current agent has completely flowed out.

The Fluid Library will try to maximize the out flow of all fluid sources; therefore, the priority of FluidDropoff out flow is set to 1 by default. Sometimes to resolve flow priority conflicts you may need to customize the out flow priority by further increasing it.

Optionally, FluidDropoff can generate batches, one batch per agent. The batch type and color can depend on the agent as the agent can be accessed from the dynamic Batch field.

Demo model: FluidDropoff Open the model page in AnyLogic Cloud. There you can run the model or download it (by clicking Model source files). Demo model: FluidDropoffOpen the model in your AnyLogic desktop installation.

Properties

Fluid to dropoff
Determines the amount of fluid to be dropped off by the agent.
Type: double
Local variable: Agent agent — the agent
Rate
The maximum (desired) output rate.
Name: rate
Type: double
Set new value at runtime: set_rate(new value)
Custom priority
If the option is set (the value equals true), the priority of the pipeline outflow will be defined by the Output flow priority property below, otherwise it equals 1. The priority affects the LP solver when it tries to maximize the flow through the system.
Name: customPriority
Type: boolean
Set new value at runtime: set_customPriority(new value)
Output flow priority
[Visible and applies if the Custom priority option is set]
The custom priority of the outflow of this block in the overall flowchart. Must be a positive integer.
Name: priorityOutCustom
Type: int
Set new value at runtime: set_priorityOutCustom(new value)
Custom batches
Determines whether the block will generate custom batches (which may depend on the agent). If the option is selected, the batch corresponding to the agent will be defined by the Batch property. If not, it will be BatchTypes.DEFAULT_BATCH.
Type: boolean
Local variable: Agent agent — the agent
Batch
[Visible and applies if the Custom batches option is set]
Defines the batch to be created for the current agent.
Type: Object
Local variable: Agent agent — the agent
Custom batch color
[Visible and applies if the Custom batches option is set]
If the option is set, the batch color is defined by the Batch color property, otherwise the standard color mapping applies.
Name: customBatchColor
Type: boolean
Set new value at runtime: set_customBatchColor(new value)
Batch color
[Visible and applies if the Custom batch color option is set]
Defines the color of the current batch, which may depend on the agent and the batch.
Type: Color
Local variables:
Agent agent — the agent
Object batch — the batch
Agent location
The space markup shape (node or path) where the agents are located while being in this block.
Name: agentLocation
Set new value at runtime: set_agentLocation(new value)

Animation

Storage tank
The name of the Storage tank space markup shape used to animate FluidDropoff (both in 2D and 3D animation). The storage tank animates the fluid the block currently contains.
Name: storageTank
Type: StorageTank
Show batches in flowchart
If set, the block icon will display the current batch color.
Name: showBatchesInFlowchart
Type: boolean
Set new value at runtime: set_showBatchesInFlowchart(new value)

Actions

On enter
The action executed upon arrival of an agent at the block.
Local variable: Agent agent — the agent
On agent done
The action executed when the total amount has been dropped off (flowed out through the outFluid port). The agent will proceed to the out port, and the next agent will be allowed to enter.
Local variables:
Agent agent — the agent
double amount — the amount
On rate change
The action executed when the flow rate changes.
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 outrate — the current output rate

Functions

Fluid amount
Function Description
double amount() Returns the amount of fluid currently contained in the block and waiting to flow out. This amount is less or equal the total amount of fluid to be dropped off by the current agent.
double amount(AmountUnits units) Returns the amount of fluid (in given units) currently contained in the block and waiting to flow out. This amount is less or equal the total amount of fluid to be dropped off by the current agent.

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

units — the amount units
double totalAmountToDropoff() Returns the total amount of fluid being dropped off by the current agent, or 0 if there is no agent in the block.
double totalAmountToDropoff(AmountUnits units) Returns the total amount of fluid (in given units) being dropped off by the current agent, or 0 if there is no agent in the block.

units — the amount units
Flow rate
Function Description
double currentRate() Returns the current flow rate of fluid that goes out.
double currentRate(FlowRateUnits units) Returns the current flow rate (in given units) of fluid that goes out.

units — the flow rate units
Agent
Function Description
Agent agent() Returns the current agent dropping off fluid, or null if there is no agent.
Resetting statistics
Function Description
void resetStats() Resets statistics collected for this block, including the statistics collected for its ports.

Ports

outFluid
The fluid output port.
in
The agent input port.
out
The agent output port.
How can we improve this article?