Changeset 1950


Ignore:
Timestamp:
Oct 17, 2005, 5:47:56 PM (19 years ago)
Author:
steve
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/pyvolution/euler.py

    r1949 r1950  
    5858Generic_domain = Domain #Rename
    5959
    60 #Shallow water domain
     60#Euler domain
    6161class Domain(Generic_domain):
    6262
     
    6565                 use_inscribed_circle=False):
    6666
    67         conserved_quantities = ['stage', 'xmomentum', 'ymomentum']
    68         other_quantities = ['elevation', 'friction']
     67        conserved_quantities = ['density', 'xmomentum', 'ymomentum', 'energy']
     68        other_quantities = ['pressure']
    6969        Generic_domain.__init__(self, coordinates, vertices, boundary,
    7070                                conserved_quantities, other_quantities,
    7171                                tagged_elements, geo_reference, use_inscribed_circle)
    7272
    73         from config import minimum_allowed_height, g
    74         self.minimum_allowed_height = minimum_allowed_height
    75         self.g = g
    76 
    77         self.forcing_terms.append(gravity)
    78         self.forcing_terms.append(manning_friction)
     73        from euler_config import minimum_allowed_density
     74        self.minimum_allowed_density = minimum_allowed_density
    7975
    8076        #Realtime visualisation
     
    8985        self.store = False
    9086        self.format = 'sww'
    91         self.smooth = True
     87        self.smooth = False
    9288
    9389        #Reduction operation for get_vertex_values
     
    9692        #self.reduction = min  #Looks better near steep slopes
    9793
    98         self.quantities_to_be_stored = ['stage']
     94        self.quantities_to_be_stored = ['density', 'xmomentum', 'ymomentum', 'energy', 'pressure']
    9995
    10096
    10197        #Establish shortcuts to relevant quantities (for efficiency)
    102         #self.w = self.quantities['stage']
    103         #self.uh = self.quantities['xmomentum']
    104         #self.vh = self.quantities['ymomentum']
    105         #self.z = self.quantities['elevation']
    106         #self.eta = self.quantities['friction']
     98        self.rho = self.quantities['density']
     99        self.mx = self.quantities['xmomentum']
     100        self.my = self.quantities['ymomentum']
     101        self.E = self.quantities['energy']
     102
    107103
    108104    def initialise_visualiser(self,scale_z=1.0,rect=None):
     
    111107            from realtime_visualisation_new import Visualiser
    112108            self.visualiser = Visualiser(self,scale_z,rect)
    113             self.visualiser.setup['elevation']=True
    114109        self.visualise = True
    115110
     
    119114        #Check that we are solving the shallow water wave equation
    120115
    121         msg = 'First conserved quantity must be "stage"'
     116        msg = 'First conserved quantity must be "density"'
    122117        assert self.conserved_quantities[0] == 'stage', msg
    123118        msg = 'Second conserved quantity must be "xmomentum"'
    124119        assert self.conserved_quantities[1] == 'xmomentum', msg
    125120        msg = 'Third conserved quantity must be "ymomentum"'
     121        assert self.conserved_quantities[2] == 'ymomentum', msg
     122        msg = 'Fourth conserved quantity must be "energy"'
    126123        assert self.conserved_quantities[2] == 'ymomentum', msg
    127124
Note: See TracChangeset for help on using the changeset viewer.