CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   a variable/expression to calculate water depth (https://www.cfd-online.com/Forums/cfx/147744-variable-expression-calculate-water-depth.html)

hmasenger January 28, 2015 09:23

a variable/expression to calculate water depth
 
2 Attachment(s)
hi all;
i am modeling a free surface flow over a spillway. in the attached picture the green line refers to water surface(z@polyline1) and the blue one refers to spillway bottom elevation(z@polyline2). i am looking for an expression to calculate water depth among spillway length (y axis in the picture).actually i need something like ( z@polyline1-z@polyline2) but ofcourse this turns to an error saying unrecognized z. i don't know how to define the expected expression. any help would greatly appreciated .
best regard.

ghorrocks January 28, 2015 16:31

I would export the surface and spillway polyline objects from CFD-Post and do the calculation yourself in matlab/python/excel/whatever.

hmasenger January 31, 2015 11:14

1 Attachment(s)
Quote:

Originally Posted by ghorrocks (Post 529438)
I would export the surface and spillway polyline objects from CFD-Post and do the calculation yourself in matlab/python/excel/whatever.

i did this but some problem emerges .pleas do me a favor checking out the exported data i have attached.
two problem exists after exporting results to a csv file.
1-i don't know why number of data points are not equal for polylines?! there is about 2600 data point for one polyline while there is only 1000 for the other one!
2-the exported data are in a revers order for polylines i mean for one polyline data points starts from -1.5 to -4 [for y axis] but for the other polyline it starts from -4 to -1.5 !! why this happens?

ghorrocks January 31, 2015 16:46

The polyline (and all other objects for that matter) export data when the object crosses a control volume boundary. This means the number of points can vary quite a bit. It also means there is no specific order, it can be any order.

You can make the polyline using sampling rather that slicing and then you can control the points. But my preferred way forward is to use a more sophisticated routine in python which can handle any point order and different point resolutions. It is not difficult to do, but will keep you happily occupied for a morning to develop the code.


All times are GMT -4. The time now is 19:00.