Changeset 9682
- Timestamp:
- Feb 23, 2015, 2:01:25 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/anuga/abstract_2d_finite_volumes/generic_domain.py
r9617 r9682 1524 1524 yieldstep = float(yieldstep) 1525 1525 1526 # Can be useful to access yieldstep from inside domain 1527 self.yieldstep = yieldstep 1528 1526 1529 self._order_ = self.default_order 1527 1530 -
trunk/anuga_core/anuga/parallel/parallel_internal_boundary_operator.py
r9681 r9682 456 456 if numpy.sign(self.smooth_Q) != numpy.sign(Q): 457 457 Q = 0. 458 self.smooth_Q = 0. 458 459 else: 459 460 # Make Q positive (for anuga's structure operator) -
trunk/anuga_core/anuga/parallel/parallel_structure_operator.py
r9681 r9682 152 152 self.accumulated_flow = 0.0 153 153 self.discharge = 0.0 154 self.discharge_ function_value= 0.0154 self.discharge_abs_timemean = 0.0 155 155 self.velocity = 0.0 156 156 self.outlet_depth = 0.0 … … 400 400 # Update Stats 401 401 self.discharge = Q*timestep_star/timestep #outflow_extra_depth*self.outflow.get_area()/timestep 402 self.discharge_ function_value = Q402 self.discharge_abs_timemean += Q*timestep_star/self.domain.yieldstep 403 403 self.velocity = barrel_speed #self.discharge/outlet_depth/self.width 404 404 … … 630 630 message += 'Type: %s\n' % self.structure_type 631 631 message += 'Discharge [m^3/s]: %.2f\n' % self.discharge 632 message += 'Discharge function value [m^3/s]: %.2f\n' % self.discharge_ function_value632 message += 'Discharge function value [m^3/s]: %.2f\n' % self.discharge_abs_timemean 633 633 message += 'Velocity [m/s]: %.2f\n' % self.velocity 634 634 message += 'Inlet Driving Energy %.2f\n' % self.driving_energy … … 650 650 self.log_filename = self.domain.get_datadir() + '/' + self.label + '.log' 651 651 log_to_file(self.log_filename, stats, mode='w') 652 log_to_file(self.log_filename, 'time,discharge ,discharge_function_value,velocity,driving_energy,delta_total_energy')652 log_to_file(self.log_filename, 'time,discharge_instantaneous,discharge_abs_timemean,velocity_instantaneous,driving_energy_instantaneous,delta_total_energy_instantaneous') 653 653 654 654 #log_to_file(self.log_filename, self.culvert_type) … … 674 674 message = '%.5f, ' % self.domain.get_time() 675 675 message += '%.5f, ' % self.discharge 676 message += '%.5f, ' % self.discharge_ function_value676 message += '%.5f, ' % self.discharge_abs_timemean 677 677 message += '%.5f, ' % self.velocity 678 678 message += '%.5f, ' % self.driving_energy 679 679 message += '%.5f' % self.delta_total_energy 680 680 681 # Reset discharge_abs_timemean each time there is reporting (FIXME: 682 # This assumes this function is only called after each yieldstep) 683 self.discharge_abs_timemean = 0. 684 681 685 return message 682 686 -
trunk/anuga_core/anuga/structures/internal_boundary_operator.py
r9681 r9682 145 145 return Q, barrel_velocity, outlet_culvert_depth 146 146 147 147 148 def discharge_routine_explicit(self): 148 149 """Procedure to determine the inflow and outflow inlets. … … 224 225 # Make Q positive (for anuga's structure operator) 225 226 Q = min( abs(self.smooth_Q), abs(Q) ) 227 #Q = abs(self.smooth_Q) 226 228 227 229 return Q, barrel_velocity, outlet_culvert_depth … … 260 262 dt = self.domain.get_timestep() 261 263 262 263 264 if dt > 0.: 264 265 E0 = self.inlet0_energy … … 275 276 Q1 = self.internal_boundary_function(E0 + sol[0], E1 + sol[1]) 276 277 discharge = (1.0-theta)*Q0 + theta*Q1 278 # We need to find 'sol' such that 'output' is [0., 0.] 277 279 output = sol*areas - discharge*dt*numpy.array([-1., 1.]) 278 280 return(output) … … 281 283 Q1 = self.internal_boundary_function(E0 + final_sol[0], E1 + final_sol[1]) 282 284 Q = (1.0-theta)*Q0 + theta*Q1 283 284 285 else: 285 286 Q = Q0 286 287 287 288 288 # Use time-smoothed discharge if smoothing_timescale > 0. … … 306 306 if numpy.sign(self.smooth_Q) != numpy.sign(Q): 307 307 Q = 0. 308 self.smooth_Q = 0. 308 309 else: 309 310 # Make Q positive (for anuga's structure operator) 310 311 Q = min( abs(self.smooth_Q), abs(Q) ) 312 #Q = abs(self.smooth_Q) 313 # FIXME: Debugging 314 #Q = abs(self.smooth_Q) 311 315 312 316 barrel_velocity = numpy.nan -
trunk/anuga_core/anuga/structures/structure_operator.py
r9681 r9682 121 121 self.accumulated_flow = 0.0 122 122 self.discharge = 0.0 123 self.discharge_ function_value= 0.0123 self.discharge_abs_timemean = 0.0 124 124 self.velocity = 0.0 125 125 self.outlet_depth = 0.0 … … 186 186 enquiry_point1 = self.enquiry_points[1] 187 187 188 #outward_vector1 = - self.culvert_vector189 188 self.inlets.append(inlet_enquiry.Inlet_enquiry( 190 189 self.domain, … … 195 194 verbose = self.verbose)) 196 195 197 198 tris_1 = self.inlets[1].triangle_indices199 #print tris_1200 #print self.domain.centroid_coordinates[tris_1]201 202 self.set_logging(logging)203 204 196 if force_constant_inlet_elevations: 205 197 # Try to enforce a constant inlet elevation 206 198 inlet_global_elevation = self.inlets[-1].get_average_elevation() 207 199 self.inlets[-1].set_elevations(inlet_global_elevation) 200 201 tris_1 = self.inlets[1].triangle_indices 202 203 self.set_logging(logging) 204 208 205 209 206 … … 319 316 self.accumulated_flow += gain 320 317 self.discharge = Q*timestep_star/timestep 321 self.discharge_ function_value = Q318 self.discharge_abs_timemean += gain/self.domain.yieldstep 322 319 self.velocity = barrel_speed 323 320 self.outlet_depth = outlet_depth … … 555 552 556 553 message += 'Discharge [m^3/s]: %.2f\n' % self.discharge 557 message += 'Discharge_function_value [m^3/s]: %.2f\n' % self.discharge_ function_value554 message += 'Discharge_function_value [m^3/s]: %.2f\n' % self.discharge_abs_timemean 558 555 message += 'Velocity [m/s]: %.2f\n' % self.velocity 559 556 message += 'Outlet Depth [m]: %.2f\n' % self.outlet_depth … … 577 574 self.log_filename = self.domain.get_datadir() + '/' + self.label + '.log' 578 575 log_to_file(self.log_filename, self.statistics(), mode='w') 579 log_to_file(self.log_filename, 'time, discharge , discharge_function_value, velocity, accumulated_flow, driving_energy, delta_total_energy')576 log_to_file(self.log_filename, 'time, discharge_instantaneous, discharge_abs_timemean, velocity, accumulated_flow, driving_energy_instantaneous, delta_total_energy_instantaneous') 580 577 581 578 #log_to_file(self.log_filename, self.culvert_type) … … 586 583 message = '%.5f, ' % self.domain.get_time() 587 584 message += '%.5f, ' % self.discharge 588 message += '%.5f, ' % self.discharge_ function_value585 message += '%.5f, ' % self.discharge_abs_timemean 589 586 message += '%.5f, ' % self.velocity 590 587 message += '%.5f, ' % self.accumulated_flow 591 588 message += '%.5f, ' % self.driving_energy 592 589 message += '%.5f' % self.delta_total_energy 593 594 590 591 # Reset discharge_abs_timemean since last time this function was called 592 # (FIXME: This assumes that the function is called only just after a 593 # yield step) 594 self.discharge_abs_timemean = 0. 595 595 596 596 return message -
trunk/anuga_work/development/gareth/tests/ras_bridge/channel_floodplain1.py
r9681 r9682 191 191 smoothing_timescale=0.0, 192 192 logging=True) 193 194 print 'I0: ', bridge.inlets[0].triangle_indices 195 print 'EQ0: ', bridge.inlets[0].enquiry_index 196 print 'I1: ', bridge.inlets[0].triangle_indices 197 print 'EQ1: ', bridge.inlets[1].enquiry_index 193 198 194 199 #------------------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.