Changeset 483


Ignore:
Timestamp:
Nov 4, 2004, 10:18:24 AM (19 years ago)
Author:
ole
Message:
 
Location:
inundation/ga/storm_surge/pyvolution
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inundation/ga/storm_surge/pyvolution/flatbed.py

    r232 r483  
    1414
    1515#Create basic mesh
    16 N = 8
    17 points, vertices, boundary = rectangular(N, N)
     16N = 150
     17points, vertices, boundary = rectangular(N, N, 1000, 1000)
    1818
    1919#Create shallow water domain
    2020domain = Domain(points, vertices, boundary)
    21 domain.smooth = False
    22 domain.visualise = True
    23 domain.default_order=2
     21domain.smooth = True
     22domain.visualise = False
     23domain.store = True
     24domain.default_order=1
     25
     26#Set driving forces
     27manning = 0.07
     28manning = 0.0
     29inflow_level = 10.0
     30domain.set_quantity('friction', manning)
    2431
    2532
     
    2734# Boundary conditions
    2835Br = Reflective_boundary(domain)
    29 Bd = Dirichlet_boundary([0.2,0.,0.])
     36Bd = Dirichlet_boundary([inflow_level,0.,0.])
    3037
    3138domain.set_boundary({'left': Bd, 'right': Br, 'top': Br, 'bottom': Br})
     39domain.check_integrity()
    3240
    33 
    34 domain.check_integrity()
    3541
    3642######################
    3743#Evolution
    38 #for t in domain.evolve(yieldstep = 0.05, finaltime = 1.):
    39 #    domain.write_time()
    40 
    41 
    42 #import sys; sys.exit()
    43 
    44 ######################
    45 #Evolution
    46 for t in domain.evolve(yieldstep = 0.01, finaltime = 0.03):
     44for t in domain.evolve(yieldstep = 10, finaltime = 500):
    4745    domain.write_time()
    4846
    49 print domain.quantities['level'].centroid_values[:4]
    50 print domain.quantities['xmomentum'].centroid_values[:4]
    51 print domain.quantities['ymomentum'].centroid_values[:4]
    52 domain.distribute_to_vertices_and_edges()
    53 print
    54 print domain.quantities['level'].vertex_values[:4,0]
    55 print domain.quantities['xmomentum'].vertex_values[:4,0]
    56 print domain.quantities['ymomentum'].vertex_values[:4,0] 
     47print 'Done'   
     48
  • inundation/ga/storm_surge/pyvolution/flatbed_compare.py

    r458 r483  
    11"""Example of shallow water wave equation.
    22
    3 Comparison of flatbed between mark 2(Grohm) and mark 3
     3Generate slope
    44
    55"""
     
    1010from mesh_factory import rectangular
    1111from shallow_water import Domain, Reflective_boundary, Dirichlet_boundary,\
    12      Transmissive_boundary, Constant_height
     12     Constant_height
    1313from Numeric import array
    1414
    1515#Create basic mesh
    16 N = 10
     16N = 8
    1717points, vertices, boundary = rectangular(N, N)
    1818
    1919#Create shallow water domain
    2020domain = Domain(points, vertices, boundary)
    21 
    22 if N < 20:
    23     domain.visualise = True
    24 else:
    25     domain.visualise = False
    26     domain.store = True
    27     domain.format = 'sww'
    28     domain.filename = 'compare_py3'
    29 
    30 #domain.visualise = False
    3121domain.smooth = False
    32 domain.default_order = 1
    33 
    34 
    35 print 'Field values'
    36 domain.set_quantity('elevation', 0.0)
    37 domain.set_quantity('friction', 1)
     22domain.visualise = True
     23domain.default_order=2
    3824
    3925
     
    4228Br = Reflective_boundary(domain)
    4329Bd = Dirichlet_boundary([0.2,0.,0.])
    44 Bt = Transmissive_boundary(domain)
    4530
    46 domain.set_boundary({'left': Bd, 'right': Bt, 'top': Bt, 'bottom': Bt})
     31domain.set_boundary({'left': Bd, 'right': Br, 'top': Br, 'bottom': Br})
     32
     33
    4734domain.check_integrity()
    48 
    49 print domain.quantities['elevation'].centroid_values[:4]
    50 print domain.quantities['friction'].centroid_values[:4]
    5135
    5236######################
    5337#Evolution
    54 for t in domain.evolve(yieldstep = 0.01, finaltime = 0.5):
    55     domain.write_time()
    56     #print
    57 
    58 #print domain.quantities['level'].centroid_values
    59 #print domain.quantities['xmomentum'].centroid_values
    60 #print domain.quantities['ymomentum'].centroid_values   
    61 
    62 #print 'R'
    63 #print domain.quantities['level'].edge_values
     38#for t in domain.evolve(yieldstep = 0.05, finaltime = 1.):
     39#    domain.write_time()
    6440
    6541
     42#import sys; sys.exit()
     43
     44######################
     45#Evolution
     46for t in domain.evolve(yieldstep = 0.01, finaltime = 0.03):
     47    domain.write_time()
     48
     49print domain.quantities['level'].centroid_values[:4]
     50print domain.quantities['xmomentum'].centroid_values[:4]
     51print domain.quantities['ymomentum'].centroid_values[:4]
     52domain.distribute_to_vertices_and_edges()
     53print
     54print domain.quantities['level'].vertex_values[:4,0]
     55print domain.quantities['xmomentum'].vertex_values[:4,0]
     56print domain.quantities['ymomentum'].vertex_values[:4,0] 
Note: See TracChangeset for help on using the changeset viewer.