Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijerVnk/DamPipingSellmeijerVnkKernelWrapper.cs =================================================================== diff -u -r4052 -r4229 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijerVnk/DamPipingSellmeijerVnkKernelWrapper.cs (.../DamPipingSellmeijerVnkKernelWrapper.cs) (revision 4052) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijerVnk/DamPipingSellmeijerVnkKernelWrapper.cs (.../DamPipingSellmeijerVnkKernelWrapper.cs) (revision 4229) @@ -263,7 +263,7 @@ return DesignStrategy.ShoulderPerPoint; } - private static void EvaluateUpliftSituation(DamKernelInput damKernelInput, out IKernelDataInput kernelDataInput, + private bool EvaluateUpliftSituation(DamKernelInput damKernelInput, out IKernelDataInput kernelDataInput, PlLines plLines, double waterLevel, DamPipingSellmeijerVnkOutput damPipingOutput) { const double upliftCriterionTolerance = 0.000000001; @@ -284,74 +284,73 @@ UpliftLocationAndResult upliftLocationAndResult = upliftLocationDeterminator.GetLocationAndResult(upliftCriterion); upliftSituation.IsUplift = (upliftLocationAndResult != null); double 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); + double xExit = upliftLocationAndResult.X; + double surfaceLevel = surfaceLine.Geometry.GetZatX(upliftLocationAndResult.X); double topLevelAquifer = soilProfile1D.GetLayerWithName(upliftLocationAndResult.LayerWhereUpliftOccuresId) .TopLevel; - dCoverLayer = DamPipingHelper.DetermineHeightCoverLayer(topLevelAquifer, surfaceLevel); + double dCoverLayer = DamPipingHelper.DetermineHeightCoverLayer(topLevelAquifer, surfaceLevel); SoilProfile1DAquiferLayerCombiner.AquiferLayerProperties aquiferLayer = SoilProfile1DAquiferLayerCombiner.CombineLayers(soilProfile1D, upliftLocationAndResult.LayerWhereUpliftOccuresId); - permeabilityKx = aquiferLayer.PermeabilityKx; - upliftFactor = upliftLocationAndResult.UpliftFactor; - } + double permeabilityKx = aquiferLayer.PermeabilityKx; + double? upliftFactor = upliftLocationAndResult.UpliftFactor; + double seepageLength = xExit - xEntry; - double seepageLength = xExit - xEntry; + // 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.Scenarios[0].PolderLevel, surfaceLevel); - // 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.Scenarios[0].PolderLevel, surfaceLevel); + Soil inBetweenAquiferlayerSoil = soilProfile1D.BottomAquiferLayer.Soil; + double inBetweenAquiferlayerHeight; + double bottomAquiferlayerHeight = soilProfile1D.GetLayerHeight(soilProfile1D.BottomAquiferLayer); + if (soilProfile1D.InBetweenAquiferLayer != null) + { + inBetweenAquiferlayerSoil = soilProfile1D.InBetweenAquiferLayer.Soil; + inBetweenAquiferlayerHeight = soilProfile1D.GetLayerHeight(soilProfile1D.InBetweenAquiferLayer); + } + else + { + bottomAquiferlayerHeight = bottomAquiferlayerHeight / 2; + inBetweenAquiferlayerHeight = bottomAquiferlayerHeight; + } - Soil inBetweenAquiferlayerSoil = soilProfile1D.BottomAquiferLayer.Soil; - double inBetweenAquiferlayerHeight; - double bottomAquiferlayerHeight = soilProfile1D.GetLayerHeight(soilProfile1D.BottomAquiferLayer); - if (soilProfile1D.InBetweenAquiferLayer != null) - { - inBetweenAquiferlayerSoil = soilProfile1D.InBetweenAquiferLayer.Soil; - inBetweenAquiferlayerHeight = soilProfile1D.GetLayerHeight(soilProfile1D.InBetweenAquiferLayer); + kernelDataInput = new DamPipingSellmeijerVnkInput + { + HRiver = waterLevel, + HExit = referenceLevel, + PolderLevel = location.Scenarios[0].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; + return true; } - else - { - bottomAquiferlayerHeight = bottomAquiferlayerHeight / 2; - inBetweenAquiferlayerHeight = bottomAquiferlayerHeight; - } - kernelDataInput = new DamPipingSellmeijerVnkInput - { - HRiver = waterLevel, - HExit = referenceLevel, - PolderLevel = location.Scenarios[0].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; + kernelDataInput = new DamPipingSellmeijerVnkInput(); + return false; } - private static void PerformSingleCalculationSellmeijerVnk(out List messages, DamPipingSellmeijerVnkOutput damPipingOutput, + private void PerformSingleCalculationSellmeijerVnk(out List messages, DamPipingSellmeijerVnkOutput damPipingOutput, DamPipingSellmeijerVnkInput damPipingInput) { damPipingOutput.CalculationResult = CalculationResult.NoRun; @@ -375,7 +374,7 @@ } } - private static PipingCalculatorSellmeijerVNK CreatePipingCalculatorSellmeijerVnk(IKernelDataInput kernelDataInput) + private PipingCalculatorSellmeijerVNK CreatePipingCalculatorSellmeijerVnk(IKernelDataInput kernelDataInput) { var damPipingInput = kernelDataInput as DamPipingSellmeijerVnkInput; ThrowWhenKernelInputNull(damPipingInput); @@ -400,23 +399,23 @@ return calculator; } - private static void ThrowWhenKernelInputNull(DamPipingSellmeijerVnkInput damPipingInput) + private void ThrowWhenKernelInputNull(DamPipingSellmeijerVnkInput damPipingInput) { if (damPipingInput == null) { throw new NoNullAllowedException(Resources.DamPipingSellmeijerVnkKernelWrapper_NoInputObjectDefinedForSellmeijerVNK); } } - private static void ThrowWhenKernelOutputNull(DamPipingSellmeijerVnkOutput damPipingOutput) + private void ThrowWhenKernelOutputNull(DamPipingSellmeijerVnkOutput damPipingOutput) { if (damPipingOutput == null) { throw new NoNullAllowedException(Resources.DamPipingSellmeijerVnkKernelWrapper_NoOutputObjectDefinedForSellmeijerVNK); } } - private static void ThrowWhenDamKernelInputNull(DamKernelInput damKernelInput) + private void ThrowWhenDamKernelInputNull(DamKernelInput damKernelInput) { if (damKernelInput == null) { Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapper.cs =================================================================== diff -u -r4052 -r4229 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapper.cs (.../DamPipingBlighKernelWrapper.cs) (revision 4052) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapper.cs (.../DamPipingBlighKernelWrapper.cs) (revision 4229) @@ -75,8 +75,10 @@ Location location = damKernelInput.Location; double waterLevel = damKernelInput.RiverLevelHigh; PlLines plLines = PlLinesHelper.CreatePlLinesForPiping(damKernelInput.TimeStepDateTime, location, soilProfile1D, waterLevel); - EvaluateUpliftSituation(damKernelInput, out kernelDataInput, plLines, damPipingBlighInput, waterLevel, damPipingBlighOutput); - return PrepareResult.Successful; + if (EvaluateUpliftSituation(damKernelInput, out kernelDataInput, plLines, damPipingBlighInput, waterLevel, damPipingBlighOutput)) + { + return PrepareResult.Successful; + } } kernelDataInput = null; @@ -268,7 +270,9 @@ return DesignStrategy.ShoulderPerPoint; } - private static void EvaluateUpliftSituation(DamKernelInput damKernelInput, out IKernelDataInput kernelDataInput, PlLines plLines, DamPipingBlighInput damPipingBlighInput, double waterLevel, DamPipingBlighOutput damPipingBlighOutput) + private bool EvaluateUpliftSituation(DamKernelInput damKernelInput, out IKernelDataInput kernelDataInput, PlLines plLines, + DamPipingBlighInput damPipingBlighInput, double waterLevel, + DamPipingBlighOutput damPipingBlighOutput) { const double upliftCriterionTolerance = 0.000000001; SoilProfile1D soilProfile1D = damKernelInput.SubSoilScenario.SoilProfile1D; @@ -288,45 +292,43 @@ UpliftLocationAndResult upliftLocationAndResult = upliftLocationDeterminator.GetLocationAndResult(upliftCriterion); upliftSituation.IsUplift = (upliftLocationAndResult != null); double xEntry = surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).X; - var xExit = 0.0; - var surfaceLevel = 0.0; - var d70 = 0.0; - var dCoverLayer = 0.0; - double? upliftFactor = null; if (upliftLocationAndResult != null) { - xExit = upliftLocationAndResult.X; - surfaceLevel = surfaceLine.Geometry.GetZatX(upliftLocationAndResult.X); + double xExit = upliftLocationAndResult.X; + double surfaceLevel = surfaceLine.Geometry.GetZatX(upliftLocationAndResult.X); SoilLayer1D heaveLayer = soilProfile1D.GetLayerWithName(upliftLocationAndResult.LayerWhereUpliftOccuresId); - d70 = Physics.FactorMeterToMicroMeter * heaveLayer.Soil.DiameterD70; + double d70 = Physics.FactorMeterToMicroMeter * heaveLayer.Soil.DiameterD70; double topLevelAquifer = soilProfile1D.GetLayerWithName(upliftLocationAndResult.LayerWhereUpliftOccuresId).TopLevel; - dCoverLayer = DamPipingHelper.DetermineHeightCoverLayer(topLevelAquifer, surfaceLevel); - upliftFactor = upliftLocationAndResult.UpliftFactor; + double dCoverLayer = DamPipingHelper.DetermineHeightCoverLayer(topLevelAquifer, surfaceLevel); + double? upliftFactor = upliftLocationAndResult.UpliftFactor; + double seepageLength = xExit - xEntry; + damPipingBlighInput.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.Scenarios[0].PolderLevel, surfaceLevel); + kernelDataInput = new DamPipingBlighInput + { + HRiver = waterLevel, + HExit = referenceLevel, + Rc = defaultFluidisationGradient, + DTotal = dCoverLayer, + SeepageLength = seepageLength, + D70 = d70 + }; + damPipingBlighOutput.ExitPointX = xExit; + damPipingBlighOutput.UpliftFactor = upliftFactor; + damPipingBlighOutput.UpliftSituation = upliftSituation; + return true; } - double seepageLength = xExit - xEntry; - damPipingBlighInput.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.Scenarios[0].PolderLevel, surfaceLevel); - kernelDataInput = new DamPipingBlighInput - { - HRiver = waterLevel, - HExit = referenceLevel, - Rc = defaultFluidisationGradient, - DTotal = dCoverLayer, - SeepageLength = seepageLength, - D70 = d70 - }; - damPipingBlighOutput.ExitPointX = xExit; - damPipingBlighOutput.UpliftFactor = upliftFactor; - damPipingBlighOutput.UpliftSituation = upliftSituation; + kernelDataInput = new DamPipingBlighInput(); + return false; } - private static void PerformSingleCalculationBligh(out List messages, DamPipingBlighOutput damPipingBlighOutput, DamPipingBlighInput damPipingBlighInput) + private void PerformSingleCalculationBligh(out List messages, DamPipingBlighOutput damPipingBlighOutput, DamPipingBlighInput damPipingBlighInput) { damPipingBlighOutput.CalculationResult = CalculationResult.NoRun; damPipingBlighOutput.FoSp = defaultMaxReturnValue; @@ -355,7 +357,7 @@ /// The kernel data input. /// /// No input object defined for Bligh - private static PipingCalculatorBligh CreatePipingCalculatorBligh(IKernelDataInput kernelDataInput) + private PipingCalculatorBligh CreatePipingCalculatorBligh(IKernelDataInput kernelDataInput) { var damPipingBlighInput = kernelDataInput as DamPipingBlighInput; ThrowWhenKernelInputNull(damPipingBlighInput); @@ -371,23 +373,23 @@ return calculator; } - private static void ThrowWhenKernelInputNull(DamPipingBlighInput damPipingBlighInput) + private void ThrowWhenKernelInputNull(DamPipingBlighInput damPipingBlighInput) { if (damPipingBlighInput == null) { throw new NoNullAllowedException(Resources.DamPipingBlighKernelWrapper_NoInputObjectDefinedForBligh); } } - private static void ThrowWhenKernelOutputNull(DamPipingBlighOutput damPipingBlighOutput) + private void ThrowWhenKernelOutputNull(DamPipingBlighOutput damPipingBlighOutput) { if (damPipingBlighOutput == null) { throw new NoNullAllowedException(Resources.DamPipingBlighKernelWrapper_NoOutputObjectDefinedForBligh); } } - private static void ThrowWhenDamKernelInputNull(DamKernelInput damKernelInput) + private void ThrowWhenDamKernelInputNull(DamKernelInput damKernelInput) { if (damKernelInput == null) { Index: DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/PipingBlighTests.cs =================================================================== diff -u -r4052 -r4229 --- DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/PipingBlighTests.cs (.../PipingBlighTests.cs) (revision 4052) +++ DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/PipingBlighTests.cs (.../PipingBlighTests.cs) (revision 4229) @@ -236,4 +236,40 @@ Assert.AreEqual(1.311, output.Results.CalculationResults[locationIndex * 2 + 1].PipingDesignResults.BlighFactor, tolerance); Assert.AreEqual((locationIndex + 1) * 2, output.Results.CalculationResults.Length); } + + [Test] + [TestCase(1)] + [TestCase(4)] + public void TestDAMSUP_169(int maxCores) + { + const string mapTestFiles = @"TestFiles\"; + string fullInputFilename = Path.Combine(mapTestFiles, "DAMSUP169Bligh.xml"); + Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; + string inputString = File.ReadAllText(fullInputFilename); + var engineInterface = new EngineInterface(inputString); + Assert.IsNotNull(engineInterface.DamProjectData); + engineInterface.DamProjectData.MaxCalculationCores = maxCores; + string result = engineInterface.Validate(); + Assert.IsTrue(result == null, "Validation must succeed but does not, see output xml in debugger"); + string outputString = engineInterface.Run(); + string outputName = "Output" + maxCores + ".xml"; + File.WriteAllText(outputName, outputString); + Output output = DamXmlSerialization.LoadOutputFromXmlString(outputString); + int errorCount = GeneralHelper.DetermineNumberOfCalculationErrors(engineInterface.DamProjectData.CalculationMessages); + Assert.AreEqual(0, errorCount, "There should be nor errors during the calculation."); + Assert.AreNotEqual(null, output.Results.CalculationResults); + Assert.AreEqual(6, output.Results.CalculationResults.Length); + Assert.AreEqual(17.208, output.Results.CalculationResults[0].PipingDesignResults.BlighFactor, tolerance); + Assert.AreEqual(90.000, output.Results.CalculationResults[1].PipingDesignResults.BlighFactor, tolerance); + Assert.AreEqual(90.000, output.Results.CalculationResults[2].PipingDesignResults.BlighFactor, tolerance); + Assert.AreEqual(90.000, output.Results.CalculationResults[3].PipingDesignResults.BlighFactor, tolerance); + Assert.AreEqual(7.041, output.Results.CalculationResults[4].PipingDesignResults.BlighFactor, tolerance); + Assert.AreEqual(90.000, output.Results.CalculationResults[5].PipingDesignResults.BlighFactor, tolerance); + Assert.AreEqual(5, output.Results.CalculationMessages.Length); + Assert.IsTrue(output.Results.CalculationMessages[0].Message1.Contains("no uplift")); + Assert.IsTrue(output.Results.CalculationMessages[1].Message1.Contains("no uplift")); + Assert.IsTrue(output.Results.CalculationMessages[2].Message1.Contains("no uplift")); + Assert.IsTrue(output.Results.CalculationMessages[3].Message1.Contains("no uplift")); + Assert.IsTrue(output.Results.CalculationMessages[4].Message1.Contains("no uplift")); + } } \ No newline at end of file Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/WtiPipingSellmeijerRevised/WtiPipingSellmeijerRevisedKernelWrapperTests.cs =================================================================== diff -u -r4052 -r4229 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/WtiPipingSellmeijerRevised/WtiPipingSellmeijerRevisedKernelWrapperTests.cs (.../WtiPipingSellmeijerRevisedKernelWrapperTests.cs) (revision 4052) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/WtiPipingSellmeijerRevised/WtiPipingSellmeijerRevisedKernelWrapperTests.cs (.../WtiPipingSellmeijerRevisedKernelWrapperTests.cs) (revision 4229) @@ -196,9 +196,10 @@ [Test] public void TestConvertToPipingSurfaceLine() { + var kernelWrapper = new WtiPipingSellmeijerRevisedKernelWrapper(); const double diff = 0.0001; SurfaceLine2 surfaceLine = FactoryForSurfaceLines.CreateSurfaceLineForWtiPiping(true); - PipingSurfaceLine surfaceLinePiping = WtiPipingSellmeijerRevisedKernelWrapper.ConvertToPipingSurfaceLine(surfaceLine); + PipingSurfaceLine surfaceLinePiping = kernelWrapper.ConvertToPipingSurfaceLine(surfaceLine); Assert.AreEqual(12, surfaceLinePiping.Points.Count); // Check some coodinates and types Assert.AreEqual(34.5, surfaceLinePiping.Points[2].X, diff); @@ -226,8 +227,9 @@ public void TestConvertToPipingProfile() { const double diff = 0.0001; + var kernelWrapper = new WtiPipingSellmeijerRevisedKernelWrapper(); SoilProfile1D profile = FactoryForSoilProfiles.CreatePipingSellmeijerProfileWithOneSandlayer(); - PipingProfile profilePiping = WtiPipingSellmeijerRevisedKernelWrapper.ConvertToPipingProfile(profile); + PipingProfile profilePiping = kernelWrapper.ConvertToPipingProfile(profile); Assert.AreEqual(2, profilePiping.Layers.Count); Assert.AreEqual(10, profilePiping.Layers[0].TopLevel, diff); @@ -248,6 +250,7 @@ [Test] public void TestAssignFailedValuesWtiUplift() { + var kernelWrapper = new WtiPipingSellmeijerRevisedKernelWrapper(); var output = new WtiPipingSellmeijerRevisedOutput(); // Uplift output.FoSu = 1; @@ -261,7 +264,7 @@ output.FoSbe = 1; output.Hcbe = 1; output.DeltaPhiCbe = 1; - WtiPipingSellmeijerRevisedKernelWrapper.AssignFailedValuesWtiUplift(output); + kernelWrapper.AssignFailedValuesWtiUplift(output); // Uplift Assert.AreEqual(0, output.FoSu); Assert.AreEqual(0, output.Hcu); @@ -279,6 +282,7 @@ [Test] public void TestAssignFailedValuesWtiHeave() { + var kernelWrapper = new WtiPipingSellmeijerRevisedKernelWrapper(); var output = new WtiPipingSellmeijerRevisedOutput(); // Uplift output.FoSu = 1; @@ -292,7 +296,7 @@ output.FoSbe = 1; output.Hcbe = 1; output.DeltaPhiCbe = 1; - WtiPipingSellmeijerRevisedKernelWrapper.AssignFailedValuesWtiHeave(output); + kernelWrapper.AssignFailedValuesWtiHeave(output); // Uplift Assert.AreEqual(1, output.FoSu); Assert.AreEqual(1, output.Hcu); @@ -310,6 +314,7 @@ [Test] public void TestAssignFailedValuesWtiSellmeijerRevised() { + var kernelWrapper = new WtiPipingSellmeijerRevisedKernelWrapper(); var output = new WtiPipingSellmeijerRevisedOutput(); // Uplift output.FoSu = 1; @@ -323,7 +328,7 @@ output.FoSbe = 1; output.Hcbe = 1; output.DeltaPhiCbe = 1; - WtiPipingSellmeijerRevisedKernelWrapper.AssignFailedValuesWtiSellmeijerRevised(output); + kernelWrapper.AssignFailedValuesWtiSellmeijerRevised(output); // Uplift Assert.AreEqual(1, output.FoSu); Assert.AreEqual(1, output.Hcu); @@ -542,6 +547,7 @@ [TestCase(CharacteristicPointType.TrafficLoadOutside, PipingCharacteristicPointType.None)] public void TestConvertToPipingPointType(CharacteristicPointType charPointType, PipingCharacteristicPointType pipingCharacteristicPointType) { - Assert.AreEqual(pipingCharacteristicPointType, WtiPipingSellmeijerRevisedKernelWrapper.ConvertToPipingPointType(charPointType)); + var kernelWrapper = new WtiPipingSellmeijerRevisedKernelWrapper(); + Assert.AreEqual(pipingCharacteristicPointType, kernelWrapper.ConvertToPipingPointType(charPointType)); } } \ No newline at end of file Index: DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/TestFiles/DAMSUP169Bligh.xml =================================================================== diff -u --- DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/TestFiles/DAMSUP169Bligh.xml (revision 0) +++ DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/TestFiles/DAMSUP169Bligh.xml (revision 4229) @@ -0,0 +1,1167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijer4Forces/DamPipingSellmeijer4ForcesKernelWrapper.cs =================================================================== diff -u -r4052 -r4229 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijer4Forces/DamPipingSellmeijer4ForcesKernelWrapper.cs (.../DamPipingSellmeijer4ForcesKernelWrapper.cs) (revision 4052) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijer4Forces/DamPipingSellmeijer4ForcesKernelWrapper.cs (.../DamPipingSellmeijer4ForcesKernelWrapper.cs) (revision 4229) @@ -69,8 +69,10 @@ Location location = damKernelInput.Location; double waterLevel = damKernelInput.RiverLevelHigh; PlLines plLines = PlLinesHelper.CreatePlLinesForPiping(damKernelInput.TimeStepDateTime, location, soilProfile1D, waterLevel); - EvaluateUpliftSituation(damKernelInput, out kernelDataInput, plLines, waterLevel, damPipingOutput); - return PrepareResult.Successful; + if (EvaluateUpliftSituation(damKernelInput, out kernelDataInput, plLines, waterLevel, damPipingOutput)) + { + return PrepareResult.Successful; + } } kernelDataInput = null; @@ -262,7 +264,7 @@ return DesignStrategy.ShoulderPerPoint; } - private static void EvaluateUpliftSituation(DamKernelInput damKernelInput, out IKernelDataInput kernelDataInput, + private bool EvaluateUpliftSituation(DamKernelInput damKernelInput, out IKernelDataInput kernelDataInput, PlLines plLines, double waterLevel, DamPipingSellmeijer4ForcesOutput damPipingOutput) { @@ -284,64 +286,60 @@ UpliftLocationAndResult upliftLocationAndResult = upliftLocationDeterminator.GetLocationAndResult(upliftCriterion); upliftSituation.IsUplift = (upliftLocationAndResult != null); double 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); + double xExit = upliftLocationAndResult.X; + double surfaceLevel = surfaceLine.Geometry.GetZatX(upliftLocationAndResult.X); double topLevelAquifer = soilProfile1D.GetLayerWithName(upliftLocationAndResult.LayerWhereUpliftOccuresId).TopLevel; - dCoverLayer = DamPipingHelper.DetermineHeightCoverLayer(topLevelAquifer, surfaceLevel); + double dCoverLayer = DamPipingHelper.DetermineHeightCoverLayer(topLevelAquifer, surfaceLevel); SoilProfile1DAquiferLayerCombiner.AquiferLayerProperties aquiferLayer = SoilProfile1DAquiferLayerCombiner.CombineLayers(soilProfile1D, upliftLocationAndResult.LayerWhereUpliftOccuresId); - d70 = aquiferLayer.D70 * Physics.FactorMeterToMicroMeter; + double d70 = aquiferLayer.D70 * Physics.FactorMeterToMicroMeter; - aquiferHeight = aquiferLayer.Height; - permeabilityKx = aquiferLayer.PermeabilityKx; - upliftFactor = upliftLocationAndResult.UpliftFactor; - } + double aquiferHeight = aquiferLayer.Height; + double permeabilityKx = aquiferLayer.PermeabilityKx; + double? upliftFactor = upliftLocationAndResult.UpliftFactor; + double seepageLength = xExit - xEntry; - double seepageLength = xExit - xEntry; + // 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.Scenarios[0].PolderLevel, surfaceLevel); - // 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.Scenarios[0].PolderLevel, surfaceLevel); + Soil inBetweenAquiferlayerSoil = soilProfile1D.BottomAquiferLayer.Soil; + if (soilProfile1D.InBetweenAquiferLayer != null) + { + inBetweenAquiferlayerSoil = soilProfile1D.InBetweenAquiferLayer.Soil; + } - Soil inBetweenAquiferlayerSoil = soilProfile1D.BottomAquiferLayer.Soil; - if (soilProfile1D.InBetweenAquiferLayer != null) - { - inBetweenAquiferlayerSoil = soilProfile1D.InBetweenAquiferLayer.Soil; + 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; + return true; } - 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; + kernelDataInput = new DamPipingSellmeijer4ForcesInput(); + return false; } - private static void PerformSingleCalculationSellmeijer4Forces(out List messages, DamPipingSellmeijer4ForcesOutput damPipingOutput, + private void PerformSingleCalculationSellmeijer4Forces(out List messages, DamPipingSellmeijer4ForcesOutput damPipingOutput, DamPipingSellmeijer4ForcesInput damPipingInput) { damPipingOutput.CalculationResult = CalculationResult.NoRun; @@ -365,7 +363,7 @@ } } - private static PipingCalculatorSellmeijer4Forces CreatePipingCalculatorSellmeijer4Forces(IKernelDataInput kernelDataInput) + private PipingCalculatorSellmeijer4Forces CreatePipingCalculatorSellmeijer4Forces(IKernelDataInput kernelDataInput) { var damPipingInput = kernelDataInput as DamPipingSellmeijer4ForcesInput; ThrowWhenKernelInputNull(damPipingInput); @@ -386,23 +384,23 @@ return calculator; } - private static void ThrowWhenKernelInputNull(DamPipingSellmeijer4ForcesInput damPipingInput) + private void ThrowWhenKernelInputNull(DamPipingSellmeijer4ForcesInput damPipingInput) { if (damPipingInput == null) { throw new NoNullAllowedException(Resources.DamPipingSellmeijer4ForcesKernelWrapper_NoInputObjectDefinedForSellmeijer4Forces); } } - private static void ThrowWhenKernelOutputNull(DamPipingSellmeijer4ForcesOutput damPipingOutput) + private void ThrowWhenKernelOutputNull(DamPipingSellmeijer4ForcesOutput damPipingOutput) { if (damPipingOutput == null) { throw new NoNullAllowedException(Resources.DamPipingSellmeijer4ForcesKernelWrapper_NoOutputObjectDefinedForSellmeijer4Forces); } } - private static void ThrowWhenDamKernelInputNull(DamKernelInput damKernelInput) + private void ThrowWhenDamKernelInputNull(DamKernelInput damKernelInput) { if (damKernelInput == null) { Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/WtiPipingSellmeijerRevised/WtiPipingSellmeijerRevisedKernelWrapper.cs =================================================================== diff -u -r4052 -r4229 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/WtiPipingSellmeijerRevised/WtiPipingSellmeijerRevisedKernelWrapper.cs (.../WtiPipingSellmeijerRevisedKernelWrapper.cs) (revision 4052) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/WtiPipingSellmeijerRevised/WtiPipingSellmeijerRevisedKernelWrapper.cs (.../WtiPipingSellmeijerRevisedKernelWrapper.cs) (revision 4229) @@ -84,8 +84,10 @@ PlLines plLines = PlLinesHelper.CreatePlLinesForPiping(damKernelInput.TimeStepDateTime, location, soilProfile1D, waterLevel); - EvaluateUpliftSituation(damKernelInput, out kernelDataInput, plLines, waterLevel, damPipingOutput); - return PrepareResult.Successful; + if (EvaluateUpliftSituation(damKernelInput, out kernelDataInput, plLines, waterLevel, damPipingOutput)) + { + return PrepareResult.Successful; + } } } @@ -411,7 +413,7 @@ /// /// Type of the characteristic point. /// the PipingCharacteristicPointType - internal static PipingCharacteristicPointType ConvertToPipingPointType(CharacteristicPointType characteristicPointType) + internal PipingCharacteristicPointType ConvertToPipingPointType(CharacteristicPointType characteristicPointType) { switch (characteristicPointType) { @@ -430,7 +432,7 @@ /// /// The surface line. /// the PipingSurfaceLine - internal static PipingSurfaceLine ConvertToPipingSurfaceLine(SurfaceLine2 surfaceLine) + internal PipingSurfaceLine ConvertToPipingSurfaceLine(SurfaceLine2 surfaceLine) { var pipingSurfaceLine = new PipingSurfaceLine(); foreach (CharacteristicPoint surfaceLineCharacteristicPoint in surfaceLine.CharacteristicPoints) @@ -453,7 +455,7 @@ /// /// The soil profile1 d. /// the PipingProfile - internal static PipingProfile ConvertToPipingProfile(SoilProfile1D soilProfile1D) + internal PipingProfile ConvertToPipingProfile(SoilProfile1D soilProfile1D) { var pipingProfile = new PipingProfile(); foreach (SoilLayer1D soilLayer1D in soilProfile1D.Layers) @@ -474,21 +476,21 @@ return pipingProfile; } - internal static void AssignFailedValuesWtiUplift(WtiPipingSellmeijerRevisedOutput wtiPipingOutput) + internal void AssignFailedValuesWtiUplift(WtiPipingSellmeijerRevisedOutput wtiPipingOutput) { wtiPipingOutput.FoSu = defaultFailedValue; wtiPipingOutput.Hcu = defaultFailedValue; wtiPipingOutput.DeltaPhiCu = defaultFailedValue; } - internal static void AssignFailedValuesWtiHeave(WtiPipingSellmeijerRevisedOutput wtiPipingOutput) + internal void AssignFailedValuesWtiHeave(WtiPipingSellmeijerRevisedOutput wtiPipingOutput) { wtiPipingOutput.FoSh = defaultFailedValue; wtiPipingOutput.Hch = defaultFailedValue; wtiPipingOutput.Gradient = defaultFailedValue; } - internal static void AssignFailedValuesWtiSellmeijerRevised(WtiPipingSellmeijerRevisedOutput wtiPipingOutput) + internal void AssignFailedValuesWtiSellmeijerRevised(WtiPipingSellmeijerRevisedOutput wtiPipingOutput) { wtiPipingOutput.FoSbe = defaultFailedValue; wtiPipingOutput.Hcbe = defaultFailedValue; @@ -503,7 +505,7 @@ /// The pl lines. /// The water level. /// The dam piping output. - private static void EvaluateUpliftSituation(DamKernelInput damKernelInput, out IKernelDataInput kernelDataInput, + private bool EvaluateUpliftSituation(DamKernelInput damKernelInput, out IKernelDataInput kernelDataInput, PlLines plLines, double waterLevel, WtiPipingSellmeijerRevisedOutput damPipingOutput) { @@ -525,92 +527,89 @@ UpliftLocationAndResult upliftLocationAndResult = upliftLocationDeterminator.GetLocationAndResult(upliftCriterion); upliftSituation.IsUplift = (upliftLocationAndResult != null); double 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); + double xExit = upliftLocationAndResult.X; + double surfaceLevel = surfaceLine.Geometry.GetZatX(upliftLocationAndResult.X); double topLevelAquifer = soilProfile1D.GetLayerWithName(upliftLocationAndResult.LayerWhereUpliftOccuresId).TopLevel; - dCoverLayer = DamPipingHelper.DetermineHeightCoverLayer(topLevelAquifer, surfaceLevel); + double dCoverLayer = DamPipingHelper.DetermineHeightCoverLayer(topLevelAquifer, surfaceLevel); SoilProfile1DAquiferLayerCombiner.AquiferLayerProperties aquiferLayer = SoilProfile1DAquiferLayerCombiner.CombineLayers(soilProfile1D, upliftLocationAndResult.LayerWhereUpliftOccuresId); - d70 = aquiferLayer.D70; + double d70 = aquiferLayer.D70; - aquiferHeight = aquiferLayer.Height; - permeabilityKx = aquiferLayer.PermeabilityKx; - upliftFactor = upliftLocationAndResult.UpliftFactor; - } + double aquiferHeight = aquiferLayer.Height; + double permeabilityKx = aquiferLayer.PermeabilityKx; + double? upliftFactor = upliftLocationAndResult.UpliftFactor; + double seepageLength = (xExit - xEntry) + damKernelInput.Location.DistanceToEntryPoint; - double seepageLength = (xExit - xEntry) + damKernelInput.Location.DistanceToEntryPoint; + // 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.Scenarios[0].PolderLevel, surfaceLevel); - // 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.Scenarios[0].PolderLevel, surfaceLevel); + Soil inBetweenAquiferlayerSoil = soilProfile1D.BottomAquiferLayer.Soil; + if (soilProfile1D.InBetweenAquiferLayer != null) + { + inBetweenAquiferlayerSoil = soilProfile1D.InBetweenAquiferLayer.Soil; + } - Soil inBetweenAquiferlayerSoil = soilProfile1D.BottomAquiferLayer.Soil; - if (soilProfile1D.InBetweenAquiferLayer != null) - { - inBetweenAquiferlayerSoil = soilProfile1D.InBetweenAquiferLayer.Soil; - } + // Additional parameters for Uplift + double phiPolder = referenceLevel; + double rExit = 1 - location.ModelParametersForPlLines.DampingFactorPl3; + if (soilProfile1D.InBetweenAquiferLayer != null) + { + rExit = 1 - location.ModelParametersForPlLines.DampingFactorPl4; + } - // Additional parameters for Uplift - double phiPolder = referenceLevel; - double rExit = 1 - location.ModelParametersForPlLines.DampingFactorPl3; - if (soilProfile1D.InBetweenAquiferLayer != null) - { - rExit = 1 - location.ModelParametersForPlLines.DampingFactorPl4; + EffectiveThicknessCalculator effectiveThicknessCalculator = CreateEffectiveThicknessCalculator(soilProfile1D, surfaceLine, location.Scenarios[0].PolderLevel, + Physics.UnitWeightOfwater, xExit); + effectiveThicknessCalculator.Calculate(); + double effectiveStress = effectiveThicknessCalculator.EffectiveStress; + + // Fill the input for the wti-uplift calculation as well as the wti-piping SellmeijerRevised calculation. + kernelDataInput = new WtiPipingSellmeijerRevisedInput + { + HRiver = waterLevel, + HExit = referenceLevel, + Rc = defaultFluidisationGradient, + DTotal = dCoverLayer, + SeepageLength = seepageLength, + // specific Sellmeijer 4 Forces + KinematicViscosityWater = Physics.WaterViscosity, + VolumetricWeightOfWater = Physics.UnitWeightOfwater, + WhitesDragCoefficient = inBetweenAquiferlayerSoil.WhitesConstant, + BeddingAngle = inBetweenAquiferlayerSoil.BeddingAngle, + D70 = d70, + DAquifer = aquiferHeight, + DarcyPermeability = permeabilityKx, + ModelFactorUplift = 1.0, + EffectiveStress = effectiveStress, + PhiExit = phiPolder + rExit * (waterLevel - phiPolder), + RExit = rExit, + PhiPolder = phiPolder + }; + damPipingOutput.EffectiveStress = effectiveStress; + damPipingOutput.ExitPointX = xExit; + damPipingOutput.UpliftFactor = upliftFactor; + damPipingOutput.UpliftSituation = upliftSituation; + damPipingOutput.DeltaPhibe = waterLevel - referenceLevel - defaultFluidisationGradient * dCoverLayer; + damPipingOutput.SeepageLength = seepageLength; + return true; } - EffectiveThicknessCalculator effectiveThicknessCalculator = CreateEffectiveThicknessCalculator(soilProfile1D, surfaceLine, location.Scenarios[0].PolderLevel, - Physics.UnitWeightOfwater, xExit); - effectiveThicknessCalculator.Calculate(); - double effectiveStress = effectiveThicknessCalculator.EffectiveStress; - - // Fill the input for the wti-uplift calculation as well as the wti-piping SellmeijerRevised calculation. - kernelDataInput = new WtiPipingSellmeijerRevisedInput - { - HRiver = waterLevel, - HExit = referenceLevel, - Rc = defaultFluidisationGradient, - DTotal = dCoverLayer, - SeepageLength = seepageLength, - // specific Sellmeijer 4 Forces - KinematicViscosityWater = Physics.WaterViscosity, - VolumetricWeightOfWater = Physics.UnitWeightOfwater, - WhitesDragCoefficient = inBetweenAquiferlayerSoil.WhitesConstant, - BeddingAngle = inBetweenAquiferlayerSoil.BeddingAngle, - D70 = d70, - DAquifer = aquiferHeight, - DarcyPermeability = permeabilityKx, - ModelFactorUplift = 1.0, - EffectiveStress = effectiveStress, - PhiExit = phiPolder + rExit * (waterLevel - phiPolder), - RExit = rExit, - PhiPolder = phiPolder - }; - damPipingOutput.EffectiveStress = effectiveStress; - damPipingOutput.ExitPointX = xExit; - damPipingOutput.UpliftFactor = upliftFactor; - damPipingOutput.UpliftSituation = upliftSituation; - damPipingOutput.DeltaPhibe = waterLevel - referenceLevel - defaultFluidisationGradient * dCoverLayer; - damPipingOutput.SeepageLength = seepageLength; + kernelDataInput = new WtiPipingSellmeijerRevisedInput(); + return false; } /// /// Creates the piping calculator wti sellmeijer revised. /// /// The kernel data input. /// the Sellmeijer2011Calculator - private static Sellmeijer2011Calculator CreatePipingCalculatorWtiSellmeijerRevised(IKernelDataInput kernelDataInput) + private Sellmeijer2011Calculator CreatePipingCalculatorWtiSellmeijerRevised(IKernelDataInput kernelDataInput) { var wtiPipingSellmeijerRevisedInput = kernelDataInput as WtiPipingSellmeijerRevisedInput; ThrowWhenKernelInputNull(wtiPipingSellmeijerRevisedInput); @@ -642,7 +641,7 @@ /// /// The kernel data input. /// - private static WTIUpliftCalculator CreateWtiUpliftCalculator(IKernelDataInput kernelDataInput) + private WTIUpliftCalculator CreateWtiUpliftCalculator(IKernelDataInput kernelDataInput) { var wtiPipingSellmeijerRevisedInput = kernelDataInput as WtiPipingSellmeijerRevisedInput; ThrowWhenKernelInputNull(wtiPipingSellmeijerRevisedInput); @@ -665,7 +664,7 @@ /// /// The kernel data input. /// - private static HeaveCalculator CreateWtiHeaveCalculator(IKernelDataInput kernelDataInput) + private HeaveCalculator CreateWtiHeaveCalculator(IKernelDataInput kernelDataInput) { var wtiPipingSellmeijerRevisedInput = kernelDataInput as WtiPipingSellmeijerRevisedInput; ThrowWhenKernelInputNull(wtiPipingSellmeijerRevisedInput); @@ -689,7 +688,7 @@ /// The volumetric weight of water. /// The x exit. /// the EffectiveThicknessCalculator - private static EffectiveThicknessCalculator CreateEffectiveThicknessCalculator(SoilProfile1D soilProfile, SurfaceLine2 surfaceLine, + private EffectiveThicknessCalculator CreateEffectiveThicknessCalculator(SoilProfile1D soilProfile, SurfaceLine2 surfaceLine, double phreaticLevel, double volumicWeightOfWater, double xExit) { var calculator = new EffectiveThicknessCalculator @@ -709,7 +708,7 @@ /// The messages. /// The wti piping output. /// The wti piping input. - private static void PerformSingleCalculationWtiSellmeijerRevised(out List messages, WtiPipingSellmeijerRevisedOutput wtiPipingOutput, + private void PerformSingleCalculationWtiSellmeijerRevised(out List messages, WtiPipingSellmeijerRevisedOutput wtiPipingOutput, WtiPipingSellmeijerRevisedInput wtiPipingInput) { wtiPipingOutput.FoSbe = defaultMaxReturnValue; @@ -737,7 +736,7 @@ /// The messages. /// The wti piping output. /// The wti piping input. - private static void PerformSingleCalculationWtiUplift(out List messages, WtiPipingSellmeijerRevisedOutput wtiPipingOutput, + private void PerformSingleCalculationWtiUplift(out List messages, WtiPipingSellmeijerRevisedOutput wtiPipingOutput, WtiPipingSellmeijerRevisedInput wtiPipingInput) { wtiPipingOutput.FoSu = defaultMaxReturnValue; @@ -759,7 +758,7 @@ } } - private static void PerformSingleCalculationWtiHeave(out List messages, WtiPipingSellmeijerRevisedOutput wtiPipingOutput, + private void PerformSingleCalculationWtiHeave(out List messages, WtiPipingSellmeijerRevisedOutput wtiPipingOutput, WtiPipingSellmeijerRevisedInput wtiPipingInput) { wtiPipingOutput.FoSh = defaultMaxReturnValue; @@ -781,23 +780,23 @@ } } - private static void ThrowWhenKernelInputNull(WtiPipingSellmeijerRevisedInput wtiPipingInput) + private void ThrowWhenKernelInputNull(WtiPipingSellmeijerRevisedInput wtiPipingInput) { if (wtiPipingInput == null) { throw new NoNullAllowedException(Resources.WtiPipingSellmeijerRevisedKernelWrapper_NoInputObjectDefined); } } - private static void ThrowWhenKernelOutputNull(WtiPipingSellmeijerRevisedOutput wtiPipingOutput) + private void ThrowWhenKernelOutputNull(WtiPipingSellmeijerRevisedOutput wtiPipingOutput) { if (wtiPipingOutput == null) { throw new NoNullAllowedException(Resources.WtiPipingSellmeijerRevisedKernelWrapper_NoOutputObjectDefined); } } - private static void ThrowWhenDamKernelInputNull(DamKernelInput damKernelInput) + private void ThrowWhenDamKernelInputNull(DamKernelInput damKernelInput) { if (damKernelInput == null) { Index: DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/WtiPipingSellmeijerRevisedTests.cs =================================================================== diff -u -r4052 -r4229 --- DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/WtiPipingSellmeijerRevisedTests.cs (.../WtiPipingSellmeijerRevisedTests.cs) (revision 4052) +++ DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/WtiPipingSellmeijerRevisedTests.cs (.../WtiPipingSellmeijerRevisedTests.cs) (revision 4229) @@ -267,4 +267,40 @@ Assert.IsNotNull(outputString); return DamXmlSerialization.LoadOutputFromXmlString(outputString); } + + [Test] + [TestCase(1)] + [TestCase(4)] + public void TestDAMSUP_169(int maxCores) + { + const string mapTestFiles = @"TestFiles\"; + string fullInputFilename = Path.Combine(mapTestFiles, "DAMSUP169WtiSellmeijerRevised.xml"); + Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; + string inputString = File.ReadAllText(fullInputFilename); + var engineInterface = new EngineInterface(inputString); + Assert.IsNotNull(engineInterface.DamProjectData); + engineInterface.DamProjectData.MaxCalculationCores = maxCores; + string result = engineInterface.Validate(); + Assert.IsTrue(result == null, "Validation must succeed but does not, see output xml in debugger"); + string outputString = engineInterface.Run(); + string outputName = "Output" + maxCores + ".xml"; + File.WriteAllText(outputName, outputString); + Output output = DamXmlSerialization.LoadOutputFromXmlString(outputString); + int errorCount = GeneralHelper.DetermineNumberOfCalculationErrors(engineInterface.DamProjectData.CalculationMessages); + Assert.AreEqual(0, errorCount, "There should be nor errors during the calculation."); + Assert.AreNotEqual(null, output.Results.CalculationResults); + Assert.AreEqual(6, output.Results.CalculationResults.Length); + Assert.AreEqual(26.006, output.Results.CalculationResults[0].PipingDesignResults.Wti2017FactorOverall, tolerance); + Assert.AreEqual(90.000, output.Results.CalculationResults[1].PipingDesignResults.Wti2017FactorOverall, tolerance); + Assert.AreEqual(90.000, output.Results.CalculationResults[2].PipingDesignResults.Wti2017FactorOverall, tolerance); + Assert.AreEqual(90.000, output.Results.CalculationResults[3].PipingDesignResults.Wti2017FactorOverall, tolerance); + Assert.AreEqual(9.316, output.Results.CalculationResults[4].PipingDesignResults.Wti2017FactorOverall, tolerance); + Assert.AreEqual(90.000, output.Results.CalculationResults[5].PipingDesignResults.Wti2017FactorOverall, tolerance); + Assert.AreEqual(5, output.Results.CalculationMessages.Length); + Assert.IsTrue(output.Results.CalculationMessages[0].Message1.Contains("no uplift")); + Assert.IsTrue(output.Results.CalculationMessages[1].Message1.Contains("no uplift")); + Assert.IsTrue(output.Results.CalculationMessages[2].Message1.Contains("no uplift")); + Assert.IsTrue(output.Results.CalculationMessages[3].Message1.Contains("no uplift")); + Assert.IsTrue(output.Results.CalculationMessages[4].Message1.Contains("no uplift")); + } } \ No newline at end of file Index: DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/TestFiles/DAMSUP169WtiSellmeijerRevised.xml =================================================================== diff -u --- DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/TestFiles/DAMSUP169WtiSellmeijerRevised.xml (revision 0) +++ DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/TestFiles/DAMSUP169WtiSellmeijerRevised.xml (revision 4229) @@ -0,0 +1,1167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file