Task 2.2 - Creating a tank pool
Task Overview
In this task, you will extend the previous model to use a concept similar to the use of tank pools in chemical processing. You will create one or more receiving tanks for each of the allowed product types, and switch the flow from the flow pipe into one of the tanks with the correct product type. Last, we will apply a factor to the flow.
Step 1 Adding more tanks
In order to keep the time required for this tutorial reasonable, we will first reduce the amount of products.
In the Set Product Type activity of the producing tank, you had entered the expression duniform(1, 10)
to sample a new
product for each batch. Change this to only use three products instead of 10.
Remove the receiving tank from the model and create a new tank with a content of 800. Set the product type of the tank to 1, and the maximum outflow rate to 100 (you can leave the inflow on unconstrained, it will be constrained by the pipe's maximum outflow rate).
Use the existing ProcessFlow logic to make sure that you open the inputs and close the outputs of the tank on reset and on tank empty. When the tank is full, do the opposite:
Copy this tank seven times, connect all copies to the final sink and add them to a group:
Set three of the tanks to product type 1, three to product type 2 and two to product type 3 and group them together into three tank pools. Create a pump for each tank pool, set its flow rate to unconstrained, and connect all the tanks in that tank pool to the pump. Then connect the second flow pipe to each of the pumps. The model should now look more or less as follows.
Then make sure that not one token is created in the logic for the receiving tanks, but one token per tank. You can do the by using the group.
Step 2 Redirecting the flow
In the previous task, you told the second pipe that whenever the product at the output changes, it should close the receiving object's inputs because you wanted that tank to empty. You will now change this to redirect the flow to one of the connected pumps, depending on the product type. If you connected the pumps in the correct order, then product 1 will go to the first output port; product 2 to the second output port and product 3 to the last output port.
Add a seperate flow in the ProcessFlow to control the flow pipe. Make sure that at the start you open the port based on the current product in the pipe. The option Select means that this specific port is opened and all the other ports are closed.
Then, after every product out change, assign the new product to a label and use that label to direct the flow to the correct port.
Once every week maintenance (1 hour) is required on the pump for tankpool 1. This means that the flow during maintenance is only 50% of the normal flow. You can model this with the Apply Impact Factor activity. First, create a token and assign the pump to a label. Then, wait for one week minus the maintenance time before you apply the factor.
After maintenance has finished, you can reset the impact factor.
Now if you run the model, you will see all arrows turn red except the arrow of the product flowing from the pipe. The material will flow into one of the pumps, which will use their “Preferred Order” flow rule to forward the flow into the first available tank. Because of the logic you put on those tanks, the tanks will fill up until they are full and then close their input until they are empty, making them unavailable for inflow during that time. Also check that flow is limited during the maintenance to tankpool 1.
This is the final result:
Conclusion
In this task you have used implemented a tank pool concept, where flow will go to the first available tank of a set of tanks that is assigned to the current product.