Changeset 8075


Ignore:
Timestamp:
Nov 19, 2010, 5:01:35 PM (8 years ago)
Author:
steve
Message:

End of week commit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/structures/inlet_operator.py

    r8073 r8075  
    7373
    7474        # FIXME (SR): Might be nice to spread the over the inlet so that it is flat
     75
     76
     77        # Spread Q*timestep amount of water evenly over the inlet region
     78
     79        areas = self.inlet.get_areas()
     80        stages = self.inlet.get_stages()
     81
     82        stages_order = stages.argsort()
     83
     84        summed_areas = numpy.zeros_like(areas)
     85        summed_Q = numpy.zeros_like(areas)
     86
     87        for i,a in enumerate(areas[stages_order]):
     88            print i,a, stages[stages_order[i]]
     89            if i == 0:
     90                summed_areas[i] = a
     91                summed_Q[i] = stages[stages_order[i]] - stages[stages_order[i]]
     92            else:
     93                summed_areas[i] = summed_areas[i-1] + a
     94                summed_Q[i] = summed_Q[i-1]
     95
     96        print summed_areas
     97
     98
     99           
     100
     101
     102
     103        print stages_order
     104        print stages
     105        print areas
     106        print stages[stages_order]
     107
     108
    75109        new_inlet_depth = self.inlet.get_average_depth() + (Q*timestep/self.inlet.get_area())
    76110        self.inlet.set_depths(new_inlet_depth)
Note: See TracChangeset for help on using the changeset viewer.