Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijerVnk/DamPipingSellmeijerVnkKernelWrapper.cs =================================================================== diff -u -r1217 -r1237 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijerVnk/DamPipingSellmeijerVnkKernelWrapper.cs (.../DamPipingSellmeijerVnkKernelWrapper.cs) (revision 1217) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijerVnk/DamPipingSellmeijerVnkKernelWrapper.cs (.../DamPipingSellmeijerVnkKernelWrapper.cs) (revision 1237) @@ -33,6 +33,7 @@ using Deltares.DamEngine.Calculators.DikesDesign; using Deltares.DamEngine.Calculators.Properties; using Deltares.DamEngine.Data.Design; +using Deltares.DamEngine.Data.General.PlLines; using Deltares.DamEngine.Data.Geometry; using Deltares.DamEngine.Data.Standard.Calculation; @@ -55,98 +56,113 @@ /// public PrepareResult Prepare(DamKernelInput damKernelInput, int iterationIndex, out IKernelDataInput kernelDataInput, out IKernelDataOutput kernelDataOutput) { - var damOutput = new DamPipingSellmeijerVnkOutput() + var damPipingOutput = new DamPipingSellmeijerVnkOutput() { 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, + var plLines = PlLinesHelper.CreatePlLinesForPiping(location, soilProfile1D, waterLevel, damKernelInput.DamFailureMechanismeCalculationSpecification.AssessmentScenarioJobSettings.HydraulicShortcutType, out upliftSituation); - var upliftLocationDeterminator = new UpliftLocationDeterminator - { - PlLines = plLines, - SoilProfile = soilProfile1D, - SurfaceLine = surfaceLine, - DikeEmbankmentMaterial = location.GetDikeEmbankmentSoil(), - XSoilGeometry2DOrigin = location.XSoilGeometry2DOrigin - }; - var upliftLocationAndResult = upliftLocationDeterminator.GetLocationAndResult(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 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); + EvaluateUpliftSituation(damKernelInput, out kernelDataInput, plLines, waterLevel, damPipingOutput); + return PrepareResult.Successful; + } + kernelDataInput = null; + return PrepareResult.NotRelevant; + } - var aquiferLayer = SoilProfile1DAquiferLayerCombiner.CombineLayers(soilProfile1D, upliftLocationAndResult.LayerWhereUpliftOccuresId); + private static void EvaluateUpliftSituation(DamKernelInput damKernelInput, out IKernelDataInput kernelDataInput, + PlLines plLines, double waterLevel, DamPipingSellmeijerVnkOutput damPipingOutput) + { + const double upliftCriterionTolerance = 0.000000001; + var soilProfile1D = damKernelInput.SubSoilScenario.SoilProfile1D; + var surfaceLine = damKernelInput.Location.SurfaceLine; + var location = damKernelInput.Location; + var 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 + var 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 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); - permeabilityKx = aquiferLayer.PermeabilityKx; - upliftFactor = upliftLocationAndResult.UpliftFactor; - } - var seepageLength = xExit - xEntry; + var aquiferLayer = SoilProfile1DAquiferLayerCombiner.CombineLayers(soilProfile1D, + upliftLocationAndResult.LayerWhereUpliftOccuresId); - // 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); + permeabilityKx = aquiferLayer.PermeabilityKx; + upliftFactor = upliftLocationAndResult.UpliftFactor; + } - Soil inBetweenAquiferlayerSoil = soilProfile1D.BottomAquiferLayer.Soil; - double inBetweenAquiferlayerHeight; - var bottomAquiferlayerHeight = soilProfile1D.GetLayerHeight(soilProfile1D.BottomAquiferLayer); - if (soilProfile1D.InBetweenAquiferLayer != null) - { - inBetweenAquiferlayerSoil = soilProfile1D.InBetweenAquiferLayer.Soil; - inBetweenAquiferlayerHeight = soilProfile1D.GetLayerHeight(soilProfile1D.InBetweenAquiferLayer); - } - else - { - bottomAquiferlayerHeight = bottomAquiferlayerHeight / 2; - inBetweenAquiferlayerHeight = bottomAquiferlayerHeight; - } + var seepageLength = xExit - xEntry; - kernelDataInput = new DamPipingSellmeijerVnkInput() - { - HRiver = riverLevel, - HExit = referenceLevel, - PolderLevel = location.PolderLevel, - Rc = defaultFluidisationGradient, - DTotal = dCoverLayer, - SeepageLength = seepageLength, - D70 = inBetweenAquiferlayerSoil.DiameterD70 * Physics.FactorMeterToMicroMeter, - WhitesConstant = inBetweenAquiferlayerSoil.WhitesConstant, - BeddingAngle = inBetweenAquiferlayerSoil.BeddingAngle, - PermeabilityKx = permeabilityKx, - WaterViscosity = Physics.WaterViscosity, - SurfaceLevel = surfaceLevel, - DInBetweenAquiferlayer = inBetweenAquiferlayerHeight, - DBottomAquiferlayer = bottomAquiferlayerHeight, - PermeabilityInBetweenAquiferlayer = inBetweenAquiferlayerSoil.PermeabKx, - PermeabilityBottomAquiferlayer = soilProfile1D.BottomAquiferLayer.Soil.PermeabKx, - }; - damOutput.ExitPointX = xExit; - damOutput.UpliftFactor = upliftFactor; - damOutput.UpliftSituation = upliftSituation; - return PrepareResult.Successful; + // 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); + + Soil inBetweenAquiferlayerSoil = soilProfile1D.BottomAquiferLayer.Soil; + double inBetweenAquiferlayerHeight; + var bottomAquiferlayerHeight = soilProfile1D.GetLayerHeight(soilProfile1D.BottomAquiferLayer); + if (soilProfile1D.InBetweenAquiferLayer != null) + { + inBetweenAquiferlayerSoil = soilProfile1D.InBetweenAquiferLayer.Soil; + inBetweenAquiferlayerHeight = soilProfile1D.GetLayerHeight(soilProfile1D.InBetweenAquiferLayer); } - kernelDataInput = null; - return PrepareResult.NotRelevant; + else + { + bottomAquiferlayerHeight = bottomAquiferlayerHeight / 2; + inBetweenAquiferlayerHeight = bottomAquiferlayerHeight; + } + + kernelDataInput = new DamPipingSellmeijerVnkInput() + { + HRiver = waterLevel, + HExit = referenceLevel, + PolderLevel = location.PolderLevel, + Rc = defaultFluidisationGradient, + DTotal = dCoverLayer, + SeepageLength = seepageLength, + D70 = inBetweenAquiferlayerSoil.DiameterD70 * Physics.FactorMeterToMicroMeter, + WhitesConstant = inBetweenAquiferlayerSoil.WhitesConstant, + BeddingAngle = inBetweenAquiferlayerSoil.BeddingAngle, + PermeabilityKx = permeabilityKx, + WaterViscosity = Physics.WaterViscosity, + SurfaceLevel = surfaceLevel, + DInBetweenAquiferlayer = inBetweenAquiferlayerHeight, + DBottomAquiferlayer = bottomAquiferlayerHeight, + PermeabilityInBetweenAquiferlayer = inBetweenAquiferlayerSoil.PermeabKx, + PermeabilityBottomAquiferlayer = soilProfile1D.BottomAquiferLayer.Soil.PermeabKx, + }; + damPipingOutput.ExitPointX = xExit; + damPipingOutput.UpliftFactor = upliftFactor; + damPipingOutput.UpliftSituation = upliftSituation; } /// @@ -187,25 +203,34 @@ public void Execute(IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, out List messages) { DamPipingSellmeijerVnkInput damPipingInput = kernelDataInput as DamPipingSellmeijerVnkInput; - if (damPipingInput == null) - { - throw new NoNullAllowedException(Resources.DamPipingSellmeijerVnkKernelWrapper_Execute_NoInputObjectDefinedForSellmeijerVNK); - } DamPipingSellmeijerVnkOutput damPipingOutput = (DamPipingSellmeijerVnkOutput)kernelDataOutput; - if (damPipingOutput == null) - { - throw new NoNullAllowedException(Resources.DamPipingSellmeijerVnkKernelWrapper_NoOutputObjectDefinedForSellmeijerVNK); - } + ThrowWhenKernelInputNull(damPipingInput); + ThrowWhenKernelOutputNull(damPipingOutput); + PerformSingleCalculationSellmeijerVnk(out messages, damPipingOutput, damPipingInput); + } + + private static void PerformSingleCalculationSellmeijerVnk(out List messages, DamPipingSellmeijerVnkOutput damPipingOutput, + DamPipingSellmeijerVnkInput damPipingInput) + { + damPipingOutput.CalculationResult = CalculationResult.NoRun; damPipingOutput.FoSp = defaultMaxReturnValue; messages = new List(); - if (damPipingOutput.UpliftSituation.IsUplift) + try { - var calculator = CreatePipingCalculatorSellmeijerVnk(kernelDataInput); - calculator.Calculate(); - damPipingOutput.FoSp = calculator.FoSp; - damPipingOutput.Hc = calculator.Hc; - damPipingOutput.CalculationResult = CalculationResult.Succeeded; + if (damPipingOutput.UpliftSituation.IsUplift) + { + var calculator = CreatePipingCalculatorSellmeijerVnk(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)); + } } /// @@ -221,14 +246,8 @@ string resultMessage, out List designResults) { DamPipingSellmeijerVnkOutput damPipingOutput = kernelDataOutput as DamPipingSellmeijerVnkOutput; - if (damPipingOutput == null) - { - throw new NoNullAllowedException(Resources.DamPipingSellmeijerVnkKernelWrapper_NoOutputObjectDefinedForSellmeijerVNK); - } - if (damKernelInput == null) - { - throw new NoNullAllowedException(Resources.DamPipingSellmeijerVnkKernelWrapper_NoInputObjectDefinedForSellmeijerVNK); - } + ThrowWhenDamKernelInputNull(damKernelInput); + ThrowWhenKernelOutputNull(damPipingOutput); designResults = new List(); var designResult = new DesignResult(damKernelInput.DamFailureMechanismeCalculationSpecification, @@ -240,7 +259,6 @@ var pipingDesignResults = new PipingDesignResults(PipingModelType.SellmeijerVnk); designResult.PipingDesignResults = pipingDesignResults; pipingDesignResults.ResultMessage = resultMessage; - // TODO: for now this only works for NoAdaption of geometry; if adaption is enabled, the real redesigned surfaceline has to be assigned pipingDesignResults.RedesignedSurfaceLine = damKernelInput.Location.SurfaceLine; pipingDesignResults.SellmeijerVnkFactor = damPipingOutput.FoSp; pipingDesignResults.SellmeijerVnkHcritical = damPipingOutput.Hc; @@ -259,10 +277,53 @@ /// The point. /// The 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 DamPipingSellmeijerVnkInput; + var damPipingOutput = (DamPipingSellmeijerVnkOutput)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 + PerformSingleCalculationSellmeijerVnk(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; } /// @@ -276,11 +337,19 @@ /// /// if the design was succesful /// - /// public bool EvaluateDesign(DamKernelInput damKernelInput, IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, out DesignAdvise designAdvise, out string evaluationMessage) { - throw new NotImplementedException(); + var damPipingInput = kernelDataInput as DamPipingSellmeijerVnkInput; + var damPipingOutput = (DamPipingSellmeijerVnkOutput)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); + designAdvise = DesignAdvise.None; + return (fosAchieved >= fosRequiered); } public void PrepareDesign(IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, DamKernelInput damKernelInput, @@ -303,10 +372,7 @@ private static PipingCalculatorSellmeijerVNK CreatePipingCalculatorSellmeijerVnk(IKernelDataInput kernelDataInput) { DamPipingSellmeijerVnkInput damPipingInput = kernelDataInput as DamPipingSellmeijerVnkInput; - if (damPipingInput == null) - { - throw new NoNullAllowedException(Resources.DamPipingSellmeijerVnkKernelWrapper_NoInputObjectDefinedForSellmeijerVNK); - } + ThrowWhenKernelInputNull(damPipingInput); var calculator = new PipingCalculatorSellmeijerVNK() { HRiver = damPipingInput.HRiver, @@ -328,5 +394,28 @@ return calculator; } + private static void ThrowWhenKernelInputNull(DamPipingSellmeijerVnkInput damPipingInput) + { + if (damPipingInput == null) + { + throw new NoNullAllowedException(Resources.DamPipingSellmeijerVnkKernelWrapper_NoInputObjectDefinedForSellmeijerVNK); + } + } + + private static void ThrowWhenKernelOutputNull(DamPipingSellmeijerVnkOutput damPipingOutput) + { + if (damPipingOutput == null) + { + throw new NoNullAllowedException(Resources.DamPipingSellmeijerVnkKernelWrapper_NoOutputObjectDefinedForSellmeijerVNK); + } + } + + private static void ThrowWhenDamKernelInputNull(DamKernelInput damKernelInput) + { + if (damKernelInput == null) + { + throw new NoNullAllowedException(Resources.DamPipingSellmeijerVnkKernelWrapper_NoInputObjectDefinedForSellmeijerVNK); + } + } } } Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.nl-NL.resx =================================================================== diff -u -r1216 -r1237 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.nl-NL.resx (.../Resources.nl-NL.resx) (revision 1216) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.nl-NL.resx (.../Resources.nl-NL.resx) (revision 1237) @@ -162,9 +162,6 @@ Geen uitvoer object gedefinieerd voor Sellmeijer 4 Krachten - - Geen invoer object gedefinieerd voor Sellmeijer VNK - Geen invoer object gedefinieerd voor Sellmeijer VNK Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijer4Forces/DamPipingSellmeijer4ForcesKernelWrapper.cs =================================================================== diff -u -r1217 -r1237 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijer4Forces/DamPipingSellmeijer4ForcesKernelWrapper.cs (.../DamPipingSellmeijer4ForcesKernelWrapper.cs) (revision 1217) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijer4Forces/DamPipingSellmeijer4ForcesKernelWrapper.cs (.../DamPipingSellmeijer4ForcesKernelWrapper.cs) (revision 1237) @@ -84,10 +84,10 @@ 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 soilProfile1D = damKernelInput.SubSoilScenario.SoilProfile1D; + var surfaceLine = damKernelInput.Location.SurfaceLine; + var location = damKernelInput.Location; + var upliftSituation = new UpliftSituation(); var upliftLocationDeterminator = new UpliftLocationDeterminator { PlLines = plLines, @@ -97,7 +97,7 @@ 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 upliftCriterion = location.UpliftCriterionPiping.Value - upliftCriterionTolerance; var upliftLocationAndResult = upliftLocationDeterminator.GetLocationAndResult(upliftCriterion); upliftSituation.IsUplift = (upliftLocationAndResult != null); var xEntry = surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).X; @@ -227,10 +227,7 @@ private static PipingCalculatorSellmeijer4Forces CreatePipingCalculatorSellmeijer4Forces(IKernelDataInput kernelDataInput) { DamPipingSellmeijer4ForcesInput damPipingInput = kernelDataInput as DamPipingSellmeijer4ForcesInput; - if (damPipingInput == null) - { - throw new NoNullAllowedException(Resources.DamPipingSellmeijer4ForcesKernelWrapper_NoInputObjectDefinedForSellmeijer4Forces); - } + ThrowWhenKernelInputNull(damPipingInput); var calculator = new PipingCalculatorSellmeijer4Forces { HRiver = damPipingInput.HRiver, @@ -274,7 +271,6 @@ var pipingDesignResults = new PipingDesignResults(PipingModelType.Sellmeijer4Forces); designResult.PipingDesignResults = pipingDesignResults; pipingDesignResults.ResultMessage = resultMessage; - // TODO: for now this only works for NoAdaption of geometry; if adaption is enabled, the real redesigned surfaceline has to be assigned pipingDesignResults.RedesignedSurfaceLine = damKernelInput.Location.SurfaceLine; pipingDesignResults.Sellmeijer4ForcesFactor = damPipingOutput.FoSp; pipingDesignResults.Sellmeijer4ForcesHcritical = damPipingOutput.Hc; @@ -293,7 +289,6 @@ /// The point. /// The messages. /// - /// public ShoulderDesign CalculateDesignAtPoint(DamKernelInput damKernelInput, IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, GeometryPoint point, out List messages) { Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapper.cs =================================================================== diff -u -r1217 -r1237 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapper.cs (.../DamPipingBlighKernelWrapper.cs) (revision 1217) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapper.cs (.../DamPipingBlighKernelWrapper.cs) (revision 1237) @@ -260,7 +260,6 @@ pipingDesignResults.ResultMessage = resultMessage; pipingDesignResults.BlighFactor = damPipingBlighOutput.FoSp; pipingDesignResults.BlighHcritical = damPipingBlighOutput.Hc; - // TODO: for now this only works for NoAdaption of geometry; if adaption is enabled, the real redesigned surfaceline has to be assigned pipingDesignResults.RedesignedSurfaceLine = damKernelInput.Location.SurfaceLine; pipingDesignResults.UpliftSituation = damPipingBlighOutput.UpliftSituation; pipingDesignResults.LocalExitPointX = damPipingBlighOutput.ExitPointX; Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.Designer.cs =================================================================== diff -u -r1216 -r1237 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 1216) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 1237) @@ -202,15 +202,6 @@ /// /// Looks up a localized string similar to No input object defined for Sellmeijer VNK. /// - internal static string DamPipingSellmeijerVnkKernelWrapper_Execute_NoInputObjectDefinedForSellmeijerVNK { - get { - return ResourceManager.GetString("DamPipingSellmeijerVnkKernelWrapper_Execute_NoInputObjectDefinedForSellmeijerVNK", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No input object defined for Sellmeijer VNK. - /// internal static string DamPipingSellmeijerVnkKernelWrapper_NoInputObjectDefinedForSellmeijerVNK { get { return ResourceManager.GetString("DamPipingSellmeijerVnkKernelWrapper_NoInputObjectDefinedForSellmeijerVNK", resourceCulture); Index: DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/Deltares.DamEngine.Interface.Tests.csproj =================================================================== diff -u -r1203 -r1237 --- DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/Deltares.DamEngine.Interface.Tests.csproj (.../Deltares.DamEngine.Interface.Tests.csproj) (revision 1203) +++ DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/Deltares.DamEngine.Interface.Tests.csproj (.../Deltares.DamEngine.Interface.Tests.csproj) (revision 1237) @@ -150,6 +150,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.resx =================================================================== diff -u -r1216 -r1237 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.resx (.../Resources.resx) (revision 1216) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.resx (.../Resources.resx) (revision 1237) @@ -144,9 +144,6 @@ No output object defined for Bligh - - No input object defined for Sellmeijer VNK - No output object defined for Sellmeijer VNK Index: DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/PipingSellmeijerVnkTests.cs =================================================================== diff -u -r1161 -r1237 --- DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/PipingSellmeijerVnkTests.cs (.../PipingSellmeijerVnkTests.cs) (revision 1161) +++ DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/PipingSellmeijerVnkTests.cs (.../PipingSellmeijerVnkTests.cs) (revision 1237) @@ -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,61 @@ Assert.AreEqual(0.0, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.UpliftSituation.Pl4LocationXMinUplift, tolerance); } + [Test] + public void CanPerformSellmeijerVnkDesignWithAdaptionPipingVoorbeeld1() + { + // Based on ".\data\DamEngineTestProjects\PipingVoorbeeld1\PipingSellmeijerVNK.damx" + // Set Analysis type to "Adapt geometry" + // Change required safety factor piping to 1.01 + const string fileName = @"TestFiles\PipingVoorbeeld1_SellmeijerVNKDesignInputFile.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; + // uplift = true + Assert.AreEqual(true, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.UpliftSituation.IsUplift); + // shoulder height = 1.995 + Assert.AreEqual(1.995, redesignedSurfaceLine.DetermineShoulderHeight(), tolerance); + // dike length = 84.486 + Assert.AreEqual(84.486, redesignedSurfaceLine.GetDikeLength(), tolerance); + + // ShoulderWidth = X_Kruin binnenberm - X_Insteek binnenberm = 82.51 - 29.01 = 53.5 + // Read from PipingSellmeijerVNK_Piping_CharacteristicPoints.csv by export surfacelines in Release + Assert.AreEqual(53.5, 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 = 94.486 + // Read from PipingSellmeijerVNK_Piping_CharacteristicPoints.csv by export surfacelines in Release + Assert.AreEqual(94.486, 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 = 94.486 (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 1.167, but that is not correct, because that is the value at X = 29.014 + // expected value = 1.070 + Assert.AreEqual(1.070, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.SellmeijerVnkFactor, tolerance); + // The Hcritical in Dam 15.1.2.24738 is 2.105, but that is not correct, because that is the value at X = 29.014 + // expected value = 4.067 + Assert.AreEqual(4.067, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.SellmeijerVnkHcritical, 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); + } + } } Index: DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/PipingSellmeijer4ForcesTests.cs =================================================================== diff -u -r1221 -r1237 --- DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/PipingSellmeijer4ForcesTests.cs (.../PipingSellmeijer4ForcesTests.cs) (revision 1221) +++ DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/PipingSellmeijer4ForcesTests.cs (.../PipingSellmeijer4ForcesTests.cs) (revision 1237) @@ -91,8 +91,11 @@ var output = DamXmlSerialization.LoadOutputFromXmlString(outputString); DamProjectData actualDamProjectData = FillDamFromXmlOutput.CreateDamProjectData(null, output); SurfaceLine2 redesignedSurfaceLine = actualDamProjectData.DesignCalculations[0].PipingDesignResults.RedesignedSurfaceLine; + // uplift = true Assert.AreEqual(true, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.UpliftSituation.IsUplift); + // shoulder height = 1.995 Assert.AreEqual(1.995, redesignedSurfaceLine.DetermineShoulderHeight(), tolerance); + // dike length = 66.986 Assert.AreEqual(66.986, redesignedSurfaceLine.GetDikeLength(), tolerance); // ShoulderWidth = X_Kruin binnenberm - X_Insteek binnenberm = 65.01 - 29.01 = 36.0 @@ -127,7 +130,6 @@ // 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); - } } Index: DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/TestFiles/PipingVoorbeeld1_SellmeijerVNKDesignInputFile.xml =================================================================== diff -u --- DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/TestFiles/PipingVoorbeeld1_SellmeijerVNKDesignInputFile.xml (revision 0) +++ DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/TestFiles/PipingVoorbeeld1_SellmeijerVNKDesignInputFile.xml (revision 1237) @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file