Changeset 1876
- Timestamp:
- Oct 6, 2005, 3:48:58 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/analytical solutions/Analytical_solution_circular_hydraulic_jump.py
r1839 r1876 29 29 wh0 = Q/(2.0*pi*0.1) 30 30 h0 = bed[2] + 0.005 31 wh1 = -Q/(2.0*pi*0.5) 31 32 h1 = 0.562 32 33 Manning = 0.009 … … 44 45 # Set a default tagging 45 46 47 46 48 for id, face in domain.boundary: 47 49 domain.boundary[(id,face)] = 'outer' 48 50 point = domain.get_vertex_coordinate(id,(face+1)%3) 49 51 radius2 = point[0]*point[0] + point[1]*point[1] 52 typical_outer = (id,face) 50 53 if radius2 < 0.1: 51 54 domain.boundary[(id,face)] = 'inner' 55 typical_inner = (id,face) 52 56 53 57 … … 104 108 #--------------------------- 105 109 # Set up boundary conditions 106 DD_BC = Dirichlet_Discharge_boundary(domain, h0, wh0) 107 TM_BC = Transmissive_Momentum_Set_Stage_boundary(domain, outflow_height) 108 D_BC = Dirichlet_boundary([h1, 0, 0]) 110 DD_BC_INNER = Dirichlet_Discharge_boundary(domain, h0, wh0) 111 DD_BC_OUTER = Dirichlet_Discharge_boundary(domain, h1, wh1) 109 112 110 domain.set_boundary({'inner': DD_BC , 'outer': D_BC})113 domain.set_boundary({'inner': DD_BC_INNER, 'outer': DD_BC_OUTER}) 111 114 112 115 #------------------ 113 116 # Order of accuracy 114 domain.default_order = 2115 domain.CFL = 1.0117 domain.default_order = 1 118 domain.CFL = 0.75 116 119 #domain.beta_w = 0.5 117 120 #domain.beta_h = 0.2 … … 128 131 129 132 from realtime_visualisation_new import Visualiser 130 vxmom = Visualiser(domain,title='xmomentum',scale_z=10.0)131 vymom = Visualiser(domain,title='ymomentum',scale_z=10.0)133 #vxmom = Visualiser(domain,title='xmomentum',scale_z=10.0) 134 #vymom = Visualiser(domain,title='ymomentum',scale_z=10.0) 132 135 133 136 … … 136 139 import time 137 140 138 print 'PROBLEM WITH INSTABILITY AFTER t'139 141 t0 = time.time() 140 142 for t in domain.evolve(yieldstep = .01, finaltime = 10): 141 143 domain.write_time() 142 vxmom.update_quantity('xmomentum') 143 vymom.update_quantity('ymomentum') 144 #vxmom.update_quantity('xmomentum') 145 #vymom.update_quantity('ymomentum') 146 print 'outer stage ',domain.quantities['stage'].get_values(location='centroids',indices=[typical_outer[0]]) 147 print ' radial mom ',sqrt(domain.quantities['xmomentum'].get_values(location='centroids',indices=[typical_outer[0]])[0]**2 + 148 domain.quantities['ymomentum'].get_values(location='centroids',indices=[typical_outer[0]])[0]**2) 149 print 'inner stage ',domain.quantities['stage'].get_values(location='centroids',indices=[typical_inner[0]]) 150 print ' radial mom ',sqrt(domain.quantities['xmomentum'].get_values(location='centroids',indices=[typical_inner[0]])[0]**2 + 151 domain.quantities['ymomentum'].get_values(location='centroids',indices=[typical_inner[0]])[0]**2) 152 144 153 145 154 print 'That took %.2f seconds' %(time.time()-t0) 146
Note: See TracChangeset
for help on using the changeset viewer.