<< Click to Display Table of Contents >> Calculate FlowData (complex) with PlantLink |
Please make sure you read through the Calculate simple Example chapter, because we will keep the explanations shorter and you may miss some details.
In this more elaborate example we see a combination of calculations and PlantLink configurations.
This is the order of steps:
1.The user types in Design Flow Speed and Flow Rate
2.Based on those two values the "Calculated Size" will be calculated
3.Next PlantLink will retrieve the next larger Size, Outside Diameter and Wall Thickness where the inside diameter is larger than the Calculated Size
4.The Inside Diameter will be calculated
5.The Pipe Area will be calculated
6.The Operational Flow Speed will be calculated
For Pipe Line Segments we created all the necessary properties.
For the calculation of the pipe size we use this simple calculation:
Qw = Flow Rate m³/h
v = Velocity (m/s)
The formula is represented through this expression.
Sqr([Flow Rate (m³/h)] / [Design Flow Speed (m/s)] / 3600 * 4 / 3.1415)
Since the size is calculated in meters we need to multiply with 1000 to get mm.
The Round function then rounds the value to two decimal point.
Round(...... * 1000, 2)
The whole expression looks like this:
Round(Sqr([Flow Rate (m³/h)] / [Design Flow Speed (m/s)] / 3600 * 4 / 3.1415) * 1000, 2)
This is how it looks in the configuration dialog.
Next we have a SQLite database for PlantLink in out project.
We have one table with 5 columns.
1.NominalDiameter = Size
2.ODMax = Outside Diameter for the Size
3.WTMax = Wall Thickness for the Size
4.ODMin = Outside Diameter for the next smaller Size
5.WTMin = Wall Thickness for the next smaller Size
The next steps show the configuration for PlantLink. We will not cover all the details of PlantLink at this point. Please have a look under How to use Videos.
We start PlantLink.
We select the database we want to use.
We select the "Update" link type.
We select the class for which we want to bring in the data from the database table.
We select the table OD from out database.
With the following expression PlantLink finds the size where it chooses the Size where ODMax - 2 x WTMax is greater than the Calculated Size AND ODMin - 2 x WTMin is less than the Calculated Size. This effectively means to get the Size which is the next larger Size than the Calculated Size.
[ODMax] - 2 * [WTMax] >= ?CalculatedSize(mm) And [ODMin] - 2 * [WTMin] <= ?CalculatedSize(mm)
Then the required fields are mapped.
And we give the link a name.
The new Link is active and no error appear.
Next we calculate the Inside Diameter from the values coming from PlantLink.
[Outside Diameter (mm)] - 2 * [Wall Thickness (mm)]
Then we calculate the Pipe Area in m². Therefore we need to divide by 1000000.
[Inside Diameter (mm)] * [Inside Diameter (mm)] * 3.1415 / 4 / 1000000
Last we calculate the Operational Flow Speed based in the same formula as at the beginning. An we round again for two decimal points.
Round([Flow Rate (m³/h)] / [Pipe Area (m²)] / 3600, 2)
As soon as we type in the values 2 and 10 all the calculations and link configurations are triggered.