Page 414 - ExtendSim User Guide
P. 414

Merging, Diverging, and Routing Flow
Merging and diverging flow
Options in the block’s dialog allow you to specify what happens if the value at the ID connec- tor doesn’t match any of the branch IDs listed in the table:
• Choosetopconnection
• Choosebottomconnection
• Stopflow
• Generate error
A blank value received at the ID connector always stops the flow until the connector receives a valid input.
☞ The Select mode uses a fixed flow rule to obtain the set of effective rates for each branch and to determine which branch to route the flow to.
Select Mode Diverge model
In the Select Mode Diverge model, a Create block is set to output a sequential value (1, 2, 3, or 4) every 20 time units. At its ID input connector, the Diverge block receives the value from the Create block, compares that value to entries in its dialog table, and selects the appropri- ate outflow connector. Three Tank blocks, each with an infinite capacity for flow units, are connected to the Diverge block. The Tank blocks are identified by the ID values entered in the Diverge block’s dialog. For example, an Output ID of 1 indicates the Tank labeled “Infinite Sink 1”.
In this example the Create block is
responsible for controlling the Diverge
block. When the Create block sends a
value of 2 to the Diverge block’s ID connector, the flow is routed to Infinite Sink 2, and so forth.
Notice that in this model 4 is an invalid number and the Diverge block is set to Invalid value at ID: stop flow. When the Create block sends a value of 4, all flow through the Diverge block stops and a red bar appears on the block's right side. This pause in the flow could be used for a specific purpose, for instance to allow time to empty downstream Tanks.
☞ Try running the model after checking Pause each step (in the upper left corner of the model). This will cause the simulation to pause so you can more easily see the effect of the Create block sending values to the Diverge block. Clicking the Pause/Resume button in the toolbar will continue execution to each succeeding event. (There can be more than one event without time advancing.) For more information, see “Stepping through a model” on page 600.
Select Mode Merge model
This model is the mirror image of the Select Mode Diverge model discussed above. While the three source tanks provide an infinite supply of flow, it is the Merge block that controls which tank flow is drawn from. Since the Merge block is in Select mode, the Create block controls
Select Mode Diverge model
Discrete Rate

   412   413   414   415   416