// Copyright (C) Stichting Deltares 2017. 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.Io; using NUnit.Framework; using NUnit.Framework.Constraints; namespace Deltares.DamEngine.Interface.Tests { [TestFixture] public class PipingBlighTests { private const double tolerance = 0.0005; [Test] public void CanPerformBlighDesignPipingVoorbeeld1() { const string fileName = @"TestFiles\PipingVoorbeeld1_BlighInputFile.xml"; string inputString = File.ReadAllText(fileName); EngineInterface engineInterface = new EngineInterface(inputString); Assert.IsNotNull(engineInterface.DamProjectData); string outputString = engineInterface.Run(); // Factor piping = 0.521 // Kritische hoogte = 1.667 // Factor opdrijven = 0.5825 // 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 opdrijven 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.521, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.BlighFactor, tolerance); Assert.AreEqual(1.667, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.BlighHcritical, 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 CanPerformBlighDesignRechterDiezedijk() { const string fileName = @"TestFiles\Rechter Diezedijk_BlighInputFile.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); Assert.AreEqual(122, output.Results.CalculationResults.DesignResults.Length); Assert.AreEqual(0.7825, output.Results.CalculationResults.DesignResults[0].PipingDesignResults.BlighFactor, tolerance); Assert.AreEqual(0.8089, output.Results.CalculationResults.DesignResults[121].PipingDesignResults.BlighFactor, tolerance); } } }