Changeset 8876


Ignore:
Timestamp:
May 27, 2013, 7:38:13 PM (11 years ago)
Author:
steve
Message:

Sequential code to mimick get_enquiry code in parallel structure

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

Legend:

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

    r8871 r8876  
    103103            outlet_culvert_depth = 0.0
    104104            self.case = "Culvert blocked"
     105            self.inflow  = self.inlets[0]
     106            self.outflow = self.inlets[1]
    105107            return Q, barrel_velocity, outlet_culvert_depth
    106108
     
    267269        #FIXME(Ole): What about inlet control?
    268270
    269     culv_froude=math.sqrt(Q**2*flow_width/(anuga.g*flow_area**3))
     271    if  flow_area <= 0.0 :
     272        culv_froude = 0.0
     273    else:
     274        culv_froude=math.sqrt(Q**2*flow_width/(anuga.g*flow_area**3))
     275       
    270276    if local_debug:
    271277        anuga.log.critical('FLOW AREA = %s' % str(flow_area))
  • trunk/anuga_core/source/anuga/structures/inlet_enquiry.py

    r8874 r8876  
    102102
    103103            depth = self.get_enquiry_water_depth()
    104             u = self.get_enquiry_xmom()/(depth + velocity_protection/depth)
    105             v = self.get_enquiry_ymom()/(depth + velocity_protection/depth)
     104            u = depth*self.get_enquiry_xmom()/(depth**2 + velocity_protection)
     105            v = depth*self.get_enquiry_ymom()/(depth**2 + velocity_protection)
    106106
    107107            return u, v
     
    111111
    112112            depth = self.get_enquiry_water_depth()
    113             return self.get_enquiry_xmom()/(depth + velocity_protection/depth)
     113            return depth*self.get_enquiry_xmom()/(depth**2 + velocity_protection)
    114114
    115115    def get_enquiry_yvelocity(self):
    116116
    117117            depth = self.get_enquiry_water_depth()
    118             return self.get_enquiry_ymom()/(depth + velocity_protection/depth)
     118            return depth*self.get_enquiry_ymom()/(depth**2 + velocity_protection)
    119119
    120120
  • trunk/anuga_core/source/anuga/structures/structure_operator.py

    r8874 r8876  
    457457
    458458        return self.apron
     459
     460
     461    def get_master_proc(self):
     462
     463        return 0
     464
     465
     466
     467    #--------------------------------------------------------
     468    # Set of enquiry functions so that in the sequential and paralle case
     469    # we can get equiry info fron the master Proc
     470    #---------------------------------------------------------
     471
     472    def get_enquiry_stages(self):
     473
     474        enq0 = self.inlets[0].get_enquiry_stage()
     475        enq1 = self.inlets[1].get_enquiry_stage()
     476
     477        return [enq0, enq1]
     478
     479
     480    def get_enquiry_depths(self):
     481
     482        enq0 = self.inlets[0].get_enquiry_depth()
     483        enq1 = self.inlets[1].get_enquiry_depth()
     484
     485        return [enq0, enq1]
     486
     487
     488    def get_enquiry_positions(self):
     489
     490        enq0 = self.inlets[0].get_enquiry_position()
     491        enq1 = self.inlets[1].get_enquiry_position()
     492
     493        return [enq0, enq1]
     494
     495
     496    def get_enquiry_xmoms(self):
     497
     498        enq0 = self.inlets[0].get_enquiry_xmom()
     499        enq1 = self.inlets[1].get_enquiry_xmom()
     500
     501        return [enq0, enq1]
     502
     503    def get_enquiry_ymoms(self):
     504
     505        enq0 = self.inlets[0].get_enquiry_ymom()
     506        enq1 = self.inlets[1].get_enquiry_ymom()
     507
     508        return [enq0, enq1]
     509
     510
     511    def get_enquiry_elevations(self):
     512
     513        enq0 = self.inlets[0].get_enquiry_elevation()
     514        enq1 = self.inlets[1].get_enquiry_elevation()
     515
     516        return [enq0, enq1]
     517
     518
     519
     520    def get_enquiry_water_depths(self):
     521
     522        enq0 = self.inlets[0].get_enquiry_water_depth()
     523        enq1 = self.inlets[1].get_enquiry_water_depth()
     524
     525        return [enq0, enq1]
     526
     527
     528    def get_enquiry_invert_elevations(self):
     529
     530        enq0 = self.inlets[0].get_enquiry_invert_elevation()
     531        enq1 = self.inlets[1].get_enquiry_invert_elevation()
     532
     533        return [enq0, enq1]
     534
     535
     536    def get_enquiry_velocitys(self):
     537
     538        enq0 = self.inlets[0].get_enquiry_velocity()
     539        enq1 = self.inlets[1].get_enquiry_velocity()
     540
     541        return [enq0, enq1]
     542
     543
     544    def get_enquiry_xvelocitys(self):
     545
     546        enq0 = self.inlets[0].get_enquiry_xvelocity()
     547        enq1 = self.inlets[1].get_enquiry_xvelocity()
     548
     549        return [enq0, enq1]
     550
     551    def get_enquiry_yvelocitys(self):
     552
     553        enq0 = self.inlets[0].get_enquiry_yvelocity()
     554        enq1 = self.inlets[1].get_enquiry_yvelocity()
     555
     556        return [enq0, enq1]
     557
     558
     559    def get_enquiry_speeds(self):
     560
     561        enq0 = self.inlets[0].get_enquiry_speed()
     562        enq1 = self.inlets[1].get_enquiry_speed()
     563
     564        return [enq0, enq1]
     565
     566
     567    def get_enquiry_velocity_heads(self):
     568
     569        enq0 = self.inlets[0].get_enquiry_velocity_head()
     570        enq1 = self.inlets[1].get_enquiry_velocity_head()
     571
     572        return [enq0, enq1]
     573
     574
     575    def get_enquiry_total_energys(self):
     576
     577        enq0 = self.inlets[0].get_enquiry_total_energy()
     578        enq1 = self.inlets[1].get_enquiry_total_energy()
     579
     580        return [enq0, enq1]
     581
     582
     583    def get_enquiry_specific_energys(self):
     584
     585        enq0 = self.inlets[0].get_enquiry_specific_energy()
     586        enq1 = self.inlets[1].get_enquiry_specific_energy()
     587
     588        return [enq0, enq1]
     589
Note: See TracChangeset for help on using the changeset viewer.