Ignore:
Timestamp:
Jun 19, 2011, 3:54:42 PM (14 years ago)
Author:
paul
Message:

Added state evolved quantity to pipe domain

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_work/development/2010-projects/anuga_1d/pipe/pipe_domain.py

    r8177 r8188  
    3232b         width            width of pipe [m]
    3333t         top              height of pipe above z [m]
     34st        state            state of the cell (pressurised or free surface
    3435eta                        mannings friction coefficient [to appear]
    3536
     
    5859
    5960        conserved_quantities = ['area', 'discharge']
    60         evolved_quantities = ['area', 'discharge', 'elevation', 'height', 'velocity','width','top','stage']
     61        evolved_quantities = ['area', 'discharge', 'elevation', 'height', 'velocity','width','top','stage','state']
    6162        other_quantities = ['friction']
    6263        Generic_domain.__init__(self,
     
    126127        msg = 'Eighth evolved quantity must be "stage"'
    127128        assert self.evolved_quantities[7] == 'stage', msg
     129        msg = 'Ninth evolved quantity must be "state"'
     130        assert self.evolved_quantities[8] == 'state', msg
    128131
    129132        Generic_domain.check_integrity(self)
     
    156159    width      = domain.quantities['width']
    157160    top        = domain.quantities['top']
     161    state      = domain.quantities['state']
    158162
    159163
    160164    from anuga_1d.pipe.pipe_domain_ext import compute_fluxes_pipe_ext
    161     domain.flux_timestep = compute_fluxes_pipe_ext(timestep,domain,area,discharge,bed,height,velocity,width,top)
     165    domain.flux_timestep = compute_fluxes_pipe_ext(timestep,domain,area,discharge,bed,height,velocity,width,top,state)
    162166
    163167#-----------------------------------------------------------------------
     
    186190    top       = domain.quantities['top']
    187191    stage     = domain.quantities['stage']
     192    state     = domain.quantities['state']
    188193
    189194    #Arrays   
     
    196201    t_C   = top.centroid_values
    197202    w_C   = stage.centroid_values
     203    s_C   = state.centroid_values
    198204
    199205    if domain.setstageflag:
     
    241247    b_V  = width.vertex_values
    242248    t_V  = top.vertex_values
     249    s_V  = state.vertex_values
    243250
    244251
     
    283290        self.top    = domain.quantities['top'].vertex_values
    284291        self.stage    = domain.quantities['stage'].vertex_values
    285 
    286         self.evolved_quantities = numpy.zeros(8, numpy.float)
     292        self.state    = domain.quantities['state'].vertex_values
     293
     294        self.evolved_quantities = numpy.zeros(9, numpy.float)
    287295
    288296    def __repr__(self):
     
    304312        q[6] =  self.top[vol_id,edge_id]
    305313        q[7] =  self.stage[vol_id,edge_id]
    306 
     314        q[8] =  self.state[vol_id,edge_id]
    307315        return q
    308316
     
    322330            raise msg
    323331
    324         assert len(evolved_quantities) == 8
     332        assert len(evolved_quantities) == 9
    325333
    326334        self.evolved_quantities=numpy.array(evolved_quantities,numpy.float)
Note: See TracChangeset for help on using the changeset viewer.