question

Ville Teivastenaho avatar image
0 Likes"
Ville Teivastenaho asked Ville Teivastenaho commented

FloWorks: Preferred order of flow

Hi,

I have a problem with a model using the FloWorks module, or I'm not fulling understanding how the flows through the network are being calucated. Attached there is a very simplified example that replicates the issue that I have with my model:

Sink has a max inflow rate of 20.

There are two tanks connected to the sink and both have unconstrained flow. First tank is connected to a flow source, but the output flow from the source is closed.

At the start of the simulation run, the first tank has an output rate of 20 to the sink, as it should with the "Preferred order" selected as sink's inflow rule.

When the first tank runs empty, flow starts (rate 20) from the second tank. The output from the source to the first tank is still closed.

So far everything works as I expect it to work. But after some delay the flow from the source to the first tank is opened. So now there is inflow to the first tank, but the flow to the sink is still coming from the second tank, even though the first one should be preferred and it now starts to accumulate content.


So is this how the flows should behave? And if it is, is there some way to force the flows to be recalculated so that the flow would follow the preferred order of tanks after opening the source?


preferred_order_demo.fsm

FlexSim 23.0.2
FloWorks
· 3
5 |100000

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

Patrick Zweekhorst avatar image Patrick Zweekhorst commented ·
Hi @Ville Teivastenaho ,


This indeed looks a bit like a bug. I would have expected the same flow as you are expecting. We will investigate this further and check if it is a bug or something else is going on. @Harald Emsbroek would probably be best to check what is going on here. He is on holiday next week so it might take till after next week till we are sure of it is a bug or not.

If this is stopping you from continuing your model we might be able to think of a work around. Closing and opening the ports of the tank would for example be an option depending on your model. If you want to discuss any possible work around you can also email me with the actual model if that helps ([email protected]), or we schedule a short call.

Patrick

0 Likes 0 ·
Ville Teivastenaho avatar image Ville Teivastenaho Patrick Zweekhorst commented ·

Thank you, I'll try first if that work around with opening and closing ports would work. If not, I can also build a logic control the flow manually between different tanks. I was hoping to keep this part of the model as simple as possible, as it is anyway just more or less temporary solution for now.

1 Like 1 ·
Patrick Zweekhorst avatar image Patrick Zweekhorst Ville Teivastenaho commented ·
Sounds good. Don't hesitate to ask an extra question or some help with the work around! I will definitely let you know when we have some more information about this problem.
0 Likes 0 ·

1 Answer

·
Harald Emsbroek avatar image
0 Likes"
Harald Emsbroek answered Ville Teivastenaho commented

Hi @Ville Teivastenaho,

I looked at the model, and the flow isn't what you (and I) expected. However, this isn't a bug, but it is by design. Let me explain this.

The solver tries to push as much product through the network as possible. Pushing is being done at the FlowSource, but also at nonempty FlowObjects, like FlowTanks. In this model the tank at the bottom is also pushing product into the network. This means that the FlowSource can push 20 into the network, and the FlowTank at the bottom (Cylindric2) can also push 20 into the network, but only if the 20 from the FlowSource is stored in the FlowTank at the top (Cylindric1), because of the inflow constraint at the FlowSink. So there is a total flow of 40, pushed out of the flow generating objects. This is more than the total of 20 we would have if only the path from the FlowSource to the FlowSink is used.

You can prevent the flow from FlowTank Cylindric2 to the FlowSink by closing the input port of the FlowSink, or the outflow (port) at the FlowTank. Just let us know if you need help with that, or if you need an example.

· 1
5 |100000

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

Ville Teivastenaho avatar image Ville Teivastenaho commented ·

Thank you @Harald Emsbroek for looking into this and explaining the logic behind it. The thing I don't yet fully understand, is when we have those two flows of 20, why does the solver "decide" to continue with the flow from the second tank (Cylindric2), even though Cylindric1 should be preferred due the order of connections?

It feels like it is not calculating any outflow from the Cylindric1 as at that moment the tank is still empty.

Because if I instantly, after opening the flow source, close and reopen the input ports of the sink, it doesn't change anything. But if I add even small delay (0.1 s) so that content of the Cylindric1 >0, and then close and open flow to the sink, then the flow starts to go through the Cylindric1.

I managed to find a solution for my current model, so this is no longer that urgent problem for me at least, but it would be nice understand better how the solver works.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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