Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/DamPipingHelper.cs =================================================================== diff -u -r877 -r1081 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/DamPipingHelper.cs (.../DamPipingHelper.cs) (revision 877) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/DamPipingHelper.cs (.../DamPipingHelper.cs) (revision 1081) @@ -20,6 +20,13 @@ // All rights reserved. using System; +using Deltares.DamEngine.Calculators.Properties; +using Deltares.DamEngine.Calculators.Uplift; +using Deltares.DamEngine.Data.General; +using Deltares.DamEngine.Data.General.PlLines; +using Deltares.DamEngine.Data.Geometry; +using Deltares.DamEngine.Data.Geotechnics; +using Deltares.DamEngine.Data.Standard; namespace Deltares.DamEngine.Calculators.KernelWrappers.Common { @@ -45,5 +52,41 @@ return d; } + /// + /// Determines the pl-lines and the uplift location. + /// + /// The dam kernel input. + /// The point. + /// The pl lines. + /// The uplift location and result. + public static void DeterminePlLinesAndUpliftLocation(DamKernelInput damKernelInput, GeometryPoint point, out PLLines plLines, out UpliftLocationAndResult upliftLocationAndResult) + { + Location location = damKernelInput.Location; + SoilProfile1D soilProfile = damKernelInput.SubSoilScenario.SoilProfile1D; + SurfaceLine2 surfaceLine = damKernelInput.Location.SurfaceLine; + + ThrowHelper.ThrowWhenConditionIsTrue( + string.Format(Resources.NoSoilProfile1DDefinedForLocation, location.Name), + () => (soilProfile == null || soilProfile.Layers.Count < 1)); + ThrowHelper.ThrowIfArgumentNull(soilProfile, string.Format(Resources.NoSurfaceLineDefinedForLocation, location.Name)); + + GeometryPoint entryPoint = surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver); + + ThrowHelper.ThrowIfArgumentNull(entryPoint, string.Format(Resources.NoDikeToeDefinedForLocation, location.Name)); + ThrowHelper.ThrowIfArgumentNull(soilProfile.BottomAquiferLayer, string.Format(Resources.NoBottomAquiferLayer, soilProfile.Name)); + + UpliftSituation upliftSituation; + plLines = PlLinesHelper.CreatePlLinesForPiping(damKernelInput.Location, damKernelInput.SubSoilScenario.SoilProfile1D, damKernelInput.RiverLevelHigh, out upliftSituation); + + UpliftLocationDeterminator upliftLocationDeterminator = new UpliftLocationDeterminator + { + PLLines = plLines, + SoilProfile = soilProfile, + SurfaceLine = surfaceLine, + DikeEmbankmentMaterial = location.GetDikeEmbankmentSoil(), + XSoilGeometry2DOrigin = location.XSoilGeometry2DOrigin + }; + upliftLocationAndResult = upliftLocationDeterminator.GetUpliftFactorAtPoint(point); + } } } Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/Common/PlLinesHelperTests.cs =================================================================== diff -u -r1011 -r1081 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/Common/PlLinesHelperTests.cs (.../PlLinesHelperTests.cs) (revision 1011) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/Common/PlLinesHelperTests.cs (.../PlLinesHelperTests.cs) (revision 1081) @@ -40,7 +40,7 @@ var soilProfile1D = FactoryForSoilProfiles.CreatePipingSellmeijerProfileWithOneSandlayer(); var riverLevel = 1.0; UpliftSituation upliftSituation; - var plLines = PlLinesHelper.CreatePlLines(location, soilProfile1D, riverLevel, out upliftSituation); + var plLines = PlLinesHelper.CreatePlLinesForPiping(location, soilProfile1D, riverLevel, out upliftSituation); Assert.AreEqual(4, plLines.PLLineCount); Assert.AreEqual(8, plLines.Lines[PLLineType.PL1].Points.Count); Assert.IsTrue(new PLLinePoint(0.000, 1.000).LocationEquals(plLines.Lines[PLLineType.PL1].Points[0])); Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijer4Forces/DamPipingSellmeijer4ForcesKernelWrapper.cs =================================================================== diff -u -r1040 -r1081 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijer4Forces/DamPipingSellmeijer4ForcesKernelWrapper.cs (.../DamPipingSellmeijer4ForcesKernelWrapper.cs) (revision 1040) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijer4Forces/DamPipingSellmeijer4ForcesKernelWrapper.cs (.../DamPipingSellmeijer4ForcesKernelWrapper.cs) (revision 1081) @@ -66,7 +66,7 @@ var location = damKernelInput.Location; double riverLevel = damKernelInput.RiverLevelHigh; UpliftSituation upliftSituation; - var plLines = PlLinesHelper.CreatePlLines(location, soilProfile1D, riverLevel, out upliftSituation); + var plLines = PlLinesHelper.CreatePlLinesForPiping(location, soilProfile1D, riverLevel, out upliftSituation); var upliftLocationDeterminator = new UpliftLocationDeterminator { PLLines = plLines, Index: DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/PipingBlighTests.cs =================================================================== diff -u -r1080 -r1081 --- DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/PipingBlighTests.cs (.../PipingBlighTests.cs) (revision 1080) +++ DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/PipingBlighTests.cs (.../PipingBlighTests.cs) (revision 1081) @@ -23,7 +23,6 @@ using Deltares.DamEngine.Data.General; using Deltares.DamEngine.Data.Geotechnics; using Deltares.DamEngine.Io; -using Deltares.DamEngine.Interface; using NUnit.Framework; namespace Deltares.DamEngine.Interface.Tests Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/PlLinesHelper.cs =================================================================== diff -u -r1026 -r1081 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/PlLinesHelper.cs (.../PlLinesHelper.cs) (revision 1026) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Common/PlLinesHelper.cs (.../PlLinesHelper.cs) (revision 1081) @@ -92,7 +92,7 @@ /// The water level. /// The uplift situation. /// - public static PLLines CreatePlLines(Location location, SoilProfile1D soilProfile, double waterLevel, out UpliftSituation upliftSituation) + public static PLLines CreatePlLinesForPiping(Location location, SoilProfile1D soilProfile, double waterLevel, out UpliftSituation upliftSituation) { var plLinesCreator = new PLLinesCreator { Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijerVnk/DamPipingSellmeijerVnkKernelWrapper.cs =================================================================== diff -u -r1040 -r1081 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijerVnk/DamPipingSellmeijerVnkKernelWrapper.cs (.../DamPipingSellmeijerVnkKernelWrapper.cs) (revision 1040) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijerVnk/DamPipingSellmeijerVnkKernelWrapper.cs (.../DamPipingSellmeijerVnkKernelWrapper.cs) (revision 1081) @@ -65,7 +65,7 @@ var location = damKernelInput.Location; double riverLevel = damKernelInput.RiverLevelHigh; UpliftSituation upliftSituation; - var plLines = PlLinesHelper.CreatePlLines(location, soilProfile1D, riverLevel, out upliftSituation); + var plLines = PlLinesHelper.CreatePlLinesForPiping(location, soilProfile1D, riverLevel, out upliftSituation); var upliftLocationDeterminator = new UpliftLocationDeterminator { PLLines = plLines, Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapper.cs =================================================================== diff -u -r1080 -r1081 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapper.cs (.../DamPipingBlighKernelWrapper.cs) (revision 1080) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapper.cs (.../DamPipingBlighKernelWrapper.cs) (revision 1081) @@ -74,7 +74,7 @@ var location = damKernelInput.Location; double waterLevel = damKernelInput.RiverLevelHigh; UpliftSituation upliftSituation; - PLLines plLines = PlLinesHelper.CreatePlLines(location, soilProfile1D, waterLevel, out upliftSituation); + PLLines plLines = PlLinesHelper.CreatePlLinesForPiping(location, soilProfile1D, waterLevel, out upliftSituation); EvaluateUpliftSituation(damKernelInput, out kernelDataInput, plLines, damPipingBlighInput, waterLevel, damPipingBlighOutput); return PrepareResult.Successful; } @@ -296,36 +296,14 @@ DamPipingBlighOutput damPipingBlighOutput = (DamPipingBlighOutput)kernelDataOutput; ThrowWhenKernelInputNull(damKernelInput); ThrowWhenKernelOutputNull(damPipingBlighOutput); - - // ============================ Start of SetupCalculationAtGivePoint() Location location = damKernelInput.Location; SoilProfile1D soilProfile = damKernelInput.SubSoilScenario.SoilProfile1D; - double waterLevel = damKernelInput.RiverLevelHigh; SurfaceLine2 surfaceLine = damKernelInput.Location.SurfaceLine; - ThrowHelper.ThrowWhenConditionIsTrue( - string.Format(Resources.NoSoilProfile1DDefinedForLocation, location.Name), - () => (soilProfile == null || soilProfile.Layers.Count < 1)); - ThrowHelper.ThrowIfArgumentNull(soilProfile, string.Format(Resources.NoSurfaceLineDefinedForLocation, location.Name)); + PLLines plLines; + UpliftLocationAndResult upliftLocationAndResult; + DamPipingHelper.DeterminePlLinesAndUpliftLocation(damKernelInput, point, out plLines, out upliftLocationAndResult); - GeometryPoint entryPoint = surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver); - - ThrowHelper.ThrowIfArgumentNull(entryPoint, string.Format(Resources.NoDikeToeDefinedForLocation, location.Name)); - ThrowHelper.ThrowIfArgumentNull(soilProfile.BottomAquiferLayer, string.Format(Resources.NoBottomAquiferLayer, soilProfile.Name)); - - PLLines plLines = CreatePlLines(damKernelInput); - - UpliftLocationDeterminator upliftLocationDeterminator = new UpliftLocationDeterminator - { - PLLines = plLines, - SoilProfile = soilProfile, - SurfaceLine = surfaceLine, - DikeEmbankmentMaterial = location.GetDikeEmbankmentSoil(), - XSoilGeometry2DOrigin = location.XSoilGeometry2DOrigin - }; - UpliftLocationAndResult upliftLocationAndResult = upliftLocationDeterminator.GetUpliftFactorAtPoint(point); - // ============================ End of SetupCalculationAtGivePoint() - double requiredFoS = location.ModelFactors.RequiredSafetyFactorPiping.Value; double upliftCriterion = location.UpliftCriterionPiping.Value; // if there is no uplift, then there is no piping so return null @@ -335,10 +313,13 @@ double xExit = upliftLocationAndResult.X; damPipingBlighInput.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 damPipingBlighInput.DTotal = dCoverLayer; - var referenceLevel = Math.Max(location.PolderLevel, point.Z); // point.Z is surfacelevel + double referenceLevel = Math.Max(location.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); @@ -357,7 +338,7 @@ return null; } - protected double CalculateExtraShoulderHeight(SoilProfile1D soilProfile, PLLines plLines, UpliftLocationAndResult upliftLocationAndResult, double upliftCriterion) + private double CalculateExtraShoulderHeight(SoilProfile1D soilProfile, PLLines plLines, UpliftLocationAndResult upliftLocationAndResult, double upliftCriterion) { var calculator = new UpliftCalculator(); calculator.SoilProfile = soilProfile; @@ -376,14 +357,5 @@ return calculator.CalculateExtraHeight(plLine.ZFromX(upliftLocationAndResult.X), upliftCriterion); } - private PLLines CreatePlLines(DamKernelInput damKernelInput) - { - var soilProfile1D = damKernelInput.SubSoilScenario.SoilProfile1D; - var location = damKernelInput.Location; - double waterLevel = damKernelInput.RiverLevelHigh; - UpliftSituation upliftSituation; - PLLines plLines = PlLinesHelper.CreatePlLines(location, soilProfile1D, waterLevel, out upliftSituation); - return plLines; - } } }