# a variable/expression to calculate water depth

 Register Blogs Members List Search Today's Posts Mark Forums Read

January 28, 2015, 09:23
a variable/expression to calculate water depth
#1
Senior Member

hamed
Join Date: Apr 2009
Posts: 148
Rep Power: 14
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.
Attached Images
 2015-01-28_17-41-49.jpg (42.1 KB, 16 views) 2015-01-28_17-52-23.jpg (30.3 KB, 18 views)

 January 28, 2015, 16:31 #2 Super Moderator   Glenn Horrocks Join Date: Mar 2009 Location: Sydney, Australia Posts: 16,814 Rep Power: 132 I would export the surface and spillway polyline objects from CFD-Post and do the calculation yourself in matlab/python/excel/whatever.

January 31, 2015, 11:14
#3
Senior Member

hamed
Join Date: Apr 2009
Posts: 148
Rep Power: 14
Quote:
 Originally Posted by ghorrocks 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?
Attached Files
 depth2.zip (32.3 KB, 5 views)

 January 31, 2015, 16:46 #4 Super Moderator   Glenn Horrocks Join Date: Mar 2009 Location: Sydney, Australia Posts: 16,814 Rep Power: 132 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.