Changeset 3370


Ignore:
Timestamp:
Jul 19, 2006, 12:03:27 PM (18 years ago)
Author:
steve
Message:

Playing with limiters

Location:
development/pyvolution-1d
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • development/pyvolution-1d/dam.py

    r3362 r3370  
    5050            h[i] = h0
    5151
    52     return h
     52    return h , u*h
    5353
    5454
     
    9797domain.order = 2
    9898domain.default_order = 2
     99domain.cfl = 0.8
     100#domain.beta = 0.0
    99101print "domain.order", domain.order
    100102
     
    114116C = domain.centroids
    115117plot1 = newLinePlot("Stage")
     118plot2 = newLinePlot("Momentum")
    116119
    117120import time
     
    123126    if t > 0.0:
    124127        StageQ = domain.quantities['stage'].vertex_values
    125         y = analytical_sol(X.flat,domain.time)
     128        y , my = analytical_sol(X.flat,domain.time)
    126129        linePlot(plot1,X,StageQ,X,y)
     130        MomentumQ = domain.quantities['xmomentum'].vertex_values
     131        linePlot(plot2,X,MomentumQ,X,my)
    127132    #raw_input('press_return')
    128133    #pass
  • development/pyvolution-1d/dam2.py

    r3362 r3370  
    4949            h[i] = h0
    5050
    51     return h
     51    return h,u*h
    5252
    5353
     
    9696domain.order = 2
    9797domain.default_order = 2
     98domain.cfl = 0.5
    9899print "domain.order", domain.order
    99100
     
    114115C = domain.centroids
    115116plot1 = newLinePlot("Stage")
     117plot2 = newLinePlot("Momentum")
    116118
    117119import time
     
    123125    if t > 0.0:
    124126        StageQ = domain.quantities['stage'].vertex_values
    125         y = analytical_sol(X.flat,domain.time)
     127        y,my = analytical_sol(X.flat,domain.time)
    126128        linePlot(plot1,X,StageQ,X,y)
     129        MomentumQ = domain.quantities['xmomentum'].vertex_values
     130        linePlot(plot2,X,MomentumQ,X,my)
    127131    #raw_input('press_return')
    128132    #pass
  • development/pyvolution-1d/dry_dam.py

    r3362 r3370  
    3636            h[i] = h0
    3737
    38     return h
    39 
     38    return h , u*h
    4039
    4140def newLinePlot(title='Simple Plot'):
     
    5958
    6059L = 2000.0     # Length of channel (m)
    61 N = 100        # Number of compuational cells
     60N = 400        # Number of compuational cells
    6261cell_len = L/N # Origin = 0.0
    6362
     
    9897C = domain.centroids
    9998plot1 = newLinePlot("Stage")
     99plot2 = newLinePlot("Momentum")
    100100
    101101import time
     
    107107    if t > 0.0:
    108108        StageQ = domain.quantities['stage'].vertex_values
    109         y = analytical_sol(X.flat,domain.time)
     109        y,my = analytical_sol(X.flat,domain.time)
    110110        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')
    112115    #pass
    113116
  • development/pyvolution-1d/quantity.py

    r3362 r3370  
    486486
    487487                x0 = X[k0] #V0 centroid
    488                 x1 = X[k] #V1 centroid (Self)
     488                x1 = X[k]  #V1 centroid (Self)
    489489                x2 = X[k2] #V2 centroid
    490490
    491491                #Gradient
     492                #G[k] = (q2-q0)/(x2-x0)
    492493                G[k] = ((q0-q1)/(x0-x1)*(x2-x1) - (q2-q1)/(x2-x1)*(x0-x1))/(x2-x0)
    493494
     
    614615
    615616        N = self.domain.number_of_elements
    616         beta = self.beta
     617        #beta = self.beta
     618        beta = 0.8
    617619
    618620        qc = self.centroid_values
  • development/pyvolution-1d/shallow_water_1d.py

    r3362 r3370  
    8080        self.smooth = True
    8181
     82        #Evolve parametrs
     83        self.cfl = 1.0
     84       
    8285        #Reduction operation for get_vertex_values
    8386        from util import mean
     
    479482                #timestep = 0.01
    480483           
    481                 timestep = min(timestep, 0.5*domain.areas[k]/max_speed)
     484                timestep = min(timestep, domain.cfl*0.5*domain.areas[k]/max_speed)
    482485                if (timestep < 1e-6) & (enter == True):
    483486                    #print "domain.order", domain.order
Note: See TracChangeset for help on using the changeset viewer.