Changeset 1635


Ignore:
Timestamp:
Jul 25, 2005, 11:18:06 AM (19 years ago)
Author:
ole
Message:

Added simplified test of conservation problem
This one shows how the minimum_allowed_height parameter determines how much is lost

Location:
inundation/ga/storm_surge
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • inundation/ga/storm_surge/parallel/run_sw_lost_mass.py

    r1631 r1635  
    2020# lose of conservation
    2121# Set it to a larger value (say 0.1) and have
    22 # consevation "restored"
     22# conservation "restored"
    2323##############################################
    2424yieldstep = 0.005
    25 yieldstep = 0.1
    26 finaltime = 100.0
     25#yieldstep = 0.08
     26#yieldstep = 0.05
     27finaltime = 1000.0
    2728
    2829import sys
     
    5253
    5354class Set_Stage:
    54     """Set an initial condition with constant water height, for x<x0
     55    """Set an initial condition with constant water height, for x0<x<x1
    5556    """
    5657
     
    110111
    111112for t in domain.evolve(yieldstep = yieldstep, finaltime = finaltime):
    112     print 'Integral stage = ',domain.quantities['stage'].get_integral(),' Time = ',domain.time
     113    #domain.write_time()
     114    print '    Integral stage = ', domain.quantities['stage'].get_integral(),' Time = ',domain.time
    113115
    114116
  • inundation/ga/storm_surge/pyvolution/shallow_water.py

    r1599 r1635  
    255255        if self.visualiser is None:
    256256            from realtime_visualisation_new import Visualiser
     257            from Numeric import array, Float
     258
     259            if rect is None:
     260                rect = array(self.xy_extent, Float)
     261
    257262            self.visualiser = Visualiser(self,scale_z,rect)
    258263        self.visualise = True
     
    564569
    565570
    566 def dry(domain):
    567     """Protect against infinitesimal heights and associated high velocities
    568     at vertices
    569     """
    570 
    571     #FIXME: Experimental (from old version). Not in use at the moment
    572 
    573     #Shortcuts
    574     wv = domain.quantities['stage'].vertex_values
    575     zv = domain.quantities['elevation'].vertex_values
    576     xmomv = domain.quantities['xmomentum'].vertex_values
    577     ymomv = domain.quantities['ymomentum'].vertex_values
    578     hv = wv - zv  #Water depths at vertices
    579 
    580     #Update
    581     for k in range(domain.number_of_elements):
    582         hmax = max(hv[k, :])
    583 
    584         if hmax < domain.minimum_allowed_height:
    585             #Control stage
    586             wv[k, :] = zv[k, :]
    587 
    588             #Control momentum
    589             xmomv[k,:] = ymomv[k,:] = 0.0
     571# def dry(domain):
     572#     """Protect against infinitesimal heights and associated high velocities
     573#     at vertices
     574#     """
     575
     576#     #FIXME: Experimental (from old version). Not in use at the moment
     577
     578#     #Shortcuts
     579#     wv = domain.quantities['stage'].vertex_values
     580#     zv = domain.quantities['elevation'].vertex_values
     581#     xmomv = domain.quantities['xmomentum'].vertex_values
     582#     ymomv = domain.quantities['ymomentum'].vertex_values
     583#     hv = wv - zv  #Water depths at vertices
     584
     585#     #Update
     586#     for k in range(domain.number_of_elements):
     587#         hmax = max(hv[k, :])
     588
     589#         if hmax < domain.minimum_allowed_height:
     590#             #Control stage
     591#             wv[k, :] = zv[k, :]
     592
     593#             #Control momentum
     594#             xmomv[k,:] = ymomv[k,:] = 0.0
    590595
    591596
Note: See TracChangeset for help on using the changeset viewer.