Changeset 3370 for development
- Timestamp:
- Jul 19, 2006, 12:03:27 PM (19 years ago)
- Location:
- development/pyvolution-1d
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
development/pyvolution-1d/dam.py
r3362 r3370 50 50 h[i] = h0 51 51 52 return h 52 return h , u*h 53 53 54 54 … … 97 97 domain.order = 2 98 98 domain.default_order = 2 99 domain.cfl = 0.8 100 #domain.beta = 0.0 99 101 print "domain.order", domain.order 100 102 … … 114 116 C = domain.centroids 115 117 plot1 = newLinePlot("Stage") 118 plot2 = newLinePlot("Momentum") 116 119 117 120 import time … … 123 126 if t > 0.0: 124 127 StageQ = domain.quantities['stage'].vertex_values 125 y = analytical_sol(X.flat,domain.time)128 y , my = analytical_sol(X.flat,domain.time) 126 129 linePlot(plot1,X,StageQ,X,y) 130 MomentumQ = domain.quantities['xmomentum'].vertex_values 131 linePlot(plot2,X,MomentumQ,X,my) 127 132 #raw_input('press_return') 128 133 #pass -
development/pyvolution-1d/dam2.py
r3362 r3370 49 49 h[i] = h0 50 50 51 return h 51 return h,u*h 52 52 53 53 … … 96 96 domain.order = 2 97 97 domain.default_order = 2 98 domain.cfl = 0.5 98 99 print "domain.order", domain.order 99 100 … … 114 115 C = domain.centroids 115 116 plot1 = newLinePlot("Stage") 117 plot2 = newLinePlot("Momentum") 116 118 117 119 import time … … 123 125 if t > 0.0: 124 126 StageQ = domain.quantities['stage'].vertex_values 125 y = analytical_sol(X.flat,domain.time)127 y,my = analytical_sol(X.flat,domain.time) 126 128 linePlot(plot1,X,StageQ,X,y) 129 MomentumQ = domain.quantities['xmomentum'].vertex_values 130 linePlot(plot2,X,MomentumQ,X,my) 127 131 #raw_input('press_return') 128 132 #pass -
development/pyvolution-1d/dry_dam.py
r3362 r3370 36 36 h[i] = h0 37 37 38 return h 39 38 return h , u*h 40 39 41 40 def newLinePlot(title='Simple Plot'): … … 59 58 60 59 L = 2000.0 # Length of channel (m) 61 N = 100 # Number of compuational cells60 N = 400 # Number of compuational cells 62 61 cell_len = L/N # Origin = 0.0 63 62 … … 98 97 C = domain.centroids 99 98 plot1 = newLinePlot("Stage") 99 plot2 = newLinePlot("Momentum") 100 100 101 101 import time … … 107 107 if t > 0.0: 108 108 StageQ = domain.quantities['stage'].vertex_values 109 y = analytical_sol(X.flat,domain.time)109 y,my = analytical_sol(X.flat,domain.time) 110 110 linePlot(plot1,X,StageQ,X,y) 111 raw_input('press_return') 111 MomentumQ = domain.quantities['xmomentum'].vertex_values 112 linePlot(plot2,X,MomentumQ,X,my) 113 114 #raw_input('press_return') 112 115 #pass 113 116 -
development/pyvolution-1d/quantity.py
r3362 r3370 486 486 487 487 x0 = X[k0] #V0 centroid 488 x1 = X[k] #V1 centroid (Self)488 x1 = X[k] #V1 centroid (Self) 489 489 x2 = X[k2] #V2 centroid 490 490 491 491 #Gradient 492 #G[k] = (q2-q0)/(x2-x0) 492 493 G[k] = ((q0-q1)/(x0-x1)*(x2-x1) - (q2-q1)/(x2-x1)*(x0-x1))/(x2-x0) 493 494 … … 614 615 615 616 N = self.domain.number_of_elements 616 beta = self.beta 617 #beta = self.beta 618 beta = 0.8 617 619 618 620 qc = self.centroid_values -
development/pyvolution-1d/shallow_water_1d.py
r3362 r3370 80 80 self.smooth = True 81 81 82 #Evolve parametrs 83 self.cfl = 1.0 84 82 85 #Reduction operation for get_vertex_values 83 86 from util import mean … … 479 482 #timestep = 0.01 480 483 481 timestep = min(timestep, 0.5*domain.areas[k]/max_speed)484 timestep = min(timestep, domain.cfl*0.5*domain.areas[k]/max_speed) 482 485 if (timestep < 1e-6) & (enter == True): 483 486 #print "domain.order", domain.order
Note: See TracChangeset
for help on using the changeset viewer.