import numpy as np import calc_prism as cp y = 10.0 v = 10.0 ys = np.arange(0.001,10.0,0.001) p_trap = {} p_trap['y'] = 22.0 p_trap['g'] = 32.2 p_trap['Q'] = 12600.0 p_trap['m'] = 2.0 p_trap['b'] = 75.0 a_trap = cp.area_trap(p_trap) print a_trap b_trap = cp.width_trap(p_trap) print b_trap p_trap['v'] = 12600.0/a_trap f_trap = cp.f_trap(p_trap) print f_trap
u_star = (p_dict['g'] * rh * s)**0.5 ratio = u_star / u_c_star if ratio <= 1.0: a, b = 0.15, 1.85 elif ratio > 1.0 and ratio <= 1.5: a, b = 0.2, 2.7 elif ratio > 1.5 and ratio <= 2.5: a, b = 0.28, 3.08 else: a, b = 0.29, 3.5 print a, b n_term1 = kn / ((8.0 * p_dict['g'])**0.5) n_term2 = ((rh / k)**(1.0 / 6.0) / (a + (b * math.log10(rh / k)))) n = n_term1 * n_term2 * k**(1.0 / 6.0) area = cp.area_trap(p_dict) print area Q = (kn / n) * cp.area_trap(p_dict) * rh**(2.0 / 3.0) * s**0.5 print Q, p_dict['y'], rh, tao, k, n # #Y = np.arange(0.001,10.0,0.001) #r = 1.0e+20 #correct_y1 = -999 #correct_n = -999 #correct_tao = -999 #correct_v = -999 #for y in Y: # p_dict['y'] = y # rh = y # tao = gamma * y * s # u_star = (p_dict['g'] * rh * s)**0.5
import numpy as np import calc_prism as cp y = 10.0 v = 10.0 ys = np.arange(0.001, 10.0, 0.001) p_trap = {} p_trap['y'] = 22.0 p_trap['g'] = 32.2 p_trap['Q'] = 12600.0 p_trap['m'] = 2.0 p_trap['b'] = 75.0 a_trap = cp.area_trap(p_trap) print a_trap b_trap = cp.width_trap(p_trap) print b_trap p_trap['v'] = 12600.0 / a_trap f_trap = cp.f_trap(p_trap) print f_trap
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
p_dict['y'] = y rh = cp.r_trap(p_dict) tao = gamma * y * s u_star = (p_dict['g'] * rh * s)**0.5 ratio = u_star/u_c_star if ratio <= 1.0: a,b = 0.15,1.85 elif ratio > 1.0 and ratio <= 1.5: a,b = 0.2,2.7 elif ratio > 1.5 and ratio <=2.5: a,b = 0.28,3.08 else: a,b = 0.29,3.5 k = avg_hgt * 0.14 * (((mei/tao)**0.25)/avg_hgt)**1.59 n_term1 = kn /((8.0*p_dict['g'])**0.5) n_term2 = ((rh/k)**(1.0/6.0)/(a + (b * math.log10(rh/k)))) n = n_term1 * n_term2 * k**(1.0/6.0) #print n rhs = (n * p_dict['Q']) / (kn * (s**0.5)) lhs = (cp.area_trap(p_dict)**(5.0/3.0)) / (cp.p_trap(p_dict)**(2.0/3.0)) this_r = abs(lhs-rhs) if this_r < r: r = this_r correct_y1 = y correct_n = n correct_tao = tao print 'y',correct_y1 print 'n',correct_n tao_bot_max = gamma * correct_y1 * s print 'tao_perm,tao_max',tao_perm,correct_tao
p_dict['m'] = 1.0 / (3.0)**0.5 p_dict['Q'] = 1500.0 #nm_2_lbft = 47.9 n = 0.015 kn = 1.49 s = 0.0005 Y = np.arange(0.001, 20.0, 0.001) r = 1.0e+20 correct_y1 = -999 correct_n = -999 correct_b = -999 for y in Y: p_dict['y'] = y p_dict['b'] = (2.0 / 3.0) * y * (3.0)**0.5 rh = cp.r_trap(p_dict) rhs = (n * p_dict['Q']) / (kn * (s**0.5)) lhs = (cp.area_trap(p_dict)**(5.0 / 3.0)) / (cp.p_trap(p_dict) **(2.0 / 3.0)) this_r = abs(lhs - rhs) if this_r < r: r = this_r correct_y1 = y correct_n = n correct_b = p_dict['b'] print 'y', correct_y1 p_dict['y'] = correct_y1 print 'f', cp.f_trap(p_dict) print 'n', correct_n print 'b', correct_b
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
u_star = (p_dict['g'] * rh * s)**0.5 ratio = u_star/u_c_star if ratio <= 1.0: a,b = 0.15,1.85 elif ratio > 1.0 and ratio <= 1.5: a,b = 0.2,2.7 elif ratio > 1.5 and ratio <=2.5: a,b = 0.28,3.08 else: a,b = 0.29,3.5 print a,b n_term1 = kn /((8.0*p_dict['g'])**0.5) n_term2 = ((rh/k)**(1.0/6.0)/(a + (b * math.log10(rh/k)))) n = n_term1 * n_term2 * k**(1.0/6.0) area = cp.area_trap(p_dict) print area Q = (kn/n) * cp.area_trap(p_dict) * rh**(2.0/3.0) * s**0.5 print Q,p_dict['y'],rh,tao,k,n # #Y = np.arange(0.001,10.0,0.001) #r = 1.0e+20 #correct_y1 = -999 #correct_n = -999 #correct_tao = -999 #correct_v = -999 #for y in Y: # p_dict['y'] = y # rh = y # tao = gamma * y * s # u_star = (p_dict['g'] * rh * s)**0.5