question

Arun Kr avatar image
0 Likes"
Arun Kr asked Jason Lightfoot edited

Change Max Flow Rate Of Mass Flow Conveyor Using Code

Hi,

How to change the max flow rate of a mass flow conveyor using code?

1688634701273.png

Regards,

Arun KR

FlexSim 23.1.2
massflowconveyormax flow ratemfc speedwidth rulewidth value
1688634701273.png (218.3 KiB)
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

·
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot edited

The max flow rate is derived - you can't set it directly as a conveyor property.

It's just maxDensity*EffectiveWidth*speed though, so you can choose and set the width (and width rule) and speed to achieve the correct flow rate.

· 2
5 |100000

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

Arun Kr avatar image Arun Kr commented ·
Can you give an example?
0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ Arun Kr commented ·

The following user command accepts the conveyor, flowunit name and desired max flow rate and looks at the width settings of the conveyor in order to calculate and set the speed.

Until the mass flow calculator is fixed to account for the width value and rules you should probably use this if you're not using the physical width:

//setSpeedFromMaxFlowRate(<conveyor>,<flow unit name>,<max flow rate>)
Object conveyor=param(1);
string funame=param(2);  //flow unit name
double maxrate=param(3);

treenode flowunit=Model.find("ConveyorSystem>variables/flowUnits/"+funame);
if (!flowunit) {
   mpt("Flow unit "+funame+" not found in the conveyor system definition");mpr();
return 0;
}

double Ux = flowunit.subnodes["length"].value;
double Uy = flowunit.subnodes["width"].value;
int isRound = flowunit.subnodes["isRound"].value;
double R = isRound ? 2.0 / sqrt(3.0) : 1.0;
double maxDensity = R / (Ux * Uy);

double width=conveyor.getProperty("Width");

string rule=conveyor.getProperty("WidthRule",GET_PROPERTY_FLAG_STRING );
double widthval=conveyor.getProperty("WidthValue");
double effectiveWidth=width;  //rule ="Conveyor Width"
if (rule=="Number of Lanes")
  effectiveWidth=widthval*Uy/R;
else if (rule=="Virtual Width")
    effectiveWidth=widthval;
else if (rule=="Single Lane Flow Unit Distance")
    effectiveWidth=Ux/widthval*Uy/R;  
else if (rule=="Single Lane Gap")
    effectiveWidth=Ux/(Ux+widthval)*Uy/R;   
else if (rule=="Percent of Upstream Width") {
    mpt("Percent of Upstream Width - unknown effective width");mpr();  // unknown
return 0;
}

double speed=maxrate/effectiveWidth/maxDensity;
conveyor.setProperty("Speed",speed);

I've not found the definition for "Percent of Upstream Width" - whether that just means physical size or the effective width of the upstream conveyor (and what if there are more than one with different width rules?).

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.