Changeset 6144
 Timestamp:
 Jan 13, 2009, 11:21:22 AM (10 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

anuga_core/source/anuga/culvert_flows/test_culvert_class.py
r6142 r6144 72 72 # Sloping Embankment Across Channel 73 73 if 5.0 < x[i] < 10.1: 74 # Cut Out Segment for Culvert FACE74 # Cut Out Segment for Culvert face 75 75 if 1.0+(x[i]5.0)/5.0 < y[i] < 4.0  (x[i]5.0)/5.0: 76 76 z[i]=z[i] … … 80 80 z[i] += 2.5 # Flat Crest of Embankment 81 81 if 12.0 < x[i] < 14.5: 82 # Cut Out Segment for Culvert FACE82 # Cut Out Segment for Culvert face 83 83 if 2.0(x[i]12.0)/2.5 < y[i] < 3.0 + (x[i]12.0)/2.5: 84 84 z[i]=z[i] … … 186 186 # Sloping Embankment Across Channel 187 187 if 5.0 < x[i] < 10.1: 188 # Cut Out Segment for Culvert FACE188 # Cut Out Segment for Culvert face 189 189 if 1.0+(x[i]5.0)/5.0 < y[i] < 4.0  (x[i]5.0)/5.0: 190 190 z[i]=z[i] … … 194 194 z[i] += 2.5 # Flat Crest of Embankment 195 195 if 12.0 < x[i] < 14.5: 196 # Cut Out Segment for Culvert FACE196 # Cut Out Segment for Culvert face 197 197 if 2.0(x[i]12.0)/2.5 < y[i] < 3.0 + (x[i]12.0)/2.5: 198 198 z[i]=z[i] … … 287 287 # Sloping Embankment Across Channel 288 288 if 5.0 < x[i] < 10.1: 289 # Cut Out Segment for Culvert FACE289 # Cut Out Segment for Culvert face 290 290 if 1.0+(x[i]5.0)/5.0 < y[i] < 4.0  (x[i]5.0)/5.0: 291 291 z[i]=z[i] … … 295 295 z[i] += 2.5 # Flat Crest of Embankment 296 296 if 12.0 < x[i] < 14.5: 297 # Cut Out Segment for Culvert FACE297 # Cut Out Segment for Culvert face 298 298 if 2.0(x[i]12.0)/2.5 < y[i] < 3.0 + (x[i]12.0)/2.5: 299 299 z[i]=z[i] … … 308 308 domain.set_quantity('friction', 0.01) # Constant friction 309 309 domain.set_quantity('stage', 310 expression='elevation + 0. 2') # Shallow initial condition310 expression='elevation + 0.1') # Shallow initial condition 311 311 312 # NOTE: Shallow values may cause this test to fail regardless of the313 # culvert due to initial adjustments. A good value is 0.2314 315 312 316 313 filename = os.path.join(path, 'example_rating_curve.csv') … … 335 332 336 333 334 337 335 # 338 336 # Evolve system through time … … 348 346 if not allclose(new_volume, ref_volume): 349 347 print msg 350 assert allclose(new_volume, ref_volume), msg 348 assert allclose(new_volume, ref_volume), msg 349 350 351 352 # Now try this for a range of other depths 353 for depth in [1.0, 0.5, 0.2, 0.1, 0.05]: 354 domain.set_time(0.0) 355 356 domain.set_quantity('stage', 357 expression='elevation + %f' % depth) 358 359 360 ref_volume = domain.get_quantity('stage').get_integral() 361 for t in domain.evolve(yieldstep = 0.1, finaltime = 25): 362 #print domain.timestepping_statistics() 363 new_volume = domain.get_quantity('stage').get_integral() 364 365 #print new_volume, ref_volume, new_volumeref_volume 366 msg = 'Total volume has changed: Is %.2f m^3 should have been %.2f m^3'\ 367 % (new_volume, ref_volume) 368 369 assert allclose(new_volume, ref_volume), msg 351 370 352 371 … … 394 413 # Sloping Embankment Across Channel 395 414 if 5.0 < x[i] < 10.1: 396 # Cut Out Segment for Culvert FACE415 # Cut Out Segment for Culvert face 397 416 if 1.0+(x[i]5.0)/5.0 < y[i] < 4.0  (x[i]5.0)/5.0: 398 417 z[i]=z[i] … … 402 421 z[i] += 2.5 # Flat Crest of Embankment 403 422 if 12.0 < x[i] < 14.5: 404 # Cut Out Segment for Culvert FACE423 # Cut Out Segment for Culvert face 405 424 if 2.0(x[i]12.0)/2.5 < y[i] < 3.0 + (x[i]12.0)/2.5: 406 425 z[i]=z[i]
Note: See TracChangeset
for help on using the changeset viewer.