import numpy as np
import calc_prism as cp

p_dict = {}
p_dict['g'] = 9.81
p_dict['d'] = 1.8
p_dict['y'] = 0.7
p_dict['Q'] = 2.8
f = cp.f_circ(p_dict)
m = cp.m_circ(p_dict)
y = np.arange(0.0001,1.7,0.0001)
conj_ys = cp.find_depths(m,y,p_dict,cp.m_circ)

print f,conj_ys
Esempio n. 2
0
p_rect['b'] = 49.0
p_rect['Q'] = 12600.0

p_trap = {}
p_trap['g'] = 32.2
p_trap['m'] = 2.0
p_trap['b'] = 75.0
p_trap['Q'] = 12600.0
p_trap['y'] = 22.0

delta_z = 1.0
k_loss = 0.5

#--energy downstream
e_trap = cp.e_trap(p_trap)        
print e_trap
#--energy upstream = e_dwn + delta_z + head_loss
e_trap -= delta_z

#--add parameters to p_rect for depth finding
p_rect['area2'] = cp.area_trap(p_trap)
p_rect['k_loss'] = k_loss



y = np.arange(0.001,100.0,0.001)
#y = np.array([19.88])
alt_depths = cp.find_depths(e_trap,y,p_rect,e_rect_mod)
print alt_depths

Esempio n. 3
0
import pylab

import calc_prism as cp     
 
#--tri params    
p_dict = {}   
p_dict['y'] = 1.12 
p_dict['Q'] = 60.0
p_dict['g'] = 32.2

m = cp.m_tri(p_dict)
print 'approach momentum: ',m

#--find conjugates
y = np.arange(0.1,1.0,0.00001)
conj_c = cp.find_depths(m,y,p_dict,cp.m_tri)
conj_c = y[find_conjugate_idxs(mc,mc1,mc_min)]  
print conj_c

fig = pylab.figure()
ax = pylab.subplot(111)
ax.plot(mc,y,'b-',lw=2.0)    
ax.plot((mc1,mc1),conj_c,'bo')
ax.plot((mc1,mc1),conj_c,'b--')

xmin,xmax = ax.get_xlim()
ax.plot((xmin,mc1),(conj_c[0],conj_c[0]),'b--')
ax.plot((xmin,mc1),(conj_c[1],conj_c[1]),'b--')

ax.text(0.1,0.95,'sequent depths:{0:3.2f} {1:3.2f}'.format(conj_c[0],conj_c[1]),color='b')
#ax.legend()
Esempio n. 4
0
import numpy as np
import calc_prism as cp

p_dict = {}
p_dict['g'] = 9.81
p_dict['Q'] = 0.30
p_dict['y'] = 0.15
p_dict['m'] = 2.0

p_dict['Y'] = np.arange(0.00001,1.0,0.00001)
m1 = cp.m_tri(p_dict)
f_tri = cp.f_tri(p_dict)
yc_tri = cp.yc_tri(p_dict)
print f_tri,yc_tri

conj_ys = cp.find_depths(m1,p_dict['Y'],p_dict,cp.m_tri)
print conj_ys
Esempio n. 5
0
import math
import numpy as np
import pylab

import calc_prism as cp


#--tri params
p_tri = {}    
p_tri['g'] = 9.81
p_tri['m'] = 2.0    
p_tri['y'] = 0.15 #m
p_tri['Q'] = 0.3


mc1 = cp.m_tri(p_tri)
print 'approach momentum: ',mc1

#--find conjugates
y = np.arange(0.1,1.0,0.00001)
conj_c = cp.find_depths(mc1,y,p_tri,cp.m_tri)

   
print conj_c
Esempio n. 6
0
import math
import numpy as np
import pylab

import calc_prism as cp     
 
#--tri params    
p_dict = {}   
p_dict['y'] = 1.12
p_dict['v'] = 60.0
p_dict['g'] = 32.2
p_dict['q'] = 60.0 * 1.12
f = cp.f_rect(p_dict)
m = cp.m_rect(p_dict)
print 'approach F: ',f
y = np.arange(0.001,100.0,0.001)
conj_depths = cp.find_depths(m,y,p_dict,cp.m_rect)
print conj_depths
#--find conjugates
#
#conj_c = cp.find_depths(m,y,p_dict,cp.m_tri)
#print conj_c
Esempio n. 7
0
p_rect = {}
p_rect['g'] = 32.2
p_rect['b'] = 49.0
p_rect['Q'] = 12600.0

p_trap = {}
p_trap['g'] = 32.2
p_trap['m'] = 2.0
p_trap['b'] = 75.0
p_trap['Q'] = 12600.0
p_trap['y'] = 22.0

delta_z = 1.0
k_loss = 0.5

#--energy downstream
e_trap = cp.e_trap(p_trap)
print e_trap
#--energy upstream = e_dwn + delta_z + head_loss
e_trap -= delta_z

#--add parameters to p_rect for depth finding
p_rect['area2'] = cp.area_trap(p_trap)
p_rect['k_loss'] = k_loss

y = np.arange(0.001, 100.0, 0.001)
#y = np.array([19.88])
alt_depths = cp.find_depths(e_trap, y, p_rect, e_rect_mod)
print alt_depths
Esempio n. 8
0
p_trap['v'] = p_trap['Q'] / a_trap
#print p_trap['v']
f_trap = cp.f_trap(p_trap)
#print f_trap

e_trap = cp.e_trap(p_trap)
#print e_trap

p_rect = {}
p_rect['b'] = 1.5
p_rect['g'] = 9.81
p_rect['Q'] = 1.0

y = np.arange(0.0001,2.0,0.0001)

rect_depths = cp.find_depths(e_trap,y,p_rect,cp.e_rect)
#print rect_depths
p_rect['y'] = rect_depths[1]

p_rect['q'] = p_rect['Q'] / p_rect['b']

yc = cp.yc_rect(p_rect)
print yc

p_rect['y'] = yc
e_c_rect = cp.e_rect(p_rect)
print e_c_rect

q2c = ((2.0/3.0) * (e_c_rect))**(3.0/2.0) * (9.9)**0.581
print q2c
Esempio n. 9
0
p_trap['v'] = p_trap['Q'] / a_trap
#print p_trap['v']
f_trap = cp.f_trap(p_trap)
#print f_trap

e_trap = cp.e_trap(p_trap)
#print e_trap

p_rect = {}
p_rect['b'] = 1.5
p_rect['g'] = 9.81
p_rect['Q'] = 1.0

y = np.arange(0.0001, 2.0, 0.0001)

rect_depths = cp.find_depths(e_trap, y, p_rect, cp.e_rect)
#print rect_depths
p_rect['y'] = rect_depths[1]

p_rect['q'] = p_rect['Q'] / p_rect['b']

yc = cp.yc_rect(p_rect)
print yc

p_rect['y'] = yc
e_c_rect = cp.e_rect(p_rect)
print e_c_rect

q2c = ((2.0 / 3.0) * (e_c_rect))**(3.0 / 2.0) * (9.9)**0.581
print q2c
Esempio n. 10
0
import numpy as np
import calc_prism as cp

p_dict = {}
p_dict['g'] = 9.81
p_dict['d'] = 1.8
p_dict['y'] = 0.7
p_dict['Q'] = 2.8
f = cp.f_circ(p_dict)
m = cp.m_circ(p_dict)
y = np.arange(0.0001, 1.7, 0.0001)
conj_ys = cp.find_depths(m, y, p_dict, cp.m_circ)

print f, conj_ys