using Deltares.Geotechnics;
using Deltares.Geotechnics.Soils;
namespace Deltares.Stability
{
public class UpliftCalculator
{
public SoilProfile2D SoilProfile2D { get; set; }
public Waternet Waternet { get; set; }
///
/// Get the uplift factor (i.e. mass of soil and free water divided by the water pressures due to PL-lines)
/// at the top of the highest aquifer. If pore pressures are negative, no uplift is possible, so uplift potential is 999.
///
/// X coordinate of the evaluated vertical
public double DetermineUpliftPotentialAtXAtTopOfHighestAquiferFromA2DProfile(double x)
{
SoilProfile1D soilProfile1D = SoilProfile2D.GetSoilProfile1D(x);
double zEvaluated = soilProfile1D.GetTopLevelOfHighestAquifer();
if (Waternet.PhreaticLine != null)
{
double phreaticLevel = Waternet.PhreaticLine.GetZAtX(x);
// mass = soil pressure including (eventually) free water above surface level
double massSoilAndFreeWater = soilProfile1D.GetTotalPressure(zEvaluated, phreaticLevel,
Waternet.UnitWeight);
double waterPressure = Waternet.PorePressureFromPiezoLevelLines(x, zEvaluated);
// If the pore pressures are negative, no uplift is possible, so a large value is used as uplift potential
if (waterPressure <= 0.0)
{
return 999;
}
return massSoilAndFreeWater/waterPressure;
}
else
{
return 999;
}
}
}
}