A collection of bits of code that allow derrivation of flows. Aimed at simulatiing breach scnearios for quick assesments of risk.
Currently working on function to modify the height of the weir over time, to simulate gradual failure of the defence.
Currenlty, the script can time step and calculate resultant volume and flow every second.
The scipt will modify the breach every minute
The first function of this script allows the extraction of a constant flow value derrived from a static set of conditions. The following data are required to calculate a static flow value:
If the volume of water to flow through the breach is already known, then this function will generate a hydrograph for the breach.
The script calculates the flow, the volume of water lost in that second and the new total volume of the reservoir every second. This essentially make the script a very simple hydrodynmaic simulation of a reservoir failure.
The resultant flow does not take into account any physical factors other than that of the weir coeefecient.
The EA has published guidelines on how it has simulated reservoir failures for its Reservoir Inundation Mapping, these should be followed for detailed analysis of reservoir failure. These calculations are for rapid, initial assesments only.
This sciprt uses the following weir equation as the basis for all of its calculations. Further infomation can be found here Link to weir calc site. Key variable in this script is the weir coeefecient. This defines the effectiveness of the weir.
Table to show different flows from a variety of weir coeefecients.
One area in which the script requires improvement is during flow conditions would be drowned out. Further research into this state is required. The script will need to be able to transition between the two flow states.
The weir flow equations assume that the weir is flowing in a modular manner throughtout the simulation. This should be the case when a breach occurs into an area of dry land, however, there may be situations where this assumption is not true. Non-modular flow occurs when the water level above and below the weir are high enough to bypass the controlling influence of the wier. The equations used within the script assume that the resultant flow can discharge freely. In bank failures this may not always be the case. Flow discharing into an area of restricted volume may see the
#!/usr/bin/ python
# Description: Weir flow equation from known volume
###functions###
def weirFlow(weirHead, weirWidth, weirCoef):
flow = 0.6666 * weirCoef * weirWidth * 19.62**0.5 * weirHead**1.5
return flow
def resVolume(resDepth, resWidth, resBredth):
resVol = resDepth * resWidth * resBredth
return resVol
def resHeight(resVol, resWidth, resBredth):
resDepth = resVol / (resWidth * resBredth)
return resDepth
# User input
print "Breach dimentions"
print
weirHead = float(raw_input("Enter the height of the breach above bed level: "))
weirWidth = float(raw_input("Enter the width of he breach: "))
weirCoef = float(raw_input("Specify weir coeffiecent: "))
calcLimit = float(raw_input("Specify minimum head to calc: "))
print "reservoir dimentions"
print
resDepth = weirHead
resWidth = float(raw_input("Enter reservoir width: "))
resBredth = float(raw_input("Enter reservoir bredth: "))
flow = weirFlow(weirHead, weirWidth, weirCoef)
resVol = resVolume(weirHead, resWidth, resBredth)
counter = 0
f = open("Weir_output.csv", "w")
while weirHead > calcLimit:
counter += 1
#remove this time steps flow
resVol = resVol - flow
#calc new res height
weirHead = resHeight(resVol, resWidth, resBredth)
#use new res height to calc new flow
flow = weirFlow(weirHead, weirWidth, weirCoef)
if counter % 60 == 0:
print counter
timeOutput = str(counter / 60)
print timeOutput
f.write(timeOutput + "," + str((round(flow, 2))) + "\n" )
f.close