Changeset 1876


Ignore:
Timestamp:
Oct 6, 2005, 3:48:58 PM (19 years ago)
Author:
steve
Message:

fixed problem with BC for circular hydraulic jump.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/analytical solutions/Analytical_solution_circular_hydraulic_jump.py

    r1839 r1876  
    2929wh0 = Q/(2.0*pi*0.1)
    3030h0 = bed[2] + 0.005
     31wh1 = -Q/(2.0*pi*0.5)
    3132h1 = 0.562
    3233Manning = 0.009
     
    4445# Set a default tagging
    4546
     47
    4648for id, face in domain.boundary:
    4749    domain.boundary[(id,face)] = 'outer'
    4850    point = domain.get_vertex_coordinate(id,(face+1)%3)
    4951    radius2 = point[0]*point[0] + point[1]*point[1]
     52    typical_outer = (id,face)
    5053    if radius2 < 0.1:
    5154        domain.boundary[(id,face)] = 'inner'
     55        typical_inner = (id,face)
    5256
    5357
     
    104108#---------------------------
    105109# 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])
     110DD_BC_INNER = Dirichlet_Discharge_boundary(domain, h0, wh0)
     111DD_BC_OUTER = Dirichlet_Discharge_boundary(domain, h1, wh1)
    109112
    110 domain.set_boundary({'inner': DD_BC, 'outer': D_BC})
     113domain.set_boundary({'inner': DD_BC_INNER, 'outer': DD_BC_OUTER})
    111114
    112115#------------------
    113116# Order of accuracy
    114 domain.default_order = 2
    115 domain.CFL = 1.0
     117domain.default_order = 1
     118domain.CFL = 0.75
    116119#domain.beta_w = 0.5
    117120#domain.beta_h = 0.2
     
    128131
    129132from 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)
    132135
    133136
     
    136139import time
    137140
    138 print 'PROBLEM WITH INSTABILITY AFTER t'
    139141t0 = time.time()
    140142for t in domain.evolve(yieldstep = .01, finaltime = 10):
    141143    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
    144153
    145154print 'That took %.2f seconds' %(time.time()-t0)
    146 
Note: See TracChangeset for help on using the changeset viewer.