Changeset 767
- Timestamp:
- Jan 21, 2005, 12:07:59 PM (20 years ago)
- Location:
- inundation/ga/storm_surge/pyvolution
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/shallow_water.py
r750 r767 6 6 consisting of methods specific to the Shallow Water Wave Equation 7 7 8 FIXME: Write equations here! 9 10 11 Conserved quantities are w (water level or stage), uh (x momentum) 12 and vh (y momentum). 8 9 U_t + E_x + G_y = S 10 11 where 12 13 U = [w, uh, vh] 14 E = [uh, u^2h + gh^2/2, uvh] 15 G = [vh, uvh, v^2h + gh^2/2] 16 S represents source terms forcing the system 17 (e.g. gravity, friction, wind stress, ...) 18 19 20 The quantities are 21 22 symbol variable name explanation 23 z elevation elevation of bed on which flow is modelled 24 h height water height above z 25 w stage water level, w = z+h 26 u speed in the x direction 27 v speed in the y direction 28 uh xmomentum momentum in the x direction 29 vh ymomentum momentum in the y direction 30 31 eta mannings friction coefficient 32 nu wind stress coefficient 33 34 The conserved quantities are w, uh, vh 35 36 37 For details see e.g. 38 Christopher Zoppou and Stephen Roberts, 39 Catastrophic Collapse of Water Supply Reservoirs in Urban Areas, 40 Journal of Hydraulic Engineering, vol. 127, No. 7 July 1999 41 13 42 14 43 … … 81 110 level = self.quantities['level'] 82 111 bed = self.quantities['elevation'] 83 84 #msg = 'All water levels must be greater than the bed elevation'85 #assert alltrue( greater_equal(86 # level.vertex_values, bed.vertex_values )), msg87 #88 #assert alltrue( greater_equal(89 # level.edge_values, bed.edge_values )), msg90 #91 #assert alltrue( greater_equal(92 # level.centroid_values, bed.centroid_values )), msg93 112 94 113 … … 220 239 """ 221 240 222 #FIXME: Needs to be tested223 224 241 from Numeric import zeros, Float 225 242 … … 233 250 raise 'Normal vector must be an Numeric array' 234 251 235 #FIXME: Put this test into C-extension as well236 252 assert l == 2, 'Normal vector must have 2 components' 237 253 238 254 239 255 n1 = normal[0] … … 423 439 Ymom.explicit_update[k] = flux[2] 424 440 425 #print 'FLUX l', Level.explicit_update426 #print 'FLUX x', Xmom.explicit_update427 #print 'FLUX y', Ymom.explicit_update428 441 429 442 domain.timestep = timestep … … 563 576 xmomc[k] = ymomc[k] = 0.0 564 577 565 #FIXME: Delete566 #From 'newstyle567 #if hc[k] < domain.minimum_allowed_height:568 # if hc[k] < 0.0:569 # #Control level and height570 # wc[k] = zc[k]571 #572 # #Control momentum573 # xmomc[k] = ymomc[k] = 0.0574 #else:575 576 578 577 579 -
inundation/ga/storm_surge/pyvolution/shallow_water_ext.c
r761 r767 431 431 normal = (PyArrayObject *) 432 432 PyArray_ContiguousFromObject(Normal, PyArray_DOUBLE, 0, 0); 433 433 434 435 if (normal -> dimensions[0] != 2) { 436 PyErr_SetString(PyExc_RuntimeError, "Normal vector must have 2 components"); 437 return NULL; 438 } 439 434 440 //Allocate space for return vector r (don't DECREF) 435 441 dimensions[0] = 3; -
inundation/ga/storm_surge/pyvolution/test_shallow_water.py
r765 r767 94 94 assert allclose(w, q) 95 95 96 96 #Check error check 97 try: 98 rotate(r, array([1,1,1]) ) 99 except: 100 pass 101 else: 102 raise 'Should have raised an exception' 97 103 98 104 def test_flux_zero_case(self):
Note: See TracChangeset
for help on using the changeset viewer.