Changeset 8077


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

end of day

File:
1 edited

Legend:

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

    r8075 r8077  
    6969        Q = self.Q
    7070
     71        amount = Q*timestep
     72
    7173        assert Q >= 0.0, 'removing water from an inlet!'
    7274
     
    8385
    8486        summed_areas = numpy.zeros_like(areas)
    85         summed_Q = numpy.zeros_like(areas)
     87        summed_amount = numpy.zeros_like(areas)
     88        diff_stage = numpy.zeros_like(areas)
    8689
    8790        for i,a in enumerate(areas[stages_order]):
     
    8992            if i == 0:
    9093                summed_areas[i] = a
    91                 summed_Q[i] = stages[stages_order[i]] - stages[stages_order[i]]
     94                summed_amount[i] = 0.0
     95                diff_stage[i] = 0.0
    9296            else:
    9397                summed_areas[i] = summed_areas[i-1] + a
    94                 summed_Q[i] = summed_Q[i-1]
     98
     99                summed_amount[i] = summed_amount[i-1] + summed_areas[i-1]*\
     100                    (stages[stages_order[i]] - stages[stages_order[i-1]])
     101
     102                diff_stage[i] = stages[stages_order[i]] - stages[stages_order[i-1]]
    95103
    96104        print summed_areas
    97 
     105        print summed_amount
     106        print diff_stage
    98107
    99108           
    100 
     109        #index = len(summed_amount)
     110        for i,a in enumerate(summed_amount):
     111            if amount > a :
     112                index = i
     113
     114        print index
    101115
    102116
     
    107121
    108122
    109         new_inlet_depth = self.inlet.get_average_depth() + (Q*timestep/self.inlet.get_area())
     123        new_inlet_depth = self.inlet.get_average_depth() + (amount/self.inlet.get_area())
    110124        self.inlet.set_depths(new_inlet_depth)
    111125
Note: See TracChangeset for help on using the changeset viewer.