Hi all, i am just running some simple tests on an open channel.
For a trapezoidal open channel, is there a way i can get the flow in m3/s at a given cross section in the channel?
Also when you get 'speed' 'stage' 'depth' etc. in the .csv file what unit is the speed in? I have read that is the square root of the total of x-momentum squared plus y-momentum squared (Speed = SQRT((x-momentum)^2 + (y-momentum)^2)), but im not sure what units the x and y momentum is in.
Any help much appreciated
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all, i am just running some simple tests on an open channel.
For a trapezoidal open channel, is there a way i can get the flow in m3/s at a given cross section in the channel?
Also when you get 'speed' 'stage' 'depth' etc. in the .csv file what unit is the speed in? I have read that is the square root of the total of x-momentum squared plus y-momentum squared (Speed = SQRT((x-momentum)^2 + (y-momentum)^2)), but im not sure what units the x and y momentum is in.
Any help much appreciated
Hi Sachi,
I remember asking this question at some point recently.
Try the following python code for grabbing the flow:
from anuga.shallow_water.data_manager import get_flow_through_cross_section
flow_line = [ [123.0, 456.0], [789.0, 123.0] ]
# Define a poly-line
model_times, model_q = get_flow_through_cross_section(filename='your_sww_file', polyline=flow_line, verbose=True)
fid = open( "flow_plot_out.csv", "w" )
i = 0
while i < len(model_times):
fid.write( str(model_times[i]) + ", " + str(model_q[i]) + "\n" )
i = i + 1
fid.close()
I believe the flow will be in m3/s but don't quote me on that - also i'd have thought the other quanitites you mention will be in SI units.
speed = (xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-30)
(don't forget to divide by the depth)
I'm guessing speed should be in m/s
Let me know if anything doesn't make sense.
Regards,
Vince
PS. I think the indentation of the code got screwed up
fid.write( str(model_times[i]) + ", " + str(model_q[i]) + "\n" )
and
i = i + 1
should be indented
V
Thanks Vincent for replying to Sachi's posting.
I can confirm that flow rates are in m^3/s and speeds in m/s.
Ole
Thanks for the reply, I have it working and writing to the csv file. works well