// Copyright (C) Stichting Deltares 2018. All rights reserved. // // This file is part of the Dam Engine. // // The Dam Engine is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . // // All names, logos, and references to "Deltares" are registered trademarks of // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. using System.IO; using Deltares.DamEngine.Data.General; using Deltares.DamEngine.Data.Geotechnics; using Deltares.DamEngine.Io; using NUnit.Framework; namespace Deltares.DamEngine.Interface.Tests { [TestFixture] public class PipingSellmeijer4ForcesTests { private const double tolerance = 0.0005; [Test] public void CanPerformSellmeijer4ForcesDesignPipingVoorbeeld1() { // Based on ".\data\DamEngineTestProjects\PipingVoorbeeld1\PipingSellmeijer4Forces.damx" // Set Analysis type to "No Adaption" const string fileName = @"TestFiles\PipingVoorbeeld1_Sellmeijer4ForcesInputFile.xml"; string inputString = File.ReadAllText(fileName); EngineInterface engineInterface = new EngineInterface(inputString); Assert.IsNotNull(engineInterface.DamProjectData); string outputString = engineInterface.Run(); // Factor piping = 0.506 // Kritische hoogte = 1.619 // Factor opdrijven = 0.351 // Kwelweglengte piping = 25.0 // Intredepunt x-lokaal = 10.0 // Uittredepunt x-lokaal = 35.0 // Opdrijven = true // Profielnaam = soilprofile_01 // PL3 opdrijven = 0.582 // PL3 stijghoogte aangepast = 1.262 // PL3 locatie opdriven lokaal = 35.0 // PL4 opdrijven = 0.0 // PL4 stijghoogte aangepast = 0.0 // PL4 locatie opdrijven lokaal = 0.0 // Locatie naam = "profiel 1" // ID locatie scenario = "1" // Heave Factor = 90.0 Assert.IsNotNull(outputString); var output = DamXmlSerialization.LoadOutputFromXmlString(outputString); Assert.AreEqual(0.506, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.Sellmeijer4ForcesFactor, tolerance); Assert.AreEqual(1.619, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.Sellmeijer4ForcesHcritical, tolerance); Assert.AreEqual(35.0, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.ExitPointX, tolerance); // The following values are not the same as in the classic UI // The upliftfactor there is 0.351, but that is the Wti Upliftfactor // The adjusted PL3/PL4 values there are not 0.0, but those are the values for stability; for piping no adjustment has to be made Assert.AreEqual(0.5825, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.UpliftFactor, tolerance); Assert.AreEqual(true, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.UpliftSituation.IsUplift); 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); } [Test] public void CanPerformSellmeijer4ForcesDesignWithAdaptionPipingVoorbeeld1() { // Based on ".\data\DamEngineTestProjects\PipingVoorbeeld1\PipingSellmeijer4Forces.damx" // Set Analysis type to "Adapt geometry" const string fileName = @"TestFiles\PipingVoorbeeld1_Sellmeijer4ForcesDesignInputFile.xml"; string inputString = File.ReadAllText(fileName); EngineInterface engineInterface = new EngineInterface(inputString); Assert.IsNotNull(engineInterface.DamProjectData); string outputString = engineInterface.Run(); Assert.IsNotNull(outputString); var output = DamXmlSerialization.LoadOutputFromXmlString(outputString); DamProjectData actualDamProjectData = FillDamFromXmlOutput.CreateDamProjectData(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); // ShoulderLength = X_Kruin binnenberm - X_Insteek binnenberm = 65.01 - 29.01 = 36.0 // Read from PipingSellmeijer4Forces_Piping_CharacteristicPoints.csv by export surfacelines in Release Assert.AreEqual(36.0, redesignedSurfaceLine.DetermineShoulderLength(), tolerance); Assert.AreEqual(0.0, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.UpliftSituation.Pl3MinUplift, tolerance); Assert.AreEqual(0.0, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.UpliftSituation.Pl3HeadAdjusted, tolerance); Assert.AreEqual(0.0, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.UpliftSituation.Pl3LocationXMinUplift, tolerance); Assert.AreEqual(0.0, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.UpliftSituation.Pl4MinUplift, tolerance); Assert.AreEqual(0.0, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.UpliftSituation.Pl4HeadAdjusted, tolerance); Assert.AreEqual(0.0, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.UpliftSituation.Pl4LocationXMinUplift, tolerance); // The ExitPointX in Dam 15.1.2.24738 is (incorrectly) not shown // ExitPointX = X_Teen dijk binnenwaarts = 76.986 // Read from PipingSellmeijer4Forces_Piping_CharacteristicPoints.csv by export surfacelines in Release Assert.AreEqual(76.986, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.ExitPointX, tolerance); // The following values are not the same as in the Dam 15.1.2.24738 release // The final piping calculation at the redesigned situation is done at X = 29.014 (the "insteek van de berm"), // but it should have been done at X = 76.986 (the "teen van de dijk") // Found expected values by debugging with Classic // after change in Classic: upliftLocationDeterminator.GetLocationAndResult(upliftcriterion - 0.000000001) // The Factor in Dam 15.1.2.24738 is 2.064, but that is not correct, because that is the value at X = 29.014 // expected value = 1.312 Assert.AreEqual(1.312, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.Sellmeijer4ForcesFactor, tolerance); // The Hcritical in Dam 15.1.2.24738 is 1.25, but that is not correct, because that is the value at X = 29.014 // expected value = 4.198 Assert.AreEqual(4.198, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.Sellmeijer4ForcesHcritical, tolerance); // The upliftfactor in Dam 15.1.2.24738 is (incorrectly) not shown // expected value = 0.582 Assert.AreEqual(0.582, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.UpliftFactor, tolerance); } [Test, Category("Work_In_Progress")] public void CanPerformSellmeijer4ForcesDesignWithAdaptionWithHeightPipingVoorbeeld1() { // Based on ".\data\DamEngineTestProjects\PipingVoorbeeld1\PipingSellmeijer4Forces.damx" // Set Analysis type to "Adapt geometry" // Set DTH = 4.5 for location "profiel 1" const string fileName = @"TestFiles\PipingVoorbeeld1_Sellmeijer4ForcesDesignHeightInputFile.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(null, output); SurfaceLine2 redesignedSurfaceLine = actualDamProjectData.DesignCalculations[0].PipingDesignResults.RedesignedSurfaceLine; // The following 2 line are the only differences with CanPerformSellmeijer4ForcesDesignWithAdaptionPipingVoorbeeld1() Assert.AreEqual(4.5, redesignedSurfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtRiver).Z, tolerance); Assert.AreEqual(4.5, redesignedSurfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtPolder).Z, tolerance); // The following test are the same as for CanPerformSellmeijer4ForcesDesignWithAdaptionPipingVoorbeeld1() Assert.AreEqual(true, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.UpliftSituation.IsUplift); Assert.AreEqual(1.995, redesignedSurfaceLine.DetermineShoulderHeight(), tolerance); Assert.AreEqual(66.986, redesignedSurfaceLine.GetDikeLength(), tolerance); Assert.AreEqual(36.0, redesignedSurfaceLine.DetermineShoulderLength(), 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); Assert.AreEqual(1.312, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.Sellmeijer4ForcesFactor, tolerance); Assert.AreEqual(4.198, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.Sellmeijer4ForcesHcritical, tolerance); Assert.AreEqual(0.582, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.UpliftFactor, tolerance); } } }