Jump to content

Flow sequence from a table with entities from another


Omedius
 Share

Recommended Posts

Hi,


It's the first time I'm working with the flow library. My question relates to configuring a flow of two liquids that come from a single source, but may be of two kinds (different densities). I would like to have one table, describing the properties of the entities, and another table, having one field as a model type, and another one as the weight limit in the flow sequence.


So, basically

Table1:

--Entity--- ---Density (kg/cubic meter)--- ... some other props

TypeA 5000

TypeB 10000


Table2:

RowNumber (not a field, just for sequence) --Entity--- ---Amount (cubic meters)---

1 TypeA 10000

2 TypeA 20000

3 TypeB 30000

4 TypeB 25000

5 TypeA 10000

6 TypeB 12000

7 TypeB 10000


I need to make pauses between the sequential flows of different (or the same) liquids, in the order presented in 2nd table, but I believe, I'll figure out how to achieve this.


The question is - how do I configure the source? I need to reference both tables, since I need to limit certain values by weight in the source, but have input in volume.


I also have some other entity properties that I would need to access further in the simulation. They are in Table1, which is the descriptive table, not the one used for initializing the flow source.


What I tried to do - is

1. Specified the entity type as a referenced property from the Initialization table (Table2)

2. I created the RunInitialized trigger for the flow source to SetRow to number 1 (I will further increment the rownumber - if there is a better solution, please advise)

3. I tried to limit MaximumVolume by accessing another table - and here I'm stuck. I need to lookup Table1, but not by id (integer), but by the entity type. So, the lookup table seems not to fit here.


Please advise of this design, how do I lookup in a Table1, when I have an entity of known type.

Link to comment
Share on other sites

  • 1 month later...

Ok.

I've been looking for replies almost daily, working on a different side...

Now, coming back.. Hopefully an easier question.


How can I reset the FlowSource after it has generated a predefined volume of an entity? So, I have a table with sequence of volumes. I need to follow this table and generate sequentially the indicated volumes. Let's say that entity is the same for a start (which is actually wrong and the next step will be selecting the entity simultaneously).


Simulation should stop only after all the volumes have been generated.


UPD: To make it even simpler. Can I just reset the FlowSource so that after it has generated everything is has (MaximumVolume), it resets the generated volume to zero and proceeds again with this amount?.. For, say, two or three times.

Link to comment
Share on other sites

You might build a model like this:


Source -> ItemToFlowConverter -> the flow line


Where the Source object is the Standard Library Source for creating discrete entity arrivals.


So, use a Source to create discrete entities (of possibly varying entity types) from table data. Then have each discrete entity go into an ItemToFlowConverter to be converted into a specified quantity of flow, by specifying the 'Flow Quantity Per Item' property however you like (sounds like that will possibly be a value also coming from table data that was used to define the entity's type).


The FlowSource is currently easiest to use as an infinite flow supply of some flow type. You can of course open and close the 'Output' flow regulator (e.g., Assign Output@MyFlowSourceName.FlowRegulator.CurrentMaximumFlowRate = 0 to close the output valve of the flow source).


However, if you have a situation with discrete arrivals of flow quantities where each arrival has some entity type and some volume or weight quantity, I think using a Source -> ItemToFlowConverter combination is probably the best way to go.

Link to comment
Share on other sites

Even easier is to use a "tank" object as the source instead of a "flow source" object.


It has more AddOn processes to control logic (switch over delays), as well as being able to purge contents or automatically refill multiple entity types based on events fired.

Link to comment
Share on other sites

Even easier is to use a "tank" object as the source instead of a "flow source" object.


It has more AddOn processes to control logic (switch over delays), as well as being able to purge contents or automatically refill multiple entity types based on events fired.

 


Mark, just a note that the FlowToItemConverter has 'Purge Contents Triggers', 'Clean-In-Place Triggers', and several add-on process triggers as well.

Link to comment
Share on other sites

×
×
  • Create New...