//----------------------------------------------------------------------- // // Copyright (c) 2009 Deltares. All rights reserved. // // B.S.T.I.M. The // tom.the@deltares.nl // 18-05-2009 // Contains tests forclass PLLineCreator //----------------------------------------------------------------------- using Deltares.Geotechnics.TestUtils; using Deltares.Uplift; using NUnit.Framework; namespace Deltares.Dam.Tests { [TestFixture] public class UpliftCalculatorTest { [Test] public void CalculateExtraHeightForSimpleProfileWithPhreaticLineInProfile() { const double cTolerance = 0.0001; var calculator = new UpliftCalculator(); calculator.SoilProfile = FactoryForSoilProfileTests.CreateSimpleProfile(); calculator.SurfaceLevel = 5.0; calculator.PhreaticLevel = -1.0; calculator.TopOfLayerToBeEvaluated = -10; calculator.VolumicWeightOfWater = 10.0; // Phreatic level in profile // Mass of soil volume above // dry 6 m x 12 kN/m3 = 72 // wet 9 m x 16 kN/m3 = 144 // Total: 72 + 144 = 216 // UpliftFactor = 1.2 // Phreatic pressure // 20 m x 10 kN/m3 = 200 // Mass of Watervolume = 200 // mass of soil = uplift factor * Mass of watervolume = 1.2 * 200 = 240 // Extra mass soil = 240 - 216 = 24 // Extra Height = Extra mass soil / (unit weight soil for raising) = 24 / 12 = 2.0 calculator.UnitWeightSoilEmbankment = null; Assert.AreEqual(2.0, calculator.CalculateExtraHeight(10.0, 1.2), cTolerance); // Extra Height = Extra mass soil / (unit weight soil for raising) = 24 / 8 = 3.0 calculator.UnitWeightSoilEmbankment = 8.0; Assert.AreEqual(3.0, calculator.CalculateExtraHeight(10.0, 1.2), cTolerance); } [Test] public void CalculateHeadOfPlLineForSimpleProfileWithPhreaticLineInProfile() { const double cTolerance = 0.0001; var calculator = new UpliftCalculator(); calculator.SoilProfile = FactoryForSoilProfileTests.CreateSimpleProfile(); calculator.SurfaceLevel = 5.0; calculator.PhreaticLevel = -1.0; calculator.TopOfLayerToBeEvaluated = -10; calculator.VolumicWeightOfWater = 10.0; // Phreatic level in profile // Mass of soil volume above // dry 6 m x 12 kN/m3 = 72 // wet 9 m x 16 kN/m3 = 144 // Total: 72 + 144 = 216 // UpliftFactor = 1.0 // Mass of Watervolume = mass of soil / uplift factor = 216 / 1.0 = 216 // Head = mass of watervolume / volumic weight water - top of layer = 216 / 10 - (-10) = 21.6 - (-10.0) = 11.6 m Assert.AreEqual(11.6, calculator.CalculateHeadOfPLLine(1.0), cTolerance); double upliftFactor = calculator.CalculateUpliftFactor(11.6); Assert.AreEqual(1.0, upliftFactor, cTolerance); calculator.IsUseOvenDryUnitWeight = true; double head = calculator.CalculateHeadOfPLLine(1.0); double upliftFactorOvenDry = calculator.CalculateUpliftFactor(head); Assert.AreEqual(1.0, upliftFactorOvenDry, cTolerance); } [Test] public void CalculateUpliftFactorForSimpleProfileWithPhreaticLineInProfile() { const double cTolerance = 0.0001; var calculator = new UpliftCalculator(); calculator.SoilProfile = FactoryForSoilProfileTests.CreateSimpleProfile(); calculator.SurfaceLevel = 5.0; calculator.PhreaticLevel = -1.0; calculator.TopOfLayerToBeEvaluated = -10; calculator.VolumicWeightOfWater = 10.0; // Phreatic level in profile // Mass of soil volume above // dry 6 m x 12 kN/m3 = 72 // wet 9 m x 16 kN/m3 = 144 // Total: 72 + 144 = 216 // Phreatic pressure // 20 m x 10 kN/m3 = 200 // UpliftFactor = 216/200 = 1.08 Assert.AreEqual(1.08, calculator.CalculateUpliftFactor(10.0), cTolerance); } /// /// Same as above test, but now the oven dry unit weight has to be used /// [Test] public void CalculateUpliftFactorForSimpleProfileWithPhreaticLineInProfileAndDryOption() { const double cTolerance = 0.0001; var calculator = new UpliftCalculator(); calculator.SoilProfile = FactoryForSoilProfileTests.CreateSimpleProfile(); foreach (var layer in calculator.SoilProfile.Layers) { layer.Soil.DryUnitWeight = layer.Soil.AbovePhreaticLevel; layer.Soil.AbovePhreaticLevel = layer.Soil.AbovePhreaticLevel + 1.0; } calculator.SurfaceLevel = 5.0; calculator.PhreaticLevel = -1.0; calculator.TopOfLayerToBeEvaluated = -10; calculator.VolumicWeightOfWater = 10.0; calculator.IsUseOvenDryUnitWeight = true; // Phreatic level in profile // Mass of soil volume above // dry 6 m x 12 kN/m3 = 72 // wet 9 m x 16 kN/m3 = 144 // Total: 72 + 144 = 216 // Phreatic pressure // 20 m x 10 kN/m3 = 200 // UpliftFactor = 216/200 = 1.08 Assert.AreEqual(1.08, calculator.CalculateUpliftFactor(10.0), cTolerance); } [Test] [ExpectedException(typeof(UpliftCalculatorException))] public void ThrowsExceptionWhenSoilProfileParameterIsMissingInCalculateHeadOfPlLine() { var calculator = new UpliftCalculator(); calculator.CalculateHeadOfPLLine(0.0); } [Test] [ExpectedException(typeof(UpliftCalculatorException))] public void ThrowsExceptionWhenSoilProfileParameterIsMissingInCalculateUpliftFactor() { var calculator = new UpliftCalculator(); calculator.CalculateUpliftFactor(0.0); } [TestFixtureSetUp] public void FixtureSetup() {} [TestFixtureTearDown] public void FixtureTearDown() {} } }