Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/WtiPipingBligh/WtiPipingBlighKernelWrapper.cs =================================================================== diff -u --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/WtiPipingBligh/WtiPipingBlighKernelWrapper.cs (revision 0) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/WtiPipingBligh/WtiPipingBlighKernelWrapper.cs (revision 6132) @@ -0,0 +1,403 @@ +// Copyright (C) Stichting Deltares 2024. All rights reserved. +// +// This file is part of the Dam Engine. +// +// The Dam Engine is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero 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 Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero 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 System.Collections.Generic; +using System.Data; +using Deltares.DamEngine.Calculators.DikesDesign; +using Deltares.DamEngine.Calculators.KernelWrappers.Common; +using Deltares.DamEngine.Calculators.KernelWrappers.Interfaces; +using Deltares.DamEngine.Calculators.Properties; +using Deltares.DamEngine.Calculators.Uplift; +using Deltares.DamEngine.Data.Design; +using Deltares.DamEngine.Data.General; +using Deltares.DamEngine.Data.General.PlLines; +using Deltares.DamEngine.Data.General.Results; +using Deltares.DamEngine.Data.Geometry; +using Deltares.DamEngine.Data.Geotechnics; +using Deltares.DamEngine.Data.Standard; +using Deltares.DamEngine.Data.Standard.Calculation; +using Deltares.DamEngine.Data.Standard.Logging; +using Deltares.WTIPiping; +using UpliftLocationAndResult = Deltares.DamEngine.Calculators.Uplift.UpliftLocationAndResult; + +namespace Deltares.DamEngine.Calculators.KernelWrappers.WtiPipingBligh; + +/// +/// Wrapper around Bligh piping kernel +/// +/// +public class WtiPipingBlighKernelWrapper : IKernelWrapper +{ + private const double defaultFluidisationGradient = 0.3; + private const double defaultMaxReturnValue = 90.0; + + /// + /// Create the kernel input. + /// + /// The dam kernel input. + /// The number of the current iteration. + /// The kernel data input. + /// The kernel data output. + /// + /// Result of the preparation + /// + public PrepareResult Prepare(DamKernelInput damKernelInput, int iterationIndex, out IKernelDataInput kernelDataInput, out IKernelDataOutput kernelDataOutput) + { + var damPipingBlighOutput = new WtiPipingBlighOutput + { + CalculationResult = CalculationResult.NoRun, + FoSp = defaultMaxReturnValue + }; + kernelDataOutput = damPipingBlighOutput; + if (damKernelInput.SubSoilScenario.SegmentFailureMechanismType.Value.In(SegmentFailureMechanismType.Piping, SegmentFailureMechanismType.All)) + { + var damPipingBlighInput = new WtiPipingBlighInput(); + + SoilProfile1D soilProfile1D = damKernelInput.SubSoilScenario.SoilProfile1D; + Location location = damKernelInput.Location; + double waterLevel = damKernelInput.RiverLevelHigh; + PlLines plLines = PlLinesHelper.CreatePlLinesForPiping(damKernelInput.TimeStepDateTime, location, soilProfile1D, waterLevel); + if (EvaluateUpliftSituation(damKernelInput, out kernelDataInput, plLines, damPipingBlighInput, waterLevel, damPipingBlighOutput)) + { + return PrepareResult.Successful; + } + } + + kernelDataInput = null; + return PrepareResult.NotRelevant; + } + + /// + /// Validates the kernel data input. + /// + /// The kernel data input. + /// The kernel data output. + /// The messages. + /// + /// Number of errors that prevent a calculation + /// + public int Validate(IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, out List messages) + { + var damPipingBlighOutput = (WtiPipingBlighOutput) kernelDataOutput; + BlighCalculator calculatorBligh = CreateWtiPipingCalculatorBligh(kernelDataInput); + List kernelMessages = calculatorBligh.Validate(); + messages = new List(); + foreach (string stringMessage in kernelMessages) + { + messages.Add(new LogMessage + { + Message = stringMessage, + MessageType = LogMessageType.Error + }); + } + + if (messages.Count > 0) + { + damPipingBlighOutput.CalculationResult = CalculationResult.InvalidInputData; + } + + return messages.Count; + } + + /// + /// Executes the kernel. + /// + /// The kernel data input. + /// The kernel data output. + /// The messages. + /// No input object defined for Bligh + public void Execute(IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, out List messages) + { + var damPipingBlighInput = kernelDataInput as WtiPipingBlighInput; + var damPipingBlighOutput = (WtiPipingBlighOutput) kernelDataOutput; + ThrowWhenKernelInputNull(damPipingBlighInput); + ThrowWhenKernelOutputNull(damPipingBlighOutput); + PerformSingleCalculationBligh(out messages, damPipingBlighOutput, damPipingBlighInput); + } + + /// + /// Fills the design results from the kernel output. + /// + /// The dam kernel input. + /// The kernel data output. + /// The design scenario. + /// The result message. + /// The design results. + /// No output object defined for Bligh + public void PostProcess(DamKernelInput damKernelInput, IKernelDataOutput kernelDataOutput, + DesignScenario designScenario, string resultMessage, + out List designResults) + { + var damPipingBlighOutput = kernelDataOutput as WtiPipingBlighOutput; + ThrowWhenDamKernelInputNull(damKernelInput); + ThrowWhenKernelOutputNull(damPipingBlighOutput); + + designResults = new List(); + var designResult = new DesignResult(damKernelInput.DamFailureMechanismeCalculationSpecification, + designScenario, damKernelInput.SubSoilScenario.SoilProfile1D, null) + { + CalculationResult = damPipingBlighOutput.CalculationResult + }; + var pipingDesignResults = new PipingDesignResults(PipingModelType.Bligh); + designResult.PipingDesignResults = pipingDesignResults; + pipingDesignResults.ResultMessage = resultMessage; + pipingDesignResults.BlighFactor = damPipingBlighOutput.FoSp; + pipingDesignResults.BlighHcritical = damPipingBlighOutput.Hc; + pipingDesignResults.RedesignedSurfaceLine = damKernelInput.Location.SurfaceLine; + pipingDesignResults.UpliftSituation = damPipingBlighOutput.UpliftSituation; + pipingDesignResults.LocalExitPointX = damPipingBlighOutput.ExitPointX; + pipingDesignResults.UpliftFactor = damPipingBlighOutput.UpliftFactor; + designResults.Add(designResult); + } + + /// + /// Calculates the design at point. + /// + /// The dam kernel input. + /// The kernel data input. + /// The kernel data output. + /// The point. + /// The messages. + /// + public ShoulderDesign CalculateDesignAtPoint(DamKernelInput damKernelInput, IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, Point2D point, out List messages) + { + messages = new List(); + var damPipingBlighInput = kernelDataInput as WtiPipingBlighInput; + var damPipingBlighOutput = (WtiPipingBlighOutput) kernelDataOutput; + ThrowWhenDamKernelInputNull(damKernelInput); + ThrowWhenKernelOutputNull(damPipingBlighOutput); + Location location = damKernelInput.Location; + SoilProfile1D soilProfile = damKernelInput.SubSoilScenario.SoilProfile1D; + SurfaceLine2 surfaceLine = damKernelInput.Location.SurfaceLine; + + PlLines plLines; + UpliftLocationAndResult upliftLocationAndResult; + DamPipingHelper.DeterminePlLinesAndUpliftLocation(damKernelInput, point, out plLines, out upliftLocationAndResult); + + double requiredFoS = location.ModelFactors.RequiredSafetyFactorPiping; + double upliftCriterion = location.UpliftCriterionPiping; + // if there is no uplift, then there is no piping so return null + if (upliftLocationAndResult != null) + { + double xEntry = surfaceLine.CharacteristicPoints.GetPoint2D(CharacteristicPointType.DikeToeAtRiver).X; + double xExit = upliftLocationAndResult.X; + damPipingBlighInput.SeepageLength = xExit - xEntry; + double topLevelAquifer = soilProfile.GetLayerWithName(upliftLocationAndResult.LayerWhereUpliftOccuresId).TopLevel; + + // The following 2 parameters are dependent on the position of the point and have to be recalculated for the current point + double dCoverLayer = DamPipingHelper.DetermineHeightCoverLayer(topLevelAquifer, point.Z); // point.Z is surfacelevel + damPipingBlighInput.DTotal = dCoverLayer; + double referenceLevel = Math.Max(location.CurrentScenario.PolderLevel, point.Z); // point.Z is surfacelevel + damPipingBlighInput.HExit = referenceLevel; + + // Calculate the piping safety factor using the level of the given point + PerformSingleCalculationBligh(out messages, damPipingBlighOutput, damPipingBlighInput); + + // If too low, then determine required height and length (from uplift) + if (damPipingBlighOutput.FoSp < requiredFoS) + { + // Finally, determine the required shoulderheight + double currentShoulderHeight = upliftLocationAndResult.Z - + surfaceLine.CharacteristicPoints.GetPoint2D(CharacteristicPointType.DikeToeAtPolder).Z; + var shoulderDesign = new ShoulderDesign( + upliftLocationAndResult.X - surfaceLine.GetDikeToeInward().X, + currentShoulderHeight + ShoulderDesignHelper.CalculateExtraShoulderHeight(soilProfile, plLines, upliftLocationAndResult, upliftCriterion)); + return shoulderDesign; + } + } + + return null; + } + + /// + /// Evaluates the design (current factor greater than desired factor) + /// + /// The dam kernel input. + /// The kernel data input. + /// The kernel data output. + /// The design advise. + /// The evaluation message. + /// + /// if the design was succesful + /// + /// + public bool EvaluateDesign(DamKernelInput damKernelInput, IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, + out DesignAdvise designAdvise, out string evaluationMessage) + { + var damPipingBlighInput = kernelDataInput as WtiPipingBlighInput; + var damPipingBlighOutput = (WtiPipingBlighOutput) kernelDataOutput; + ThrowWhenKernelInputNull(damPipingBlighInput); + ThrowWhenDamKernelInputNull(damKernelInput); + ThrowWhenKernelOutputNull(damPipingBlighOutput); + double fosRequired = damKernelInput.Location.ModelFactors.RequiredSafetyFactorPiping; + double fosAchieved = damPipingBlighOutput.FoSp; + evaluationMessage = String.Format(Resources.FactorAchievedVsFactorRequired, fosAchieved, fosRequired); + designAdvise = DesignAdvise.None; + return (fosAchieved >= fosRequired); + } + + public void PrepareDesign(IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, DamKernelInput damKernelInput, + int iterationIndex, out EmbankmentDesignParameters embankmentDesignParameters) + { + throw new NotImplementedException(); + } + + /// + /// Gets the design strategy + /// + /// + /// + public DesignStrategy GetDesignStrategy(DamKernelInput damKernelInput) + { + return DesignStrategy.ShoulderPerPoint; + } + + private bool EvaluateUpliftSituation(DamKernelInput damKernelInput, out IKernelDataInput kernelDataInput, PlLines plLines, + WtiPipingBlighInput wtiPipingBlighInput, double waterLevel, + WtiPipingBlighOutput wtiPipingBlighOutput) + { + const double upliftCriterionTolerance = 0.000000001; + SoilProfile1D soilProfile1D = damKernelInput.SubSoilScenario.SoilProfile1D; + SurfaceLine2 surfaceLine = damKernelInput.Location.SurfaceLine; + Location location = damKernelInput.Location; + var upliftSituation = new UpliftSituation(); + var upliftLocationDeterminator = new UpliftLocationDeterminator + { + PlLines = plLines, + SoilProfile = soilProfile1D, + SurfaceLine = surfaceLine, + DikeEmbankmentMaterial = location.GetDikeEmbankmentSoil() + }; + // The tolerance is built in because after design it could be that the value that is designed to, is not reached by this margin + double upliftCriterion = location.UpliftCriterionPiping - upliftCriterionTolerance; + UpliftLocationAndResult upliftLocationAndResult = upliftLocationDeterminator.GetLocationAndResult(upliftCriterion); + upliftSituation.IsUplift = (upliftLocationAndResult != null); + double xEntry = surfaceLine.CharacteristicPoints.GetPoint2D(CharacteristicPointType.DikeToeAtRiver).X; + if (upliftLocationAndResult != null) + { + double xExit = upliftLocationAndResult.X; + double surfaceLevel = surfaceLine.Geometry.GetZatX(upliftLocationAndResult.X); + SoilLayer1D heaveLayer = soilProfile1D.GetLayerWithName(upliftLocationAndResult.LayerWhereUpliftOccuresId); + double d70 = Physics.FactorMeterToMicroMeter * heaveLayer.Soil.DiameterD70; + double topLevelAquifer = soilProfile1D.GetLayerWithName(upliftLocationAndResult.LayerWhereUpliftOccuresId).TopLevel; + double dCoverLayer = DamPipingHelper.DetermineHeightCoverLayer(topLevelAquifer, surfaceLevel); + double? upliftFactor = upliftLocationAndResult.UpliftFactor; + double seepageLength = xExit - xEntry; + wtiPipingBlighInput.HRiver = waterLevel; + // Reference level is highest value of surfaceLevel or PolderLevel + // Uit TR Zandmeevoerende wellen (1999): "Het verval dH is gelijk aan het verschil tussen buitenwaterstand (het ontwerppeil(OP)) + // bij zeedijken en de maatgevende hoogwaterstand (MHW bij rivierdijken) en de waterstand binnendijks ter plaatse van het uittredepunt, + // rekening houdend met zeespiegelrijzing etc.(zie paragraaf 3.7.2). In dien ter plaatse van het uittreepunt of de opbarstlocatie + // geen vrije waterstand heerst kan gerekend worden met het maaiveldniveau, rekening houdend met eventuele maaiveld daling (zie paragraaf 3.7.2)." + double referenceLevel = Math.Max(location.CurrentScenario.PolderLevel, surfaceLevel); + kernelDataInput = new WtiPipingBlighInput + { + HRiver = waterLevel, + HExit = referenceLevel, + Rc = defaultFluidisationGradient, + DTotal = dCoverLayer, + SeepageLength = seepageLength, + D70 = d70 + }; + wtiPipingBlighOutput.ExitPointX = xExit; + wtiPipingBlighOutput.UpliftFactor = upliftFactor; + wtiPipingBlighOutput.UpliftSituation = upliftSituation; + return true; + } + + kernelDataInput = new WtiPipingBlighInput(); + return false; + } + + private void PerformSingleCalculationBligh(out List messages, WtiPipingBlighOutput wtiPipingBlighOutput, WtiPipingBlighInput wtiPipingBlighInput) + { + wtiPipingBlighOutput.CalculationResult = CalculationResult.NoRun; + wtiPipingBlighOutput.FoSp = defaultMaxReturnValue; + messages = new List(); + try + { + if (wtiPipingBlighOutput.UpliftSituation.IsUplift) + { + BlighCalculator calculatorBligh = CreateWtiPipingCalculatorBligh(wtiPipingBlighInput); + calculatorBligh.Calculate(); + if (!double.IsPositiveInfinity(calculatorBligh.FoSp)) + { + wtiPipingBlighOutput.FoSp = calculatorBligh.FoSp; + } + wtiPipingBlighOutput.Hc = calculatorBligh.Hc; + wtiPipingBlighOutput.CalculationResult = CalculationResult.Succeeded; + } + } + catch (Exception e) + { + wtiPipingBlighOutput.CalculationResult = CalculationResult.UnexpectedError; + messages.Add(new LogMessage(LogMessageType.Error, null, e.Message)); + } + } + + /// + /// Creates the Bligh piping calculator based on kernel input. + /// + /// The kernel data input. + /// + /// No input object defined for Bligh + private BlighCalculator CreateWtiPipingCalculatorBligh(IKernelDataInput kernelDataInput) + { + var damPipingBlighInput = kernelDataInput as WtiPipingBlighInput; + ThrowWhenKernelInputNull(damPipingBlighInput); + var calculator = new BlighCalculator + { + HRiver = damPipingBlighInput.HRiver, + HExit = damPipingBlighInput.HExit, + Rc = damPipingBlighInput.Rc, + DTotal = damPipingBlighInput.DTotal, + SeepageLength = damPipingBlighInput.SeepageLength, + D50 = 0.81 * damPipingBlighInput.D70 * Physics.FactorMicroMeterToMeter, + ModelFactorPiping = 1 + }; + return calculator; + } + + private void ThrowWhenKernelInputNull(WtiPipingBlighInput wtiPipingBlighInput) + { + if (wtiPipingBlighInput == null) + { + throw new NoNullAllowedException(Resources.DamPipingBlighKernelWrapper_NoInputObjectDefinedForBligh); + } + } + + private void ThrowWhenKernelOutputNull(WtiPipingBlighOutput wtiPipingBlighOutput) + { + if (wtiPipingBlighOutput == null) + { + throw new NoNullAllowedException(Resources.DamPipingBlighKernelWrapper_NoOutputObjectDefinedForBligh); + } + } + + private void ThrowWhenDamKernelInputNull(DamKernelInput damKernelInput) + { + if (damKernelInput == null) + { + throw new NoNullAllowedException(Resources.DamPipingBlighKernelWrapper_NoDamInputObjectDefinedForBligh); + } + } +} \ No newline at end of file Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapperTests.cs =================================================================== diff -u -r5416 -r6132 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapperTests.cs (.../DamPipingBlighKernelWrapperTests.cs) (revision 5416) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapperTests.cs (.../WtiPipingBlighKernelWrapperTests.cs) (revision 6132) @@ -22,7 +22,7 @@ using System.Collections.Generic; using System.Data; using Deltares.DamEngine.Calculators.KernelWrappers.Common; -using Deltares.DamEngine.Calculators.KernelWrappers.DamPipingBligh; +using Deltares.DamEngine.Calculators.KernelWrappers.WtiPipingBligh; using Deltares.DamEngine.Calculators.KernelWrappers.Interfaces; using Deltares.DamEngine.Data.Design; using Deltares.DamEngine.Data.General; @@ -36,7 +36,7 @@ namespace Deltares.DamEngine.Calculators.Tests.KernelWrappers.DamPipingBligh; [TestFixture] -public class DamPipingBlighKernelWrapperTests +public class WtiPipingBlighKernelWrapperTests { [Test] public void TestFullCalculation() @@ -80,7 +80,7 @@ DamFailureMechanismeCalculationSpecification = damFailureMechanismeCalculationSpecification }; - var kernelWrapper = new DamPipingBlighKernelWrapper(); + var kernelWrapper = new WtiPipingBlighKernelWrapper(); // Prepare the wrapper. Result is input for the calculation dll IKernelDataInput damPipingInput; @@ -94,7 +94,7 @@ // Run the dll kernelWrapper.Execute(damPipingInput, kernelDataOutput, out messages); - var damPipingOutput = (DamPipingBlighOutput) kernelDataOutput; + var damPipingOutput = (WtiPipingBlighOutput) kernelDataOutput; Assert.That(messages.Count, Is.EqualTo(0)); Assert.That(damPipingOutput.FoSp, Is.EqualTo(4.5).Within(diff)); Assert.That(damPipingOutput.Hc, Is.EqualTo(2.25).Within(diff)); @@ -161,11 +161,11 @@ RiverLevelHigh = 2.0, DamFailureMechanismeCalculationSpecification = damFailureMechanismeCalculationSpecification }; - var kernelWrapper = new DamPipingBlighKernelWrapper(); + var kernelWrapper = new WtiPipingBlighKernelWrapper(); IKernelDataInput kernelDataInput; IKernelDataOutput kernelDataOutput; kernelWrapper.Prepare(damKernelInput, 0, out kernelDataInput, out kernelDataOutput); - var damPipingInput = (DamPipingBlighInput) kernelDataInput; + var damPipingInput = (WtiPipingBlighInput) kernelDataInput; Assert.That(damPipingInput.HRiver, Is.EqualTo(2.0).Within(diff)); Assert.That(damPipingInput.HExit, Is.EqualTo(0.0).Within(diff)); Assert.That(damPipingInput.Rc, Is.EqualTo(0.3).Within(diff)); @@ -177,17 +177,17 @@ [Test] public void TestValidate() { - var kernelWrapper = new DamPipingBlighKernelWrapper(); + var kernelWrapper = new WtiPipingBlighKernelWrapper(); // Validate without setting values. Expected error messages. - var damPipingInput = new DamPipingBlighInput(); - var damPipingOutput = new DamPipingBlighOutput(); + var damPipingInput = new WtiPipingBlighInput(); + var damPipingOutput = new WtiPipingBlighOutput(); List messages; kernelWrapper.Validate(damPipingInput, damPipingOutput, out messages); Assert.That(messages.Count, Is.GreaterThan(0)); // Validate the input when valid input is provided. Expected no messages. - damPipingInput = new DamPipingBlighInput + damPipingInput = new WtiPipingBlighInput { HRiver = 1.0, HExit = 0.0, @@ -204,7 +204,7 @@ [Test] public void TestPostProcess() { - var kernelWrapper = new DamPipingBlighKernelWrapper(); + var kernelWrapper = new WtiPipingBlighKernelWrapper(); var subSoilScenario = new SoilGeometryProbability { @@ -227,7 +227,7 @@ var upliftSituation = new UpliftSituation(); upliftSituation.IsUplift = true; var calculationResult = CalculationResult.Succeeded; - var output = new DamPipingBlighOutput + var output = new WtiPipingBlighOutput { FoSp = 1.1, Hc = 2.2, @@ -262,7 +262,7 @@ [SetUICulture("nl-NL")] public void TestLanguageNLThrowsExceptionInExecuteWhenInputIsNull() { - var kernelWrapper = new DamPipingBlighKernelWrapper(); + var kernelWrapper = new WtiPipingBlighKernelWrapper(); List messages; Assert.That(() => kernelWrapper.Execute(null, null, out messages), Throws.InstanceOf().With.Message.EqualTo("Geen invoer object gedefinieerd voor Bligh")); } @@ -271,7 +271,7 @@ [SetUICulture("en-US")] public void TestLanguageENThrowsExceptionInExecuteWhenInputIsNull() { - var kernelWrapper = new DamPipingBlighKernelWrapper(); + var kernelWrapper = new WtiPipingBlighKernelWrapper(); List messages; Assert.That(() => kernelWrapper.Execute(null, null, out messages), Throws.InstanceOf().With.Message.EqualTo("No input object defined for Bligh")); } @@ -280,7 +280,7 @@ [SetUICulture("nl-NL")] public void TestThrowsExceptionInPostProcessWhenOutputIsNull() { - var kernelWrapper = new DamPipingBlighKernelWrapper(); + var kernelWrapper = new WtiPipingBlighKernelWrapper(); List results; Assert.That(() => kernelWrapper.PostProcess(new DamKernelInput(), null, null, "", out results), Throws.InstanceOf().With.Message.EqualTo("Geen uitvoer object gedefinieerd voor Bligh")); } @@ -289,8 +289,8 @@ [SetUICulture("nl-NL")] public void TestThrowsExceptionInPostProcessWhenInputIsNull() { - var kernelWrapper = new DamPipingBlighKernelWrapper(); + var kernelWrapper = new WtiPipingBlighKernelWrapper(); List results; - Assert.That(() => kernelWrapper.PostProcess(null, new DamPipingBlighOutput(), null, "", out results), Throws.InstanceOf().With.Message.EqualTo("Geen Dam invoer object gedefinieerd voor Bligh")); + Assert.That(() => kernelWrapper.PostProcess(null, new WtiPipingBlighOutput(), null, "", out results), Throws.InstanceOf().With.Message.EqualTo("Geen Dam invoer object gedefinieerd voor Bligh")); } } \ No newline at end of file Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/WtiPipingBligh/WtiPipingBlighOutput.cs =================================================================== diff -u --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/WtiPipingBligh/WtiPipingBlighOutput.cs (revision 0) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/WtiPipingBligh/WtiPipingBlighOutput.cs (revision 6132) @@ -0,0 +1,81 @@ +// Copyright (C) Stichting Deltares 2024. All rights reserved. +// +// This file is part of the Dam Engine. +// +// The Dam Engine is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero 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 Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero 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 Deltares.DamEngine.Calculators.KernelWrappers.Interfaces; +using Deltares.DamEngine.Data.General; +using Deltares.DamEngine.Data.Standard.Calculation; + +namespace Deltares.DamEngine.Calculators.KernelWrappers.WtiPipingBligh; + +/// +/// Output class for piping Bligh +/// +/// +public class WtiPipingBlighOutput : IKernelDataOutput +{ + /// + /// Gets or sets the calculation result. + /// + /// + /// The calculation result. + /// + public CalculationResult CalculationResult { get; set; } + + /// + /// Gets or sets the safetyfactor for Bligh. + /// + /// + /// The fo sp. + /// + public double FoSp { get; set; } + + /// + /// Gets or sets the H-critical. + /// + /// + /// The hc. + /// + public double Hc { get; set; } + + /// + /// Gets or sets the uplift factor. + /// + /// + /// The uplift factor. + /// + public double? UpliftFactor { get; set; } + + /// + /// Gets or sets the x-coordinate of the exit point. + /// + /// + /// The exit point x. + /// + public double ExitPointX { get; set; } + + /// + /// Gets or sets the uplift situation. + /// + /// + /// The uplift situation. + /// + public UpliftSituation UpliftSituation { get; set; } +} \ No newline at end of file Fisheye: Tag 6132 refers to a dead (removed) revision in file `DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapperTests.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/KernelWrapperHelper.cs =================================================================== diff -u -r4540 -r6132 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/KernelWrapperHelper.cs (.../KernelWrapperHelper.cs) (revision 4540) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/KernelWrapperHelper.cs (.../KernelWrapperHelper.cs) (revision 6132) @@ -20,7 +20,7 @@ // All rights reserved. using System; -using Deltares.DamEngine.Calculators.KernelWrappers.DamPipingBligh; +using Deltares.DamEngine.Calculators.KernelWrappers.WtiPipingBligh; using Deltares.DamEngine.Calculators.KernelWrappers.Interfaces; using Deltares.DamEngine.Calculators.KernelWrappers.MacroStabilityInwards; using Deltares.DamEngine.Calculators.KernelWrappers.MacroStabilityOutwards; @@ -78,7 +78,7 @@ switch (currentSpecification.PipingModelType) { case PipingModelType.Bligh: - kernelWrapper = new DamPipingBlighKernelWrapper(); + kernelWrapper = new WtiPipingBlighKernelWrapper(); break; case PipingModelType.Wti2017: kernelWrapper = new WtiPipingSellmeijerRevisedKernelWrapper(); Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/WtiPipingBligh/WtiPipingBlighInput.cs =================================================================== diff -u --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/WtiPipingBligh/WtiPipingBlighInput.cs (revision 0) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/WtiPipingBligh/WtiPipingBlighInput.cs (revision 6132) @@ -0,0 +1,79 @@ +// Copyright (C) Stichting Deltares 2024. All rights reserved. +// +// This file is part of the Dam Engine. +// +// The Dam Engine is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero 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 Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero 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 Deltares.DamEngine.Calculators.KernelWrappers.Interfaces; + +namespace Deltares.DamEngine.Calculators.KernelWrappers.WtiPipingBligh; + +/// +/// Input parameters for Piping bligh +/// +/// +public class WtiPipingBlighInput : IKernelDataInput +{ + /// + /// Gets or sets the River level . + /// + /// + /// The h river. + /// + public double HRiver { get; set; } + + /// + /// Gets or sets the head at exit point. + /// + /// + /// The h exit. + /// + public double HExit { get; set; } + + /// + /// Gets or sets the reduction factor. + /// + /// + /// The rc. + /// + public double Rc { get; set; } + + /// + /// Gets or sets the total thickness of cover layer . + /// + /// + /// The d total. + /// + public double DTotal { get; set; } + + /// + /// Gets or sets the seepage length. + /// + /// + /// The length of the seepage. + /// + public double SeepageLength { get; set; } + + /// + /// Gets or sets the D70. + /// + /// + /// The D70. + /// + public double D70 { get; set; } +} \ No newline at end of file Fisheye: Tag 6132 refers to a dead (removed) revision in file `DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapper.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 6132 refers to a dead (removed) revision in file `DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighOutput.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 6132 refers to a dead (removed) revision in file `DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighInput.cs'. Fisheye: No comparison available. Pass `N' to diff?