Skip to main content
Version: 27.0

FlowToItem

Inherits from Object

Description

An object that converts FloWorks flow (continuous or bulk) into discrete FlexSim flow items.

Properties

PropertyDescription
flowControlGets or sets the Flow Control that manages the flow rates for this object.
inputFlowObject.InputOutput object that allows access to FloWorks object's input ports.
statsAllows access to a FloWorks object's statistics.

Methods

MethodDescription
connectConnect a FloWorks object to this object.
impactApplies an impact factor to the maximum input and/or output flow rate and waits for resume().
resumeEnds an impact factor event, which temporarily decreased or increased the maximum flow of a FloWorks object.
stopApplies an impact factor of zero to the maximum input and output flow rate, sets the FloWorks state of the object, and waits for resume().

Details

FlowToItem.flowControl

Object flowControl

Description

Gets or sets the Flow Control that manages the flow rates for this object.

The FlowControl is responsible for optimizing the flow through a network. Every object that is connected to the FlowControl is part of the network the FlowControl will optimize. Every flow object must be part of a FlowControl. The controller will calculate all rates throughout the network. After the flows have been established a new event will be created to recalculate the flow. This happens for instance when a tank becomes full or empty.

By requesting this property, you will get a reference to the Flow Control that currently manages this object.

By setting this property, you can change the Flow Control that manages the object. To disconnect the object from any flow networks, assign nullvar.

FlowToItem.input

FlowObject.InputOutput input

Description

FlowObject.InputOutput object that allows access to FloWorks object's input ports.

See the FlowObject.InputOutput documentation for more information.

FlowToItem.stats

readonly stats

Description

Allows access to a FloWorks object's statistics.

This property provides the following properties and methods:

input - returns the current cumulative inflow of the object.

output - returns the current discrete output statistic of the object.

utilization - returns the flow utilization of this object as a number between 0 and 1.

state(Variant& profile = nullvar) - returns a state tracked variable. If no profile argument is given, or if it is 1, then the default FloWorks state profile is returned. If the profile argument is equal to 0, the default FlexSim state profile is returned (note that most FloWorks objects do not use this). Other state profiles can be returned by providing the profile number or name.

// Get the state of a pump FlowObject obj = model().find("FlowPump1"); int curState = obj.stats.state().value;

FlowToItem.connect()

void connect( FlowObject connectTo )

Parameters

ParameterDescription
connectToThe object to connect to.

Description

Connect a FloWorks object to this object.

In some models, you want to dynamically connect and disconnect ports.

After dynamically (i.e. during the model run, not before Reset) connecting or disconnecting ports a recalculation of the flow rates is required.

This recalculation is not triggered when you use the default FlexSim commands such as contextdragconnection.

Therefore FloWorks provides two commands: FlowObject.connect and FlowObject.(input/output).ports.[disconnect](flow-object-port.html#method-disconnect).

FlowToItem.impact()

void impact( Variant id, double impactFactor, int isInputInfluenced, int isOutputInfluenced, int flowState = 0 )

Parameters

ParameterDescription
idSelect a key that uniquely represents this impact factor, for example an object, token or number. You may use the same key to cancel the impact factor and use different keys to stack multiple impact factors.
impactFactorThe impact factor applied to the flow. Zero will stop all flow, an impact factor less than 1 will reduce the flow, and an impact factor greater than 1 will temporarily increase the maximum possible flow.
isInputInfluencedWhen non-zero, the impact factor will be applied to the maximum input flow. For non-content-holding objects, always use this parameter.
isOutputInfluencedFor tanks, when non-zero, the impact factor will (also) be applied to the maximum outflow rate.
flowStateThe state to set on the FloWorks state profile while the impact factor is active (and not overridden by other events).

Description

Applies an impact factor to the maximum input and/or output flow rate and waits for resume().

Start an impact factor event, which temporarily decreases or increases the maximum flow of a FloWorks object.

The impact factor event applies a multiplicative factor to the maximum flow rate, which can completely stop or reduce the flow because of a failure mode; but by setting a factor larger than 1 this function can also be used to model increased productivity due to e.g. seasonal fluctuations.

This function is called automatically from the "down" trigger of a FloWorks Impact Event, you do not usually need to call it manually.

FlowToItem.resume()

void resume( Variant id )

Parameters

ParameterDescription
idSelect a key that uniquely represents this impact factor, for example an object, token or number. You may use the same key to cancel the impact factor and use different keys to stack multiple impact factors.

Description

Ends an impact factor event, which temporarily decreased or increased the maximum flow of a FloWorks object.

Ends an impact factor event, which temporarily decreased or increased the maximum flow of a FloWorks object.

The impact factor event applies a multiplicative factor to the maximum flow rate, which can completely stop or reduce the flow because of a failure mode; but by setting a factor larger than 1 this function can also be used to model increased productivity due to e.g. seasonal fluctuations.

This function is called automatically from the "up" trigger of a FloWorks Impact Event, you usually only need to call it manually if you explicitly used the .stop() command.

Note that multiple events may be active on a flow object at any time, and multiple flow objects may be impacted by an event, so you may need to call this command more than once.

FlowToItem.stop()

void stop( Variant id, int flowState )

Parameters

ParameterDescription
idSelect a key that uniquely represents this impact factor, for example an object, token or number. You may use the same key to cancel the impact factor and use different keys to stack multiple impact factors.
flowStateThe state to set on the FloWorks state profile while the impact factor is active (and not overridden by other events).

Description

Applies an impact factor of zero to the maximum input and output flow rate, sets the FloWorks state of the object, and waits for resume().

Start an impact factor event, which temporarily stops all inflow and outflow of a FloWorks object.

This function is equivalent to calling FlowObject.impact(id, 0, true, true, flowState).