 Timestamp:
 Aug 30, 2010, 5:53:45 PM (13 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/anuga_core/source/anuga/structures/culvert_operator.py
r7978 r7980 2 2 from anuga.config import g 3 3 import anuga.utilities.log as log 4 import box_culvert 5 import culvert_routines 4 5 from boyd_box_culvert import Boyd_box_culvert 6 6 7 7 class Culvert_operator: … … 34 34 self.height = height 35 35 36 self.culvert = box_culvert.Box_culvert(self.domain, end_points, self.width, self.height) 36 self.culvert = Boyd_box_culvert(self.domain, end_points, self.width, self.height) 37 print self.culvert 38 self.routine = self.culvert.routine 39 print self.routine 37 40 self.inlets = self.culvert.get_inlets() 38 41 … … 43 46 44 47 timestep = self.domain.get_timestep() 48 49 Q, barrel_speed, culvert_outlet_depth = self.routine() 45 50 46 from culvert_routines import Culvert_routines 47 culvert_routine = culvert_routines.Culvert_routines(self.culvert) 48 49 Q, barrel_velocity, culvert_outlet_depth = culvert_routine.boyd_circle() 51 inflow = self.routine.get_inflow() 52 outflow = self.routine.get_outflow() 50 53 51 transfer_water = Q*timestep54 outflow_direction =  outflow.outward_culvert_vector 52 55 53 inflow = culvert_routine.get_inflow() 54 outflow = culvert_routine.get_outflow() 56 outflow_momentum_flux = barrel_speed**2*culvert_outlet_depth*outflow_direction 55 57 56 inflow.set_heights(inflow.get_average_height()  transfer_water) 58 59 print Q, barrel_speed, culvert_outlet_depth, outflow_momentum_flux 60 61 #FIXME (SR) Check whether we need to mult/divide by inlet area 62 inflow_transfer = Q*timestep/inflow.get_area() 63 64 outflow_transfer = Q*timestep/outflow.get_area() 65 66 67 68 inflow.set_heights(inflow.get_average_height()  inflow_transfer) 69 57 70 inflow.set_xmoms(0.0) 58 71 inflow.set_ymoms(0.0) 59 72 60 outflow.set_heights(outflow.get_average_height() + transfer_water) 61 outflow.set_xmoms(0.0) 62 outflow.set_ymoms(0.0) 73 #u = outflow.get_xvelocities() 74 #v = outflow.get_yvelocities() 75 76 outflow.set_heights(outflow.get_average_height() + outflow_transfer) 77 #outflow.set_xmoms(outflow.get_xmoms() + timestep*outflow_momentum_flux[0] ) 78 #outflow.set_ymoms(outflow.get_ymoms() + timestep*outflow_momentum_flux[1] ) 63 79 64 80 def print_stats(self): … … 74 90 75 91 print 'inlet triangle indices and centres' 76 print inlet.triangle_indices [i]77 print self.domain.get_centroid_coordinates()[inlet.triangle_indices [i]]92 print inlet.triangle_indices 93 print self.domain.get_centroid_coordinates()[inlet.triangle_indices] 78 94 79 95 print 'polygon'
Note: See TracChangeset
for help on using the changeset viewer.