// 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; using Core.Common.Base; using Core.Common.Base.Data; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.Probabilistics; using RingtoetsCommonDataResources = Ringtoets.Common.Data.Properties.Resources; namespace Ringtoets.ClosingStructures.Data { public class ClosingStructuresInput : Observable, ICalculationInput { private readonly NormalDistribution modelFactorSuperCriticalFlow; private readonly NormalDistribution thresholdLowWeirHeight; private readonly NormalDistribution drainCoefficient; private readonly LogNormalDistribution areaFlowApertures; private readonly NormalDistribution levelCrestOfStructureNotClosing; private readonly NormalDistribution waterLevelInside; private readonly LogNormalDistribution storageStructureArea; private readonly LogNormalDistribution allowableIncreaseOfLevelForStorage; private readonly LogNormalDistribution flowWidthAtBottomProtection; private readonly NormalDistribution widthOfFlowApertures; private readonly LogNormalDistribution stormDuration; private readonly LogNormalDistribution criticalOverToppingDischarge; private RoundedDouble orientationOfTheNormalOfTheStructure; private RoundedDouble factorStormDurationOpenStructure; private double failureProbablityOpenStructure; private double failureProbabilityReparation; private double failureProbabilityOfStructureGivenErosion; private double probabilityOpenStructureBeforeFlooding; private RoundedDouble wavedirectionDeviation; public ClosingStructuresInput() { orientationOfTheNormalOfTheStructure = new RoundedDouble(2); factorStormDurationOpenStructure = new RoundedDouble(2); wavedirectionDeviation = new RoundedDouble(2); probabilityOpenStructureBeforeFlooding = 1.0; modelFactorSuperCriticalFlow = new NormalDistribution(2) { Mean = (RoundedDouble) 1.1, StandardDeviation = (RoundedDouble) 0.03 }; thresholdLowWeirHeight = new NormalDistribution(2) { Mean = (RoundedDouble) double.NaN, StandardDeviation = (RoundedDouble) 0.1 }; drainCoefficient = new NormalDistribution(2) { Mean = (RoundedDouble) 1, StandardDeviation = (RoundedDouble) 0.2 }; areaFlowApertures = new LogNormalDistribution(2) { Mean = (RoundedDouble) double.NaN, StandardDeviation = (RoundedDouble) 0.01 }; levelCrestOfStructureNotClosing = new NormalDistribution(2) { Mean = (RoundedDouble) double.NaN, StandardDeviation = (RoundedDouble) 0.05 }; waterLevelInside = new NormalDistribution(2) { Mean = (RoundedDouble) double.NaN, StandardDeviation = (RoundedDouble) 0.1 }; allowableIncreaseOfLevelForStorage = new LogNormalDistribution(2) { Mean = (RoundedDouble) double.NaN, StandardDeviation = (RoundedDouble) 0.1 }; storageStructureArea = new LogNormalDistribution(2) { Mean = (RoundedDouble) double.NaN, StandardDeviation = (RoundedDouble) 0.1 }; flowWidthAtBottomProtection = new LogNormalDistribution(2) { Mean = (RoundedDouble) double.NaN, StandardDeviation = (RoundedDouble) 0.05 }; widthOfFlowApertures = new NormalDistribution(2) { Mean = (RoundedDouble) double.NaN, }; widthOfFlowApertures.SetStandardDeviationFromVariationCoefficient(0.05); criticalOverToppingDischarge = new LogNormalDistribution(2) { Mean = (RoundedDouble) double.NaN }; criticalOverToppingDischarge.SetStandardDeviationFromVariationCoefficient(0.15); stormDuration = new LogNormalDistribution(2) { Mean = (RoundedDouble) 7.5 }; stormDuration.SetStandardDeviationFromVariationCoefficient(0.25); } #region Structure type /// /// Gets or sets the type of closing structure. /// public ClosingStructureType ClosingStructureType { get; set; } #endregion #region Deterministic inputs /// /// Gets or sets the storm duration for an open structure. /// public RoundedDouble FactorStormDurationOpenStructure { get { return factorStormDurationOpenStructure; } set { factorStormDurationOpenStructure = value.ToPrecision(factorStormDurationOpenStructure.NumberOfDecimalPlaces); } } /// /// Gets or sets the orientation of the normal of the structure. /// public RoundedDouble OrientationOfTheNormalOfTheStructure { get { return orientationOfTheNormalOfTheStructure; } set { orientationOfTheNormalOfTheStructure = value.ToPrecision(orientationOfTheNormalOfTheStructure.NumberOfDecimalPlaces); } } /// /// Gets or sets the identical apertures to use during the calculation. /// public int IdenticalAperture { get; set; } /// /// Gets or sets the failure probability of an open structure. /// /// Thrown when the value of the probability /// is not between [0, 1]. public double FailureProbabilityOpenStructure { get { return failureProbablityOpenStructure; } set { if (value < 0 || value > 1) { throw new ArgumentException(RingtoetsCommonDataResources.FailureProbability_Value_needs_to_be_between_0_and_1); } failureProbablityOpenStructure = value; } } /// /// Gets or sets the reparation failure probability. /// /// Thrown when the value of the probability /// is not between [0, 1]. public double FailureProbablityReparation { get { return failureProbabilityReparation; } set { if (value < 0 || value > 1) { throw new ArgumentException(RingtoetsCommonDataResources.FailureProbability_Value_needs_to_be_between_0_and_1); } failureProbabilityReparation = value; } } /// /// Gets or sets the failure probability of structure given erosion. /// /// Thrown when the value of the probability /// is not between [0, 1]. public double FailureProbabilityOfStructureGivenErosion { get { return failureProbabilityOfStructureGivenErosion; } set { if (value < 0 || value > 1) { throw new ArgumentException(RingtoetsCommonDataResources.FailureProbability_Value_needs_to_be_between_0_and_1); } failureProbabilityOfStructureGivenErosion = value; } } /// /// Gets and sets the deviation of the wave direction. /// public RoundedDouble WavedirectionDeviation { get { return wavedirectionDeviation; } set { wavedirectionDeviation = value.ToPrecision(wavedirectionDeviation.NumberOfDecimalPlaces); } } /// /// Gets or sets the failure probability of an open structure before flooding. /// /// Thrown when the value of the probability /// is not between [0, 1]. public double ProbabilityOpenStructureBeforeFlooding { get { return probabilityOpenStructureBeforeFlooding; } set { if (value < 0 || value > 1) { throw new ArgumentException(RingtoetsCommonDataResources.FailureProbability_Value_needs_to_be_between_0_and_1); } probabilityOpenStructureBeforeFlooding = value; } } #endregion #region Probabilistic inputs /// /// Gets the drain coefficient normal distribution and sets the the drain coefficient mean. /// public NormalDistribution DrainCoefficient { get { return drainCoefficient; } set { drainCoefficient.Mean = value.Mean; } } /// /// Gets the model factor super critical flow normal distribution and sets the mean. /// public NormalDistribution ModelFactorSuperCriticalFlow { get { return modelFactorSuperCriticalFlow; } set { modelFactorSuperCriticalFlow.Mean = value.Mean; } } /// /// Gets the threshold low weir height normal distribution and sets the threshold low weir height mean. /// public NormalDistribution ThresholdLowWeirHeight { get { return thresholdLowWeirHeight; } set { thresholdLowWeirHeight.Mean = value.Mean; } } /// /// Gets and sets the area flow apertures normal distribution. /// public LogNormalDistribution AreaFlowApertures { get { return areaFlowApertures; } set { areaFlowApertures.Mean = value.Mean; areaFlowApertures.StandardDeviation = value.StandardDeviation; } } /// /// Gets or sets the level crest of structure not closing normal distribution. /// public NormalDistribution LevelCrestOfStructureNotClosing { get { return levelCrestOfStructureNotClosing; } set { levelCrestOfStructureNotClosing.Mean = value.Mean; levelCrestOfStructureNotClosing.StandardDeviation = value.StandardDeviation; } } /// /// Gets or sets the water level inside normal distribution. /// public NormalDistribution WaterLevelInside { get { return waterLevelInside; } set { waterLevelInside.Mean = value.Mean; waterLevelInside.StandardDeviation = value.StandardDeviation; } } /// /// Gets or sets the allowable increase of level for storage log normal distribution. /// public LogNormalDistribution AllowableIncreaseOfLevelForStorage { get { return allowableIncreaseOfLevelForStorage; } set { allowableIncreaseOfLevelForStorage.Mean = value.Mean; allowableIncreaseOfLevelForStorage.StandardDeviation = value.StandardDeviation; } } /// /// Gets or sets the storage structure area log normal distribution. /// public LogNormalDistribution StorageStructureArea { get { return storageStructureArea; } set { storageStructureArea.Mean = value.Mean; storageStructureArea.StandardDeviation = value.StandardDeviation; } } /// /// Gets or sets the flow widt at bottom protection log normal distribution. /// public LogNormalDistribution FlowWidthAtBottomProtection { get { return flowWidthAtBottomProtection; } set { flowWidthAtBottomProtection.Mean = value.Mean; flowWidthAtBottomProtection.StandardDeviation = value.StandardDeviation; } } /// /// Gets or sets the width of flow apertures normal distribution. /// public NormalDistribution WidthOfFlowApertures { get { return widthOfFlowApertures; } set { widthOfFlowApertures.Mean = value.Mean; widthOfFlowApertures.StandardDeviation = value.StandardDeviation; } } /// /// Gets or sets the critical overtopping discharge. /// public LogNormalDistribution CriticalOverToppingDischarge { get { return criticalOverToppingDischarge; } set { criticalOverToppingDischarge.Mean = value.Mean; criticalOverToppingDischarge.StandardDeviation = value.StandardDeviation; } } /// /// Gets the storm duration log normal distribution and sets the storm duration mean. /// public LogNormalDistribution StormDuration { get { return stormDuration; } set { stormDuration.Mean = value.Mean; } } #endregion } }