Changeset 8047
- Timestamp:
- Oct 21, 2010, 12:09:11 PM (14 years ago)
- 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 209 209 210 210 211 self.set_ new_mannings_function(False)211 self.set_sloped_mannings_function(False) 212 212 213 213 self.minimum_storable_height = minimum_storable_height … … 219 219 220 220 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. 225 224 The flag is tested in the python wrapper 226 225 mannings_friction_implicit 227 226 """ 228 227 if flag: 229 self.use_ new_mannings = True228 self.use_sloped_mannings = True 230 229 else: 231 self.use_ new_mannings = False230 self.use_sloped_mannings = False 232 231 233 232 … … 1152 1151 """ 1153 1152 1154 from shallow_water_ext import manning_friction_ old1155 from shallow_water_ext import manning_friction_ new1153 from shallow_water_ext import manning_friction_flat 1154 from shallow_water_ext import manning_friction_sloped 1156 1155 1157 1156 xmom = domain.quantities['xmomentum'] … … 1173 1172 g = domain.g 1174 1173 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, \ 1177 1176 ymom_update) 1178 1177 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, \ 1180 1179 ymom_update) 1181 1180 … … 1190 1189 """ 1191 1190 1192 from shallow_water_ext import manning_friction_ old1193 from shallow_water_ext import manning_friction_ new1191 from shallow_water_ext import manning_friction_flat 1192 from shallow_water_ext import manning_friction_sloped 1194 1193 1195 1194 xmom = domain.quantities['xmomentum'] … … 1210 1209 eps = domain.minimum_allowed_height 1211 1210 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, \ 1214 1213 ymom_update) 1215 1214 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, \ 1217 1216 ymom_update) 1218 1217 -
trunk/anuga_core/source/anuga/shallow_water/shallow_water_ext.c
r8017 r8047 519 519 520 520 521 void _manning_friction_ old(double g, double eps, int N,521 void _manning_friction_flat(double g, double eps, int N, 522 522 double* w, double* zv, 523 523 double* uh, double* vh, … … 552 552 553 553 554 void _manning_friction_ new(double g, double eps, int N,554 void _manning_friction_sloped(double g, double eps, int N, 555 555 double* x, double* w, double* zv, 556 556 double* uh, double* vh, … … 1145 1145 1146 1146 1147 PyObject *manning_friction_ new(PyObject *self, PyObject *args) {1147 PyObject *manning_friction_sloped(PyObject *self, PyObject *args) { 1148 1148 // 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) 1150 1150 // 1151 1151 … … 1173 1173 N = w -> dimensions[0]; 1174 1174 1175 _manning_friction_ new(g, eps, N,1175 _manning_friction_sloped(g, eps, N, 1176 1176 (double*) x -> data, 1177 1177 (double*) w -> data, … … 1229 1229 1230 1230 1231 PyObject *manning_friction_ old(PyObject *self, PyObject *args) {1231 PyObject *manning_friction_flat(PyObject *self, PyObject *args) { 1232 1232 // 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) 1234 1234 // 1235 1235 … … 1256 1256 N = w -> dimensions[0]; 1257 1257 1258 _manning_friction_ old(g, eps, N,1258 _manning_friction_flat(g, eps, N, 1259 1259 (double*) w -> data, 1260 1260 (double*) z -> data, … … 2896 2896 {"compute_fluxes_ext_kinetic", compute_fluxes_ext_kinetic, METH_VARARGS, "Print out"}, 2897 2897 {"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"}, 2900 2900 {"chezy_friction", chezy_friction, METH_VARARGS, "Print out"}, 2901 2901 {"flux_function_central", flux_function_central, METH_VARARGS, "Print out"}, -
trunk/anuga_core/source/anuga/shallow_water/test_shallow_water_domain.py
r7841 r8047 1772 1772 1773 1773 def test_manning_friction(self): 1774 """ Assuming flat manning frinction is default 1775 """ 1774 1776 from anuga.config import g 1775 1777 … … 1848 1850 1849 1851 1850 def test_ manning_friction_old(self):1852 def test_flat_manning_friction(self): 1851 1853 from anuga.config import g 1852 1854 … … 1864 1866 domain = Domain(points, vertices) 1865 1867 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 1866 1872 #Set up for a gradient of (3,0) at mid triangle (bce) 1867 1873 def slope(x, y): … … 1924 1930 1925 1931 1926 def test_ manning_friction_new(self):1932 def test_sloped_manning_friction(self): 1927 1933 from anuga.config import g 1928 1934 … … 1940 1946 domain = Domain(points, vertices) 1941 1947 1942 # Use the newfunction which takes into account the extra1948 # Use the sloped function which takes into account the extra 1943 1949 # wetted area due to slope of bed 1944 domain.set_ new_mannings_function(True)1950 domain.set_sloped_mannings_function(True) 1945 1951 1946 1952 #Set up for a gradient of (3,0) at mid triangle (bce)
Note: See TracChangeset
for help on using the changeset viewer.