Flow Mixer

Overview and Key Concepts

The flow mixer is used to combine products together into a single, new product. The different materials can either be pulled sequentially or in parallel. The Mixer always works in batches. It does not send any material until it has received and processed all the material that it was set to receive.

The flow mixer pulls material from one or more input ports and mixes it together into a new product as defined in the mixer settings.

Ingredients, steps and recipes

A mixer recipe consists of a number of steps that the mixer will execute consecutively. These steps are defined in the step table. Each step can pull material from zero or more input ports at the same time. A delay time can also be defined that begins after all the material for that step has been collected. The next step will not begin until after the delay time is over. Each step can be given a description, which is displayed near the object's name in the model view.

The recipe is entered into the Mixer Recipe table on the Current Recipe Tab. row of the table represents material coming from a single input port during a single step. Each row has four columns: the ingredient name, the port number, the step number and the amount. The name is a text that describes the material being pulled in for that row. It is included for your convenience only, the mixer logic ignores the value. The port number refers to the input port that the material will be pulled from. The step number is the step in the Step Table the Mixer must be in to pull this material, it must refer to a valid step number defined in that table. Once the Mixer has collected the correct amount for a given row, it will not pull any more material for that row, even if the other rows in the same step are not complete yet. The amount is the actual amount of material that will be pulled from the specified port during the specified step.

Parallel and sequential processing of steps

Different materials will be pulled in parallel if they have the same step number. They will be pulled in series if they have different step numbers. It is possible (and often very useful) to have a recipe that calls for some ingredients to be pulled in parallel and others to be pulled in series. There is no limit on the number of steps or ingredients that can be defined. There is also no limit on the number of ingredients that can be pulled during any single step. If the you wish to have material pulled from the same input port during multiple steps, you can define multiple rows for that input port in the Recipe Table.

Because the flow mixer controls which ports it will pull from at any point in time, there is no Flow Tab where you can define the input flow rates. The maximum overall input rate and output rate can be specified on the Current Recipe Tab. Make sure that the rate is high enough to allow input from multiple ports if their recipe requires that. Once the delay after the final step is complete, the mixer will release the product through all open ports.

Visual display

The mixer provides a visual display of the material that has been received at any point in the process. The level indicator bar will not show the mixer's final product color until the delay time of the last step is complete. Before that time, the level indicator is a series of layers of different colors. There is one layer for each ingredient in the Recipe. The size of each layer is the percentage of the total batch that has been pulled for that ingredient. This multi-color bar is a good indicator of what is happening in a Mixer at any given time.

Manual vs. automatic mode

By default, the flow mixer operates in automatic mode. This means that it will start collecting ingredients for the first step of the recipe as soon as the model is started. As soon as a batch has been completely released and the mixer is empty again, it will also immediately start working on the next batch.

Sometimes you need more fine-grained control over when the mixer starts working on a batch. For example, you may want to collect enough material in the supply tanks before you start mixing the next batch, or you may have a production schedule to run and want to dynamically change the recipe between different batches. If this is the case, you can disable the "Continuously repeat recipe" checkbox in the mixer settings. The mixer will now remain idle until you start a recipe using the "Start Mixer Recipe" trigger option or the FlowMixer.startRecipe() method.


The mixer uses the standard events that are common to almost all FloWorks objects. See FloWorks Triggers for an explanation of these events.

The mixer is a content-holding object and therefore also inherits the On Empty and On Full events from the flow tank. See Flow Tanks - Events for a description of these events.

The flow mixer has the following additional events on the Current Recipe Tab.

Before Step Delay Trigger, After Step Delay Trigger

These events occur in each recipe step, after all the ingredients have been collected, before and after the delay for that step, respectively.

They have the following parameter:

Event Parameter Explanation
stepnum The number of the step for which the delay will be or has been executed, starting from step 1 up to (and including) the number of steps defined in the Mixer Steps table.


For statistical purposes, the pump's and valve's FloWorks state profile will be in one of the following states at various points during a simulation run:

  • Idle - The mixer is in manual mode and is waiting for a Start Recipe command. This state is indicated visually by a yellow box around the mixer.
  • Filling - The mixer is collecting ingredients at a positive inflow rate.
  • Full - The mixer has reached its maximum content.
  • Empty - The tank is empty and there is no net flow (the flow is zero or inflow rate is equal to the outflow rate).
  • Mixing - The mixer is in the delay period of the step indicated in the object information.
  • Releasing - The tank is not empty and the outflow rate exceeds the inflow rate.
  • Not empty - The mixer is collecting or releasing, and is neither empty nor full, but there is no net flow.


