// Copyright (C) Stichting Deltares 2018. 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; using System.Collections.Generic; using Deltares.DamEngine.Calculators.Properties; using Deltares.DamEngine.Data.Geotechnics; namespace Deltares.DamEngine.Calculators.RegionalAssessment.Evaluator { /// /// Exception class for AquitardEvaluator /// /// public class AquitardEvaluatorException : Exception { public AquitardEvaluatorException(string message) : base(message) { } } /// /// Class which determines Aquitard values which are used in the determination of hydraulic shortcut. /// public class AquitardEvaluator { private readonly SoilProfile1D soilProfile; const double cMinimimalUnitWeightAquitard = 12.0; // kN/m2 /// /// Initializes a new instance of the class. /// /// The soil profile. 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); } /// /// Determines the aquitard clay thickness. /// /// The surface level. /// public double DetermineAquitardClayThickness(double surfaceLevel) { ThrowExceptionWhenSurfaceLevelOutsideProfile(surfaceLevel, null); double aquitardBottomLevel = 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; } /// /// Sum all aquitards between boezembottom and aquifer /// /// /// /// /// private double DetermineAquitardThickness(double surfaceLevel, bool checkOnMinimalWeight, Soil embankmentMaterial) { ThrowExceptionWhenSurfaceLevelOutsideProfile(surfaceLevel, embankmentMaterial); double aquitardBottomLevel = soilProfile.GetTopLevelOfHighestAquifer(); double thickness = 0.0; List layers = new List(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; } private void ThrowExceptionWhenSurfaceLevelOutsideProfile(double surfaceLevel, Soil embankmentMaterial) { if (surfaceLevel < soilProfile.BottomLevel || (surfaceLevel > soilProfile.TopLevel && embankmentMaterial == null)) { throw new AquitardEvaluatorException(string.Format( Resources.AquitardEvaluatorSurfaceLevelOutsideProfile, surfaceLevel, soilProfile.Name, soilProfile.BottomLevel, soilProfile.TopLevel)); } } } }