Changeset 8859


Ignore:
Timestamp:
May 9, 2013, 12:17:00 PM (12 years ago)
Author:
steve
Message:

Adding facility to change culvert_height

Location:
trunk/anuga_core/source/anuga/structures
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/structures/run_gate_operator.py

    r8858 r8859  
    1010import anuga
    1111
    12 from anuga.structures.boyd_pipe_operator import Boyd_pipe_operator
     12from anuga.structures.boyd_box_operator import Boyd_box_operator
    1313from anuga.structures.inlet_operator import Inlet_operator
    1414                           
     
    4141                                               len2=width)
    4242domain = anuga.Domain(points, vertices, boundary)   
    43 domain.set_name('run_culvert_inlet')                 # Output name
     43domain.set_name('run_gate_operator')                 # Output name
    4444domain.set_default_order(2)
    4545#domain.set_beta(1.5)
     
    8989
    9090
    91 
    92 Boyd_pipe_operator(domain,
     91gate = Boyd_box_operator(domain,
    9392                            end_points=[[9.0, 2.5],[13.0, 2.5]],
    9493                            losses=1.5,
    95                             diameter=1.5,
     94                            width=1.5,
    9695                            apron=5.0,
    9796                            use_momentum_jet=True,
     
    101100
    102101
     102gate.set_culvert_height(10.0)
     103
    103104line = [[0.0, 5.0], [0.0, 10.0]]
    104 Q = 5.0
     105Q = 1.0
    105106Inlet_operator(domain, line, Q)
    106107
     
    113114
    114115## Inflow based on Flow Depth and Approaching Momentum
    115 Bi = anuga.Dirichlet_boundary([2.0, 0.0, 0.0])
    116116Br = anuga.Reflective_boundary(domain)              # Solid reflective wall
    117 #Bo = anuga.Dirichlet_boundary([-5, 0, 0])           # Outflow
    118117
    119 ## Upstream and downstream conditions that will exceed the rating curve
    120 ## I.e produce delta_h outside the range [0, 10] specified in the the
    121 ## file example_rating_curve.csv
    122 #Btus = anuga.Time_boundary(domain, \
    123             #lambda t: [100*num.sin(2*pi*(t-4)/10), 0.0, 0.0])
    124 #Btds = anuga.Time_boundary(domain, \
    125             #lambda t: [-5*(num.cos(2*pi*(t-4)/20)), 0.0, 0.0])
    126 #domain.set_boundary({'left': Btus, 'right': Btds, 'top': Br, 'bottom': Br})
    127118domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom': Br})
    128119
     
    134125#min_delta_w = sys.maxint
    135126#max_delta_w = -min_delta_w
    136 for t in domain.evolve(yieldstep = 1.0, finaltime = 200):
     127for t in domain.evolve(yieldstep = 1.0, finaltime = 50):
    137128    domain.write_time()
     129
     130
     131    if num.allclose(t, 10.0):
     132        gate.set_culvert_height(0.000001)
     133
     134    Q, velocity, depth = gate.discharge_routine()
     135
     136    print gate.culvert_height
     137    print Q
     138    print velocity
     139    print depth
     140       
    138141
    139142    #if domain.get_time() > 150.5 and domain.get_time() < 151.5 :
     
    146149    #if delta_w < min_delta_w: min_delta_w = delta_w
    147150
    148     print domain.volumetric_balance_statistics()
     151    #print domain.volumetric_balance_statistics()
    149152   
    150153    pass
  • trunk/anuga_core/source/anuga/structures/structure_operator.py

    r8858 r8859  
    210210
    211211
    212     def set_height(self, height):
    213 
    214         self.height = height
    215 
    216     def set_width(self, width):
    217 
    218         self.width = width
     212    def set_culvert_height(self, height):
     213
     214        self.culvert_height = height
     215
     216    def set_culvert_width(self, width):
     217
     218        self.culvert_width = width
    219219       
    220220
Note: See TracChangeset for help on using the changeset viewer.