Ignore:
Timestamp:
Jul 30, 2008, 4:59:59 PM (16 years ago)
Author:
ole
Message:

Rating curves for culverts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/culvert_flows/culvert_class.py

    r5585 r5586  
    107107        label += '_' + str(id(self))
    108108       
    109         # Open log file for storing some specific results...
    110         self.log_filename = label + '.log'
    111109        self.label = label
    112 
    113         # Print something
     110       
     111        # File for storing culvert quantities
     112        self.timeseries_filename = label + '_timeseries.csv'
     113        fid = open(self.timeseries_filename, 'w')
     114        fid.write('time, E0, E1, Velocity, Discharge\n')
     115        fid.close()
     116
     117        # Log file for storing general textual output
     118        self.log_filename = label + '.log'         
    114119        log_to_file(self.log_filename, self.label)       
    115120        log_to_file(self.log_filename, description)
     
    142147        bounding_polygon = domain.get_boundary_polygon()
    143148        for key in P.keys():
    144             print 'Key', key
    145149            if key in ['exchange_polygon0',
    146150                       'exchange_polygon1',
     
    149153                for point in P[key]:
    150154               
    151                     print 'Passing in:', point
    152155                    msg = 'Point %s in polygon %s for culvert %s did not'\
    153156                        %(str(point), key, self.label)
     
    271274            ux = xmomentum/(depth+velocity_protection/depth)   # Velocity (x-direction)
    272275            uy = ymomentum/(depth+velocity_protection/depth)   # Velocity (y-direction)
    273             print 'Velocity in culvert:', ux, uy, depth, xmomentum, ymomentum
     276            #print 'Velocity in culvert:', ux, uy, depth, xmomentum, ymomentum
    274277            v = mean(sqrt(ux**2+uy**2))      # Average velocity
    275278            w = mean(stage)                  # Average stage
     
    390393        log_to_file(log_filename, s)
    391394
     395        # Log timeseries to file
     396        fid = open(self.timeseries_filename, 'a')       
     397        fid.write('%f, %f, %f, %f, %f\n'\
     398                      %(time,
     399                        openings[0].total_energy,
     400                        openings[1].total_energy,
     401                        barrel_velocity,
     402                        Q))
     403        fid.close()
     404
     405        # Update momentum       
    392406        delta_t = time - self.last_time
    393407        if delta_t > 0.0:
Note: See TracChangeset for help on using the changeset viewer.