Changeset 9218


Ignore:
Timestamp:
Jun 24, 2014, 12:07:40 PM (10 years ago)
Author:
steve
Message:

Added in DE2 algorithm

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/shallow_water/shallow_water_domain.py

    r9213 r9218  
    556556            print '##########################################################################'
    557557
     558
     559    def set_DE2_defaults(self):
     560        """Set up the defaults for running the flow_algorithm "DE1"
     561           A 'discontinuous elevation' method
     562        """
     563        self.set_CFL(0.95)
     564        self.set_use_kinematic_viscosity(False)
     565        #self.timestepping_method='rk2'#'rk3'#'euler'#'rk2'
     566        self.set_timestepping_method(2)
     567       
     568        self.set_using_discontinuous_elevation(True)
     569        self.set_compute_fluxes_method('DE')
     570        self.set_distribute_to_vertices_and_edges_method('DE')
     571       
     572        # Don't place any restriction on the minimum storable height
     573        self.minimum_storable_height=-99999999999.0
     574        self.minimum_allowed_height=1.0e-12
     575
     576        self.use_edge_limiter=True
     577        self.set_default_order(2)
     578        self.set_extrapolate_velocity()
     579
     580        self.beta_w=0.75
     581        self.beta_w_dry=0.1
     582        self.beta_uh=0.75
     583        self.beta_uh_dry=0.1
     584        self.beta_vh=0.75
     585        self.beta_vh_dry=0.1
     586       
     587
     588        #self.set_quantities_to_be_stored({'stage': 2, 'xmomentum': 2,
     589        #         'ymomentum': 2, 'elevation': 2, 'height':2})
     590        #self.set_quantities_to_be_stored({'stage': 2, 'xmomentum': 2,
     591        #         'ymomentum': 2, 'elevation': 1})
     592        self.set_store_centroids(True)
     593
     594        self.optimise_dry_cells=False
     595
     596        # We need the edge_coordinates for the extrapolation
     597        self.edge_coordinates=self.get_edge_midpoint_coordinates()
     598
     599        # By default vertex values are NOT stored uniquely
     600        # for storage efficiency. We may override this (but not so important since
     601        # centroids are stored anyway
     602        # self.set_store_vertices_smoothly(False)
     603
     604        self.maximum_allowed_speed=0.0
     605
     606        ## FIXME: Should implement tracking of boundary fluxes
     607        ## Keep track of the fluxes through the boundaries
     608        self.boundary_flux_integral=num.ndarray(1)
     609        self.boundary_flux_integral[0]=0.
     610        self.boundary_flux_sum=num.ndarray(1)
     611        self.boundary_flux_sum[0]=0.
     612
     613        self.call=1 # Integer counting how many times we call compute_fluxes_central
     614
     615        if self.processor == 0 and self.verbose:
     616            print '##########################################################################'
     617            print '#'
     618            print '# Using discontinuous elevation solver DE2 '
     619            print '#'
     620            print '# A slightly more diffusive version of DE1, does use rk2 timestepping'
     621            print '#'
     622            print '# Make sure you use centroid values when reporting on important output quantities'
     623            print '#'
     624            print '##########################################################################'
     625
     626
     627
    558628    def update_special_conditions(self):
    559629
     
    709779           DE0
    710780           DE1
     781           DE2
    711782        """
    712783
     
    716787            flag = str(float(str(flag))).replace(".","_")
    717788
    718         flow_algorithms = ['1_0', '1_5', '1_75', '2_0', '2_0_limited', '2_5', 'tsunami', 'yusuke', 'DE0', 'DE1']
     789        flow_algorithms = ['1_0', '1_5', '1_75', '2_0', '2_0_limited', '2_5', 'tsunami', 'yusuke', 'DE0', 'DE1', 'DE2']
    719790
    720791        if flag in flow_algorithms:
     
    823894            self.set_extrapolate_velocity()
    824895
    825         if self.flow_algorithm == 'DE1':
    826             self.set_DE1_defaults()
    827            
    828            
     896
    829897        if self.flow_algorithm == 'DE0':
    830898            self.set_DE0_defaults()
     899           
     900        if self.flow_algorithm == 'DE1':
     901            self.set_DE1_defaults()         
     902         
     903        if self.flow_algorithm == 'DE2':
     904            self.set_DE2_defaults()
    831905
    832906    def get_flow_algorithm(self):
     
    834908
    835909        Currently
    836            1_0, 1_5, 1_75 2_0, 2_5, tsunami, DE0, DE1
     910           1_0, 1_5, 1_75 2_0, 2_5, tsunami, DE0, DE1, DE2
    837911        """
    838912
Note: See TracChangeset for help on using the changeset viewer.