Changeset 8203
- Timestamp:
- Aug 31, 2011, 10:17:30 PM (13 years ago)
- Location:
- trunk/anuga_core/source/anuga/shallow_water_balanced
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/shallow_water_balanced/run_wave_shelf.py
r8202 r8203 66 66 #------------------------------------------------------------------------------ 67 67 depth1 = -100.0 68 depth2 = - 50.0068 depth2 = -30.00 69 69 def topography(x,y): 70 70 z = num.zeros_like(x) … … 80 80 81 81 if x[i] > 100000.0: 82 z[i] = depth2*(1.0 - (x[i] - 75000.0)/50000)82 z[i] = depth2*(1.0 - 1.1*(x[i] - 100000.0)/50000) 83 83 return z 84 84 -
trunk/anuga_core/source/anuga/shallow_water_balanced/swb_domain.py
r8202 r8203 71 71 self.quantities['height'].set_beta(1.0) 72 72 73 #-------------------------------------------- 74 # Replace shallow water gravity forcing term 75 # with swb version 76 #-------------------------------------------- 77 self.forcing_terms[1] = swb_gravity 78 73 79 74 80 def check_integrity(self): … … 161 167 v_C = V.centroid_values 162 168 163 num_min = num.min(w_C-z_C)164 if num_min < -1.0e-5:165 print '**** num.min(w_C-z_C)', num_min169 #num_min = num.min(w_C-z_C) 170 #if num_min < -1.0e-5: 171 # print '**** num.min(w_C-z_C)', num_min 166 172 167 173 … … 415 421 ################################################################################ 416 422 417 def gravity(domain):423 def swb_gravity(domain): 418 424 """Apply gravitational pull in the presence of bed slope 419 425 Wrapper calls underlying C implementation 420 426 """ 421 427 422 from swb_domain_ext import gravity as gravity_c 428 from swb_domain_ext import gravity_c 429 430 #print "Using swb gravity" 423 431 424 432 xmom_update = domain.quantities['xmomentum'].explicit_update 425 433 ymom_update = domain.quantities['ymomentum'].explicit_update 426 434 427 stage = domain.quantities['stage']435 stage = domain.quantities['stage'] 428 436 elevation = domain.quantities['elevation'] 429 437 430 438 431 stage = stage.vertex_values439 stage = stage.vertex_values 432 440 elevation = elevation.vertex_values 433 441 -
trunk/anuga_core/source/anuga/shallow_water_balanced/swb_domain_ext.c
r8202 r8203 597 597 &xmom, &ymom)) { 598 598 //&epsilon)) { 599 PyErr_SetString(PyExc_RuntimeError, "s hallow_water_ext.c: gravity could not parse input arguments");599 PyErr_SetString(PyExc_RuntimeError, "swb_domain_ext.c: gravity could not parse input arguments"); 600 600 return NULL; 601 601 } … … 612 612 k3 = 3*k; // base index 613 613 614 // Get bathymetry614 // Get stage 615 615 w0 = ((double*) w -> data)[k3 + 0]; 616 616 w1 = ((double*) w -> data)[k3 + 1]; 617 617 w2 = ((double*) w -> data)[k3 + 2]; 618 618 619 619 // Get water depth 620 620 h0 = ((double*) w -> data)[k3 + 0] - ((double*) z -> data)[k3 + 0]; 621 621 h1 = ((double*) w -> data)[k3 + 1] - ((double*) z -> data)[k3 + 1]; … … 630 630 631 631 // Get average depth from centroid values 632 avg_h = 1.0/3.0* 632 avg_h = 1.0/3.0*( h0 + h1 +h2 ); 633 633 634 634 // Compute bed slope
Note: See TracChangeset
for help on using the changeset viewer.