Index: Riskeer/HydraRing/src/Riskeer.HydraRing.Calculation/Data/Input/Piping/PipingCalculationInput.cs =================================================================== diff -u --- Riskeer/HydraRing/src/Riskeer.HydraRing.Calculation/Data/Input/Piping/PipingCalculationInput.cs (revision 0) +++ Riskeer/HydraRing/src/Riskeer.HydraRing.Calculation/Data/Input/Piping/PipingCalculationInput.cs (revision c9adb9ba78be9544433a690fdb9e41560e60bde8) @@ -0,0 +1,188 @@ +// Copyright (C) Stichting Deltares 2019. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer 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 Riskeer.HydraRing.Calculation.Data.Variables; + +namespace Riskeer.HydraRing.Calculation.Data.Input.Piping +{ + /// + /// Container of all data necessary for performing a piping calculation via Hydra-Ring. + /// + public class PipingCalculationInput : ExceedanceProbabilityCalculationInput + { + private readonly double phreaticLevelExitMean; + private readonly double phreaticLevelExitStandardDeviation; + private readonly double waterVolumetricWeight; + private readonly double effectiveThicknessCoverageLayerMean; + private readonly double effectiveThicknessCoverageLayerStandardDeviation; + private readonly double saturatedVolumicWeightOfCoverageLayerMean; + private readonly double saturatedVolumicWeightOfCoverageLayerStandardDeviation; + private readonly double saturatedVolumicWeightOfCoverageLayerShift; + private readonly double upliftModelFactorMean; + private readonly double upliftModelFactorStandardDeviation; + private readonly double dampingFactorExitMean; + private readonly double dampingFactorExitStandardDeviation; + private readonly double seepageLengthMean; + private readonly double seepageLengthCoefficientOfVariation; + private readonly double thicknessAquiferLayerMean; + private readonly double thicknessAquiferLayerStandardDeviation; + private readonly double sandParticlesVolumicWeight; + private readonly double sellmeijerModelFactorMean; + private readonly double sellmeijerModelFactorStandardDeviation; + private readonly double beddingAngle; + private readonly double whitesDragCoefficient; + private readonly double waterKinematicViscosity; + private readonly double darcyPermeabilityMean; + private readonly double darcyPermeabilityCoefficientOfVariation; + private readonly double diameter70Mean; + private readonly double diameter70CoefficientOfVariation; + private readonly double gravity; + private readonly double criticalHeaveGradient; + + /// + /// Creates a new instance of the class. + /// + /// The id of the hydraulic boundary location. + /// The length of the section. + /// The mean of the phreatic level at the exit point. + /// The standard deviation of the phreatic level at the exit point. + /// The volumetric weight of water. + /// The mean of the effective thickness of the coverage layers at the exit point. + /// The standard deviation of the effective thickness of the coverage layers at the exit point. + /// The mean of the volumic weight of the saturated coverage layer. + /// The standard deviation of the volumic weight of the saturated coverage layer. + /// The shift of the volumic weight of the saturated coverage layer. + /// The mean of the distribution used to account for uncertainty in the model for uplift. + /// The standard deviation of the distribution used to account for uncertainty in the model for uplift. + /// The mean of the damping factor at the exit point. + /// The standard deviation of the damping factor at the exit point. + /// The mean of the horizontal distance between entry and exit point. + /// The coefficient of variation of the horizontal distance between entry and exit point. + /// The mean of the total thickness of the aquifer layers at the exit point. + /// The standard deviation of the total thickness of the aquifer layers at the exit point. + /// The (lowerbound) volumic weight of sand grain material of a sand layer under water. + /// The mean of the distribution used to account for uncertainty in the model for Sellmeijer. + /// The standard deviation of the distribution used to account for uncertainty in the model for Sellmeijer. + /// The angle of the force balance representing the amount in which sand grains resist rolling. + /// The White's drag coefficient. + /// The kinematic viscosity of water at 10 °C. + /// The mean of the Darcy-speed with which water flows through the aquifer layer. + /// The coefficient of variation of the Darcy-speed with which water flows through the aquifer layer. + /// The mean of the sieve size through which 70% of the grains of the top part of the aquifer pass. + /// The coefficient of variation of the sieve size through which 70% of the grains of the top part of the aquifer pass. + /// The gravitational acceleration. + /// The critical exit gradient for heave. + public PipingCalculationInput(long hydraulicBoundaryLocationId, + double sectionLength, + double phreaticLevelExitMean, double phreaticLevelExitStandardDeviation, + double waterVolumetricWeight, + double effectiveThicknessCoverageLayerMean, double effectiveThicknessCoverageLayerStandardDeviation, + double saturatedVolumicWeightOfCoverageLayerMean, double saturatedVolumicWeightOfCoverageLayerStandardDeviation, + double saturatedVolumicWeightOfCoverageLayerShift, + double upliftModelFactorMean, double upliftModelFactorStandardDeviation, + double dampingFactorExitMean, double dampingFactorExitStandardDeviation, + double seepageLengthMean, double seepageLengthCoefficientOfVariation, + double thicknessAquiferLayerMean, double thicknessAquiferLayerStandardDeviation, + double sandParticlesVolumicWeight, + double sellmeijerModelFactorMean, double sellmeijerModelFactorStandardDeviation, + double beddingAngle, + double whitesDragCoefficient, + double waterKinematicViscosity, + double darcyPermeabilityMean, double darcyPermeabilityCoefficientOfVariation, + double diameter70Mean, double diameter70CoefficientOfVariation, + double gravity, + double criticalHeaveGradient) + : base(hydraulicBoundaryLocationId) + { + Section = new HydraRingSection(1, sectionLength, double.NaN); + this.phreaticLevelExitMean = phreaticLevelExitMean; + this.phreaticLevelExitStandardDeviation = phreaticLevelExitStandardDeviation; + this.waterVolumetricWeight = waterVolumetricWeight; + this.effectiveThicknessCoverageLayerMean = effectiveThicknessCoverageLayerMean; + this.effectiveThicknessCoverageLayerStandardDeviation = effectiveThicknessCoverageLayerStandardDeviation; + this.saturatedVolumicWeightOfCoverageLayerMean = saturatedVolumicWeightOfCoverageLayerMean; + this.saturatedVolumicWeightOfCoverageLayerStandardDeviation = saturatedVolumicWeightOfCoverageLayerStandardDeviation; + this.saturatedVolumicWeightOfCoverageLayerShift = saturatedVolumicWeightOfCoverageLayerShift; + this.upliftModelFactorMean = upliftModelFactorMean; + this.upliftModelFactorStandardDeviation = upliftModelFactorStandardDeviation; + this.dampingFactorExitMean = dampingFactorExitMean; + this.dampingFactorExitStandardDeviation = dampingFactorExitStandardDeviation; + this.seepageLengthMean = seepageLengthMean; + this.seepageLengthCoefficientOfVariation = seepageLengthCoefficientOfVariation; + this.thicknessAquiferLayerMean = thicknessAquiferLayerMean; + this.thicknessAquiferLayerStandardDeviation = thicknessAquiferLayerStandardDeviation; + this.sandParticlesVolumicWeight = sandParticlesVolumicWeight; + this.sellmeijerModelFactorMean = sellmeijerModelFactorMean; + this.sellmeijerModelFactorStandardDeviation = sellmeijerModelFactorStandardDeviation; + this.beddingAngle = beddingAngle; + this.whitesDragCoefficient = whitesDragCoefficient; + this.waterKinematicViscosity = waterKinematicViscosity; + this.darcyPermeabilityMean = darcyPermeabilityMean; + this.darcyPermeabilityCoefficientOfVariation = darcyPermeabilityCoefficientOfVariation; + this.diameter70Mean = diameter70Mean; + this.diameter70CoefficientOfVariation = diameter70CoefficientOfVariation; + this.gravity = gravity; + this.criticalHeaveGradient = criticalHeaveGradient; + } + + public override HydraRingFailureMechanismType FailureMechanismType { get; } = HydraRingFailureMechanismType.Piping; + + public override int VariableId { get; } = 58; + + public override HydraRingSection Section { get; } + + public override IEnumerable Variables + { + get + { + yield return new NormalHydraRingVariable(42, HydraRingDeviationType.Standard, phreaticLevelExitMean, + phreaticLevelExitStandardDeviation); + yield return new DeterministicHydraRingVariable(43, waterVolumetricWeight); + yield return new LogNormalHydraRingVariable(44, HydraRingDeviationType.Standard, effectiveThicknessCoverageLayerMean, + effectiveThicknessCoverageLayerStandardDeviation); + yield return new LogNormalHydraRingVariable(45, HydraRingDeviationType.Standard, saturatedVolumicWeightOfCoverageLayerMean, + saturatedVolumicWeightOfCoverageLayerStandardDeviation, + saturatedVolumicWeightOfCoverageLayerShift); + yield return new LogNormalHydraRingVariable(46, HydraRingDeviationType.Standard, upliftModelFactorMean, + upliftModelFactorStandardDeviation); + yield return new LogNormalHydraRingVariable(47, HydraRingDeviationType.Standard, dampingFactorExitMean, + dampingFactorExitStandardDeviation); + yield return new LogNormalHydraRingVariable(48, HydraRingDeviationType.Variation, seepageLengthMean, + seepageLengthCoefficientOfVariation); + yield return new LogNormalHydraRingVariable(49, HydraRingDeviationType.Standard, thicknessAquiferLayerMean, + thicknessAquiferLayerStandardDeviation); + yield return new DeterministicHydraRingVariable(50, sandParticlesVolumicWeight + waterVolumetricWeight); + yield return new LogNormalHydraRingVariable(51, HydraRingDeviationType.Standard, sellmeijerModelFactorMean, + sellmeijerModelFactorStandardDeviation); + yield return new DeterministicHydraRingVariable(52, beddingAngle); + yield return new DeterministicHydraRingVariable(53, whitesDragCoefficient); + yield return new DeterministicHydraRingVariable(54, waterKinematicViscosity); + yield return new LogNormalHydraRingVariable(55, HydraRingDeviationType.Variation, darcyPermeabilityMean, + darcyPermeabilityCoefficientOfVariation); + yield return new LogNormalHydraRingVariable(56, HydraRingDeviationType.Variation, diameter70Mean, + diameter70CoefficientOfVariation); + yield return new DeterministicHydraRingVariable(58, gravity); + yield return new DeterministicHydraRingVariable(124, criticalHeaveGradient); + } + } + } +} \ No newline at end of file Fisheye: Tag c9adb9ba78be9544433a690fdb9e41560e60bde8 refers to a dead (removed) revision in file `Riskeer/HydraRing/src/Riskeer.HydraRing.Calculation/Data/Input/PipingCalculationInput.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Riskeer/HydraRing/test/Riskeer.HydraRing.Calculation.Test/Data/Input/Overtopping/OvertoppingCalculationInputTest.cs =================================================================== diff -u -r86594ccd7329d320872573a1d066fe18959d3cea -rc9adb9ba78be9544433a690fdb9e41560e60bde8 --- Riskeer/HydraRing/test/Riskeer.HydraRing.Calculation.Test/Data/Input/Overtopping/OvertoppingCalculationInputTest.cs (.../OvertoppingCalculationInputTest.cs) (revision 86594ccd7329d320872573a1d066fe18959d3cea) +++ Riskeer/HydraRing/test/Riskeer.HydraRing.Calculation.Test/Data/Input/Overtopping/OvertoppingCalculationInputTest.cs (.../OvertoppingCalculationInputTest.cs) (revision c9adb9ba78be9544433a690fdb9e41560e60bde8) @@ -73,7 +73,6 @@ var expectedRingBreakWater = new HydraRingBreakWater(2, 3.3); // Call - var overtoppingCalculationInput = new OvertoppingCalculationInput( hydraulicBoundaryLocationId, sectionNormal, expectedRingProfilePoints, expectedRingForelandPoints, expectedRingBreakWater, Index: Riskeer/HydraRing/test/Riskeer.HydraRing.Calculation.Test/Data/Input/Piping/PipingCalculationInputTest.cs =================================================================== diff -u --- Riskeer/HydraRing/test/Riskeer.HydraRing.Calculation.Test/Data/Input/Piping/PipingCalculationInputTest.cs (revision 0) +++ Riskeer/HydraRing/test/Riskeer.HydraRing.Calculation.Test/Data/Input/Piping/PipingCalculationInputTest.cs (revision c9adb9ba78be9544433a690fdb9e41560e60bde8) @@ -0,0 +1,121 @@ +// Copyright (C) Stichting Deltares 2019. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer 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 Riskeer.HydraRing.Calculation.Data; +using Riskeer.HydraRing.Calculation.Data.Input; +using Riskeer.HydraRing.Calculation.Data.Input.Piping; +using Riskeer.HydraRing.Calculation.Data.Variables; +using Riskeer.HydraRing.Calculation.TestUtil; + +namespace Riskeer.HydraRing.Calculation.Test.Data.Input.Piping +{ + [TestFixture] + public class PipingCalculationInputTest + { + [Test] + public void Constructor_Always_ExpectedValues() + { + // Setup + const int hydraulicBoundaryLocationId = 1000; + const double sectionLength = 22.2; + const double phreaticLevelExitMean = 1.1; + const double phreaticLevelExitStandardDeviation = 2.2; + const double waterVolumetricWeight = 3.3; + const double effectiveThicknessCoverageLayerMean = 4.4; + const double effectiveThicknessCoverageLayerStandardDeviation = 5.5; + const double saturatedVolumicWeightOfCoverageLayerMean = 6.6; + const double saturatedVolumicWeightOfCoverageLayerStandardDeviation = 7.7; + const double saturatedVolumicWeightOfCoverageLayerShift = 8.8; + const double upliftModelFactorMean = 9.9; + const double upliftModelFactorStandardDeviation = 10.0; + const double dampingFactorExitMean = 11.1; + const double dampingFactorExitStandardDeviation = 12.2; + const double seepageLengthMean = 13.3; + const double seepageLengthCoefficientOfVariation = 14.4; + const double thicknessAquiferLayerMean = 15.5; + const double thicknessAquiferLayerStandardDeviation = 16.6; + const double sandParticlesVolumicWeight = 17.7; + const double sellmeijerModelFactorMean = 18.8; + const double sellmeijerModelFactorStandardDeviation = 19.9; + const double beddingAngle = 20.0; + const double whitesDragCoefficient = 21.1; + const double waterKinematicViscosity = 22.2; + const double darcyPermeabilityMean = 23.3; + const double darcyPermeabilityCoefficientOfVariation = 24.4; + const double diameter70Mean = 25.5; + const double diameter70CoefficientOfVariation = 26.6; + const double gravity = 27.7; + const double criticalHeaveGradient = 28.8; + + // Call + var pipingCalculationInput = new PipingCalculationInput( + hydraulicBoundaryLocationId, sectionLength, phreaticLevelExitMean, phreaticLevelExitStandardDeviation, + waterVolumetricWeight, effectiveThicknessCoverageLayerMean, effectiveThicknessCoverageLayerStandardDeviation, + saturatedVolumicWeightOfCoverageLayerMean, saturatedVolumicWeightOfCoverageLayerStandardDeviation, + saturatedVolumicWeightOfCoverageLayerShift, upliftModelFactorMean, upliftModelFactorStandardDeviation, + dampingFactorExitMean, dampingFactorExitStandardDeviation, seepageLengthMean, seepageLengthCoefficientOfVariation, + thicknessAquiferLayerMean, thicknessAquiferLayerStandardDeviation, sandParticlesVolumicWeight, + sellmeijerModelFactorMean, sellmeijerModelFactorStandardDeviation, beddingAngle, whitesDragCoefficient, + waterKinematicViscosity, darcyPermeabilityMean, darcyPermeabilityCoefficientOfVariation, diameter70Mean, + diameter70CoefficientOfVariation, gravity, criticalHeaveGradient); + + // Assert + const int expectedCalculationTypeId = 1; + const int expectedVariableId = 58; + Assert.IsInstanceOf(pipingCalculationInput); + Assert.AreEqual(expectedCalculationTypeId, pipingCalculationInput.CalculationTypeId); + Assert.AreEqual(hydraulicBoundaryLocationId, pipingCalculationInput.HydraulicBoundaryLocationId); + Assert.AreEqual(HydraRingFailureMechanismType.Piping, pipingCalculationInput.FailureMechanismType); + Assert.AreEqual(expectedVariableId, pipingCalculationInput.VariableId); + HydraRingDataEqualityHelper.AreEqual(GetDefaultPipingVariables().ToArray(), pipingCalculationInput.Variables.ToArray()); + Assert.IsNaN(pipingCalculationInput.Beta); + + HydraRingSection hydraRingSection = pipingCalculationInput.Section; + Assert.AreEqual(1, hydraRingSection.SectionId); + Assert.AreEqual(sectionLength, hydraRingSection.SectionLength); + Assert.IsNaN(hydraRingSection.CrossSectionNormal); + } + + private static IEnumerable GetDefaultPipingVariables() + { + yield return new NormalHydraRingVariable(42, HydraRingDeviationType.Standard, 1.1, 2.2); + yield return new DeterministicHydraRingVariable(43, 3.3); + yield return new LogNormalHydraRingVariable(44, HydraRingDeviationType.Standard, 4.4, 5.5); + yield return new LogNormalHydraRingVariable(45, HydraRingDeviationType.Standard, 6.6, 7.7, 8.8); + yield return new LogNormalHydraRingVariable(46, HydraRingDeviationType.Standard, 9.9, 10.0); + yield return new LogNormalHydraRingVariable(47, HydraRingDeviationType.Standard, 11.1, 12.2); + yield return new LogNormalHydraRingVariable(48, HydraRingDeviationType.Variation, 13.3, 14.4); + yield return new LogNormalHydraRingVariable(49, HydraRingDeviationType.Standard, 15.5, 16.6); + yield return new DeterministicHydraRingVariable(50, 17.7 + 3.3); + yield return new LogNormalHydraRingVariable(51, HydraRingDeviationType.Standard, 18.8, 19.9); + yield return new DeterministicHydraRingVariable(52, 20.0); + yield return new DeterministicHydraRingVariable(53, 21.1); + yield return new DeterministicHydraRingVariable(54, 22.2); + yield return new LogNormalHydraRingVariable(55, HydraRingDeviationType.Variation, 23.3, 24.4); + yield return new LogNormalHydraRingVariable(56, HydraRingDeviationType.Variation, 25.5, 26.6); + yield return new DeterministicHydraRingVariable(58, 27.7); + yield return new DeterministicHydraRingVariable(124, 28.8); + } + } +} \ No newline at end of file