The mixer has seven tabs with various properties. Some of these are adaptations of standard property pages, some are specific to the mixer. We first give an overview of the tabs, the mixer specific settings are described in more detail in the subsequent sections.


In addition to the standard Settings properties, the Settings tabs for the mixer also contain the following fields.

Maximum content

The maximum amount of material that this mixer can hold at any time. Note that you should not specify recipes requiring more storage than the maximum content, or the mixer will never finish the collecting phase.

Reset Maximum Content

Automatically calculate the maximum content based on the tank geometry. The maximum content is calculated according to xyz where x, y, z are the dimensions of the tank.

The maximum content is converted to model fluid units - for example if your length units are meters and the fluid units are liters, the maximum content will be set to the value described above times 1000, since 1 m3 = 1000 L.

Product sources

The product sources tab specifies from which input port the mixer should get its products when loading a global product recipe. For more information about defining global recipes, see the Products page. In summary, in the global product recipe you specify the steps and ingredients just like you would in the Current Recipe Tab of the mixer, except that in the recipe steps you do not specify specific input ports but product types. The reason is that you can load the same recipe into different mixers, which may have different configurations for their input ports. For example, one mixer may get product A from input port 1 while another mixer gets the product from input port 3. The purpose of the Product Sources table is to convert these global product ingredients to specific input ports numbers when loading the recipe into the Current Recipe table of the mixer.

The Product Source trigger has the following parameters:

Event Parameter Explanation
product The name or the number of the product. In general, this trigger will be called when you are using named products so this will contain the name of the product. If you need the product ID, call the GetFlowProductId function.
step The step number. You may want to get the same product from different input ports, depending on which step of the recipe the mixer is collecting.

The product sources trigger should return the number of an input port. By default, the following two options are available in the dropdown:

  • First port with the correct product. The mixer will automatically determine a port to get the product from. It will go through all its input ports, starting at 1, and pick the first port for which the input object has the sought product ID. This picklist option assumes that all input objects are FlowObjects.
  • Use product sources table. This pick option references the product sources table on the Product sources tab. Using the green "Plus" button in the top right corner you can add new rows to this table. On each row, specify one possible product that the mixer can collect, and which input port number to collect it from.

Current recipe

The Current Recipe tab shows the recipe that the mixer is currently executing. By default, this will be the recipe that you entered; however if you set the mixer to manual mode and call FlowMixer.loadRecipe (or select the Load Mixer Recipe option from a trigger picklist) this table will be overwritten with the loaded recipe.

The tab has the following properties:

Mixer steps

Defines the number of steps and the delay after each step. To change the number of steps, fill in the required number in the "Number of Steps" field and click "Update". The description in each step is just for your convenience: it is ignored by the mixer logic. You will reference the step by rank in the Recipe table.

Mixer Recipe

In this table you define exactly which ingredients should be collected, in what amount, from which source and in which step. As described above, all ingredients for the same step will be collected simultaneously.

Inflow / Outflow

You cannot select an input or output rule for the mixer as it manages its own ports. You can only select the maximum inflow rate and outflow rate. Make sure the input rate is sufficient to simultaneously allow all ingredients in any of the steps to enter without restriction, otherwise you may see them get collected sequentially due to the Preferred Order Rule.

Before / After Step Delay Trigger

These triggers are described in the section Events.

Level indicator

The Level Indicator tab has the following properties:

Draw Level Indicator

If this is checked, the level indicator bar will be drawn on the object.


If this is selected, the level indicator bar will be drawn as a colored box.


If this is selected, the level indicator bar will be drawn as a colored cylinder.

Position, Rotation, and Size

Here you can set the position, rotation, and size of the bar based on X, Y, and Z values.

Field Description
Change the position of the object.
Change the rotation of the object.
Change the size of the object.

Custom coding

You may control the behavior of the flow mixer dynamically by writing FlexScript, for example in a Script window or by changing the code behind one of the options in an object trigger.

The flow mixer is an instance of the FlowMixer class, see the class reference for information about its properties.