Changeset 9305


Ignore:
Timestamp:
Aug 15, 2014, 12:52:46 PM (11 years ago)
Author:
davies
Message:

Adjustment to collect_max_quantities operator

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/operators/collect_max_quantities_operator.py

    r9288 r9305  
    2424    Maxima are updated every update_frequency timesteps [any integer >=1 is
    2525    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
    2628   
    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)
    2930    """
    3031
     
    3334                 update_frequency=1,
    3435                 collection_start_time=0.,
     36                 velocity_zero_height=None,
    3537                 description = None,
    3638                 label = None,
     
    6870        self.collection_start_time = collection_start_time
    6971
     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
    7084    def __call__(self):
    7185        """
     
    87101
    88102                #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)
    90104                self.max_speed = num.maximum(self.max_speed, velMax)
    91105
Note: See TracChangeset for help on using the changeset viewer.