Paul Toone avatar image
Paul Toone posted

Fluid Objects Step-By-Step Model Construction   

Building the Fluid Model

To start building the fluid model, you will need to start with a new model. Do not begin with the models you saved from the previous lessons. It is expected that you know how to create objects, connect their ports, and use their Properties GUIs.

If at any time you encounter difficulties while building this model, a fully functional tutorial model can be found at

Step 1: Model Layout and Connections

To begin this lesson, drag out the following objects from the library. These objects can be found in the library by clicking on the plus button next to "Fluid" found near the bottom of the library window:

Note: When you create the first Fluid Object, a Ticker is automatically created and placed at (0,0). You can move this to any point in your model where it is not in the way, but do not delete it. It is required for the Fluid Objects to work.

  • 2 Sources named Source1 and Source2 (Discrete Objects).
  • 1 Operator named Operator (Discrete Objects).
  • 2 ItemToFluids named ItemToFluid1 and ItemToFluid2 (Fluid Objects).
  • 2 FluidPipes named fluidpipe1 and fluidpipe2 (Fluid Objects).
  • 2 FluidTanks named fluidtank1 and fluidtank1 (Fluid Objects).
  • 2 more FluidPipes named fluidpipe3 and FluidPipe4 (Fluid Objects).
  • 1 FluidMixer named FluidMixer (Fluid Objects).
  • 1 FluidProcessor named FluidProcessor (Fluid Objects).
  • 1 FluidToItem named FluidToItem (Fluid Objects).
  • 1 Conveyor named Conveyor (Discrete Objects).
  • 1 Sink named Sink (Discrete Objects).
  • Arrange the objects as shown below.

Once the objects have all been created and positioned where you want them in the model, they need to be connected. You use the same keys to connect Fluid Objects as you do to connect Discrete Objects: the A key creates an input/output connection and the S key creates a center port connection.

  • Connect the objects so that there is a processing line
    • from Source1 to ItemToFluid1
    • from ItemToFluid1 to fluidpipe1
    • from fluidpipe1 tofluidtank1
    • from fluidtank1 to fluidpipe3
    • from fluidpipe3 to FluidMixer
    • from FluidMixer toFluidProcessor
    • from FluidProcessor to FluidToItem
    • from FluidToItem to Conveyor
    • from Conveyor to Sink
    in that order, as shown below.
  • Make a parallel line of connections from Source2 to FluidMixer
  • Both sources should call for the Operator to transport the flowitem to ItemToFluid, so a center port connection needs to be made from each Source1 and Source2 to the Operator.

Step 2: Configure the Sources

The default inter-arrival time for the Sources will work well for this model. They just need to call an Operator to transport the flowitems they create to the ItemToFluid objects.

  • Click on Source1 to open its properties in the Quick Properties. Under the Flow section check Use Transport.
  • Repeat this step for Source2.

Step 3: Set the Colors of the Objects

When the objects are created they will be different colors, depending on their class. It is often helpful to color the objects based on the type of material that they will be processing. In this model there are two processing lines that are each composed of an ItemToFluid, a Pipe, a Tank and another Pipe. Using the Properties GUI, we will change the color of those four objects on one line to blue and the objects on the other line to red. This will cause pieces of the objects to change to that color as the model is running.

  • Double-click on ItemToFluid1 to open its Properties window, and click the General tab.
  • Click the button located next to the Color field. The color popup will appear. Select a blue color from the the options, then click OK.
  • Click OK to apply the changes and close the Properties window.
  • Repeat this step for the rest of the objects mentioned above, coloring the other processing line red instead of blue.

Step 4: Configure the ItemToFluid

Next the ItemToFluid objects have to be configured to create the correct amount of material for each flowitem that comes in.

  • Double-click ItemToFluid1 to open its Properties window. On the ItemToFluid tab, change Discrete Units per Flowitem to 10. This tells ItemToFluid to create 10 gallons of fluid for each flowitemthat enters.
  • Change Maximum Object Rate and Maximum Port Rate to 2.
  • Change the Maximum Content to 20.
  • Click OK to apply the changes and close the Properties window.
  • Repeat this step for ItemToFluid2.

Step 5: Configure the FluidPipes

The Pipes that lead away from the ItemToFluids are the next objects that need to be configured. Pipes do not allow the modeler to specify the input and output rates. The output rate is based on the actual rate that material was received.

  • Double-click fluidpipe1 to open its Properties window.
  • On the Pipe tab, set Maximum Flow Rate to 2, and set the MaximumContent to 20. This will ensure that material spends time in the Pipe, but not too much time.

  • Click the Layout tab. Adjust the FluidPipe, changing and/or adding sections of pipe, so that it appears to start at ItemToFluid and end near FluidTank (the actual values of your FluidPipe may be different than the ones shown below). Changing the Layout does not affect the behavior of the pipes. More information about this tab can be found here.

  • Click the OK button to apply the changes and close the Properties window. Repeat this step for fluidpipe2.

Step 6: Configure the FluidTanks

