...
Step 8: Calculate the diameter of the orifices for each row based on the area of the orifices calculated above.
Step 9: Create the height arrays. The H_flowloc is an array of the height at which the flow rate is calculated (this is equal to 1/2*the row spacing above the row being evaluated). H_orificeloc is an array of the heights at which orifices will be made.
Step 10: This creates the array of target flow rates based on the heights given by the H_flowloc array and assuming a perfectly linear realtionship.
Step 11: This is a function that calculates the actual flow rate through the LFOM for a given height of water. The program determines the flow through all orifices below the water level based on varying amounts of head (water elevation).
Step 12: This is a function that calculates the number of orifices necessary at each H_orificeloc based on a given diameter.
Step 13: This function calculates the error of the design based on the differences between the predicted flow rate and the actual flow rate through the LFOM.
Step 14: This funciton returns the maximum error, the absolute value of the errors is taken so that the positive and negative errors are accounted for.