Changeset 9305
- Timestamp:
- Aug 15, 2014, 12:52:46 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/operators/collect_max_quantities_operator.py
r9288 r9305 24 24 Maxima are updated every update_frequency timesteps [any integer >=1 is 25 25 ok], after t exceeds collection_start_time. 26 27 In theory this might save time (??), since computing e.g. velocity/momentum etc in python might be expensive 26 28 27 28 This can save time, since computing e.g. velocity/momentum etc in python might be expensive 29 Optionally velocities can be zeroed below velocity_zero_height (defaults to minimum_allowed_height if not required) 29 30 """ 30 31 … … 33 34 update_frequency=1, 34 35 collection_start_time=0., 36 velocity_zero_height=None, 35 37 description = None, 36 38 label = None, … … 68 70 self.collection_start_time = collection_start_time 69 71 72 #------------------------------------------ 73 # Can (rarely) get high velocities being recorded 74 # (e.g. in 3 cells out of 170000 for a 48 hour simulation, 75 # which are not persistent -- probably just spikes from nearly dry cells) 76 # Try to remove this by zeroing velocity in very shallow cells 77 #------------------------------------------ 78 if velocity_zero_height is not None: 79 self.velocity_zero_height=velocity_zero_height 80 else: 81 self.velocity_zero_height=domain.minimum_allowed_height 82 83 70 84 def __call__(self): 71 85 """ … … 87 101 88 102 #velMax=(momNorm/(localDepth+velocity_protection/localDepth))*(localDepth>self.domain.minimum_allowed_height) 89 velMax=(momNorm/localDepth)*(localDepth>self. domain.minimum_allowed_height)103 velMax=(momNorm/localDepth)*(localDepth>self.velocity_zero_height) 90 104 self.max_speed = num.maximum(self.max_speed, velMax) 91 105
Note: See TracChangeset
for help on using the changeset viewer.