"Flow chart of Queen B System The program is"
Flow chart of Queen-B System The program is running on the CR200 in Queen-B basically monitors the encoders every minute and average the values every twenty minutes. Flow is calculated for a twenty-minute period and is accumulated. The accumulated value is compared with a threshold. If reached, water samples are taken in downstream side. The equation for full pipe flow is used and adjusted by a factor if channel flow is present. In this program of CR200 we have Flags as variables only. Flags are used in the following manner: Flag_1 : High to take sample, low does not take sample yet. Is high when manual switch is pressed one time or the accumulated flow threshold is reached. Flag_3 : If the bottle is almost full, stops the sampling. If No_of_samples which is the counter reaches 120, sampling is halted. High to halt sampling. Flag_Trigger: Used to manually Set /Unset Flow mode & Time mode via time mode / Run switch & Telemetry Flag_Time : Used to manually Set / Unset Time mode(A) & Time mode(B) Flag_Reset : Sets High only when Reset / Run switch high. Parameters for Culvert, Constants and Peak of flow used to calculate threshold are entered in Program as Constant Variables in program. The chart flow, formulas used to calculate flow and calculation of threshold are included below: Description of Program Modes (1) Flow mode: Take samples based on Flow threshold. (2) Time mode: Time mode has too sub modes. (i) Time mode(A): Takes samples based on Time > Time Threshold (ii) Time mode(B): Takes samples based on HWE, TWE > Ditch_Elev (3) Reset / Run mode: For resetting the No of sample. TABLE 1 , Running interval = 10 sec Count rain pulses Rain_acc Is manual sample switch pressed once & does Single- No Ended Channel-1(SE-1) set to high? Yes Flag_1 High. Reset No_of_samples counter. Flag_3 low Yes Is Time mode/Run pressed once & does No Single ended channel- 2(SE-2) set to high Yes Switch to Time mode Flag_Trigger = 1 Flag_Time = 0 Flag_Reset=0 Flag_1 high? No Is one minute? Yes Read encoders Yes No Yes Upaccum+reading Flag_3 high? Is bottle full? End Yes Dnaccum+reading Are readings<35ft End Upcount+1 No Dncount+1 No Call Subroutine 2 to take sample? End End End Table-2: Running Interval = 20 minutes Call Subroutine-1 to calculate flow & accumulated flow Declare constants for setting culvert offsets Call Subroutine 7 to calculate decimal day Flag_Trigger high? No Flag_Time low? Yes 0 min into 6 hr interval? No Yes Flag_1 high Acc_qh1 = 0 Counter = 0 Set accumulated flow threshold Q_kt Output to storage area Is Flag_Trigger = Low? No Is Flag_Trigger = High? Yes Is accumulated Is Flag_Time=High? No flow>=threshold? End Yes Flag_1 High Reset Flag_1 High accumulate flow Reset accumulated flow End End Total Capacity of Reservoir = 19000 ml Volume per sample = 150 ml Total samples to fill reservoir = 19000 ml / 150 ml = 127 If one week between samples in reservoir retrieval, the time between samples is: Day *24hours*60min/127 = 80 min Note: Day is a variable No. of day divided by system administrator In this case Day = 7 day (one week) The peak of flow expected in ONE culvert has to be entered in the parameter Flow Peak in the CR200 program. As an example with a Flow Peak of 7cfs, the total volume through the pipe is: 7 cfs * 80 min * 60 sec = 33,600cf This would be the accumulated Q threshold. However we have to set threshold in q (cfs) as the accumulated volume Q might be higher in magnitude than permitted in the CR10 final storage, which are 99999. Table-2 which measures flow runs every 1200 sec. The accumulated flow reached with this volume would be: 33.600 cf / 1200 sec = 28 cfs Manual retrieval of samples should be done when No_of_samples is close to 120. SUBROUTINE 1 : Calculates average HWE and TWE during execution interval (20 minutes), calculates average flow and stores it into FLOW20MIN, calculates accumulated flow, stores it into ACC_qh1. The encoder reading has been accumulated in upaccum and dnaccum from Table 1.If TWE is less than 28.9 ft, there is no flow in the channel due to the physical characteristics of the terrain. Upencoder delivered No HWE = 0 valid measurements? Yes No Dnencoder delivered TWE=0 End End valid measurements? Yes HWE=AVG upaccum Reset uppaccum TWE=AVG dnaccum Reset dnaccum Is TWE > 28.9 ft? No FLOW20MIN = 0 End Yes Perform all calculations of subroutine-3, calculation of FLOW20MIN ACC_qh1 = ACC_qh1+ FLOW20MIN End SUBROUTINE 2 : This subroutine is used to take water samples from downstream. Ex1=downstream small pump Ex2=downstream bilge pump No Is Ex-2 high?Dnstream No Ex-1 high? Small Yes Is 7 min in 8 min No Is 0 min in 8 min End Interval? bilge pump running? dnstream pump interval? running? Yes Yes Yes No Ex-2 high. Activate Ex-1 low. Stop Dnstream bilge pump End dnstream small pump. Is 4 min in 8 min No interval? End Yes Flag_1 low. No_of_samples + 1 Ex-1 high. Activate small dnstream pump Is 6 min in 8 min No No End No_of_samples No interval? End >= 120? Yes Ex-2 low. Stop Flag_3 High dnstream bilge pump End End SUBROUTINE 3: (Which is already included in SUBROUTINE 1, It does not physically exist in program.) Calculate Flow based on HWE and TWE. Output in Working_Q Is HWE = TWE ? Yes No flow. Working_Q = 0 End No HWE < TWE ? Yes Backflow. E Working_Q = 0 End No Calculate Total Area, perimeter of culvert HW =HWE – HWELEV TW = TWE – TWELEV Calculate flow with full pipe formula TW < Diameter? No End Working_Q Yes Calculate qfract Working_Q = Working_Q * qfract End FULL PIPE FLOW FORMULA 64.4( HWE − TWE ) q = π ⋅ r2 KF + KE + 1 KE = K KF = 29.1 ξ 2 L / (0.25 D) 1.333 L = Length of Culvert D = Diameter of Culvert KE = K as we do not expect the case where Inlet is un-submerged and outlet submerged. Both sides the Culvert will be submerged if outlet is submerged. Adjustment factor for channel flow Qfract = 0.0043 – 0.2857 D + 4.7431 D2 - 7.5127 D3 + 8.3438 D4 - 4.2713 D5 D = TW / Diameter of Culvert SUBROUTINE 9 : ( It does not physically exist in program) Enter values by declaring constants Dia_1 = diameter of culvert Dia_2 = diameter of culvert B_elev = base elevation Length_1 = length of culvert Flow_Peak = peak of flow for ONE culvert Const1_49 = 1.49 Pi = 3.1416 Manning = 0.024 K = 0.7 SUBROUTINE 7: Store year, day, hr, min and seconds SUBROUTINE 79 : Enter Offsets Upoffset = upstream culvert offset Upsgoff = upstream staff gauge offset Dnoffset = downstream culvert offset Dnsgoff = downstream staff gauge offset Hwelev = elevation of bottom of upstream culvert Twelev = elevation of bottom of downstream culvert HWOFFSET = UPOFFSET + UPSGOFF ‘This is the total offset to add to the encoder output TWOFFSET = DNOFFSET + DNSGOFF ‘This is the total offset to add to the encoder output