//-----------------------------------------------------------------------
//
// Copyright (c) 2011 Deltares. All rights reserved.
//
// B.S.T.I.M. The
// tom.the@deltares.nl
// 21-06-2011
// Test UpliftRWEvaluator
//-----------------------------------------------------------------------
using Deltares.Geotechnics;
using Deltares.Geotechnics.Soils;
using Deltares.Geotechnics.SurfaceLines;
using Deltares.Geotechnics.TestUtils;
namespace Deltares.Dam.Tests
{
using System;
using NUnit.Framework;
using Deltares.Dam.Data;
[TestFixture]
public class UpliftRWEvaluatorTests
{
[Test]
public void CanDetectUplift()
{
UpliftRWEvaluator upliftRWEvaluator = new UpliftRWEvaluator();
using (var surfaceLineTutorial1 = FactoryForSurfaceLineTests.CreateSurfaceLineTutorial1())
using (Location location = CreateLocation(surfaceLineTutorial1))
{
// Next adjustment to meet condition that all PL3 points removal is enabled (see PLLinesCreator.DetermineHowToActDueToDitch())
location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DitchPolderSide).X += 2.5;
SoilProfile1D soilProfile = FactoryForSoilProfileTests.CreateClaySandProfile();
foreach (SoilLayer1D layer in soilProfile.Layers)
{
layer.Soil.DryUnitWeight = layer.Soil.AbovePhreaticLevel - 10;
}
Enum[] previousChoices = CreateChoices();
previousChoices[2] = DikeDrySensitivity.None;
UpliftType uplifType = (UpliftType)upliftRWEvaluator.Evaluate(location, new SoilGeometry(soilProfile, null), previousChoices);
Assert.AreEqual(UpliftType.NoUplift, uplifType);
previousChoices[2] = DikeDrySensitivity.Dry;
foreach (SoilLayer1D layer in soilProfile.Layers)
{
layer.Soil.BelowPhreaticLevel = layer.Soil.BelowPhreaticLevel - 10;
}
uplifType = (UpliftType)upliftRWEvaluator.Evaluate(location, new SoilGeometry(soilProfile, null), previousChoices);
Assert.AreEqual(UpliftType.Uplift, uplifType);
}
}
private Location CreateLocation(SurfaceLine2 surfaceline)
{
var location = new Location();
location.Name = "Test location";
location.DredgingDepth = -4.0;
location.BoezemLevelTp = 2.0;
location.BoezemLevelHbp = 1.8;
location.PolderLevel = -1.0;
location.PolderLevelLow = -1.0;
location.HeadPl3 = location.BoezemLevelHbp - 0.1;
location.HeadPl4 = location.BoezemLevelHbp - 0.1;
location.SurfaceLine2 = surfaceline;
location.LocalXZSurfaceLine2 = location.SurfaceLine2;
location.LocalXZSheetPilePoint = location.LocalXZSurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver);
location.ModelFactors.UpliftCriterionStability = 1.0;
location.SheetPileLength = 0.0;
return location;
}
private Enum[] CreateChoices()
{
Enum[] choices = new Enum[3];
choices[0] = HydraulicShortcutType.NoHydraulicShortcut;
choices[1] = LoadSituation.Dry;
choices[2] = DikeDrySensitivity.None;
return choices;
}
}
}