static void Main(string[] args) { BusMovement testBM = new BusMovement("BusMovement.txt"); HydroZones testHZ = new HydroZones("CityZones.txt"); River testR = new River("Riverinput.txt"); Rainfall testRf = new Rainfall("TestRF.out"); RiverFlow testRFlow = new RiverFlow("TestRFlow.out"); // Test output Console.Write(" Rainfall is: " + testRf.GetcumRF() + "\n"); Console.Write(" Riverflow at Ouse at Skelton is: " + testRFlow.GetFlowOuseSkelton() + "\n"); Console.Write(" Riverflow at Foss at Huntington is: " + testRFlow.GetFlowFossHuntington() + "\n"); Console.Write(" Flow at the furthest downstream node is: " + testR.calcRiverFlow(testHZ, testBM, testRf, testRFlow) + "\n"); }
public double calcRiverFlow(HydroZones HZ, BusMovement BM, Rainfall Rf, RiverFlow RFlow) { double cumArea = 0, cumConc = 0; for (int i = 1; i <= numRiverReaches; i++) { // Get upstream node and check if node exists or not iUpstream = riverReach[i].GetUpstreamReach(); if (iUpstream != 0) { flowUpstream = riverReach[iUpstream].GetFlowAtNode(); } else { // Check to see if need to add other inflows if (i == 1) { // Add in flow for Ouse at Skelton flowUpstream = RFlow.GetFlowOuseSkelton() * 86400; } else if (i == 6) { // Add in flow for Foss at Huntington flowUpstream = RFlow.GetFlowFossHuntington() * 86400; } else { flowUpstream = 0; } } // Get tributary node and check if it exists or not iUpstream = riverReach[i].GetTributaryReach(); if (iUpstream != 0) { flowTributary = riverReach[iUpstream].GetFlowAtNode(); } else { flowTributary = 0; } // Calc inflow from CityZone associated with river reach (if any) numCityZones = riverReach[i].GetNumCZs(); if (numCityZones > 0) { inflowCityZone = 0; for (int iCZs = 1; iCZs <= numCityZones; iCZs++) { int IDCZ = riverReach[i].GetIDCZ(iCZs); inflowCityZone = inflowCityZone + (Rf.GetcumRF() / 1000) * HZ.GetOverallAreaHZ(IDCZ); cumArea = cumArea + HZ.GetUrbanAreaHZ(IDCZ); cumConc = cumConc + BM.GetROEmissions(IDCZ) / HZ.GetUrbanAreaHZ(IDCZ); } } else { inflowCityZone = 0; } // calc flow based on flow from upstream node, tributary, inflow from city zone and any WWTW inflow flowAtNode = flowUpstream + flowTributary + inflowCityZone + riverReach[i].GetFlowWWTW(); riverReach[i].SetFlowAtNode(flowAtNode); } Console.Write(" Cum. Area is : " + cumArea + "\n"); Console.Write(" Cum. Conc is : " + cumConc + "\n"); return(riverReach[numRiverReaches].GetFlowAtNode()); }