The ItemToFluids now have a maximum output rate of 2, but the FluidTanks have a maximum input rate 1. If these values are left as they are, the FluidTank's rate will be used during the model run (because it is the lower of two values) and the FluidPipe will not be able to send material downstream as fast as you have told it to. So the rate on the FluidTanks needs to be changed. FluidTanks allow the modeler to set three levels that will cause triggers to fire when the content of the FluidTank reaches them. These values are called marks. They are edited on the Marks tab of the Properties Window. For this model, the Tanks should keep their output ports closed until they have received a certain amount of material. They will then open the output ports and leave them open until the Tank becomes empty. They will always keep their input ports open.

  • Double-click fluidtank1. On the Tank tab, under Input Ports, change the Maximum Object Rate and the Maximum Port Rate to 2.
  • Click the Marks tab. Change the Low Mark to 1, and the High Mark to 45. Leave the Mid Mark at 0. If a mark has the value 0, the trigger for that mark will never fire.

  • On the Marks tab, click the to add a function to the Passing Low Mark trigger. Select the Open or Close Ports option.

  • Click where it says rising. The available options will appear.

  • Give the function the following parameters:

  • Add the Open or Close Ports function to the Passing High Mark trigger in the same way. Give it the following parameters:

  • Click OK to apply the changes and close the Properties window.
  • Repeat the same procedure for fluidtank2.

Step 7: Reorient and resize the next Pipes

Depending on where you placed the objects in your model, the Pipes that lead from the Tanks to the Mixer may need to be adjusted so that they point toward the Mixer. Again, this is completely visual, the size and layout of the Pipes will not affect their behavior. Use the Layout tab to configure the Pipes in your model so that they look good to you. The default maximum content of these Pipes is currently too large for this model.

  • Double-click fluidpipe3 to open its Properties window. On the Pipe tab, change the Maximum Content to 10. This will make sure that the material leaving the Tanks takes just a little time to get to the Mixer.
  • Repeat this step for FluidPipe4.

Step 8: Set up the Mixer's step and recipe tables

The FluidMixer now needs to be configured to receive the two different materials and combine them into a new material. This is done by changing the two tables found on the Steps tab in the FluidMixer's Properties window. The Mixer Steps table is used to define a series of steps that the Mixer must go through for each batch that it processes. In this model, the Mixer Steps table needs 2 steps. The Mixer should pull 10 gallons of the first material from input port 1 during step 1. Then it should pull 20 gallons of the second material from input port 2.

  • Double-click the FluidMixer to open its Properties window, and click the Steps tab.
  • Under Mixer Steps, change the Number of Steps to2.
  • Click Update. The steps will appear in the table.

The description of the steps is not important, call them anything you want. The delay time for each step is executed after all the material for that step is received, and before the Mixer starts receiving material for the next step.

  • Set the Delay for Step 1 to 0, and the Delay for Step 2 to 10.

  • On the Steps tab, under Mixer Recipe, change the Number ofIngredients to 2.
  • Click Update. The ingredients will now appear in the table. Once more, the description can be anything you want because the object does not refer to these names. Call them Material1 and Material2.
  • For Material1, change the Port to 1, the Amount to 10, and the Step to 1.
  • For Material2, change the Port to 2, the Amount to 20, and the Step to 2.

The Mixer's level display is a useful tool to watch during the model run. It will display how much of each material in the Recipe Table the Mixer has received at any point in time. By default it is hidden behind the Mixer's 3D shape. More information about the fluid level display is found here. You can also manipulate the size and shape of the fluid level display so that it looks like part of the object to get a more realistic look.

  • Click the FluidLevelDisplay tab. Change Y to 1.

Step 9: Examine the FluidProcessor

The FluidProcessor's default values will work well for this model. It will receive material from input port 1, process it for a certain amount of time and send it to output port 1. The amount of time it spends processing is based on its Maximum Content and the Maximum Output Rate that the modeler defines in the FluidProcessor Properties window on the FluidProcessor tab. You can play with these values if you want to see how they affect the model. To make the bar on this object appear in front like on that of the Mixer, you will once again need to change the Y location of the level indicator bar to 1, as done in the previous step.

Step 10: Configure the FluidToItem

The FluidToItem near the end of the line will convert the fluid material coming from the FluidProcessor and change it into flowitems. The Fluid per Discrete Unit and Discrete Units per Flowitem will be multiplied together to determine how much material will have to be collected to create a single flowitem. In this case, 10 gallons of fluid will become 1 flowitem.

  • Double-click the FluidToItem to open its Properties window.
  • On the FluidToItem tab, under Flowitem Output, change Fluid per Discrete Unit to 10.
  • On the FluidToItem tab, change the Maximum Content to 10. This tells the object that it can only collect enough material for 1 flowitem at any time. If this value is higher, the FluidToItem may end up acting as a Queue and creating too much storage space in your model.

Step 11: Reset and run the model.

  • Reset and Save the model.
  • Run the model. You should see the level indicator bars on the objects going up and down. You should also see the Pipes flashing. If a Pipe is drawn in gray, it is empty. If it is a pulsing color, material is flowing through the pipe. If it is a solid color, the material is blocked. There will also be flowitems being changed into fluid and fluid being changed into flowitems.

After completing this lesson your should have an idea of how these Fluid Objects work and some of their capabilities. There is far more that they can do than was covered in this lesson. Read through their documentation and try other options and settings. Soon you'll be putting together larger, more detailed fluid-based models.

flexsim users manual
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.



paul.t contributed to this article


FlexSim 2016.1