 Timestamp:
 Jun 18, 2010, 6:05:23 PM (12 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/anuga_core/source/anuga/shallow_water/boundaries.py
r7765 r7861 182 182 return sea_level + normalized_amplitude/cosh(t25)**2 183 183 184 Bts = Transmissive_n_momentum_zero_t_momentum_set_stage_boundary(domain, waveform) 184 Bts = Transmissive_n_momentum_zero_t_momentum_set_stage_boundary\ 185 (domain, waveform) 185 186 186 187 Underlying domain must be specified when boundary is instantiated … … 243 244 x = float(value[0]) 244 245 245 ## import math246 ## if vol_id == 9433:247 ## print 'vol_id = ',vol_id, ' edge_id = ',edge_id, 'q = ', q, ' x = ',x248 ## print 'normal = ', normal249 ## print 'n . p = ', (normal[0]*q[1] + normal[1]*q[2])250 ## print 't . p = ', (normal[1]*q[1]  normal[0]*q[2])251 252 253 246 q[0] = x 254 247 ndotq = (normal[0]*q[1] + normal[1]*q[2]) … … 398 391 # Where v is velocity, n is manning's coefficient, h is depth 399 392 # and S is the slope into the domain. 400 # Let mu be the momentum (vh), then this equation becomes: mu = 1/n h^{5/3} sqrt(S) 393 # Let mu be the momentum (vh), then this equation becomes: 394 # mu = 1/n h^{5/3} sqrt(S) 401 395 # from which we can isolate depth to get 402 # h = (mu n/sqrt(S) )^{3/5}396 # h = (mu n/sqrt(S) )^{3/5} 403 397 404 398 slope = 0 # get gradient for this triangle dot normal 405 399 406 400 # get manning coef from this triangle 407 friction = self.domain.get_quantity('friction').get_values( location='edges',408 401 friction = self.domain.get_quantity('friction').get_values(\ 402 location='edges', indices=[vol_id])[0] 409 403 mannings_n = friction[edge_id] 410 404 411 405 if slope > epsilon and mannings_n > epsilon: 412 depth = pow(self.average_momentum * mannings_n/math.sqrt(slope), 3.0/5) 406 depth = pow(self.average_momentum * mannings_n/math.sqrt(slope), \ 407 3.0/5) 413 408 else: 414 409 depth = 1.0 … … 416 411 # Elevation on this edge 417 412 418 z = self.domain.get_quantity('elevation').get_values( location='edges',419 413 z = self.domain.get_quantity('elevation').get_values(\ 414 location='edges', indices=[vol_id])[0] 420 415 elevation = z[edge_id] 421 416
Note: See TracChangeset
for help on using the changeset viewer.