Skip to content

Commit

Permalink
Merge pull request #141 from stoiver/appveyor-runtests
Browse files Browse the repository at this point in the history
Appveyor test_all working
  • Loading branch information
stoiver committed Sep 14, 2017
2 parents f3442fb + 3a693a8 commit d7e948c
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 2 deletions.
1 change: 1 addition & 0 deletions anuga/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ def get_args():
from anuga.utilities.model_tools import read_hole_dir_single_file_with_multi_poly
from anuga.utilities.model_tools import read_multi_poly_file_value
from anuga.utilities.model_tools import Create_culvert_bridge_Operator
from anuga.utilities.model_tools import get_WCC_2002_Blockage_factor
from anuga.utilities.model_tools import get_WCC_2016_Blockage_factor


Expand Down
43 changes: 43 additions & 0 deletions anuga/utilities/model_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,3 +592,46 @@ def get_WCC_2016_Blockage_factor(Structure,Event,Scenario, long_result=False, ve
else:
return(BF)



def get_WCC_2002_Blockage_factor(Structure, verbose=True):
"""
If the Structure has a single dimension it is assumed a Diameter (hence Pipe)
Else it is a Box with w & h
--------------------------------------------------------------------
2017 - 06 - 22
Wollongong Blockage Factor Calculator for 2002 Blockage Policy
Author: Petar Milevski
--------------------------------------------------------------------
For all design storm events
if diag >= 6.0m, blockage factor = 0.25, otherwise blockage factor is 100%
"""

if len(Structure) > 1:# ====== FOR BOX =================
h = float(Structure[0])
w = float(Structure[1])
diag = (w**2+h**2)**0.5

else: # ====== FOR PIPE ================
d = float(Structure[0])
diag = d

if diag >= 6.0:
BF = 0.25
else:
BF = 1.0

if verbose:
print ' Importing Culverts'
print ' Culvert Size ([H,W] or [d]): ', Structure
print ' Diagonal: ', diag
print ' Blockage Factor: ', BF
print ''

return(BF)
3 changes: 1 addition & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@ build_script:
- python setup.py install --skip-build

test_script:
- cd ..
- python -c "import anuga; anuga.test()"
- python test_all.py

0 comments on commit d7e948c

Please sign in to comment.