Ignore:
Timestamp:
Jul 14, 2006, 2:11:20 PM (18 years ago)
Author:
jakeman
Message:

New file dam.py tests numerical solution against analytical solution of
Stoker 57. Numerical results match Stoker's roughly but oscillations
present. Most likely limiting is not working correctly. Q.limit does
have an effect but unsure whether this effect is the right one.

File:
1 edited

Legend:

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

    r3293 r3335  
    6363
    6464        #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)
    6767        #print "\nI have Removed forcing terms line 64 1dsw"
    6868
     
    174174        #and or visualisation
    175175        self.distribute_to_vertices_and_edges()
    176 
     176       
    177177        #Initialise real time viz if requested
    178178        #if self.visualise is True and self.time == 0.0:
     
    432432    #Loop
    433433    timestep = float(sys.maxint)
     434    enter = True
    434435    for k in range(N):
    435436
     
    473474            # flux = edgefluxleft - edgefluxright
    474475            flux -= edgeflux #* domain.edgelengths[k,i]
    475 
    476476            #Update optimal_timestep
    477477            try:
    478478                #timestep = min(timestep, 0.5*domain.radii[k]/max_speed)
    479479                #timestep = 0.01
     480           
    480481                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
    483488                    s = domain.quantities['stage']
    484489                    s = s.centroid_values
    485490                    xm = domain.quantities['xmomentum']
    486491                    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           
    494497            except ZeroDivisionError:
    495498                pass
     
    497500        #Normalise by area and store for when all conserved
    498501        #quantities get updated
    499         #flux /= domain.areas[k]
     502        flux /= domain.areas[k]
    500503        # ADD ABOVE LINE AGAIN
    501504        Stage.explicit_update[k] = flux[0]
     
    599602    """
    600603
    601     from config import optimised_gradient_limiter
     604    #from config import optimised_gradient_limiter
    602605
    603606    #Remove very thin layers of water
Note: See TracChangeset for help on using the changeset viewer.