Changeset 9130


Ignore:
Timestamp:
Jun 2, 2014, 12:50:04 PM (11 years ago)
Author:
davies
Message:

Adding a smoothing_timescale to parallel_boyd_box_operator

Location:
trunk/anuga_core/source
Files:
4 edited

Legend:

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

    r9125 r9130  
    124124                                   }
    125125
    126 
    127         self.hydraulic_variable_names=['Qfactor', 's1', 's2', 'h1', 'h2']
    128         #self.hydraulic_variable_names=('Qfactor',)
     126        # DO NOT CHANGE THE ORDER OF hydraulic_variable_names
     127        # It needs to match hard-coded assumptions in C [compute_fluxes_central]
     128        # If you add a variable, append it to the end of hydraulic_variable_names
     129        self.hydraulic_variable_names=('Qfactor', 's1', 's2', 'h1', 'h2')
    129130
    130131        self.ncol_hydraulic_properties=len(self.hydraulic_variable_names)
  • trunk/anuga_core/source/anuga/structures/structure_operator.py

    r9013 r9130  
    212212            new_inflow_xmom = old_inflow_xmom*factor
    213213            new_inflow_ymom = old_inflow_ymom*factor
    214                
     214           
    215215            self.inflow.set_depths(new_inflow_depth)
    216216   
     
    251251            new_inflow_xmom = old_inflow_xmom/old_inflow_depth*new_inflow_depth
    252252            new_inflow_ymom = old_inflow_ymom/old_inflow_depth*new_inflow_depth
    253                
    254253            self.inflow.set_depths(new_inflow_depth)   
    255254            self.inflow.set_xmoms(new_inflow_xmom)
  • trunk/anuga_core/source/anuga_parallel/parallel_boyd_box_operator.py

    r9029 r9130  
    3232                 manning=0.013,
    3333                 enquiry_gap=0.0,
     34                 smoothing_timescale=0.0,
    3435                 use_momentum_jet=True,
    3536                 use_velocity_head=True,
     
    9697        self.case = 'N/A'
    9798
     99        self.domain=domain
     100        # May/June 2014 -- allow 'smoothing ' of driving_energy, delta total energy, and outflow_enq_depth
     101        self.smoothing_timescale=0.
     102        self.smooth_driving_energy=0.
     103        self.smooth_delta_total_energy=0.
     104        self.smooth_outflow_enq_depth=0.
     105        # Set them based on a call to the discharge routine with smoothing_timescale=0.
     106        # [values of self.smooth_* are required in discharge_routine, hence dummy values above]
     107        Qvd=self.discharge_routine()
     108        self.smooth_driving_energy=1.0*self.driving_energy
     109        self.smooth_delta_total_energy=1.0*self.delta_total_energy
     110        self.smooth_outflow_enq_depth=Qvd[2]
     111        # Finally, set the smoothing timescale we actually want
     112        self.smoothing_timescale=smoothing_timescale
     113
    98114        '''
    99115        print "ATTRIBUTES OF PARALLEL BOYD BOX::"
     
    235251                    self.driving_energy = inflow_enq_depth
    236252                   
     253                # May/June 2014 -- change the driving forces gradually, with forward euler timestepping
     254                ts=self.domain.timestep/max(self.domain.timestep, self.smoothing_timescale,1.0e-06)
     255                self.smooth_driving_energy=self.smooth_driving_energy+\
     256                                        ts*(self.driving_energy-self.smooth_driving_energy)
     257                self.smooth_delta_total_energy=self.smooth_delta_total_energy+\
     258                                        ts*(self.delta_total_energy-self.smooth_delta_total_energy)
     259                self.smooth_outflow_enq_depth=self.smooth_outflow_enq_depth+\
     260                                        ts*(outflow_enq_depth-self.smooth_outflow_enq_depth)
     261
    237262           
    238263                Q, barrel_velocity, outlet_culvert_depth, flow_area, case = \
     
    241266                                                flow_width          =self.culvert_width,
    242267                                                length              =self.culvert_length,
    243                                                 driving_energy      =self.driving_energy,
    244                                                 delta_total_energy  =self.delta_total_energy,
    245                                                 outlet_enquiry_depth=outflow_enq_depth,
     268                                                #driving_energy      =self.driving_energy,
     269                                                #delta_total_energy  =self.delta_total_energy,
     270                                                #outlet_enquiry_depth=outflow_enq_depth,
     271                                                # Allow smoothing of the driving energies
     272                                                driving_energy      =self.smooth_driving_energy,
     273                                                delta_total_energy  =self.smooth_delta_total_energy,
     274                                                outlet_enquiry_depth=self.smooth_outflow_enq_depth,
    246275                                                sum_loss            =self.sum_loss,
    247276                                                manning             =self.manning)
  • trunk/anuga_core/source/anuga_parallel/parallel_operator_factory.py

    r9029 r9130  
    127127                       manning=0.013,
    128128                       enquiry_gap=0.0,
     129                       smoothing_timescale=0.0,
    129130                       use_momentum_jet=True,
    130131                       use_velocity_head=True,
     
    256257                                         manning=manning,
    257258                                         enquiry_gap=enquiry_gap,
     259                                         smoothing_timescale=smoothing_timescale,
    258260                                         use_momentum_jet=use_momentum_jet,
    259261                                         use_velocity_head=use_velocity_head,
Note: See TracChangeset for help on using the changeset viewer.