Changeset 7973
 Timestamp:
 Aug 25, 2010, 12:31:00 PM (9 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/anuga_core/source/anuga/structures/Inlet.py
r7972 r7973 1 1 from anuga.geometry.polygon import inside_polygon, is_inside_polygon 2 2 from anuga.config import velocity_protection 3 import math 3 4 4 5 import numpy as num … … 74 75 return self.domain.quantities['stage'].centroid_values.take(self.triangle_indices) 75 76 77 76 78 def get_average_stage(self): 77 79 … … 91 93 92 94 return self.domain.quantities['xmomentum'].centroid_values.take(self.triangle_indices) 95 93 96 94 97 def get_average_xmom(self): … … 131 134 132 135 133 def get_average_velocit ies(self):136 def get_average_velocity(self): 134 137 135 depths = self.get_stages()  self.get_elevations() 136 u = self.get_xmoms()/(depths + velocity_protection/depths) 137 v = self.get_ymoms()/(depths + velocity_protection/depths) 138 u, v = self.get_velocities() 138 139 139 return num.sum(u)/self.triangle_indices.size, num.sum(v)/self.triangle_indices.size 140 average_u = num.sum(u)/self.triangle_indices.size 141 average_v = num.sum(v)/self.triangle_indices.size 142 143 return math.sqrt(average_u**2 + average_v**2) 144 145 146 def set_total_energy(self, total_energy): 147 148 self.total_energy = total_energy 149 150 151 def get_total_energy(self): 152 153 return self.total_energy 154 155 156 def set_specific_energy(self, specific_energy): 157 158 self.specific_energy = specific_energy 159 160 161 def get_specific_energy(self): 162 163 return self.specific_energy 164 165
Note: See TracChangeset
for help on using the changeset viewer.