Changeset 3335 for development/pyvolution-1d/shallow_water_1d.py
- Timestamp:
- Jul 14, 2006, 2:11:20 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
development/pyvolution-1d/shallow_water_1d.py
r3293 r3335 63 63 64 64 #forcing terms not included in 1d domain ?WHy? 65 #self.forcing_terms.append(gravity)66 #self.forcing_terms.append(manning_friction)65 self.forcing_terms.append(gravity) 66 self.forcing_terms.append(manning_friction) 67 67 #print "\nI have Removed forcing terms line 64 1dsw" 68 68 … … 174 174 #and or visualisation 175 175 self.distribute_to_vertices_and_edges() 176 176 177 177 #Initialise real time viz if requested 178 178 #if self.visualise is True and self.time == 0.0: … … 432 432 #Loop 433 433 timestep = float(sys.maxint) 434 enter = True 434 435 for k in range(N): 435 436 … … 473 474 # flux = edgefluxleft - edgefluxright 474 475 flux -= edgeflux #* domain.edgelengths[k,i] 475 476 476 #Update optimal_timestep 477 477 try: 478 478 #timestep = min(timestep, 0.5*domain.radii[k]/max_speed) 479 479 #timestep = 0.01 480 480 481 timestep = min(timestep, 0.5*domain.areas[k]/max_speed) 481 if timestep < 0.00001: 482 #print 'max_speed', max_speed 482 if (timestep < 1e-6) & (enter == True): 483 #print "domain.order", domain.order 484 #domain.write_time() 485 print "cell number", k 486 print "timestep", timestep 487 print 'max_speed', max_speed 483 488 s = domain.quantities['stage'] 484 489 s = s.centroid_values 485 490 xm = domain.quantities['xmomentum'] 486 491 xm = xm.centroid_values 487 #print 'h', s[k] 488 #print 'xm', xm[k] 489 #print 'u', xm[k]/s[k] 490 #break 491 #timestep = 0.01 492 #print 'areas', domain.areas[k] 493 #print "timestep", timestep 492 print 'h', s[k] 493 print 'xm', xm[k] 494 print 'u', xm[k]/s[k] 495 enter = False 496 494 497 except ZeroDivisionError: 495 498 pass … … 497 500 #Normalise by area and store for when all conserved 498 501 #quantities get updated 499 #flux /= domain.areas[k]502 flux /= domain.areas[k] 500 503 # ADD ABOVE LINE AGAIN 501 504 Stage.explicit_update[k] = flux[0] … … 599 602 """ 600 603 601 from config import optimised_gradient_limiter604 #from config import optimised_gradient_limiter 602 605 603 606 #Remove very thin layers of water
Note: See TracChangeset
for help on using the changeset viewer.