question

jim.draper avatar image
0 Likes"
jim.draper asked Joshua S commented

Filling Fluid Mixer based on Content of Mixer

I am using custom code in the step triggers of two Fluid Mixer objects to refill when the step sequence is completed and the mixer is empty. How can I code to trigger a refill when the mixer content falls below a certain level (e.g. 1000 kg) rather than after the two step cycle (step 1 fill; step 2 mix) and then completely emptying. After the refill is complete, the mixer should revert to step 2 (mixing). Each of the two mixers can hold 3000 kg and are being fed from a common tank connected to both mixers. The two mixers are communicating with each other through the central ports.

Here is my current method:

Before step trigger:

/**Custom Code*/
treenode current = ownerobject(c);
int stepnum = parval(1);

if (stepnum == 1)
{
openinput(current);
closeinput(centerobject(current,1));
}
After step trigger:
/**Custom Code*/
treenode current = ownerobject(c);
int stepnum = parval(1);


if (stepnum == 1)
{
closeinput(current);
openinput(centerobject(current,1));
}

Thanks.

FlexSim 18.1.2
fluid mixer
5 |100000

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

1 Answer

Joshua S avatar image
0 Likes"
Joshua S answered Joshua S commented

One way you can trigger a refill is to use an event triggered source in process flow where it fires when the content drops below 1000, then have other activities attached to it opening or closing ports.


event-triggered.png (10.6 KiB)
· 11
5 |100000

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

jim.draper avatar image jim.draper commented ·

Joshua,

Thank your for your suggestion. It sounds like a plausible solution. I have not used process flow before and suppose I will have to dig into the user manual to figure out how to recreate the example given above.

0 Likes 0 ·
Joshua S avatar image Joshua S jim.draper commented ·

If you upload your model I could make the adjustments. I do recommend going through through the tutorials for Process flow, it's extremely powerful and will give you greater controll over any model you make.

0 Likes 0 ·
jim.draper avatar image jim.draper Joshua S commented ·

Joshua,

Here is my model. There are a lot of custom objects in the model. Do you need those files as well?

Jim Draper

fresh-burger-line-8-31-18.fsm

0 Likes 0 ·
Show more comments
Show more comments
jim.draper avatar image jim.draper commented ·

Good catch! Yes, the slug should be added when the level drops below the amount it will add to the final mixer. There may be some instances that it will exceed the 3000 lb. capacity of the primary mixer but in reality, it can hold more than 3000 lb. if need be. The 3000 lb. is the recommended fill level and not a hard ceiling amount. The worst case scenario would be if the level drops to 1,484 lb. and then a slug is added bringing it up to 3,484 lb. I think that is doable.

0 Likes 0 ·
Joshua S avatar image Joshua S jim.draper commented ·

Take a look at this model and see if this all checks out of what should be happening. the 6 minutes seems to check out with this.meat-example.fsm

0 Likes 0 ·
meat-example.fsm (35.9 KiB)