Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/Structures/StructuresClosureLowSillCalculationInput.cs
===================================================================
diff -u
--- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/Structures/StructuresClosureLowSillCalculationInput.cs (revision 0)
+++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/Structures/StructuresClosureLowSillCalculationInput.cs (revision 8efa69259273360cbc69986142938d7e1e826b2a)
@@ -0,0 +1,171 @@
+// 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;
+
+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 modelFactorOvertoppingSupercriticalFlowMean;
+ private readonly double modelFactorOvertoppingSupercriticalFlowStandardDeviation;
+ private readonly double modelFactorSubcriticalFlowMean;
+ private readonly double modelFactorSubcriticalFlowVariation;
+ private readonly double thresholdLowWeirHeightMean;
+ private readonly double thresholdLowWeirHeightStandardDeviation;
+ private readonly double waterLevelInsideMean;
+ private readonly double waterLevelInsideStandardDeviation;
+ private readonly double widthOfFlowAperturesMean;
+ private readonly double widthOfFlowAperturesVariation;
+
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The id of the hydraulic station to use during the calculation.
+ /// The section to use during the calculation.
+ /// The gravitational acceleration to use during the calculation.
+ /// The factor of the storm duration for an open structure to use during the calculation.
+ /// The failure probability for an open structure to use during the calculation.
+ /// The reparation failure probabilty to use during the calculation.
+ /// The identical aperture to use during the calculation.
+ /// The mean of the allowable increase of the level for the storage to use during the calculation.
+ /// The standard deviation of the allowable increase of the level for the storage to use during the calculation.
+ /// The mean of the model factor for the storage volume to use during the calculation.
+ /// The standard deviation of the model factor for the storage volume to use during the calculation.
+ /// The mean of the storage structure area to use during the calculation.
+ /// The variation of the storage structure area to use during the calculation.
+ /// The model factor for incoming flow volume to use during the calculation.
+ /// The mean of the flow width at bottom protection to use during the calculation.
+ /// The standard deviation of the flow width at bottom protection to use during the calculation.
+ /// The mean of the critical overtopping discharge to use during the calculation.
+ /// The variation of the critical overtopping discharge to use during the calculation.
+ /// The failure probability of structure given erosion to use during the calculation.
+ /// The mean of the storm duration to use during the calculation.
+ /// The variation of the storm duration to use during the calculation.
+ /// The propability of an open structure before flooding to use during the calculation.
+ /// The mean of the model factor subcitrical flow to use during the calculation.
+ /// The variation of the model factor subcitrical flow to use during the calculation.
+ /// The mean of the height threshold lo weir to use during the calculation.
+ /// The standard deviation of the height threshold lo weir to use during the calculation.
+ /// The mean of the waterlevel inside to use during the calculation.
+ /// The standard deviation of the waterlevel inside to use during the calculation.
+ /// The mean of the model factor overtopping supercritical flow to use during the calculation.
+ /// The standard deviation of the model factor overtopping supercritical flow to use during the calculation.
+ /// The mean of the width of flow apertures to use during the calculation.
+ /// The variation of the width of flow apertures to use during the calculation.
+ public StructuresClosureLowSillCalculationInput(long hydraulicBoundaryLocationId, HydraRingSection hydraRingSection,
+ double hydraRingGravitationalAcceleration, double hydraRingFactorStormDurationOpenStructure,
+ double hydraRingFailureProbabilityOpenStructure, double hydraRingFailureProbabilityReparation,
+ double hydraRingIdenticalAperture, double hydraRingAllowableIncreaseOfLevelForStorageMean,
+ double hydraRingAllowableIncreaseOfLevelForStorageStandardDeviation, double hydraRingModelFactorForStorageVolumeMean,
+ double hydraRingModelFactorForStorageVolumeStandardDeviation, double hydraRingStorageStructureAreaMean,
+ double hydraRingStorageStructureAreaVariation, double hydraRingModelFactorForIncomingFlowVolume,
+ double hydraRingFlowWidthAtBottomProtectionMean, double hydraRingFlowWidthAtBottomProtectionStandardDeviation,
+ double hydraRingCriticalOvertoppingDischargeMean, double hydraRingCriticalOvertoppingDischargeVariation,
+ double hydraRingFailureProbabilityOfStructureGivenErosion, double hydraRingStormDurationMean,
+ double hydraRingStormDurationVariation, double hydraRingProbabilityOpenStructureBeforeFlooding,
+ double hydraRingModelFactorSubcriticalFlowMean, double hydraRingModelFactorSubcriticalFlowVariation,
+ double hydraRingThresholdLowWeirHeightMean, double hydraRingThresholdLowWeirHeightStandardDeviation,
+ double hydraRingWaterLevelInsideMean, double hydraRingWaterLevelInsideStandardDeviation,
+ double hydraRingModelFactorOvertoppingSupercriticalFlowMean,
+ double hydraRingModelFactorOvertoppingSupercriticalFlowStandardDeviation,
+ double hydraRingWidthOfFlowAperturesMean, double hydraRingWidthOfFlowAperturesVariation)
+ : base(hydraulicBoundaryLocationId, hydraRingSection,
+ hydraRingGravitationalAcceleration, hydraRingFactorStormDurationOpenStructure,
+ hydraRingFailureProbabilityOpenStructure, hydraRingFailureProbabilityReparation,
+ hydraRingIdenticalAperture, hydraRingAllowableIncreaseOfLevelForStorageMean,
+ hydraRingAllowableIncreaseOfLevelForStorageStandardDeviation, hydraRingModelFactorForStorageVolumeMean,
+ hydraRingModelFactorForStorageVolumeStandardDeviation, hydraRingStorageStructureAreaMean,
+ hydraRingStorageStructureAreaVariation, hydraRingModelFactorForIncomingFlowVolume,
+ hydraRingFlowWidthAtBottomProtectionMean, hydraRingFlowWidthAtBottomProtectionStandardDeviation,
+ hydraRingCriticalOvertoppingDischargeMean, hydraRingCriticalOvertoppingDischargeVariation,
+ hydraRingFailureProbabilityOfStructureGivenErosion, hydraRingStormDurationMean,
+ hydraRingStormDurationVariation, hydraRingProbabilityOpenStructureBeforeFlooding)
+ {
+ modelFactorOvertoppingSupercriticalFlowMean = hydraRingModelFactorOvertoppingSupercriticalFlowMean;
+ modelFactorOvertoppingSupercriticalFlowStandardDeviation = hydraRingModelFactorOvertoppingSupercriticalFlowStandardDeviation;
+ modelFactorSubcriticalFlowMean = hydraRingModelFactorSubcriticalFlowMean;
+ modelFactorSubcriticalFlowVariation = hydraRingModelFactorSubcriticalFlowVariation;
+ thresholdLowWeirHeightMean = hydraRingThresholdLowWeirHeightMean;
+ thresholdLowWeirHeightStandardDeviation = hydraRingThresholdLowWeirHeightStandardDeviation;
+ waterLevelInsideMean = hydraRingWaterLevelInsideMean;
+ waterLevelInsideStandardDeviation = hydraRingWaterLevelInsideStandardDeviation;
+ widthOfFlowAperturesMean = hydraRingWidthOfFlowAperturesMean;
+ widthOfFlowAperturesVariation = hydraRingWidthOfFlowAperturesVariation;
+ }
+
+ 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()
+ {
+ // Model factor overtopping supercritical flow
+ yield return new HydraRingVariable(62, HydraRingDistributionType.Normal, double.NaN,
+ HydraRingDeviationType.Standard, modelFactorOvertoppingSupercriticalFlowMean,
+ modelFactorOvertoppingSupercriticalFlowStandardDeviation, double.NaN);
+
+ // Model factor for subcritical flow
+ yield return new HydraRingVariable(64, HydraRingDistributionType.Normal, double.NaN,
+ HydraRingDeviationType.Variation, modelFactorSubcriticalFlowMean,
+ modelFactorSubcriticalFlowVariation, double.NaN);
+
+ // Height of threshold of low weir
+ yield return new HydraRingVariable(65, HydraRingDistributionType.Normal, double.NaN,
+ HydraRingDeviationType.Standard, thresholdLowWeirHeightMean,
+ thresholdLowWeirHeightStandardDeviation, double.NaN);
+
+ // Waterlevel inside
+ yield return new HydraRingVariable(93, HydraRingDistributionType.Normal, double.NaN,
+ HydraRingDeviationType.Standard, waterLevelInsideMean,
+ waterLevelInsideStandardDeviation, double.NaN);
+
+ // Width of flow apertures
+ yield return new HydraRingVariable(106, HydraRingDistributionType.Normal, double.NaN,
+ HydraRingDeviationType.Variation, widthOfFlowAperturesMean,
+ widthOfFlowAperturesVariation, double.NaN);
+ }
+ }
+}
\ No newline at end of file
Fisheye: Tag 8efa69259273360cbc69986142938d7e1e826b2a refers to a dead (removed) revision in file `Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/Structures/StructuresClosureLowThresholdCalculationInput.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Ringtoets.HydraRing.Calculation.csproj
===================================================================
diff -u -r86d6815d711c4fe513664b80b959068c62ae9a2d -r8efa69259273360cbc69986142938d7e1e826b2a
--- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Ringtoets.HydraRing.Calculation.csproj (.../Ringtoets.HydraRing.Calculation.csproj) (revision 86d6815d711c4fe513664b80b959068c62ae9a2d)
+++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Ringtoets.HydraRing.Calculation.csproj (.../Ringtoets.HydraRing.Calculation.csproj) (revision 8efa69259273360cbc69986142938d7e1e826b2a)
@@ -55,7 +55,7 @@
-
+
Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Input/Structures/StructuresClosureLowSillCalculationInputTest.cs
===================================================================
diff -u
--- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Input/Structures/StructuresClosureLowSillCalculationInputTest.cs (revision 0)
+++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Input/Structures/StructuresClosureLowSillCalculationInputTest.cs (revision 8efa69259273360cbc69986142938d7e1e826b2a)
@@ -0,0 +1,143 @@
+// 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 NUnit.Framework;
+using Ringtoets.HydraRing.Calculation.Data;
+using Ringtoets.HydraRing.Calculation.Data.Input.Structures;
+using Ringtoets.HydraRing.Calculation.TestUtil;
+
+namespace Ringtoets.HydraRing.Calculation.Test.Data.Input.Structures
+{
+ [TestFixture]
+ public class StructuresClosureLowSillCalculationInputTest
+ {
+ [Test]
+ public void Constructor_ExpectedValues()
+ {
+ // Setup
+ const int hydraulicBoundaryLocationId = 1000;
+ var hydraRingSection = new HydraRingSection(1, double.NaN, double.NaN);
+
+ const double gravitationalAcceleration = 9.81;
+ const double factorStormDurationOpenStructure = 0.1;
+ const double failureProbabilityOpenStructure = 0.04;
+ const double failureProbabilityReparation = 0.08;
+ const double identicalAperture = 0.4;
+ const double allowableIncreaseOfLevelForStorageMean = 3.3;
+ const double allowableIncreaseOfLevelForStorageStandardDeviation = 0.1;
+ const double modelFactorForStorageVolumeMean = 1.0;
+ const double modelFactorForStorageVolumeStandardDeviation = 0.2;
+ const double storageStructureAreaMean = 4.4;
+ const double storageStructureAreaStandardDeviation = 0.1;
+ const double modelFactorForIncomingFlowVolume = 1;
+ const double flowWidthAtBottomProtectionMean = 5.5;
+ const double flowWidthAtBottomProtectionStandardDeviation = 0.05;
+ const double criticalOvertoppingDischargeMean = 6.6;
+ const double criticalOvertoppingDischargeMeanStandardDeviation = 0.15;
+ const double failureProbabilityOfStructureGivenErosion = 7.7;
+ const double stormDurationMean = 7.5;
+ const double stormDurationStandardDeviation = 0.25;
+ const double probabilityOpenStructureBeforeFlooding = 0.04;
+ const double modelFactorOvertoppingSupercriticalFlowMean = 1.1;
+ const double modelFactorOvertoppingSupercriticalFlowStandardDeviation = 0.3;
+ const double widthOfFlowAperturesMean = 5.4;
+ const double widthOfFlowAperturesVariation = 0.05;
+ const double modelFactorSubcriticalFlowMean = 1.0;
+ const double modelFactorSubcriticalFlowVariation = 0.1;
+ const double thresholdLowWeirHeightMean = 0.7;
+ const double thresholdLowWeirHeightStandardDeviation = 0.1;
+ const double waterLevelInsideMean = 4.3;
+ const double waterLevelInsideStandardDeviation = 0.1;
+
+ // Call
+ var input = new StructuresClosureLowSillCalculationInput(hydraulicBoundaryLocationId, hydraRingSection,
+ gravitationalAcceleration, factorStormDurationOpenStructure,
+ failureProbabilityOpenStructure, failureProbabilityReparation,
+ identicalAperture, allowableIncreaseOfLevelForStorageMean,
+ allowableIncreaseOfLevelForStorageStandardDeviation, modelFactorForStorageVolumeMean,
+ modelFactorForStorageVolumeStandardDeviation, storageStructureAreaMean,
+ storageStructureAreaStandardDeviation, modelFactorForIncomingFlowVolume,
+ flowWidthAtBottomProtectionMean, flowWidthAtBottomProtectionStandardDeviation,
+ criticalOvertoppingDischargeMean, criticalOvertoppingDischargeMeanStandardDeviation,
+ failureProbabilityOfStructureGivenErosion, stormDurationMean,
+ stormDurationStandardDeviation, probabilityOpenStructureBeforeFlooding,
+ modelFactorSubcriticalFlowMean, modelFactorSubcriticalFlowVariation,
+ thresholdLowWeirHeightMean, thresholdLowWeirHeightStandardDeviation,
+ waterLevelInsideMean, waterLevelInsideStandardDeviation,
+ modelFactorOvertoppingSupercriticalFlowMean, modelFactorOvertoppingSupercriticalFlowStandardDeviation,
+ widthOfFlowAperturesMean, widthOfFlowAperturesVariation);
+
+ // Assert
+ Assert.IsInstanceOf(input);
+ Assert.AreEqual(hydraulicBoundaryLocationId, input.HydraulicBoundaryLocationId);
+ Assert.AreEqual(1, input.CalculationTypeId);
+ Assert.AreEqual(65, input.VariableId);
+ Assert.AreEqual(HydraRingFailureMechanismType.StructuresClosure, input.FailureMechanismType);
+ Assert.AreSame(hydraRingSection, input.Section);
+ HydraRingVariableAssert.AreEqual(GetDefaultOvertoppingVariables().ToArray(), input.Variables.ToArray());
+ }
+
+ [Test]
+ [TestCase(423, null)]
+ [TestCase(424, 106)]
+ [TestCase(425, 111)]
+ [TestCase(426, null)]
+ public void GetSubMechanismModelId_Always_ReturnsExpectedValues(int subMechanismModelId, int? expectedSubMechanismModelId)
+ {
+ // Setup
+ var input = new StructuresClosureLowSillCalculationInput(111, new HydraRingSection(1, double.NaN, double.NaN),
+ 1.1, 222, 333, 5.5, 6.6, 7.7, 8.8, 11, 22, 33, 44, 55,
+ 66, 77, 88, 99, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
+ 22, 23, 24, 25);
+
+ // Call
+ int? actualSubmechanismModelId = input.GetSubMechanismModelId(subMechanismModelId);
+
+ // Assert
+ Assert.AreEqual(expectedSubMechanismModelId, actualSubmechanismModelId);
+ }
+
+ private static IEnumerable GetDefaultOvertoppingVariables()
+ {
+ yield return new HydraRingVariable(58, HydraRingDistributionType.Deterministic, 9.81, HydraRingDeviationType.Standard, double.NaN, double.NaN, double.NaN);
+ yield return new HydraRingVariable(62, HydraRingDistributionType.Normal, double.NaN, HydraRingDeviationType.Standard, 1.1, 0.3, double.NaN);
+ yield return new HydraRingVariable(63, HydraRingDistributionType.Deterministic, double.NaN, HydraRingDeviationType.Standard, 0.1, double.NaN, double.NaN);
+ yield return new HydraRingVariable(64, HydraRingDistributionType.Normal, double.NaN, HydraRingDeviationType.Variation, 1, 0.1, double.NaN);
+ yield return new HydraRingVariable(65, HydraRingDistributionType.Normal, double.NaN, HydraRingDeviationType.Standard, 0.7, 0.1, double.NaN);
+ yield return new HydraRingVariable(68, HydraRingDistributionType.Deterministic, 0.04, HydraRingDeviationType.Standard, double.NaN, double.NaN, double.NaN);
+ yield return new HydraRingVariable(69, HydraRingDistributionType.Deterministic, 0.08, HydraRingDeviationType.Standard, double.NaN, double.NaN, double.NaN);
+ yield return new HydraRingVariable(71, HydraRingDistributionType.Deterministic, 0.4, HydraRingDeviationType.Standard, double.NaN, double.NaN, double.NaN);
+ yield return new HydraRingVariable(93, HydraRingDistributionType.Normal, double.NaN, HydraRingDeviationType.Standard, 4.3, 0.1, double.NaN);
+ yield return new HydraRingVariable(94, HydraRingDistributionType.LogNormal, double.NaN, HydraRingDeviationType.Standard, 3.3, 0.1, double.NaN);
+ yield return new HydraRingVariable(95, HydraRingDistributionType.LogNormal, double.NaN, HydraRingDeviationType.Standard, 1.0, 0.2, double.NaN);
+ yield return new HydraRingVariable(96, HydraRingDistributionType.LogNormal, double.NaN, HydraRingDeviationType.Variation, 4.4, 0.1, double.NaN);
+ yield return new HydraRingVariable(97, HydraRingDistributionType.Deterministic, 1, HydraRingDeviationType.Standard, double.NaN, double.NaN, double.NaN);
+ yield return new HydraRingVariable(103, HydraRingDistributionType.Normal, double.NaN, HydraRingDeviationType.Standard, 5.5, 0.05, double.NaN);
+ yield return new HydraRingVariable(104, HydraRingDistributionType.LogNormal, double.NaN, HydraRingDeviationType.Variation, 6.6, 0.15, double.NaN);
+ yield return new HydraRingVariable(105, HydraRingDistributionType.Normal, double.NaN, HydraRingDeviationType.Standard, 7.7, 0, double.NaN);
+ yield return new HydraRingVariable(106, HydraRingDistributionType.Normal, double.NaN, HydraRingDeviationType.Variation, 5.4, 0.05, double.NaN);
+ yield return new HydraRingVariable(108, HydraRingDistributionType.LogNormal, double.NaN, HydraRingDeviationType.Variation, 7.5, 0.25, double.NaN);
+ yield return new HydraRingVariable(129, HydraRingDistributionType.Deterministic, 0.04, HydraRingDeviationType.Standard, double.NaN, double.NaN, double.NaN);
+ }
+ }
+}
\ No newline at end of file
Fisheye: Tag 8efa69259273360cbc69986142938d7e1e826b2a refers to a dead (removed) revision in file `Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Input/Structures/StructuresClosureLowThresholdCalculationInputTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Ringtoets.HydraRing.Calculation.Test.csproj
===================================================================
diff -u -r86d6815d711c4fe513664b80b959068c62ae9a2d -r8efa69259273360cbc69986142938d7e1e826b2a
--- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Ringtoets.HydraRing.Calculation.Test.csproj (.../Ringtoets.HydraRing.Calculation.Test.csproj) (revision 86d6815d711c4fe513664b80b959068c62ae9a2d)
+++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Ringtoets.HydraRing.Calculation.Test.csproj (.../Ringtoets.HydraRing.Calculation.Test.csproj) (revision 8efa69259273360cbc69986142938d7e1e826b2a)
@@ -59,7 +59,7 @@
-
+