Index: DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/TestFiles/PipingVoorbeeld1_Sellmeijer4ForcesDesignInputFile.xml =================================================================== diff -u --- DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/TestFiles/PipingVoorbeeld1_Sellmeijer4ForcesDesignInputFile.xml (revision 0) +++ DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/TestFiles/PipingVoorbeeld1_Sellmeijer4ForcesDesignInputFile.xml (revision 1198) @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamPipingSellmeijer4Forces/DamPipingSellmeijer4ForcesKernelWrapperTests.cs =================================================================== diff -u -r1141 -r1198 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamPipingSellmeijer4Forces/DamPipingSellmeijer4ForcesKernelWrapperTests.cs (.../DamPipingSellmeijer4ForcesKernelWrapperTests.cs) (revision 1141) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamPipingSellmeijer4Forces/DamPipingSellmeijer4ForcesKernelWrapperTests.cs (.../DamPipingSellmeijer4ForcesKernelWrapperTests.cs) (revision 1198) @@ -27,11 +27,8 @@ using Deltares.DamEngine.Data.Design; using Deltares.DamEngine.Data.General; using Deltares.DamEngine.Data.General.Results; -using Deltares.DamEngine.Data.Geometry; -using Deltares.DamEngine.Data.Geotechnics; using Deltares.DamEngine.Data.Standard.Calculation; using Deltares.DamEngine.Data.Standard.Logging; -using Deltares.DamEngine.TestHelpers; using Deltares.DamEngine.TestHelpers.Factories; using NUnit.Framework; Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapper.cs =================================================================== diff -u -r1153 -r1198 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapper.cs (.../DamPipingBlighKernelWrapper.cs) (revision 1153) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapper.cs (.../DamPipingBlighKernelWrapper.cs) (revision 1198) @@ -363,6 +363,7 @@ throw new NoNullAllowedException(Resources.DamPipingBlighKernelWrapper_NoInputObjectDefinedForBligh); } } + private static void ThrowWhenKernelOutputNull(DamPipingBlighOutput damPipingBlighOutput) { if (damPipingBlighOutput == null) Index: DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/Deltares.DamEngine.Interface.Tests.csproj =================================================================== diff -u -r1173 -r1198 --- DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/Deltares.DamEngine.Interface.Tests.csproj (.../Deltares.DamEngine.Interface.Tests.csproj) (revision 1173) +++ DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/Deltares.DamEngine.Interface.Tests.csproj (.../Deltares.DamEngine.Interface.Tests.csproj) (revision 1198) @@ -141,6 +141,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijer4Forces/DamPipingSellmeijer4ForcesKernelWrapper.cs =================================================================== diff -u -r1153 -r1198 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijer4Forces/DamPipingSellmeijer4ForcesKernelWrapper.cs (.../DamPipingSellmeijer4ForcesKernelWrapper.cs) (revision 1153) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijer4Forces/DamPipingSellmeijer4ForcesKernelWrapper.cs (.../DamPipingSellmeijer4ForcesKernelWrapper.cs) (revision 1198) @@ -28,6 +28,7 @@ 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; @@ -53,92 +54,107 @@ /// /// Result of the prepare /// - public PrepareResult Prepare(DamKernelInput damKernelInput, int iterationIndex, out IKernelDataInput kernelDataInput, out IKernelDataOutput kernelDataOutput) + public PrepareResult Prepare(DamKernelInput damKernelInput, int iterationIndex, out IKernelDataInput kernelDataInput, + out IKernelDataOutput kernelDataOutput) { - var damOutput = new DamPipingSellmeijer4ForcesOutput() + var damPipingOutput = new DamPipingSellmeijer4ForcesOutput() { FoSp = defaultMaxReturnValue }; - kernelDataOutput = damOutput; + kernelDataOutput = damPipingOutput; if (damKernelInput.SubSoilScenario.SegmentFailureMechanismType == FailureMechanismSystemType.Piping) { var soilProfile1D = damKernelInput.SubSoilScenario.SoilProfile1D; - var surfaceLine = damKernelInput.Location.SurfaceLine; var location = damKernelInput.Location; - double riverLevel = damKernelInput.RiverLevelHigh; + double waterLevel = damKernelInput.RiverLevelHigh; UpliftSituation upliftSituation; - var plLines = PlLinesHelper.CreatePlLinesForPiping(location, soilProfile1D, riverLevel, out upliftSituation); - var upliftLocationDeterminator = new UpliftLocationDeterminator - { - PlLines = plLines, - SoilProfile = soilProfile1D, - SurfaceLine = surfaceLine, - DikeEmbankmentMaterial = location.GetDikeEmbankmentSoil(), - XSoilGeometry2DOrigin = location.XSoilGeometry2DOrigin - }; - var upliftLocationAndResult = upliftLocationDeterminator.GetLocationAndResult(damKernelInput.Location.ModelFactors.UpliftCriterionPiping.Value); - upliftSituation.IsUplift = (upliftLocationAndResult != null); - var xEntry = surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).X; - var xExit = 0.0; - var surfaceLevel = 0.0; - var dCoverLayer = 0.0; - var d70 = 0.0; - var aquiferHeight = 0.0; - var permeabilityKx = 0.0; - double? upliftFactor = null; - if (upliftLocationAndResult != null) - { - xExit = upliftLocationAndResult.X; - surfaceLevel = surfaceLine.Geometry.GetZatX(upliftLocationAndResult.X); - var topLevelAquifer = soilProfile1D.GetLayerWithName(upliftLocationAndResult.LayerWhereUpliftOccuresId).TopLevel; - dCoverLayer = DamPipingHelper.DetermineHeightCoverLayer(topLevelAquifer, surfaceLevel); + var plLines = PlLinesHelper.CreatePlLinesForPiping(location, soilProfile1D, waterLevel, out upliftSituation); + EvaluateUpliftSituation(damKernelInput, out kernelDataInput, plLines, waterLevel, damPipingOutput); + return PrepareResult.Successful; + } + kernelDataInput = null; + return PrepareResult.NotRelevant; + } - var aquiferLayer = SoilProfile1DAquiferLayerCombiner.CombineLayers(soilProfile1D, upliftLocationAndResult.LayerWhereUpliftOccuresId); - d70 = aquiferLayer.D70 * Physics.FactorMeterToMicroMeter; + private static void EvaluateUpliftSituation(DamKernelInput damKernelInput, out IKernelDataInput kernelDataInput, + PlLines plLines, double waterLevel, + DamPipingSellmeijer4ForcesOutput damPipingOutput) + { + const double upliftCriterionTolerance = 0.000000001; + SoilProfile1D soilProfile1D = damKernelInput.SubSoilScenario.SoilProfile1D; + SurfaceLine2 surfaceLine = damKernelInput.Location.SurfaceLine; + Location location = damKernelInput.Location; + UpliftSituation upliftSituation = new UpliftSituation(); + var upliftLocationDeterminator = new UpliftLocationDeterminator + { + PlLines = plLines, + SoilProfile = soilProfile1D, + SurfaceLine = surfaceLine, + DikeEmbankmentMaterial = location.GetDikeEmbankmentSoil(), + XSoilGeometry2DOrigin = location.XSoilGeometry2DOrigin + }; + // 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.Value - upliftCriterionTolerance; + var upliftLocationAndResult = upliftLocationDeterminator.GetLocationAndResult(upliftCriterion); + upliftSituation.IsUplift = (upliftLocationAndResult != null); + var xEntry = surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).X; + var xExit = 0.0; + var surfaceLevel = 0.0; + var dCoverLayer = 0.0; + var d70 = 0.0; + var aquiferHeight = 0.0; + var permeabilityKx = 0.0; + double? upliftFactor = null; + if (upliftLocationAndResult != null) + { + xExit = upliftLocationAndResult.X; + surfaceLevel = surfaceLine.Geometry.GetZatX(upliftLocationAndResult.X); + var topLevelAquifer = soilProfile1D.GetLayerWithName(upliftLocationAndResult.LayerWhereUpliftOccuresId).TopLevel; + dCoverLayer = DamPipingHelper.DetermineHeightCoverLayer(topLevelAquifer, surfaceLevel); - aquiferHeight = aquiferLayer.Height; - permeabilityKx = aquiferLayer.PermeabilityKx; - upliftFactor = upliftLocationAndResult.UpliftFactor; - } - var seepageLength = xExit - xEntry; + var aquiferLayer = SoilProfile1DAquiferLayerCombiner.CombineLayers(soilProfile1D, upliftLocationAndResult.LayerWhereUpliftOccuresId); + d70 = aquiferLayer.D70 * Physics.FactorMeterToMicroMeter; - // 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)." - var referenceLevel = Math.Max(location.PolderLevel, surfaceLevel); + aquiferHeight = aquiferLayer.Height; + permeabilityKx = aquiferLayer.PermeabilityKx; + upliftFactor = upliftLocationAndResult.UpliftFactor; + } + var seepageLength = xExit - xEntry; - Soil inBetweenAquiferlayerSoil = soilProfile1D.BottomAquiferLayer.Soil; - if (soilProfile1D.InBetweenAquiferLayer != null) - { - inBetweenAquiferlayerSoil = soilProfile1D.InBetweenAquiferLayer.Soil; - } + // 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)." + var referenceLevel = Math.Max(location.PolderLevel, surfaceLevel); - kernelDataInput = new DamPipingSellmeijer4ForcesInput() - { - HRiver = riverLevel, - HExit = referenceLevel, - Rc = defaultFluidisationGradient, - DTotal = dCoverLayer, - SeepageLength = seepageLength, - // specific Sellmeijer 4 Forces - WaterViscosity = Physics.WaterViscosity, - WhitesConstant = inBetweenAquiferlayerSoil.WhitesConstant, - BeddingAngle = inBetweenAquiferlayerSoil.BeddingAngle, - D70 = d70, - AquiferHeight = aquiferHeight, - PermeabilityKx = permeabilityKx, - }; - damOutput.ExitPointX = xExit; - damOutput.UpliftFactor = upliftFactor; - damOutput.UpliftSituation = upliftSituation; - return PrepareResult.Successful; + Soil inBetweenAquiferlayerSoil = soilProfile1D.BottomAquiferLayer.Soil; + if (soilProfile1D.InBetweenAquiferLayer != null) + { + inBetweenAquiferlayerSoil = soilProfile1D.InBetweenAquiferLayer.Soil; } - kernelDataInput = null; - return PrepareResult.NotRelevant; + + kernelDataInput = new DamPipingSellmeijer4ForcesInput() + { + HRiver = waterLevel, + HExit = referenceLevel, + Rc = defaultFluidisationGradient, + DTotal = dCoverLayer, + SeepageLength = seepageLength, + // specific Sellmeijer 4 Forces + WaterViscosity = Physics.WaterViscosity, + WhitesConstant = inBetweenAquiferlayerSoil.WhitesConstant, + BeddingAngle = inBetweenAquiferlayerSoil.BeddingAngle, + D70 = d70, + AquiferHeight = aquiferHeight, + PermeabilityKx = permeabilityKx, + }; + damPipingOutput.ExitPointX = xExit; + damPipingOutput.UpliftFactor = upliftFactor; + damPipingOutput.UpliftSituation = upliftSituation; } + /// /// Validates the specified kernel data input. /// @@ -175,25 +191,34 @@ public void Execute(IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, out List messages) { DamPipingSellmeijer4ForcesInput damPipingInput = kernelDataInput as DamPipingSellmeijer4ForcesInput; - if (damPipingInput == null) - { - throw new NoNullAllowedException(Resources.DamPipingSellmeijer4ForcesKernelWrapper_NoInputObjectDefinedForSellmeijer4Forces); - } DamPipingSellmeijer4ForcesOutput damPipingOutput = (DamPipingSellmeijer4ForcesOutput)kernelDataOutput; - if (damPipingOutput == null) - { - throw new NoNullAllowedException(Resources.DamPipingSellmeijer4ForcesKernelWrapper_NoOutputObjectDefinedForSellmeijer4Forces); - } + ThrowWhenKernelInputNull(damPipingInput); + ThrowWhenKernelOutputNull(damPipingOutput); + PerformSingleCalculationSellmeijer4Forces(out messages, damPipingOutput, damPipingInput); + } + + private static void PerformSingleCalculationSellmeijer4Forces(out List messages, DamPipingSellmeijer4ForcesOutput damPipingOutput, + DamPipingSellmeijer4ForcesInput damPipingInput) + { + damPipingOutput.CalculationResult = CalculationResult.NoRun; damPipingOutput.FoSp = defaultMaxReturnValue; messages = new List(); - if (damPipingOutput.UpliftSituation.IsUplift) + try { - var calculator = CreatePipingCalculatorSellmeijer4Forces(kernelDataInput); - calculator.Calculate(); - damPipingOutput.FoSp = calculator.FoSp; - damPipingOutput.Hc = calculator.Hc; - damPipingOutput.CalculationResult = CalculationResult.Succeeded; + if (damPipingOutput.UpliftSituation.IsUplift) + { + var calculator = CreatePipingCalculatorSellmeijer4Forces(damPipingInput); + calculator.Calculate(); + damPipingOutput.FoSp = calculator.FoSp; + damPipingOutput.Hc = calculator.Hc; + damPipingOutput.CalculationResult = CalculationResult.Succeeded; + } } + catch (Exception e) + { + damPipingOutput.CalculationResult = CalculationResult.UnexpectedError; + messages.Add(new LogMessage(LogMessageType.Error, null, e.Message)); + } } private static PipingCalculatorSellmeijer4Forces CreatePipingCalculatorSellmeijer4Forces(IKernelDataInput kernelDataInput) @@ -225,21 +250,16 @@ /// /// The dam kernel input. /// The kernel data output. + /// The design scenario. /// The result message. /// The design results. /// No input or output object defined public void PostProcess(DamKernelInput damKernelInput, IKernelDataOutput kernelDataOutput, DesignScenario designScenario, string resultMessage, out List designResults) { DamPipingSellmeijer4ForcesOutput damPipingOutput = kernelDataOutput as DamPipingSellmeijer4ForcesOutput; - if (damPipingOutput == null) - { - throw new NoNullAllowedException(Resources.DamPipingSellmeijer4ForcesKernelWrapper_NoOutputObjectDefinedForSellmeijer4Forces); - } - if (damKernelInput == null) - { - throw new NoNullAllowedException(Resources.DamPipingSellmeijer4ForcesKernelWrapper_NoInputObjectDefinedForSellmeijer4Forces); - } + ThrowWhenDamKernelInputNull(damKernelInput); + ThrowWhenKernelOutputNull(damPipingOutput); designResults = new List(); var designResult = new DesignResult(damKernelInput.DamFailureMechanismeCalculationSpecification, @@ -271,9 +291,54 @@ /// The messages. /// /// - public ShoulderDesign CalculateDesignAtPoint(DamKernelInput damKernelInput, IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, GeometryPoint point, out List messages) + public ShoulderDesign CalculateDesignAtPoint(DamKernelInput damKernelInput, IKernelDataInput kernelDataInput, + IKernelDataOutput kernelDataOutput, GeometryPoint point, out List messages) { - throw new NotImplementedException(); + messages = new List(); + var damPipingInput = kernelDataInput as DamPipingSellmeijer4ForcesInput; + var damPipingOutput = (DamPipingSellmeijer4ForcesOutput)kernelDataOutput; + ThrowWhenDamKernelInputNull(damKernelInput); + ThrowWhenKernelOutputNull(damPipingOutput); + 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.Value; + double upliftCriterion = location.UpliftCriterionPiping.Value; + // if there is no uplift, then there is no piping so return null + if (upliftLocationAndResult != null) + { + double xEntry = surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).X; + double xExit = upliftLocationAndResult.X; + damPipingInput.SeepageLength = xExit - xEntry; + var 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 + damPipingInput.DTotal = dCoverLayer; + double referenceLevel = Math.Max(location.PolderLevel, point.Z); // point.Z is surfacelevel + damPipingInput.HExit = referenceLevel; + + // Calculate the piping safety factor using the level of the given point + PerformSingleCalculationSellmeijer4Forces(out messages, damPipingOutput, damPipingInput); + + // If too low, then determine required height and length (from uplift) + if (damPipingOutput.FoSp < requiredFoS) + { + // Finally, determine the required shoulderheight + double currentShoulderHeight = upliftLocationAndResult.Z - + surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).Z; + var shoulderDesign = new ShoulderDesign( + upliftLocationAndResult.X - surfaceLine.GetDikeToeInward().X, + currentShoulderHeight + ShoulderDesignHelper.CalculateExtraShoulderHeight(soilProfile, plLines, upliftLocationAndResult, upliftCriterion)); + return shoulderDesign; + } + } + return null; } /// @@ -286,10 +351,18 @@ /// /// if the design was succesful /// - /// - public bool EvaluateDesign(DamKernelInput damKernelInput, IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, out string evaluationMessage) + public bool EvaluateDesign(DamKernelInput damKernelInput, IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, + out string evaluationMessage) { - throw new NotImplementedException(); + var damPipingInput = kernelDataInput as DamPipingSellmeijer4ForcesInput; + var damPipingOutput = (DamPipingSellmeijer4ForcesOutput)kernelDataOutput; + ThrowWhenKernelInputNull(damPipingInput); + ThrowWhenDamKernelInputNull(damKernelInput); + ThrowWhenKernelOutputNull(damPipingOutput); + double fosRequiered = damKernelInput.Location.ModelFactors.RequiredSafetyFactorPiping.Value; + double fosAchieved = damPipingOutput.FoSp; + evaluationMessage = String.Format(Resources.FactorAchievedVsFactorRequired, fosAchieved, fosRequiered); + return (fosAchieved >= fosRequiered); } /// @@ -300,5 +373,29 @@ { return DesignStrategy.ShoulderPerPoint; } + + private static void ThrowWhenKernelInputNull(DamPipingSellmeijer4ForcesInput damPipingInput) + { + if (damPipingInput == null) + { + throw new NoNullAllowedException(Resources.DamPipingSellmeijer4ForcesKernelWrapper_NoInputObjectDefinedForSellmeijer4Forces); + } + } + + private static void ThrowWhenKernelOutputNull(DamPipingSellmeijer4ForcesOutput damPipingOutput) + { + if (damPipingOutput == null) + { + throw new NoNullAllowedException(Resources.DamPipingSellmeijer4ForcesKernelWrapper_NoOutputObjectDefinedForSellmeijer4Forces); + } + } + + private static void ThrowWhenDamKernelInputNull(DamKernelInput damKernelInput) + { + if (damKernelInput == null) + { + throw new NoNullAllowedException(Resources.DamPipingSellmeijer4ForcesKernelWrapper_NoInputObjectDefinedForSellmeijer4Forces); + } + } } } Index: DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/PipingSellmeijer4ForcesTests.cs =================================================================== diff -u -r1161 -r1198 --- DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/PipingSellmeijer4ForcesTests.cs (.../PipingSellmeijer4ForcesTests.cs) (revision 1161) +++ DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/PipingSellmeijer4ForcesTests.cs (.../PipingSellmeijer4ForcesTests.cs) (revision 1198) @@ -20,6 +20,8 @@ // All rights reserved. using System.IO; +using Deltares.DamEngine.Data.General; +using Deltares.DamEngine.Data.Geotechnics; using Deltares.DamEngine.Io; using NUnit.Framework; @@ -75,5 +77,58 @@ Assert.AreEqual(0.0, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.UpliftSituation.Pl4LocationXMinUplift, tolerance); } + [Test] + public void CanPerformBlighDesignWithAdaptionPipingVoorbeeld1() + { + // Based on ".\data\DamEngineTestProjects\PipingVoorbeeld1\PipingSellmeijer4Forces.damx" + // Set Analysis type to "Adapt geometry" + const string fileName = @"TestFiles\PipingVoorbeeld1_Sellmeijer4ForcesDesignInputFile.xml"; + string inputString = File.ReadAllText(fileName); + EngineInterface engineInterface = new EngineInterface(inputString); + Assert.IsNotNull(engineInterface.DamProjectData); + string outputString = engineInterface.Run(); + Assert.IsNotNull(outputString); + var output = DamXmlSerialization.LoadOutputFromXmlString(outputString); + DamProjectData actualDamProjectData = FillDamFromXmlOutput.CreateDamProjectData(output); + SurfaceLine2 redesignedSurfaceLine = actualDamProjectData.DesignCalculations[0].PipingDesignResults.RedesignedSurfaceLine; + Assert.AreEqual(true, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.UpliftSituation.IsUplift); + Assert.AreEqual(1.995, redesignedSurfaceLine.DetermineShoulderHeight(), tolerance); + Assert.AreEqual(66.986, redesignedSurfaceLine.GetDikeLength(), tolerance); + + // ShoulderWidth = X_Kruin binnenberm - X_Insteek binnenberm = 65.01 - 29.01 = 36.0 + // Read from PipingSellmeijer4Forces_Piping_CharacteristicPoints.csv by export surfacelines in Release + Assert.AreEqual(36.0, redesignedSurfaceLine.DetermineShoulderWidth(), tolerance); + + Assert.AreEqual(0.0, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.UpliftSituation.Pl3MinUplift, tolerance); + Assert.AreEqual(0.0, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.UpliftSituation.Pl3HeadAdjusted, tolerance); + Assert.AreEqual(0.0, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.UpliftSituation.Pl3LocationXMinUplift, tolerance); + Assert.AreEqual(0.0, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.UpliftSituation.Pl4MinUplift, tolerance); + Assert.AreEqual(0.0, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.UpliftSituation.Pl4HeadAdjusted, tolerance); + Assert.AreEqual(0.0, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.UpliftSituation.Pl4LocationXMinUplift, tolerance); + + // The ExitPointX in Dam 15.1.2.24738 is (incorrectly) not shown + // ExitPointX = X_Teen dijk binnenwaarts = 76.986 + // Read from PipingSellmeijer4Forces_Piping_CharacteristicPoints.csv by export surfacelines in Release + Assert.AreEqual(76.986, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.ExitPointX, tolerance); + + // The following values are not the same as in the Dam 15.1.2.24738 release + // The final piping calculation at the redesigned situation is done at X = 29.014 (the "insteek van de berm"), + // but it should have been done at X = 76.986 (the "teen van de dijk") + // Found expected values by debugging with Classic + // after change in Classic: upliftLocationDeterminator.GetLocationAndResult(upliftcriterion - 0.000000001) + + // The Factor in Dam 15.1.2.24738 is 2.064, but that is not correct, because that is the value at X = 29.014 + // expected value = 1.312 + Assert.AreEqual(1.312, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.Sellmeijer4ForcesFactor, tolerance); + // The Hcritical in Dam 15.1.2.24738 is 1.25, but that is not correct, because that is the value at X = 29.014 + // expected value = 4.198 + Assert.AreEqual(4.198, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.Sellmeijer4ForcesHcritical, tolerance); + + // The upliftfactor in Dam 15.1.2.24738 is (incorrectly) not shown + // expected value = 0.582 + Assert.AreEqual(0.582, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.UpliftFactor, tolerance); + + } + } }