//-----------------------------------------------------------------------
//
// Copyright (c) 2011 Deltares. All rights reserved.
//
// B.S.T.I.M. The
// tom.the@deltares.nl
// 09-06-2011
// Evaluate thickness of aquitard layer
//-----------------------------------------------------------------------
using Deltares.Geotechnics.Soils;
namespace Deltares.Dam.Data
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Deltares.Soilbase;
using Deltares.Geotechnics;
public class AquitardEvaluatorException : Exception
{
public AquitardEvaluatorException(string message)
: base(message)
{
}
}
public class AquitardEvaluator
{
private SoilProfile1D soilProfile;
const double CMinimimalUnitWeightAquitard = 12.0; // kN/m2
public AquitardEvaluator(SoilProfile1D soilProfile)
{
this.soilProfile = soilProfile;
}
///
/// Sum all aquitards between boezembottom and aquifer with a minimum weight of CMinimimalUnitWeightAquitard
///
///
///
public double DetermineAquitardThicknessWithMinimalWeight(double surfaceLevel, Soil embankmentMaterial)
{
return DetermineAquitardThickness(surfaceLevel, true, embankmentMaterial);
}
///
/// Sum all aquitards between boezembottom and aquifer without check on minimum weight
///
///
///
public double DetermineAquitardThicknessWithoutMinimalWeight(double surfaceLevel, Soil embankmentMaterial)
{
return DetermineAquitardThickness(surfaceLevel, false, embankmentMaterial);
}
///
/// Sum all aquitards between boezembottom and aquifer
///
///
///
///
private double DetermineAquitardThickness(double surfaceLevel, bool checkOnMinimalWeight, Soil embankmentMaterial)
{
ThrowExceptionWhenSurfaceLevelOutsideProfile(surfaceLevel, embankmentMaterial);
double aquitardBottomLevel = this.soilProfile.GetTopLevelOfHighestAquifer();
double thickness = 0.0;
List layers = new List(this.soilProfile.Layers);
if (surfaceLevel > soilProfile.TopLevel)
{
SoilLayer1D embankmentLayer = new SoilLayer1D(embankmentMaterial, surfaceLevel);
layers.Insert(0, embankmentLayer);
}
foreach (SoilLayer1D layer in layers)
{
bool includeLayer = true;
// Only include layer if soil has minimal weight
if (checkOnMinimalWeight)
{
includeLayer = layer.Soil.BelowPhreaticLevel >= CMinimimalUnitWeightAquitard;
}
// Only include layer if soil is waterremmend (clay or peat)
includeLayer = includeLayer && (layer.Soil.SoilType == SoilType.Clay || layer.Soil.SoilType == SoilType.Peat);
if (includeLayer)
{
double levelTop = Math.Min(surfaceLevel, layer.TopLevel);
double levelBottom = soilProfile.TopLevel;
if (soilProfile.Layers.Contains(layer))
{
levelBottom = Math.Max(aquitardBottomLevel, layer.TopLevel - soilProfile.GetLayerHeight(layer));
}
if (levelTop > levelBottom)
{
thickness += (levelTop - levelBottom);
}
}
}
return thickness;
}
public double DetermineAquitardClayThickness(double surfaceLevel)
{
ThrowExceptionWhenSurfaceLevelOutsideProfile(surfaceLevel, null);
//ThrowExceptionWhenMoreThan2Aquifers();
double aquitardBottomLevel = this.soilProfile.GetTopLevelOfHighestAquifer();
double thickness = 0.0;
foreach (SoilLayer1D layer in soilProfile.Layers)
{
if (layer.Soil.SoilType == SoilType.Clay)
{
double levelTop = Math.Min(surfaceLevel, layer.TopLevel);
double levelBottom = Math.Max(aquitardBottomLevel, layer.TopLevel - soilProfile.GetLayerHeight(layer));
if (levelTop > levelBottom)
{
thickness += (levelTop - levelBottom);
}
}
}
return thickness;
}
private void ThrowExceptionWhenSurfaceLevelOutsideProfile(double surfaceLevel, Soil embankmentMaterial)
{
if (surfaceLevel < soilProfile.BottomLevel || (surfaceLevel > soilProfile.TopLevel && embankmentMaterial == null))
{
throw new AquitardEvaluatorException(String.Format(
"Specified z-level {0} in AquitardEvaluator outside soilprofile '{1}' (should be between {2} and {3}",
surfaceLevel, soilProfile.Name, soilProfile.BottomLevel, soilProfile.TopLevel));
}
}
private void ThrowExceptionWhenMoreThan2Aquifers()
{
if (soilProfile.GetAquiferLayers().Count > 2)
{
throw new AquitardEvaluatorException("Soilprofile has more than 2 aquifers");
}
}
}
}