Created by Adam Salwen (abs265@cornell.edu)
Modified by Andrew Smith (abs249@cornell.edu) - Spring 2012
The linear flow orifice meter was developed in 2008 by the AguaClara team at Cornell University in Ithaca, NY. It maintains a linear relationship between the height of water in the entrance tank and the overall plant flow rate, allowing an operator to easily determine how much water is flowing through the plant at any given time. This task is accomplished by mimicking the theoretical stout weir, as will be described below.
The LFOM made possible the development of an automatic chemical dose controller. This device utilizes the linear relationship between height and flow rate provided by the LFOM, and automatically doses the proper amount of coagulant to water leaving the entrance tank. This eliminates the variability in chemical doses which was previously attributed to plant operators.
Below, we describe the algorithm which designs the AguaClara LFOM and then develop this algorithm using MathCAD code. This code will be integrated into the design tool and used to design LFOM's for all future AguaClara plants.
Spring 2012: Flow through a single LFOM orifice is no longer assumed to be governed by the Bernoulli equation (Q=A*Pi.VenaContractaOrifice*sqrt(2gh)). Now, we use the equation for flow through a partially filled orifice, developed by the USGS
References - used for design/testing purposes only, will be deleted
Variables needed for design - many taken from basic/expert inputs
Taken from the expert inputs file - gives the number of rows in the LFOM. More rows needed if expected plant flow rate is higher - right now, there is no algorithm to do this automatically
An array of zeros - the size of this array is equal to the number of rows in the LFOM pipe.
This will be used extensively in the recursive algorithm which calculates the number of orifices per row.
Center-to-center spacing between LFOM rows
Design constraint: diameter of orifice holes cannot be larger than the height of a single row
1 corresponds with vertical orifices (standard in LFOM)
For larger flows, orifices will be horizontal, so set this value to zero
A typical LFOM riser pipe is shown below:
Image courtesy of: https://confluence.cornell.edu/display/AGUACLARA/LFOM+500+L+per+min
LFOM Orifice: D.LfomOrifice refers to the diameter of a single hole
ND.LfomPipe refers to the diameter of the entire turquoise pipe
H.DMax is taken as the distance between the bottom of the bottom row of orifices and the top of the top row of orifices
Note that variables with the subscript "LFOM pipe" refer to this large "riser pipe" into which all of the orifices have been drilled
Stout weir overview/calculation of proportionality coefficient
A stout weir is a theoretical flow control device in which weir width is proportional to
It is not physically possible to fabricate such a device because the base would be infinitely wide. In practice, the sutro weir serves as a constructable alternative to the stout. As the sutro weir does, we will use a modified version of the stout equation to model flow through the LFOM:
W(z) =
in which W is the weir width, calculated as a function of height
z is the height, with zero defined at the base of the weir
Alpha is found by first solving for the theoretical maximum flow through the LFOM:
flow(height)=
And then dividing the actual flow, Q.Plant by this metric. This will give alpha, which is the coefficient of proportionality
theoretical flow rate predicted by stout equation
coefficient of proportionality between LFOM and sutro weir
Width of LFOM riser pipe as a function of height
Calculation of average velocity in LFOM riser pipe
Average velocity at the bottom of the riser pipe is calculated by weighting the velocity of falling water from each height
Note that the speed of falling water is 0.841 m/s for all linear flow orifice meters of height 20cm, regardless of total plant flow rate. Even for flow rates as low as 3 L/s, we get a percent error of less than 2%. This makes sense given that all flows are scaled by Q.Plant, regardless of how Q.Plant is defined.
Final calculation of LFOM riser pipe diameter
Average velocity at the bottom of the LFOM riser pipe must be slightly greater than what is given by Q.Plant/Area, so we apply a safety factor and solve for the minimum allowable LFOM cross-sectional area and diameter. This safety factor is given in expert inputs.
Also, PVC pipes only come in certain sizes, so we must round up to the nearest available pipe size. This could result in an implicit addition to the given safety factor.
Nominal pipe diameter corresponding to the calculated minimum diameter
Rapid mix pipe and LFOM pipe must be the same size
The top row of orifices controls the rest of the design. We must ensure that the orifice area in the top row is smaller than the theoretical stout weir area, so that at least one orifice can be placed there.
Keep orifices as large as possible to make LFOM construction easier
April 15, 2012: Pi.VenaContracta orifice taken away to avoid "double-applying" the vena contracta coefficient in the orifice equation
A bound on the number of orifices allowed in each row.
The height locations of the center of the orifices.
Note that orifice height in this array is D/2 greater than the height to the orifice bottom. This gives the height of the center of the orifice above each testing location, which is the correct zero level.
The area of each orifice multiplied by the Vena Contracta Coefficient
#RowOut when there is just enough water to submerge row #RowIn. Thus FlowOutSingle(i,i)
must always be positive and nonzero.
Now uses flow through a partially filled orifice equation (http://il.water.usgs.gov/proj/feq/fequtl98.i2h/4_7aupdate.html) to determine flow out of the orifice if it is determined that a vertical orifice is being used. Right now, the orifices are always completely covered. However, if they were partially filled, the same equation could be applied.
Amount of head available at orifice location. Row.In represents the orifice row that is just submerged, and Row.Out represents the orifice row where available head is desired.
Expression for flow through a single LFOM orifice. Calls the Q.orifice equation in the fluids functions file (Q.orificeV in the case of vertical orifices)
Flow from a single, completely filled orifice when the water just covers it - generated from new equation
Flow from a single, completely filled orifice when the water just covers it - generated from old algorithm
This calculates the increase in flow rate achieved by adding a single orifice in the top submerged row.
It will be necessary for the recursive algorithm which chooses how many orifices to place in each row.
This calculate the total flow through the LFOM when the water just submerges the inputed row.
Each cell in Q.LfomOrificeRow.Vector is equal to the amount of total flow when water just submerges the specified row.
If our approximation were perfect and the LFOM gave an exactly linear relationship between height and flow rate, Q.LfomOrificeRow.Target would give the total flow from the LFOM when the specified row is just barely covered with water. Since our approximation is not perfect, however, we will use this array as a basis for error calculations. As described below, we will be running a recursive algorithm that aims to minimize least-square error between our design and the theoretical perfectly linear LFOM.
Note that (N.LfomRows-1) and (i+1) are included to align with MathCAD's format of incrementing. The first row in the LFOM is row 1, but the first entry in a MathCAD array is entry zero.
This is the recursive algorithm that carries out the bulk of the LFOM design work.
At each row, it calculates how many orifices would be needed in order for the LFOM to exactly achieve linear flow (note that this is typically not an integer number).
Because it is not possible to produce an LFOM with fractions of orifices, and because head losses would be different than calculated for a full orifice, we will use Mathcad's floor and ceiling functions to determine what the actual flow would be if we round up or round down.
The algorithm produces several trial LFOM rows (with different numbers of orifices), and tests them in series with all of the other LFOM rows. Whichever configuration most closely approximates linear flow is chosen. The results are then passed to the design tool, which draws the final LFOM design.
Mean square error (MSE) is used to determine how closely a particular LFOM design approximates linear flow. [MSE is calculated by summing the squares of the deviation from Q.LfomOrificeRow.Target]
Note that Q.LfomOrificeAdditional takes the place of incrementHoleonLevel
This returns the mean square error of a given flow array, as compared to Q.LfomOrificeRow.Target (the flows returned from a theoretical, perfectly linear LFOM)
This function will be used in the recursive algorithm below to select between possible LFOM configurations. As discussed above, the recursive algorithm will produce many trial LFOM designs by rounding the ideal number of orifices per row either up or down to an integer number. Each new trial design will be compared with the "incumbent", or existing design, and the design that more closely approximates linear flow will be retained. A smaller mean square error indicates a better fit.
Given a new LFOM configuration, this function first calculates how many additional orifices would be needed in a new row to achieve perfectly linear flow. This is done by dividing the additional flow by the additional flow through single orifice --> this will not produce an integer value. Because of this, the value is rounded down. We can add one to get the "rounded-up" value.
Note that rows 4 and 5 serve as "checks" - we cannot have a negative number of orifices. Also, addition of new orifices cannot result in an illegally high number of total orifices in a given row.
This is the recursive algorithm that carries out our design:
If test designs have already been generated for each row of orifices, run a comparison and return
the design that best approximates linear flow.
If this has not yet happened:
1. Set the number of orifices in the current row equal to the integer number of orifices needed to achieve perfectly linear flow (if ideal number of orifices is not an integer, try both the floor and ceiling of the value).
2. Go back and call the design function for the next level up, testing both the "floor" and "ceiling" values.
3. Return the current best orifice array, based on the calculations described above.
Calculate the final LFOM design by using the Temp.Lfom array defined in the last section and beginning at the zero level (base)
This gives the total flow from the design orifice when water just submerges each row
This function creates an array which can be graphed by adding the point (0,0) and shifting all other values so that the x-value reflects the LFOM row number (rather than the LFOM row number -1)
Uses the Array.Graph function just defined to create graphable flow arrays for our actual LFOM design and the theoretical, perfectly linear design
Outputs the height of the center of each row of orifices, relative to the bottom of the LFOM pipe. Includes the point (0,0)
Incrementing variable which will be used when graphing the results
Percent error between theoretically perfect linear flow and flow through our LFOM
Adjusts output to reflect the fact that percent error cannot be negative