internal static PacResults PerformCalculations(Catchment catchment, Catchment preCatchment, Facility facility, HierarchyCategory category, DischargePoint dischargePoint)
{
//Define design storms
RainfallEvent pollutionReduction = RainfallEvent.GetScsOneAEvent("Pollution Reduction", 0.83);
RainfallEvent twoYear = RainfallEvent.GetScsOneAEvent("Two-Year", 2.4);
RainfallEvent fiveYear = RainfallEvent.GetScsOneAEvent("Five-Year", 2.9);
RainfallEvent tenYear = RainfallEvent.GetScsOneAEvent("Ten-Year", 3.4);
RainfallEvent twentyFiveYear = RainfallEvent.GetScsOneAEvent("Twentyfive-Year", 3.9);
PacResults results = new PacResults();
//Calculate hydrographs for the most important design storms
Hydrograph imperviousHydrographPR = SantaBarbaraUrbanHydrograph.CalculateHydrograph
(catchment, pollutionReduction);
Hydrograph imperviousHydrographTwoYear = SantaBarbaraUrbanHydrograph.CalculateHydrograph
(catchment, twoYear);
Hydrograph imperviousHydrographFiveYear = SantaBarbaraUrbanHydrograph.CalculateHydrograph
(catchment, fiveYear);
Hydrograph imperviousHydrographTenYear = SantaBarbaraUrbanHydrograph.CalculateHydrograph
(catchment, tenYear);
Hydrograph imperviousHydrographTwentyfiveYear = SantaBarbaraUrbanHydrograph.CalculateHydrograph
(catchment, twentyFiveYear);
results.PollutionReductionResults =
ReservoirRouter.PerformCalculations(facility, category, catchment, imperviousHydrographPR);
results.PollutionReductionPeakOverflow = results.PollutionReductionResults.PeakOverflow;
results.PollutionReductionTotalOverflowVolume = results.PollutionReductionResults.OverflowVolume;
results.PollutionReductionSurfaceCapacity = results.PollutionReductionResults.PercentSurfaceCapacityUsed;
results.PollutionReductionPercentRockCapacity = results.PollutionReductionResults.PercentRockCapacityUsed;
results.PollutionReductionInflowVolume = results.PollutionReductionResults.InflowVolume;
results.PollutionReductionPeakInflow = results.PollutionReductionResults.PeakInflowRate;
results.TwoYearResults =
ReservoirRouter.PerformCalculations(facility, category, catchment, imperviousHydrographTwoYear);
results.TwoYearPeakOverflow = results.TwoYearResults.PeakOverflow;
results.TwoYearTotalOverflowVolume = results.TwoYearResults.OverflowVolume;
results.TwoYearInflowVolume = results.TwoYearResults.InflowVolume;
results.TwoYearPeakInflow = results.TwoYearResults.PeakInflowRate;
results.FiveYearResults =
ReservoirRouter.PerformCalculations(facility, category, catchment, imperviousHydrographFiveYear);
results.FiveYearPeakOverflow = results.FiveYearResults.PeakOverflow;
results.FiveYearTotalOverflowVolume = results.FiveYearResults.OverflowVolume;
results.FiveYearInflowVolume = results.FiveYearResults.InflowVolume;
results.FiveYearPeakInflow = results.FiveYearResults.PeakInflowRate;
results.TenYearResults =
ReservoirRouter.PerformCalculations(facility, category, catchment, imperviousHydrographTenYear);
results.TenYearPeakOverflow = results.TenYearResults.PeakOverflow;
results.TenYearTotalOverflowVolume = results.TenYearResults.OverflowVolume;
results.TenYearSurfaceCapacity = results.TenYearResults.PercentSurfaceCapacityUsed;
results.TenYearPercentRockCapacity = results.TenYearResults.PercentRockCapacityUsed;
results.TenYearInflowVolume = results.TenYearResults.InflowVolume;
results.TenYearPeakInflow = results.TenYearResults.PeakInflowRate;
results.TwentyfiveYearResults =
ReservoirRouter.PerformCalculations(facility, category, catchment, imperviousHydrographTwentyfiveYear);
results.TwentyfiveYearPeakOverflow = results.TwentyfiveYearResults.PeakOverflow;
results.TwentyfiveYearTotalOverflowVolume = results.TwentyfiveYearResults.OverflowVolume;
results.TwentyfiveYearInflowVolume = results.TwentyfiveYearResults.InflowVolume;
results.TwentyfiveYearPeakInflow = results.TwentyfiveYearResults.PeakInflowRate;
results.TenYearScore = PacScore.NotUsed; // Defaults
results.FlowControlScore = PacScore.NotUsed;
results.TwoYearFlowControlScore = PacScore.NotUsed;
results.FiveYearFlowControlScore = PacScore.NotUsed;
results.TenYearFlowControlScore = PacScore.NotUsed;
results.TwentyfiveYearFlowControlScore = PacScore.NotUsed;
switch (category)
{
case HierarchyCategory.Category1:
case HierarchyCategory.Category2:
results.TenYearScore = results.TenYearPeakOverflow > 0 ? PacScore.Fail : PacScore.Pass;
break;
case HierarchyCategory.Category3:
//Define preliminary catchment runoff results
results.PreDevelopedTwoYearPeakInflow = ReservoirRouter.PerformCalculations(facility, category, preCatchment, SantaBarbaraUrbanHydrograph.CalculateHydrograph(preCatchment, twoYear)).PeakInflowRate;
results.PreDevelopedFiveYearPeakInflow = ReservoirRouter.PerformCalculations(facility, category, preCatchment, SantaBarbaraUrbanHydrograph.CalculateHydrograph(preCatchment, fiveYear)).PeakInflowRate;
results.PreDevelopedTenYearPeakInflow = ReservoirRouter.PerformCalculations(facility, category, preCatchment, SantaBarbaraUrbanHydrograph.CalculateHydrograph(preCatchment, tenYear)).PeakInflowRate;
results.PreDevelopedTwentyfiveYearPeakInflow = ReservoirRouter.PerformCalculations(facility, category, preCatchment, SantaBarbaraUrbanHydrograph.CalculateHydrograph(preCatchment, twentyFiveYear)).PeakInflowRate;
switch (dischargePoint)
{
case DischargePoint.A:
results.FlowControlScore = PacScore.NotUsed;
break;
case DischargePoint.B:
if (results.TwoYearPeakOverflow <= results.PreDevelopedTwoYearPeakInflow / 2)
results.TwoYearFlowControlScore = PacScore.Pass;
else
results.TwoYearFlowControlScore = PacScore.Fail;
if (results.FiveYearPeakOverflow <= results.PreDevelopedFiveYearPeakInflow)
results.FiveYearFlowControlScore = PacScore.Pass;
else
results.FiveYearFlowControlScore = PacScore.Fail;
if (results.TenYearPeakOverflow <= results.PreDevelopedTenYearPeakInflow)
results.TenYearFlowControlScore = PacScore.Pass;
else
results.TenYearFlowControlScore = PacScore.Fail;
if (results.TwentyfiveYearPeakOverflow <= results.PreDevelopedTwentyfiveYearPeakInflow)
results.TwentyfiveYearFlowControlScore = PacScore.Pass;
else
results.TwentyfiveYearFlowControlScore = PacScore.Fail;
if (results.TwoYearPeakOverflow <= results.PreDevelopedTwoYearPeakInflow / 2 &&
results.FiveYearPeakOverflow <= results.PreDevelopedFiveYearPeakInflow &&
results.TenYearPeakOverflow <= results.PreDevelopedTenYearPeakInflow &&
results.TwentyfiveYearPeakOverflow <= results.PreDevelopedTwentyfiveYearPeakInflow)
results.FlowControlScore = PacScore.Pass;
else
results.FlowControlScore = PacScore.Fail;
break;
case DischargePoint.C:
if (results.TwoYearPeakOverflow <= results.PreDevelopedTwoYearPeakInflow)
results.TwoYearFlowControlScore = PacScore.Pass;
else
results.TwoYearFlowControlScore = PacScore.Fail;
if (results.FiveYearPeakOverflow <= results.PreDevelopedFiveYearPeakInflow)
results.FiveYearFlowControlScore = PacScore.Pass;
else
results.FiveYearFlowControlScore = PacScore.Fail;
if (results.TenYearPeakOverflow <= results.PreDevelopedTenYearPeakInflow)
results.TenYearFlowControlScore = PacScore.Pass;
else
results.TenYearFlowControlScore = PacScore.Fail;
if (results.TwoYearPeakOverflow <= results.PreDevelopedTwoYearPeakInflow &&
results.FiveYearPeakOverflow <= results.PreDevelopedFiveYearPeakInflow &&
results.TenYearPeakOverflow <= results.PreDevelopedTenYearPeakInflow)
results.FlowControlScore = PacScore.Pass;
else
results.FlowControlScore = PacScore.Fail;
break;
default:
break;
}
break;
case HierarchyCategory.Category4:
//Define preliminary catchment runoff results
results.PreDevelopedTwoYearPeakInflow = ReservoirRouter.PerformCalculations(facility, category, preCatchment, SantaBarbaraUrbanHydrograph.CalculateHydrograph(preCatchment, twoYear)).PeakInflowRate;
results.PreDevelopedFiveYearPeakInflow = ReservoirRouter.PerformCalculations(facility, category, preCatchment, SantaBarbaraUrbanHydrograph.CalculateHydrograph(preCatchment, fiveYear)).PeakInflowRate;
results.PreDevelopedTenYearPeakInflow = ReservoirRouter.PerformCalculations(facility, category, preCatchment, SantaBarbaraUrbanHydrograph.CalculateHydrograph(preCatchment, tenYear)).PeakInflowRate;
results.PreDevelopedTwentyfiveYearPeakInflow = ReservoirRouter.PerformCalculations(facility, category, preCatchment, SantaBarbaraUrbanHydrograph.CalculateHydrograph(preCatchment, twentyFiveYear)).PeakInflowRate;
if (results.TwentyfiveYearPeakOverflow <= results.PreDevelopedTenYearPeakInflow)
{
results.FlowControlScore = PacScore.Pass;
results.TwentyfiveYearFlowControlScore = PacScore.Pass;
}
else
{
results.FlowControlScore = PacScore.Fail;
results.TwentyfiveYearFlowControlScore = PacScore.Fail;
}
break;
default:
break;
}
results.PollutionReductionScore = results.PollutionReductionResults.PeakSurfaceOverflow > 0 ?
PacScore.Fail : PacScore.Pass;
return results;
}