Changeset 8047


Ignore:
Timestamp:
Oct 21, 2010, 12:09:11 PM (13 years ago)
Author:
steve
Message:

Changed name of new and old mannings function tobetter correspond to
calculation using the sloped or flat triangle area.

Location:
trunk/anuga_core/source/anuga/shallow_water
Files:
3 edited

Legend:

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

    r8017 r8047  
    209209
    210210       
    211         self.set_new_mannings_function(False)
     211        self.set_sloped_mannings_function(False)
    212212
    213213        self.minimum_storable_height = minimum_storable_height
     
    219219
    220220
    221     def set_new_mannings_function(self, flag=True):
    222         """Cludge to allow unit test to pass, but to
    223         also introduce new mannings friction function
    224         which takes into account the slope of the bed.
     221    def set_sloped_mannings_function(self, flag=True):
     222        """Set mannings friction function to use the sloped
     223        wetted area.
    225224        The flag is tested in the python wrapper
    226225        mannings_friction_implicit
    227226        """
    228227        if flag:
    229             self.use_new_mannings = True
     228            self.use_sloped_mannings = True
    230229        else:
    231             self.use_new_mannings = False
     230            self.use_sloped_mannings = False
    232231
    233232
     
    11521151    """
    11531152
    1154     from shallow_water_ext import manning_friction_old
    1155     from shallow_water_ext import manning_friction_new
     1153    from shallow_water_ext import manning_friction_flat
     1154    from shallow_water_ext import manning_friction_sloped
    11561155
    11571156    xmom = domain.quantities['xmomentum']
     
    11731172    g = domain.g
    11741173
    1175     if domain.use_new_mannings:
    1176         manning_friction_new(g, eps, x, w, uh, vh, z, eta, xmom_update, \
     1174    if domain.use_sloped_mannings:
     1175        manning_friction_sloped(g, eps, x, w, uh, vh, z, eta, xmom_update, \
    11771176                                ymom_update)
    11781177    else:
    1179         manning_friction_old(g, eps, w, uh, vh, z, eta, xmom_update, \
     1178        manning_friction_flat(g, eps, w, uh, vh, z, eta, xmom_update, \
    11801179                                ymom_update)
    11811180   
     
    11901189    """
    11911190
    1192     from shallow_water_ext import manning_friction_old
    1193     from shallow_water_ext import manning_friction_new
     1191    from shallow_water_ext import manning_friction_flat
     1192    from shallow_water_ext import manning_friction_sloped
    11941193
    11951194    xmom = domain.quantities['xmomentum']
     
    12101209    eps = domain.minimum_allowed_height
    12111210
    1212     if domain.use_new_mannings:
    1213         manning_friction_new(domain.g, eps, x, w, uh, vh, z, eta, xmom_update, \
     1211    if domain.use_sloped_mannings:
     1212        manning_friction_sloped(domain.g, eps, x, w, uh, vh, z, eta, xmom_update, \
    12141213                            ymom_update)
    12151214    else:
    1216         manning_friction_old(domain.g, eps, w, uh, vh, z, eta, xmom_update, \
     1215        manning_friction_flat(domain.g, eps, w, uh, vh, z, eta, xmom_update, \
    12171216                            ymom_update)
    12181217
  • trunk/anuga_core/source/anuga/shallow_water/shallow_water_ext.c

    r8017 r8047  
    519519
    520520
    521 void _manning_friction_old(double g, double eps, int N,
     521void _manning_friction_flat(double g, double eps, int N,
    522522               double* w, double* zv,
    523523               double* uh, double* vh,
     
    552552
    553553
    554 void _manning_friction_new(double g, double eps, int N,
     554void _manning_friction_sloped(double g, double eps, int N,
    555555                           double* x, double* w, double* zv,
    556556                           double* uh, double* vh,
     
    11451145
    11461146
    1147 PyObject *manning_friction_new(PyObject *self, PyObject *args) {
     1147PyObject *manning_friction_sloped(PyObject *self, PyObject *args) {
    11481148  //
    1149   // manning_friction_new(g, eps, x, h, uh, vh, z, eta, xmom_update, ymom_update)
     1149  // manning_friction_sloped(g, eps, x, h, uh, vh, z, eta, xmom_update, ymom_update)
    11501150  //
    11511151
     
    11731173  N = w -> dimensions[0];
    11741174
    1175   _manning_friction_new(g, eps, N,
     1175  _manning_friction_sloped(g, eps, N,
    11761176                        (double*) x -> data,
    11771177                        (double*) w -> data,
     
    12291229
    12301230
    1231 PyObject *manning_friction_old(PyObject *self, PyObject *args) {
     1231PyObject *manning_friction_flat(PyObject *self, PyObject *args) {
    12321232  //
    1233   // manning_friction_old(g, eps, h, uh, vh, z, eta, xmom_update, ymom_update)
     1233  // manning_friction_flat(g, eps, h, uh, vh, z, eta, xmom_update, ymom_update)
    12341234  //
    12351235
     
    12561256  N = w -> dimensions[0];
    12571257
    1258   _manning_friction_old(g, eps, N,
     1258  _manning_friction_flat(g, eps, N,
    12591259                        (double*) w -> data,
    12601260                        (double*) z -> data,
     
    28962896  {"compute_fluxes_ext_kinetic", compute_fluxes_ext_kinetic, METH_VARARGS, "Print out"},
    28972897  {"gravity", gravity, METH_VARARGS, "Print out"},
    2898   {"manning_friction_old", manning_friction_old, METH_VARARGS, "Print out"},
    2899   {"manning_friction_new", manning_friction_new, METH_VARARGS, "Print out"},
     2898  {"manning_friction_flat", manning_friction_flat, METH_VARARGS, "Print out"},
     2899  {"manning_friction_sloped", manning_friction_sloped, METH_VARARGS, "Print out"},
    29002900  {"chezy_friction", chezy_friction, METH_VARARGS, "Print out"},
    29012901  {"flux_function_central", flux_function_central, METH_VARARGS, "Print out"}, 
  • trunk/anuga_core/source/anuga/shallow_water/test_shallow_water_domain.py

    r7841 r8047  
    17721772
    17731773    def test_manning_friction(self):
     1774        """ Assuming flat manning frinction is default
     1775        """
    17741776        from anuga.config import g
    17751777
     
    18481850
    18491851
    1850     def test_manning_friction_old(self):
     1852    def test_flat_manning_friction(self):
    18511853        from anuga.config import g
    18521854
     
    18641866        domain = Domain(points, vertices)
    18651867
     1868        # Use the flat function which doesn't takes into account the extra
     1869        # wetted area due to slope of bed
     1870        domain.set_sloped_mannings_function(False)
     1871
    18661872        #Set up for a gradient of (3,0) at mid triangle (bce)
    18671873        def slope(x, y):
     
    19241930
    19251931
    1926     def test_manning_friction_new(self):
     1932    def test_sloped_manning_friction(self):
    19271933        from anuga.config import g
    19281934
     
    19401946        domain = Domain(points, vertices)
    19411947
    1942         # Use the new function which takes into account the extra
     1948        # Use the sloped function which takes into account the extra
    19431949        # wetted area due to slope of bed
    1944         domain.set_new_mannings_function(True)
     1950        domain.set_sloped_mannings_function(True)
    19451951       
    19461952        #Set up for a gradient of (3,0) at mid triangle (bce)
Note: See TracChangeset for help on using the changeset viewer.