// Copyright (C) Stichting Deltares 2016. All rights reserved.
//
// This file is part of Ringtoets.
//
// Ringtoets is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
//
// All names, logos, and references to "Deltares" are registered trademarks of
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
using System.Collections.Generic;
using System.Linq;
using Ringtoets.HydraRing.Calculation.Data.Variables;
namespace Ringtoets.HydraRing.Calculation.Data.Input.Structures
{
///
/// Container of all data necessary for performing a low sill based structures closure calculation via Hydra-Ring.
///
public class StructuresClosureLowSillCalculationInput : StructuresClosureCalculationInput
{
private readonly double modelFactorSuperCriticalFlowMean;
private readonly double modelFactorSuperCriticalFlowStandardDeviation;
private readonly double modelFactorSubCriticalFlowMean;
private readonly double modelFactorSubCriticalFlowVariation;
private readonly double thresholdHeightOpenWeirMean;
private readonly double thresholdHeightOpenWeirStandardDeviation;
private readonly double insideWaterLevelMean;
private readonly double insideWaterLevelStandardDeviation;
private readonly double widthFlowAperturesMean;
private readonly double widthFlowAperturesStandardDeviation;
///
/// Creates a new instance of .
///
/// The id of the hydraulic boundary location.
/// The normal of the section.
/// The foreland points.
/// The break water.
/// The gravitational acceleration.
/// The factor of the storm duration for an open structure.
/// The failure probability for an open structure.
/// The reparation failure probability.
/// The number of identical apertures.
/// The mean of the allowed level of increase for storage.
/// The standard deviation of the allowed level of increase for storage.
/// The mean of the model factor storage volume.
/// The standard deviation of the model factor storage volume.
/// The mean of the storage structure area.
/// The variation of the storage structure area.
/// The model factor inflow volume.
/// The mean of the flow width at bottom protection.
/// The standard deviation of the flow width at bottom protection.
/// The mean of the critical overtopping discharge.
/// The variation of the critical overtopping discharge.
/// The failure probability structure with erosion.
/// The mean of the storm duration.
/// The variation of the storm duration.
/// The probability or frequency of an open structure before flooding.
/// The mean of the model factor super critical flow.
/// The standard deviation of the model factor super critical flow.
/// The mean of the model factor sub critical flow.
/// The variation of the model factor sub critical flow.
/// The mean of the threshold height open weir.
/// The standard deviation of the threshold height open weir.
/// The mean of the inside water level.
/// The standard deviation of the inside water level.
/// The mean of the width flow apertures.
/// The standard deviation of the width flow apertures.
public StructuresClosureLowSillCalculationInput(long hydraulicBoundaryLocationId,
double sectionNormal,
IEnumerable forelandPoints,
HydraRingBreakWater breakWater,
double gravitationalAcceleration,
double factorStormDurationOpenStructure,
double failureProbabilityOpenStructure,
double failureProbabilityReparation,
int identicalApertures,
double allowedLevelIncreaseStorageMean, double allowedLevelIncreaseStorageStandardDeviation,
double modelFactorStorageVolumeMean, double modelFactorStorageVolumeStandardDeviation,
double storageStructureAreaMean, double storageStructureAreaVariation,
double modelFactorInflowVolume,
double flowWidthAtBottomProtectionMean, double flowWidthAtBottomProtectionStandardDeviation,
double criticalOvertoppingDischargeMean, double criticalOvertoppingDischargeVariation,
double failureProbabilityStructureWithErosion,
double stormDurationMean, double stormDurationVariation,
double probabilityOrFrequencyOpenStructureBeforeFlooding,
double modelFactorSuperCriticalFlowMean, double modelFactorSuperCriticalFlowStandardDeviation,
double modelFactorSubCriticalFlowMean, double modelFactorSubCriticalFlowVariation,
double thresholdHeightOpenWeirMean, double thresholdHeightOpenWeirStandardDeviation,
double insideWaterLevelMean, double insideWaterLevelStandardDeviation,
double widthFlowAperturesMean, double widthFlowAperturesStandardDeviation)
: base(hydraulicBoundaryLocationId,
sectionNormal,
forelandPoints, breakWater,
gravitationalAcceleration,
factorStormDurationOpenStructure,
failureProbabilityOpenStructure,
failureProbabilityReparation,
identicalApertures,
allowedLevelIncreaseStorageMean, allowedLevelIncreaseStorageStandardDeviation,
modelFactorStorageVolumeMean, modelFactorStorageVolumeStandardDeviation,
storageStructureAreaMean, storageStructureAreaVariation,
modelFactorInflowVolume,
flowWidthAtBottomProtectionMean, flowWidthAtBottomProtectionStandardDeviation,
criticalOvertoppingDischargeMean, criticalOvertoppingDischargeVariation,
failureProbabilityStructureWithErosion,
stormDurationMean, stormDurationVariation,
probabilityOrFrequencyOpenStructureBeforeFlooding)
{
this.modelFactorSuperCriticalFlowMean = modelFactorSuperCriticalFlowMean;
this.modelFactorSuperCriticalFlowStandardDeviation = modelFactorSuperCriticalFlowStandardDeviation;
this.modelFactorSubCriticalFlowMean = modelFactorSubCriticalFlowMean;
this.modelFactorSubCriticalFlowVariation = modelFactorSubCriticalFlowVariation;
this.thresholdHeightOpenWeirMean = thresholdHeightOpenWeirMean;
this.thresholdHeightOpenWeirStandardDeviation = thresholdHeightOpenWeirStandardDeviation;
this.insideWaterLevelMean = insideWaterLevelMean;
this.insideWaterLevelStandardDeviation = insideWaterLevelStandardDeviation;
this.widthFlowAperturesMean = widthFlowAperturesMean;
this.widthFlowAperturesStandardDeviation = widthFlowAperturesStandardDeviation;
}
public override IEnumerable Variables
{
get
{
var variables = base.Variables.ToList();
variables.AddRange(GetVariables());
return variables.OrderBy(v => v.VariableId);
}
}
public override int? GetSubMechanismModelId(int subMechanismId)
{
switch (subMechanismId)
{
case 424:
return 106;
case 425:
return 111;
default:
return null;
}
}
private IEnumerable GetVariables()
{
yield return new NormalHydraRingVariable(62, HydraRingDeviationType.Standard, modelFactorSuperCriticalFlowMean, modelFactorSuperCriticalFlowStandardDeviation);
yield return new NormalHydraRingVariable(64, HydraRingDeviationType.Variation, modelFactorSubCriticalFlowMean, modelFactorSubCriticalFlowVariation);
yield return new NormalHydraRingVariable(65, HydraRingDeviationType.Standard, thresholdHeightOpenWeirMean, thresholdHeightOpenWeirStandardDeviation);
yield return new NormalHydraRingVariable(93, HydraRingDeviationType.Standard, insideWaterLevelMean, insideWaterLevelStandardDeviation);
yield return new NormalHydraRingVariable(106, HydraRingDeviationType.Standard, widthFlowAperturesMean, widthFlowAperturesStandardDeviation);
}
}
}