Changeset 9619
- Timestamp:
- Feb 6, 2015, 9:49:13 AM (9 years ago)
- Location:
- trunk/anuga_core/anuga/parallel
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/anuga/parallel/parallel_boyd_box_operator.py
r9233 r9619 61 61 manning=manning, 62 62 enquiry_gap=enquiry_gap, 63 use_momentum_jet=use_momentum_jet, 64 zero_outflow_momentum=(not use_momentum_jet), 65 use_old_momentum_method=True, 63 66 description=description, 64 67 label=label, … … 80 83 81 84 self.use_momentum_jet = use_momentum_jet 85 self.zero_outflow_momentum = (not use_momentum_jet) 86 self.use_old_momentum_method = True 82 87 self.use_velocity_head = use_velocity_head 83 88 -
trunk/anuga_core/anuga/parallel/parallel_boyd_pipe_operator.py
r9029 r9619 58 58 manning=manning, 59 59 enquiry_gap=enquiry_gap, 60 use_momentum_jet=use_momentum_jet, 61 zero_outflow_momentum=(not use_momentum_jet), 62 use_old_momentum_method=True, 60 63 description=description, 61 64 label=label, … … 77 80 78 81 self.use_momentum_jet = use_momentum_jet 82 self.zero_outflow_momentum = (not use_momentum_jet) 83 self.use_old_momentum_method = True 79 84 self.use_velocity_head = use_velocity_head 80 85 -
trunk/anuga_core/anuga/parallel/parallel_structure_operator.py
r9028 r9619 49 49 manning, 50 50 enquiry_gap, 51 use_momentum_jet, 52 zero_outflow_momentum, 53 use_old_momentum_method, 51 54 description, 52 55 label, … … 117 120 self.manning = manning 118 121 self.enquiry_gap = enquiry_gap 122 self.use_momentum_jet = use_momentum_jet 123 self.zero_outflow_momentum = zero_outflow_momentum 124 if use_momentum_jet and zero_outflow_momentum: 125 msg = "Can't have use_momentum_jet and zero_outflow_momentum both True" 126 raise Exception(msg) 127 self.use_old_momentum_method = use_old_momentum_method 119 128 120 129 if description == None: … … 260 269 # Master proc of structure only 261 270 if self.myid == self.master_proc: 271 #if old_inflow_depth > 0.0 : 272 # Q_star = Q/old_inflow_depth 273 #else: 274 # Q_star = 0.0 262 275 if old_inflow_depth > 0.0 : 263 Q_star =Q/old_inflow_depth264 else: 265 Q_star= 0.0276 dt_Q_on_d = timestep*Q/old_inflow_depth 277 else: 278 dt_Q_on_d = 0.0 266 279 267 280 factor = 1.0/(1.0 + Q_star*timestep/inflow_area) 268 269 281 new_inflow_depth = old_inflow_depth*factor 270 new_inflow_xmom = old_inflow_xmom*factor 271 new_inflow_ymom = old_inflow_ymom*factor 282 283 #new_inflow_xmom = old_inflow_xmom*factor 284 #new_inflow_ymom = old_inflow_ymom*factor 285 if(self.use_old_momentum_method): 286 # This method is here for consistency with the old version of the 287 # routine 288 new_inflow_xmom = old_inflow_xmom*factor 289 new_inflow_ymom = old_inflow_ymom*factor 290 291 else: 292 # For the momentum balance, note that Q also advects the momentum, 293 # which has an average value of new_inflow_mom (or old_inflow_mom). For 294 # consistency we keep using the (new_inflow_depth/old_inflow_depth) 295 # factor for discharge: 296 # 297 # new_inflow_xmom*inflow_area = 298 # old_inflow_xmom*inflow_area - 299 # timestep*Q*(new_inflow_depth/old_inflow_depth)*new_inflow_xmom 300 # and: 301 # new_inflow_ymom*inflow_area = 302 # old_inflow_ymom*inflow_area - 303 # timestep*Q*(new_inflow_depth/old_inflow_depth)*new_inflow_ymom 304 # 305 # The choice of new_inflow_mom in the final term at the end might be 306 # replaced with old_inflow_mom 307 # 308 factor2 = 1.0/(1.0 + dt_Q_on_d*new_inflow_depth/self.inflow.get_area()) 309 new_inflow_xmom = old_inflow_xmom*factor2 310 new_inflow_ymom = old_inflow_ymom*factor2 272 311 273 312 # Master proc of structure sends new inflow attributes to all inflow inlet processors … … 310 349 if self.myid == self.master_proc: 311 350 loss = (old_inflow_depth - new_inflow_depth)*inflow_area 351 xmom_loss = (old_inflow_xmom - new_inflow_xmom)*self.inflow.get_area() 352 ymom_loss = (old_inflow_ymom - new_inflow_ymom)*self.inflow.get_area() 312 353 313 354 # set outflow … … 319 360 outflow_extra_depth = Q*timestep_star/outflow_area 320 361 outflow_direction = - outflow_outward_culvert_vector 321 outflow_extra_momentum = outflow_extra_depth*barrel_speed*outflow_direction362 #outflow_extra_momentum = outflow_extra_depth*barrel_speed*outflow_direction 322 363 323 364 gain = outflow_extra_depth*outflow_area … … 329 370 new_outflow_depth = outflow_average_depth + outflow_extra_depth 330 371 331 if self.use_momentum_jet : 372 #if self.use_momentum_jet : 373 # # FIXME (SR) Review momentum to account for possible hydraulic jumps at outlet 374 # #new_outflow_xmom = outflow.get_average_xmom() + outflow_extra_momentum[0] 375 # #new_outflow_ymom = outflow.get_average_ymom() + outflow_extra_momentum[1] 376 377 # new_outflow_xmom = barrel_speed*new_outflow_depth*outflow_direction[0] 378 # new_outflow_ymom = barrel_speed*new_outflow_depth*outflow_direction[1] 379 380 #else: 381 # #new_outflow_xmom = outflow.get_average_xmom() 382 # #new_outflow_ymom = outflow.get_average_ymom() 383 384 # new_outflow_xmom = 0.0 385 # new_outflow_ymom = 0.0 386 if self.use_momentum_jet: 332 387 # FIXME (SR) Review momentum to account for possible hydraulic jumps at outlet 333 #new_outflow_xmom = outflow.get_average_xmom() + outflow_extra_momentum[0] 334 #new_outflow_ymom = outflow.get_average_ymom() + outflow_extra_momentum[1] 335 388 # FIXME (GD) Depending on barrel speed I think this will be either 389 # a source or sink of momentum (considering the momentum losses 390 # above). Might not always be reasonable. 391 #new_outflow_xmom = self.outflow.get_average_xmom() + outflow_extra_momentum[0] 392 #new_outflow_ymom = self.outflow.get_average_ymom() + outflow_extra_momentum[1] 336 393 new_outflow_xmom = barrel_speed*new_outflow_depth*outflow_direction[0] 337 394 new_outflow_ymom = barrel_speed*new_outflow_depth*outflow_direction[1] 338 339 else: 395 396 elif self.zero_outflow_momentum: 397 new_outflow_xmom = 0.0 398 new_outflow_ymom = 0.0 340 399 #new_outflow_xmom = outflow.get_average_xmom() 341 400 #new_outflow_ymom = outflow.get_average_ymom() 342 401 343 new_outflow_xmom = 0.0 344 new_outflow_ymom = 0.0 402 else: 403 # Add the momentum lost from the inflow to the outflow. For 404 # structures where barrel_speed is unknown + direction doesn't 405 # change from inflow to outflow 406 new_outflow_xmom = self.outflow.get_average_xmom() + xmom_loss/self.outflow.get_area() 407 new_outflow_ymom = self.outflow.get_average_ymom() + ymom_loss/self.outflow.get_area() 345 408 346 409 # master proc of structure sends outflow attributes to all outflow procs -
trunk/anuga_core/anuga/parallel/parallel_weir_orifice_trapezoid_operator.py
r9028 r9619 59 59 manning=manning, 60 60 enquiry_gap=enquiry_gap, 61 use_momentum_jet=use_momentum_jet, 62 zero_outflow_momentum=(not use_momentum_jet), 63 use_old_momentum_method=True, 61 64 description=description, 62 65 label=label, … … 78 81 79 82 self.use_momentum_jet = use_momentum_jet 83 self.zero_outflow_momentum = (not use_momentum_jet) 84 self.use_old_momentum_method = True 80 85 self.use_velocity_head = use_velocity_head 81 86
Note: See TracChangeset
for help on using the changeset viewer.