Fisheye: Tag e47cee04d169bb53197aeb1ce567f1a286217594 refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Calculation/PipingCalculation.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag e47cee04d169bb53197aeb1ce567f1a286217594 refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Calculation/PipingCalculationException.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag e47cee04d169bb53197aeb1ce567f1a286217594 refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Calculation/PipingCalculationInput.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag e47cee04d169bb53197aeb1ce567f1a286217594 refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Calculation/PipingCalculationResult.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Piping/src/Ringtoets.Piping.Calculation/PipingCalculator.cs
===================================================================
diff -u
--- Ringtoets/Piping/src/Ringtoets.Piping.Calculation/PipingCalculator.cs (revision 0)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Calculation/PipingCalculator.cs (revision e47cee04d169bb53197aeb1ce567f1a286217594)
@@ -0,0 +1,259 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+using Deltares.WTIPiping;
+
+using Ringtoets.Piping.Calculation.Properties;
+
+namespace Ringtoets.Piping.Calculation
+{
+ ///
+ /// This class represents a combination of piping sub-calculations, which together can be used
+ /// to assess based on piping.
+ ///
+ public class PipingCalculator
+ {
+ private readonly PipingCalculatorInput input;
+
+ ///
+ /// Constructs a new . The is used to
+ /// obtain the parameters used in the different sub calculations.
+ ///
+ /// The containing all the values required
+ /// for performing a piping calculation.
+ public PipingCalculator(PipingCalculatorInput input)
+ {
+ this.input = input;
+ }
+
+ ///
+ /// Performs the actual sub calculations and returns a , which
+ /// contains the results of all sub calculations.
+ ///
+ /// A containing the results of the sub calculations.
+ /// Thrown when any of the invocations of the sub-calculations from the kernel throws an Exception.
+ public PipingCalculatorResult Calculate()
+ {
+ var upliftResult = CalculateUplift();
+ var heaveResult = CalculateHeave();
+ var sellmeijerResult = CalculateSellmeijer();
+
+ return new PipingCalculatorResult(
+ upliftResult.Zu,
+ upliftResult.FoSu,
+ heaveResult.Zh,
+ heaveResult.FoSh,
+ sellmeijerResult.Zp,
+ sellmeijerResult.FoSp
+ );
+ }
+
+ ///
+ /// Returns a list of validation messages. The validation messages are based on the values of the
+ /// which was provided to this and are determined by the Piping kernel.
+ ///
+ public List Validate()
+ {
+ List soilProfileValidationResults = ValidateSoilProfile();
+ List surfaceLineValidationResults = ValidateSurfaceLine();
+ List upliftCalculatorValidationResults = new List();
+ if (soilProfileValidationResults.Count == 0 && surfaceLineValidationResults.Count == 0)
+ {
+ upliftCalculatorValidationResults = ValidateUpliftCalculator();
+ }
+ List heaveCalculatorValidationResults = CreateHeaveCalculator().Validate();
+ List sellmeijerCalculatorValidationResults = CreateSellmeijerCalculator().Validate();
+
+ return upliftCalculatorValidationResults
+ .Concat(surfaceLineValidationResults)
+ .Concat(soilProfileValidationResults)
+ .Concat(heaveCalculatorValidationResults)
+ .Concat(sellmeijerCalculatorValidationResults)
+ .ToList();
+ }
+
+ private List ValidateSurfaceLine()
+ {
+ var validationResults = new List();
+ if (input.SurfaceLine == null)
+ {
+ validationResults.Add(Resources.PipingCalculation_Validate_Lacks_surfaceline_uplift);
+ }
+ else
+ {
+ try
+ {
+ PipingSurfaceLineCreator.Create(input.SurfaceLine).Validate();
+ }
+ catch (PipingSurfaceLineException e)
+ {
+ validationResults.Add(e.Message);
+ }
+ }
+ return validationResults;
+ }
+
+ private List ValidateSoilProfile()
+ {
+ var validationResults = new List();
+ if (input.SoilProfile == null)
+ {
+ validationResults.Add(Resources.PipingCalculation_Validate_Lacks_SoilProfile_uplift);
+ }
+ else
+ {
+ try
+ {
+ PipingProfileCreator.Create(input.SoilProfile).Validate();
+ }
+ catch (PipingProfileException e)
+ {
+ validationResults.Add(e.Message);
+ }
+ }
+ return validationResults;
+ }
+
+ private List ValidateUpliftCalculator()
+ {
+ try
+ {
+ EffectiveThicknessCalculator effectiveThicknessCalculator = CalculateEffectiveThickness();
+ return CreateUpliftCalculator(effectiveThicknessCalculator.EffectiveStress).Validate();
+ }
+ catch (Exception exception)
+ {
+ return new List
+ {
+ exception.Message
+ };
+ }
+ }
+
+ private Sellmeijer2011Calculator CalculateSellmeijer()
+ {
+ Sellmeijer2011Calculator sellmeijerCalculator = CreateSellmeijerCalculator();
+
+ try
+ {
+ sellmeijerCalculator.Calculate();
+ }
+ catch (PipingException e)
+ {
+ throw new PipingCalculatorException(e.Message, e);
+ }
+ catch (PipingException e)
+ {
+ throw new PipingCalculatorException(e.Message, e);
+ }
+
+ return sellmeijerCalculator;
+ }
+
+ private HeaveCalculator CalculateHeave()
+ {
+ var heaveCalculator = CreateHeaveCalculator();
+
+ try
+ {
+ heaveCalculator.Calculate();
+ }
+ catch (PipingException e)
+ {
+ throw new PipingCalculatorException(e.Message, e);
+ }
+
+ return heaveCalculator;
+ }
+
+ private WTIUpliftCalculator CalculateUplift()
+ {
+ EffectiveThicknessCalculator calculatedEffectiveStressResult = CalculateEffectiveThickness();
+ WTIUpliftCalculator upliftCalculator = CreateUpliftCalculator(calculatedEffectiveStressResult.EffectiveStress);
+
+ try
+ {
+ upliftCalculator.Calculate();
+ }
+ catch (WTIUpliftCalculatorException e)
+ {
+ throw new PipingCalculatorException(e.Message, e);
+ }
+ catch (PipingException e)
+ {
+ throw new PipingCalculatorException(e.Message, e);
+ }
+
+ return upliftCalculator;
+ }
+
+ private HeaveCalculator CreateHeaveCalculator()
+ {
+ var calculator = new HeaveCalculator
+ {
+ Ich = input.CriticalHeaveGradient,
+ PhiExit = input.PiezometricHeadExit,
+ DTotal = input.ThicknessCoverageLayer,
+ PhiPolder = input.PiezometricHeadPolder,
+ RExit = input.DampingFactorExit,
+ HExit = input.PhreaticLevelExit
+ };
+ return calculator;
+ }
+
+ private WTIUpliftCalculator CreateUpliftCalculator(double effectiveStress)
+ {
+ var calculator = new WTIUpliftCalculator
+ {
+ VolumetricWeightOfWater = input.WaterVolumetricWeight,
+ ModelFactorUplift = input.UpliftModelFactor,
+ EffectiveStress = effectiveStress,
+ HRiver = input.AssessmentLevel,
+ PhiExit = input.PiezometricHeadExit,
+ RExit = input.DampingFactorExit,
+ HExit = input.PhreaticLevelExit,
+ PhiPolder = input.PiezometricHeadPolder
+ };
+ return calculator;
+ }
+
+ private Sellmeijer2011Calculator CreateSellmeijerCalculator()
+ {
+ var calculator = new Sellmeijer2011Calculator
+ {
+ ModelFactorPiping = input.SellmeijerModelFactor,
+ HRiver = input.AssessmentLevel,
+ HExit = input.PhreaticLevelExit,
+ Rc = input.SellmeijerReductionFactor,
+ DTotal = input.ThicknessCoverageLayer,
+ SeepageLength = input.SeepageLength,
+ GammaSubParticles = input.SandParticlesVolumicWeight,
+ WhitesDragCoefficient = input.WhitesDragCoefficient,
+ D70 = input.Diameter70,
+ VolumetricWeightOfWater = input.WaterVolumetricWeight,
+ DarcyPermeability = input.DarcyPermeability,
+ KinematicViscosityWater = input.WaterKinematicViscosity,
+ Gravity = input.Gravity,
+ DAquifer = input.ThicknessAquiferLayer,
+ D70Mean = input.MeanDiameter70,
+ BeddingAngle = input.BeddingAngle
+ };
+ return calculator;
+ }
+
+ private EffectiveThicknessCalculator CalculateEffectiveThickness()
+ {
+ var calculator = new EffectiveThicknessCalculator
+ {
+ ExitPointXCoordinate = input.ExitPointXCoordinate,
+ PhreaticLevel = input.PhreaticLevelExit,
+ SoilProfile = PipingProfileCreator.Create(input.SoilProfile),
+ SurfaceLine = PipingSurfaceLineCreator.Create(input.SurfaceLine),
+ VolumicWeightOfWater = input.WaterVolumetricWeight
+ };
+ calculator.Calculate();
+ return calculator;
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Piping/src/Ringtoets.Piping.Calculation/PipingCalculatorException.cs
===================================================================
diff -u
--- Ringtoets/Piping/src/Ringtoets.Piping.Calculation/PipingCalculatorException.cs (revision 0)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Calculation/PipingCalculatorException.cs (revision e47cee04d169bb53197aeb1ce567f1a286217594)
@@ -0,0 +1,35 @@
+using System;
+
+namespace Ringtoets.Piping.Calculation
+{
+ ///
+ /// Exception thrown when something went wrong in the
+ ///
+ public class PipingCalculatorException : Exception
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public PipingCalculatorException()
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the class
+ /// with a specified error message.
+ ///
+ /// The message that describes the error.
+ public PipingCalculatorException(string message) : base (message)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the System.Exception class with a specified error message
+ /// and a reference to the inner exception that is the cause of this exception.
+ ///
+ /// The error message that explains the reason for the exception.
+ /// The exception that is the cause of the current exception, or a
+ /// null reference if no inner exception is specified.
+ public PipingCalculatorException(string message, Exception innerException) : base(message, innerException) {}
+ }
+}
\ No newline at end of file
Index: Ringtoets/Piping/src/Ringtoets.Piping.Calculation/PipingCalculatorInput.cs
===================================================================
diff -u
--- Ringtoets/Piping/src/Ringtoets.Piping.Calculation/PipingCalculatorInput.cs (revision 0)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Calculation/PipingCalculatorInput.cs (revision e47cee04d169bb53197aeb1ce567f1a286217594)
@@ -0,0 +1,375 @@
+using Ringtoets.Piping.Data;
+
+namespace Ringtoets.Piping.Calculation
+{
+ ///
+ /// This class contains all the parameters that are required to perform a piping assessment.
+ ///
+ public class PipingCalculatorInput
+ {
+ private readonly double waterVolumetricWeight;
+ private readonly double upliftModelFactor;
+ private readonly double assessmentLevel;
+ private readonly double piezometricHeadExit;
+ private readonly double dampingFactorExit;
+ private readonly double phreaticLevelExit;
+ private readonly double piezometricHeadPolder;
+ private readonly double criticalHeaveGradient;
+ private readonly double thicknessCoverageLayer;
+ private readonly double sellmeijerModelFactor;
+ private readonly double sellmeijerReductionFactor;
+ private readonly double seepageLength;
+ private readonly double sandParticlesVolumicWeight;
+ private readonly double whitesDragCoefficient;
+ private readonly double diameter70;
+ private readonly double darcyPermeability;
+ private readonly double waterKinematicViscosity;
+ private readonly double gravity;
+ private readonly double thicknessAquiferLayer;
+ private readonly double meanDiameter70;
+ private readonly double beddingAngle;
+ private readonly double exitPointXCoordinate;
+ private readonly RingtoetsPipingSurfaceLine surfaceLine;
+ private readonly PipingSoilProfile soilProfile;
+
+ ///
+ /// Constructs a new , which contains values for the parameters used
+ /// in the piping sub calculations.
+ ///
+ /// The volumetric weight of water. [kN/m³]
+ /// The calculation value used to account for uncertainty in the model for uplift.
+ /// The outside high water level. [m]
+ /// The piezometric head at the exit point. [m]
+ /// The damping factor at the exit point.
+ /// The phreatic level at the exit point. [m]
+ /// The piezometric head in the hinterland. [m]
+ /// The critical exit gradient for heave.
+ /// The total thickness of the coverage layer at the exit point. [m]
+ /// The calculation value used to account for uncertainty in the model for Sellmeijer.
+ /// The reduction factor Sellmeijer.
+ /// The horizontal distance between entree and exit point. [m]
+ /// The (lowerbound) volumic weight of sand grain material of a sand layer under water. [kN/m³]
+ /// The White's drag coefficient.
+ /// The sieve size through which 70% fraction of the grains of the top part of the aquifer passes. [m]
+ /// The Darcy-speed with which water flows through the aquifer layer. [m/s]
+ /// The kinematic viscosity of water at 10 degrees Celsius. [m²/s]
+ /// The gravitational acceleration. [m/s²]
+ /// The thickness of the aquifer layer. [m]
+ /// The mean diameter of small scale tests applied to different kinds of sand, on which the formula of Sellmeijer has been fit. [m]
+ /// The angle of the force balance representing the amount in which sand grains resist rolling. [°]
+ /// The x coordinate of the exit point. [m]
+ /// The surface line.
+ /// The profile which contains a 1 dimensional definition of soil layers with properties.
+ public PipingCalculatorInput(double waterVolumetricWeight, double upliftModelFactor, double assessmentLevel, double piezometricHeadExit, double dampingFactorExit, double phreaticLevelExit, double piezometricHeadPolder, double criticalHeaveGradient, double thicknessCoverageLayer, double sellmeijerModelFactor, double sellmeijerReductionFactor, double seepageLength, double sandParticlesVolumicWeight, double whitesDragCoefficient, double diameter70, double darcyPermeability, double waterKinematicViscosity, double gravity, double thicknessAquiferLayer, double meanDiameter70, double beddingAngle, double exitPointXCoordinate, RingtoetsPipingSurfaceLine surfaceLine, PipingSoilProfile soilProfile)
+ {
+ this.waterVolumetricWeight = waterVolumetricWeight;
+ this.upliftModelFactor = upliftModelFactor;
+ this.assessmentLevel = assessmentLevel;
+ this.piezometricHeadExit = piezometricHeadExit;
+ this.dampingFactorExit = dampingFactorExit;
+ this.phreaticLevelExit = phreaticLevelExit;
+ this.piezometricHeadPolder = piezometricHeadPolder;
+ this.criticalHeaveGradient = criticalHeaveGradient;
+ this.thicknessCoverageLayer = thicknessCoverageLayer;
+ this.sellmeijerModelFactor = sellmeijerModelFactor;
+ this.sellmeijerReductionFactor = sellmeijerReductionFactor;
+ this.seepageLength = seepageLength;
+ this.sandParticlesVolumicWeight = sandParticlesVolumicWeight;
+ this.whitesDragCoefficient = whitesDragCoefficient;
+ this.diameter70 = diameter70;
+ this.darcyPermeability = darcyPermeability;
+ this.waterKinematicViscosity = waterKinematicViscosity;
+ this.gravity = gravity;
+ this.thicknessAquiferLayer = thicknessAquiferLayer;
+ this.meanDiameter70 = meanDiameter70;
+ this.beddingAngle = beddingAngle;
+ this.exitPointXCoordinate = exitPointXCoordinate;
+ this.surfaceLine = surfaceLine;
+ this.soilProfile = soilProfile;
+ }
+
+ #region properties
+
+ ///
+ /// Gets the volumetric weight of water.
+ /// [kN/m³]
+ ///
+ public double WaterVolumetricWeight
+ {
+ get
+ {
+ return waterVolumetricWeight;
+ }
+ }
+
+ ///
+ /// Gets the calculation value used to account for uncertainty in the model for uplift.
+ ///
+ public double UpliftModelFactor
+ {
+ get
+ {
+ return upliftModelFactor;
+ }
+ }
+
+ ///
+ /// Gets the outside high water level.
+ /// [m]
+ ///
+ public double AssessmentLevel
+ {
+ get
+ {
+ return assessmentLevel;
+ }
+ }
+
+ ///
+ /// Gets the piezometric head at the exit point.
+ /// [m]
+ ///
+ public double PiezometricHeadExit
+ {
+ get
+ {
+ return piezometricHeadExit;
+ }
+ }
+
+ ///
+ /// Gets the damping factor at the exit point.
+ ///
+ public double DampingFactorExit
+ {
+ get
+ {
+ return dampingFactorExit;
+ }
+ }
+
+ ///
+ /// Gets the phreatic level at the exit point.
+ /// [m]
+ ///
+ public double PhreaticLevelExit
+ {
+ get
+ {
+ return phreaticLevelExit;
+ }
+ }
+
+ ///
+ /// Gets the piezometric head in the hinterland.
+ /// [m]
+ ///
+ public double PiezometricHeadPolder
+ {
+ get
+ {
+ return piezometricHeadPolder;
+ }
+ }
+
+ ///
+ /// Gets the critical exit gradient for heave.
+ ///
+ public double CriticalHeaveGradient
+ {
+ get
+ {
+ return criticalHeaveGradient;
+ }
+ }
+
+ ///
+ /// Gets the total thickness of the coverage layer at the exit point.
+ /// [m]
+ ///
+ public double ThicknessCoverageLayer
+ {
+ get
+ {
+ return thicknessCoverageLayer;
+ }
+ }
+
+ ///
+ /// Gets the calculation value used to account for uncertainty in the model for Sellmeijer.
+ ///
+ public double SellmeijerModelFactor
+ {
+ get
+ {
+ return sellmeijerModelFactor;
+ }
+ }
+
+ ///
+ /// Gets the reduction factor Sellmeijer.
+ ///
+ public double SellmeijerReductionFactor
+ {
+ get
+ {
+ return sellmeijerReductionFactor;
+ }
+ }
+
+ ///
+ /// Gets the horizontal distance between entree and exit point.
+ /// [m]
+ ///
+ public double SeepageLength
+ {
+ get
+ {
+ return seepageLength;
+ }
+ }
+
+ ///
+ /// Gets the (lowerbound) volumic weight of sand grain material of a sand layer under water.
+ /// [kN/m³]
+ ///
+ public double SandParticlesVolumicWeight
+ {
+ get
+ {
+ return sandParticlesVolumicWeight;
+ }
+ }
+
+ ///
+ /// Gets the White's drag coefficient.
+ ///
+ public double WhitesDragCoefficient
+ {
+ get
+ {
+ return whitesDragCoefficient;
+ }
+ }
+
+ ///
+ /// Gets the sieve size through which 70% fraction of the grains of the top part of the aquifer passes.
+ /// [m]
+ ///
+ public double Diameter70
+ {
+ get
+ {
+ return diameter70;
+ }
+ }
+
+ ///
+ /// Gets the Darcy-speed with which water flows through the aquifer layer.
+ /// [m/s]
+ ///
+ public double DarcyPermeability
+ {
+ get
+ {
+ return darcyPermeability;
+ }
+ }
+
+ ///
+ /// Gets the kinematic viscosity of water at 10 degrees Celsius.
+ /// [m²/s]
+ ///
+ public double WaterKinematicViscosity
+ {
+ get
+ {
+ return waterKinematicViscosity;
+ }
+ }
+
+ ///
+ /// Gets the gravitational acceleration.
+ /// [m/s²]
+ ///
+ public double Gravity
+ {
+ get
+ {
+ return gravity;
+ }
+ }
+
+ ///
+ /// Gets the thickness of the aquifer layer.
+ /// [m]
+ ///
+ public double ThicknessAquiferLayer
+ {
+ get
+ {
+ return thicknessAquiferLayer;
+ }
+ }
+
+ ///
+ /// Gets the mean diameter of small scale tests applied to different kinds of sand, on which the formula of Sellmeijer has been fit.
+ /// [m]
+ ///
+ public double MeanDiameter70
+ {
+ get
+ {
+ return meanDiameter70;
+ }
+ }
+
+ ///
+ /// Gets the angle of the force balance representing the amount in which sand grains resist rolling.
+ /// [°]
+ ///
+ public double BeddingAngle
+ {
+ get
+ {
+ return beddingAngle;
+ }
+ }
+
+ ///
+ /// Gets the x coordinate of the exit point.
+ /// [m]
+ ///
+ public double ExitPointXCoordinate
+ {
+ get
+ {
+ return exitPointXCoordinate;
+ }
+ }
+
+ ///
+ /// Gets the surface line.
+ ///
+ public RingtoetsPipingSurfaceLine SurfaceLine
+ {
+ get
+ {
+ return surfaceLine;
+ }
+ }
+
+ ///
+ /// Gets the profile which contains a 1 dimensional definition of soil layers with properties.
+ ///
+ public PipingSoilProfile SoilProfile
+ {
+ get
+ {
+ return soilProfile;
+ }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
Index: Ringtoets/Piping/src/Ringtoets.Piping.Calculation/PipingCalculatorResult.cs
===================================================================
diff -u
--- Ringtoets/Piping/src/Ringtoets.Piping.Calculation/PipingCalculatorResult.cs (revision 0)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Calculation/PipingCalculatorResult.cs (revision e47cee04d169bb53197aeb1ce567f1a286217594)
@@ -0,0 +1,104 @@
+namespace Ringtoets.Piping.Calculation
+{
+ ///
+ /// This class contains all the results of a complete piping calculation.
+ ///
+ public class PipingCalculatorResult
+ {
+ private readonly double upliftZValue;
+ private readonly double upliftFactorOfSafety;
+ private readonly double heaveZValue;
+ private readonly double heaveFactorOfSafety;
+ private readonly double sellmeijerZValue;
+ private readonly double sellmeijerFactorOfSafety;
+
+ ///
+ /// Constructs a new . The result will hold all the values which were given.
+ ///
+ /// The z-value of the Uplift sub calculation.
+ /// The factory of safety of the Uplift sub calculation.
+ /// The z-value of the Heave sub calculation.
+ /// The factory of safety of the Heave sub calculation.
+ /// The z-value of the Sellmeijer sub calculation.
+ /// The factory of safety of the Sellmeijer sub calculation.
+ public PipingCalculatorResult(double upliftZValue, double upliftFactorOfSafety, double heaveZValue, double heaveFactorOfSafety, double sellmeijerZValue, double sellmeijerFactorOfSafety)
+ {
+ this.upliftZValue = upliftZValue;
+ this.upliftFactorOfSafety = upliftFactorOfSafety;
+ this.heaveZValue = heaveZValue;
+ this.heaveFactorOfSafety = heaveFactorOfSafety;
+ this.sellmeijerZValue = sellmeijerZValue;
+ this.sellmeijerFactorOfSafety = sellmeijerFactorOfSafety;
+ }
+
+ #region properties
+
+ ///
+ /// Gets the z-value of the Uplift sub calculation.
+ ///
+ public double UpliftZValue
+ {
+ get
+ {
+ return upliftZValue;
+ }
+ }
+
+ ///
+ /// Gets the factory of safety of the Uplift sub calculation.
+ ///
+ public double UpliftFactorOfSafety
+ {
+ get
+ {
+ return upliftFactorOfSafety;
+ }
+ }
+
+ ///
+ /// Gets the z-value of the Heave sub calculation.
+ ///
+ public double HeaveZValue
+ {
+ get
+ {
+ return heaveZValue;
+ }
+ }
+
+ ///
+ /// Gets the factory of safety of the Heave sub calculation.
+ ///
+ public double HeaveFactorOfSafety
+ {
+ get
+ {
+ return heaveFactorOfSafety;
+ }
+ }
+
+ ///
+ /// Gets the z-value of the Sellmeijer sub calculation.
+ ///
+ public double SellmeijerZValue
+ {
+ get
+ {
+ return sellmeijerZValue;
+ }
+ }
+
+ ///
+ /// Gets the factory of safety of the Sellmeijer sub calculation.
+ ///
+ public double SellmeijerFactorOfSafety
+ {
+ get
+ {
+ return sellmeijerFactorOfSafety;
+ }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
Index: Ringtoets/Piping/src/Ringtoets.Piping.Calculation/PipingProfileCreator.cs
===================================================================
diff -u -r3479f17e22ed8f8f44470972f85f9478707af683 -re47cee04d169bb53197aeb1ce567f1a286217594
--- Ringtoets/Piping/src/Ringtoets.Piping.Calculation/PipingProfileCreator.cs (.../PipingProfileCreator.cs) (revision 3479f17e22ed8f8f44470972f85f9478707af683)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Calculation/PipingProfileCreator.cs (.../PipingProfileCreator.cs) (revision e47cee04d169bb53197aeb1ce567f1a286217594)
@@ -5,13 +5,13 @@
namespace Ringtoets.Piping.Calculation
{
///
- /// Creates instances which are required by the .
+ /// Creates instances which are required by the .
///
internal static class PipingProfileCreator
{
///
/// Creates a based on information contained in the provided ,
- /// which can then be used in the .
+ /// which can then be used in the .
///
/// The from which to take the information.
/// A new with information taken from the .
Index: Ringtoets/Piping/src/Ringtoets.Piping.Calculation/PipingProfileCreatorException.cs
===================================================================
diff -u -r3479f17e22ed8f8f44470972f85f9478707af683 -re47cee04d169bb53197aeb1ce567f1a286217594
--- Ringtoets/Piping/src/Ringtoets.Piping.Calculation/PipingProfileCreatorException.cs (.../PipingProfileCreatorException.cs) (revision 3479f17e22ed8f8f44470972f85f9478707af683)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Calculation/PipingProfileCreatorException.cs (.../PipingProfileCreatorException.cs) (revision e47cee04d169bb53197aeb1ce567f1a286217594)
@@ -3,7 +3,7 @@
namespace Ringtoets.Piping.Calculation
{
///
- /// Exception thrown when something went wrong in the
+ /// Exception thrown when something went wrong in the
///
public class PipingProfileCreatorException : Exception
{
Index: Ringtoets/Piping/src/Ringtoets.Piping.Calculation/PipingSurfaceLineCreator.cs
===================================================================
diff -u -r3479f17e22ed8f8f44470972f85f9478707af683 -re47cee04d169bb53197aeb1ce567f1a286217594
--- Ringtoets/Piping/src/Ringtoets.Piping.Calculation/PipingSurfaceLineCreator.cs (.../PipingSurfaceLineCreator.cs) (revision 3479f17e22ed8f8f44470972f85f9478707af683)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Calculation/PipingSurfaceLineCreator.cs (.../PipingSurfaceLineCreator.cs) (revision e47cee04d169bb53197aeb1ce567f1a286217594)
@@ -8,7 +8,7 @@
namespace Ringtoets.Piping.Calculation
{
///
- /// Creates instances which are required by the .
+ /// Creates instances which are required by the .
///
internal static class PipingSurfaceLineCreator
{
Index: Ringtoets/Piping/src/Ringtoets.Piping.Calculation/Ringtoets.Piping.Calculation.csproj
===================================================================
diff -u -r3479f17e22ed8f8f44470972f85f9478707af683 -re47cee04d169bb53197aeb1ce567f1a286217594
--- Ringtoets/Piping/src/Ringtoets.Piping.Calculation/Ringtoets.Piping.Calculation.csproj (.../Ringtoets.Piping.Calculation.csproj) (revision 3479f17e22ed8f8f44470972f85f9478707af683)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Calculation/Ringtoets.Piping.Calculation.csproj (.../Ringtoets.Piping.Calculation.csproj) (revision e47cee04d169bb53197aeb1ce567f1a286217594)
@@ -57,10 +57,10 @@
Properties\GlobalAssembly.cs
-
-
-
-
+
+
+
+
Index: Ringtoets/Piping/src/Ringtoets.Piping.Service/PipingCalculationService.cs
===================================================================
diff -u -r79e69f1b4b303862f3572d0f6cb60acf63a957e9 -re47cee04d169bb53197aeb1ce567f1a286217594
--- Ringtoets/Piping/src/Ringtoets.Piping.Service/PipingCalculationService.cs (.../PipingCalculationService.cs) (revision 79e69f1b4b303862f3572d0f6cb60acf63a957e9)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Service/PipingCalculationService.cs (.../PipingCalculationService.cs) (revision e47cee04d169bb53197aeb1ce567f1a286217594)
@@ -9,7 +9,7 @@
namespace Ringtoets.Piping.Service
{
///
- /// This class is responsible for invoking operations on the . Error and status information is
+ /// This class is responsible for invoking operations on the . Error and status information is
/// logged during the execution of the operation. At the end of an operation, a is returned,
/// representing the result of the operation.
///
@@ -28,7 +28,7 @@
pipingDataLogger.Info(String.Format(Resources.Validation_Subject_0_started_Time_1_,
pipingData.Name, DateTimeService.CurrentTimeAsString));
- var validationResults = new PipingCalculation(CreateInputFromData(pipingData.InputParameters)).Validate();
+ var validationResults = new PipingCalculator(CreateInputFromData(pipingData.InputParameters)).Validate();
LogMessagesAsError(Resources.Error_in_piping_validation_0, validationResults.ToArray());
pipingDataLogger.Info(String.Format(Resources.Validation_Subject_0_ended_Time_1_,
@@ -51,7 +51,7 @@
try
{
- var pipingResult = new PipingCalculation(CreateInputFromData(pipingData.InputParameters)).Calculate();
+ var pipingResult = new PipingCalculator(CreateInputFromData(pipingData.InputParameters)).Calculate();
pipingData.Output = new PipingOutput(pipingResult.UpliftZValue,
pipingResult.UpliftFactorOfSafety,
@@ -60,7 +60,7 @@
pipingResult.SellmeijerZValue,
pipingResult.SellmeijerFactorOfSafety);
}
- catch (PipingCalculationException e)
+ catch (PipingCalculatorException e)
{
LogMessagesAsError(Resources.Error_in_piping_calculation_0, e.Message);
}
@@ -79,9 +79,9 @@
}
}
- private static PipingCalculationInput CreateInputFromData(PipingInput inputParameters)
+ private static PipingCalculatorInput CreateInputFromData(PipingInput inputParameters)
{
- return new PipingCalculationInput(
+ return new PipingCalculatorInput(
inputParameters.WaterVolumetricWeight,
inputParameters.UpliftModelFactor,
inputParameters.AssessmentLevel,
Fisheye: Tag e47cee04d169bb53197aeb1ce567f1a286217594 refers to a dead (removed) revision in file `Ringtoets/Piping/test/Ringtoets.Piping.Calculation.Test/PipingCalculationExceptionTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag e47cee04d169bb53197aeb1ce567f1a286217594 refers to a dead (removed) revision in file `Ringtoets/Piping/test/Ringtoets.Piping.Calculation.Test/PipingCalculationInputTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag e47cee04d169bb53197aeb1ce567f1a286217594 refers to a dead (removed) revision in file `Ringtoets/Piping/test/Ringtoets.Piping.Calculation.Test/PipingCalculationResultTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag e47cee04d169bb53197aeb1ce567f1a286217594 refers to a dead (removed) revision in file `Ringtoets/Piping/test/Ringtoets.Piping.Calculation.Test/PipingCalculationTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Piping/test/Ringtoets.Piping.Calculation.Test/PipingCalculatorExceptionTest.cs
===================================================================
diff -u
--- Ringtoets/Piping/test/Ringtoets.Piping.Calculation.Test/PipingCalculatorExceptionTest.cs (revision 0)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Calculation.Test/PipingCalculatorExceptionTest.cs (revision e47cee04d169bb53197aeb1ce567f1a286217594)
@@ -0,0 +1,52 @@
+using System;
+
+using NUnit.Framework;
+
+namespace Ringtoets.Piping.Calculation.Test
+{
+ public class PipingCalculatorExceptionTest
+ {
+ [Test]
+ public void DefaultConstructor_InnerExceptionNullAndMessageDefault()
+ {
+ // Setup
+ var expectedMessage = String.Format("Exception of type '{0}' was thrown.", typeof(PipingCalculatorException).FullName);
+
+ // Call
+ var exception = new PipingCalculatorException();
+
+ // Assert
+ Assert.IsNull(exception.InnerException);
+ Assert.AreEqual(expectedMessage, exception.Message);
+ }
+
+ [Test]
+ public void Constructor_WithCustomMessage_InnerExceptionNullAndMessageSetToCustom()
+ {
+ // Setup
+ var expectedMessage ="Some exception message";
+
+ // Call
+ var exception = new PipingCalculatorException(expectedMessage);
+
+ // Assert
+ Assert.IsNull(exception.InnerException);
+ Assert.AreEqual(expectedMessage, exception.Message);
+ }
+
+ [Test]
+ public void Constructor_WithCustomMessageAndInnerException_InnerExceptionSetAndMessageSetToCustom()
+ {
+ // Setup
+ var expectedMessage = "Some exception message";
+ var expectedInnerException = new Exception();
+
+ // Call
+ var exception = new PipingCalculatorException(expectedMessage, expectedInnerException);
+
+ // Assert
+ Assert.AreSame(expectedInnerException, exception.InnerException);
+ Assert.AreEqual(expectedMessage, exception.Message);
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Piping/test/Ringtoets.Piping.Calculation.Test/PipingCalculatorInputTest.cs
===================================================================
diff -u
--- Ringtoets/Piping/test/Ringtoets.Piping.Calculation.Test/PipingCalculatorInputTest.cs (revision 0)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Calculation.Test/PipingCalculatorInputTest.cs (revision e47cee04d169bb53197aeb1ce567f1a286217594)
@@ -0,0 +1,99 @@
+using System;
+
+using NUnit.Framework;
+
+using Ringtoets.Piping.Data;
+
+namespace Ringtoets.Piping.Calculation.Test
+{
+ public class PipingCalculatorInputTest
+ {
+ [Test]
+ public void GivenSomeRandomValues_WhenPipingCalculationInputConstructedFromInput_ThenPropertiesAreSet()
+ {
+ var random = new Random(22);
+
+ double volumetricWeightOfWaterValue = random.NextDouble();
+ double modelFactorUpliftValue = random.NextDouble();
+ double hRiverValue = random.NextDouble();
+ double phiExitValue = random.NextDouble();
+ double rExitValue = random.NextDouble();
+ double hExitValue = random.NextDouble();
+ double phiPolderValue = random.NextDouble();
+ double ichValue = random.NextDouble();
+ double dTotalValue = random.NextDouble();
+ double sellmeijerModelFactorValue = random.NextDouble();
+ double reductionFactorValue = random.NextDouble();
+ double seepageLengthValue = random.NextDouble();
+ double sandParticlesVolumicWeightValue = random.NextDouble();
+ double whitesDragCoefficientValue = random.NextDouble();
+ double diameter70Value = random.NextDouble();
+ double darcyPermeabilityValue = random.NextDouble();
+ double waterKinematicViscosityValue = random.NextDouble();
+ double gravityValue = random.NextDouble();
+ double thicknessAquiferLayerValue = random.NextDouble();
+ double meanDiameter70Value = random.NextDouble();
+ double beddingAngleValue = random.NextDouble();
+ double exitPointXCoordinate = random.NextDouble();
+ var surfaceLine = new RingtoetsPipingSurfaceLine();
+ var soilProfile = new PipingSoilProfile(string.Empty, random.NextDouble(), new []
+ {
+ new PipingSoilLayer(random.NextDouble())
+ {
+ IsAquifer = true
+ }
+ });
+
+ var input = new PipingCalculatorInput(
+ volumetricWeightOfWaterValue,
+ modelFactorUpliftValue,
+ hRiverValue,
+ phiExitValue,
+ rExitValue,
+ hExitValue,
+ phiPolderValue,
+ ichValue,
+ dTotalValue,
+ sellmeijerModelFactorValue,
+ reductionFactorValue,
+ seepageLengthValue,
+ sandParticlesVolumicWeightValue,
+ whitesDragCoefficientValue,
+ diameter70Value,
+ darcyPermeabilityValue,
+ waterKinematicViscosityValue,
+ gravityValue,
+ thicknessAquiferLayerValue,
+ meanDiameter70Value,
+ beddingAngleValue,
+ exitPointXCoordinate,
+ surfaceLine,
+ soilProfile);
+
+ Assert.AreEqual(volumetricWeightOfWaterValue, input.WaterVolumetricWeight);
+ Assert.AreEqual(modelFactorUpliftValue, input.UpliftModelFactor);
+ Assert.AreEqual(hRiverValue, input.AssessmentLevel);
+ Assert.AreEqual(phiExitValue, input.PiezometricHeadExit);
+ Assert.AreEqual(rExitValue, input.DampingFactorExit);
+ Assert.AreEqual(hExitValue, input.PhreaticLevelExit);
+ Assert.AreEqual(phiPolderValue, input.PiezometricHeadPolder);
+ Assert.AreEqual(ichValue, input.CriticalHeaveGradient);
+ Assert.AreEqual(dTotalValue, input.ThicknessCoverageLayer);
+ Assert.AreEqual(sellmeijerModelFactorValue, input.SellmeijerModelFactor);
+ Assert.AreEqual(reductionFactorValue, input.SellmeijerReductionFactor);
+ Assert.AreEqual(seepageLengthValue, input.SeepageLength);
+ Assert.AreEqual(sandParticlesVolumicWeightValue, input.SandParticlesVolumicWeight);
+ Assert.AreEqual(whitesDragCoefficientValue, input.WhitesDragCoefficient);
+ Assert.AreEqual(diameter70Value, input.Diameter70);
+ Assert.AreEqual(darcyPermeabilityValue, input.DarcyPermeability);
+ Assert.AreEqual(waterKinematicViscosityValue, input.WaterKinematicViscosity);
+ Assert.AreEqual(gravityValue, input.Gravity);
+ Assert.AreEqual(thicknessAquiferLayerValue, input.ThicknessAquiferLayer);
+ Assert.AreEqual(meanDiameter70Value, input.MeanDiameter70);
+ Assert.AreEqual(beddingAngleValue, input.BeddingAngle);
+ Assert.AreEqual(exitPointXCoordinate, input.ExitPointXCoordinate);
+ Assert.AreSame(surfaceLine, input.SurfaceLine);
+ Assert.AreSame(soilProfile, input.SoilProfile);
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Piping/test/Ringtoets.Piping.Calculation.Test/PipingCalculatorResultTest.cs
===================================================================
diff -u
--- Ringtoets/Piping/test/Ringtoets.Piping.Calculation.Test/PipingCalculatorResultTest.cs (revision 0)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Calculation.Test/PipingCalculatorResultTest.cs (revision e47cee04d169bb53197aeb1ce567f1a286217594)
@@ -0,0 +1,30 @@
+using System;
+
+using NUnit.Framework;
+
+namespace Ringtoets.Piping.Calculation.Test
+{
+ public class PipingCalculatorResultTest
+ {
+ [Test]
+ public void GivenSomeValues_WhenConstructedWithValues_ThenPropertiesAreSet()
+ {
+ var random = new Random(22);
+ var zuValue = random.NextDouble();
+ var foSuValue = random.NextDouble();
+ var zhValue = random.NextDouble();
+ var foShValue = random.NextDouble();
+ var zsValue = random.NextDouble();
+ var foSsValue = random.NextDouble();
+
+ var actual = new PipingCalculatorResult(zuValue, foSuValue, zhValue, foShValue, zsValue, foSsValue);
+
+ Assert.That(actual.UpliftZValue, Is.EqualTo(zuValue));
+ Assert.That(actual.UpliftFactorOfSafety, Is.EqualTo(foSuValue));
+ Assert.That(actual.HeaveZValue, Is.EqualTo(zhValue));
+ Assert.That(actual.HeaveFactorOfSafety, Is.EqualTo(foShValue));
+ Assert.That(actual.SellmeijerZValue, Is.EqualTo(zsValue));
+ Assert.That(actual.SellmeijerFactorOfSafety, Is.EqualTo(foSsValue));
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Piping/test/Ringtoets.Piping.Calculation.Test/PipingCalculatorTest.cs
===================================================================
diff -u
--- Ringtoets/Piping/test/Ringtoets.Piping.Calculation.Test/PipingCalculatorTest.cs (revision 0)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Calculation.Test/PipingCalculatorTest.cs (revision e47cee04d169bb53197aeb1ce567f1a286217594)
@@ -0,0 +1,346 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+using NUnit.Framework;
+
+using Ringtoets.Piping.Calculation.TestUtil;
+using Ringtoets.Piping.Data;
+
+namespace Ringtoets.Piping.Calculation.Test
+{
+ [TestFixture]
+ public class PipingCalculatorTest
+ {
+ [Test]
+ public void Calculate_CompleteValidInput_ReturnsResultWithNoNaN()
+ {
+ PipingCalculatorInput input = new TestPipingInput().AsRealInput();
+
+ PipingCalculatorResult actual = new PipingCalculator(input).Calculate();
+
+ Assert.IsNotNull(actual);
+ Assert.IsFalse(double.IsNaN(actual.UpliftZValue));
+ Assert.IsFalse(double.IsNaN(actual.UpliftFactorOfSafety));
+ Assert.IsFalse(double.IsNaN(actual.HeaveZValue));
+ Assert.IsFalse(double.IsNaN(actual.HeaveFactorOfSafety));
+ Assert.IsFalse(double.IsNaN(actual.SellmeijerZValue));
+ Assert.IsFalse(double.IsNaN(actual.SellmeijerFactorOfSafety));
+ }
+
+ [Test]
+ public void Validate_CompleteValidInput_ReturnsNoValidationMessages()
+ {
+ // Setup
+ PipingCalculatorInput input = new TestPipingInput().AsRealInput();
+ var calculation = new PipingCalculator(input);
+
+ // Call
+ List validationMessages = calculation.Validate();
+
+ // Assert
+ Assert.AreEqual(0, validationMessages.Count);
+ }
+
+ [Test]
+ [TestCase(0)]
+ [TestCase(-1e-6)]
+ [TestCase(-100)]
+ public void Validate_ZeroOrNegativeSeepageLength_ValidationMessageForPipingLength(double seepageLength)
+ {
+ // Setup
+ PipingCalculatorInput input = new TestPipingInput
+ {
+ SeepageLength = seepageLength
+ }.AsRealInput();
+
+ var calculation = new PipingCalculator(input);
+
+ // Call
+ List validationMessages = calculation.Validate();
+
+ // Assert
+ Assert.AreEqual(1, validationMessages.Count);
+ Assert.IsTrue(validationMessages.Any(message => message.Contains("Piping length")));
+ }
+
+ [Test]
+ [TestCase(0)]
+ [TestCase(-1e-6)]
+ [TestCase(-100)]
+ public void Validate_ZeroOrNegativeAquiferThickness_ValidationMessageForDAquifer(double aquiferThickness)
+ {
+ // Setup
+ PipingCalculatorInput input = new TestPipingInput
+ {
+ ThicknessAquiferLayer = aquiferThickness
+ }.AsRealInput();
+
+ var calculation = new PipingCalculator(input);
+
+ // Call
+ List validationMessages = calculation.Validate();
+
+ // Assert
+ Assert.AreEqual(1, validationMessages.Count);
+ Assert.IsTrue(validationMessages.Any(message => message.Contains("DAquifer")));
+ }
+
+ [Test]
+ [TestCase(-1e-6)]
+ [TestCase(-100)]
+ public void Validate_NegativeBeddingAngle_ValidationMessageForBeddingAngle(double beddingAngle)
+ {
+ // Setup
+ PipingCalculatorInput input = new TestPipingInput
+ {
+ BeddingAngle = beddingAngle
+ }.AsRealInput();
+
+ var calculation = new PipingCalculator(input);
+
+ // Call
+ List validationMessages = calculation.Validate();
+
+ // Assert
+ Assert.AreEqual(1, validationMessages.Count);
+ Assert.IsTrue(validationMessages.Any(message => message.Contains("Bedding angle")));
+ }
+
+ [Test]
+ [TestCase(-1e-6)]
+ [TestCase(-100)]
+ public void Validate_PiezometricHeadExitSameAsPhreaticLevelExit_ValidationMessageForPhiExitAndHExit(double level)
+ {
+ // Setup
+ PipingCalculatorInput input = new TestPipingInput
+ {
+ PiezometricHeadExit = level,
+ PhreaticLevelExit = level
+ }.AsRealInput();
+
+ var calculation = new PipingCalculator(input);
+
+ // Call
+ List validationMessages = calculation.Validate();
+
+ // Assert
+ Assert.AreEqual(2, validationMessages.Count);
+ Assert.IsTrue(validationMessages.Any(message => message.Contains("PhiExit - HExit")));
+ Assert.IsTrue(validationMessages.Any(message => message.Contains("phiExit - hExit")));
+ }
+
+ [Test]
+ public void Validate_PhreaticLevelExitZero_TwoValidationMessageForRExit()
+ {
+ // Setup
+ PipingCalculatorInput input = new TestPipingInput
+ {
+ DampingFactorExit = 0
+ }.AsRealInput();
+
+ var calculation = new PipingCalculator(input);
+
+ // Call
+ List validationMessages = calculation.Validate();
+
+ // Assert
+ Assert.AreEqual(2, validationMessages.Count);
+ Assert.AreEqual(2, validationMessages.Count(message => message.Contains("Rexit")));
+ }
+
+ [Test]
+ public void Validate_ThicknessCoverageLayerZero_ValidationMessageForDTotal()
+ {
+ // Setup
+ PipingCalculatorInput input = new TestPipingInput
+ {
+ ThicknessCoverageLayer = 0
+ }.AsRealInput();
+
+ var calculation = new PipingCalculator(input);
+
+ // Call
+ List validationMessages = calculation.Validate();
+
+ // Assert
+ Assert.AreEqual(1, validationMessages.Count);
+ Assert.IsTrue(validationMessages.Any(message => message.Contains("Dtotal")));
+ }
+
+ [Test]
+ public void Validate_ThicknessAquiferLayerZero_ValidationMessageForDAquifer()
+ {
+ // Setup
+ PipingCalculatorInput input = new TestPipingInput
+ {
+ ThicknessAquiferLayer = 0
+ }.AsRealInput();
+
+ var calculation = new PipingCalculator(input);
+
+ // Call
+ List validationMessages = calculation.Validate();
+
+ // Assert
+ Assert.AreEqual(1, validationMessages.Count);
+ Assert.IsTrue(validationMessages.Any(message => message.Contains("DAquifer")));
+ }
+
+ [Test]
+ public void Validate_VolumetricWeightWaterZero_ValidationMessageForVolumetricWeightWater()
+ {
+ // Setup
+ PipingCalculatorInput input = new TestPipingInput
+ {
+ WaterVolumetricWeight = 0
+ }.AsRealInput();
+
+ var calculation = new PipingCalculator(input);
+
+ // Call
+ List validationMessages = calculation.Validate();
+
+ // Assert
+ Assert.AreEqual(1, validationMessages.Count);
+ Assert.IsTrue(validationMessages.Any(message => message.Contains("Volumetric weight water")));
+ }
+
+ [Test] // Validate_DifferenceAssessmentLevelAndPhreaticLevelExitEqualToSellmeijerReductionFactorTimesThicknessCoverageLayer_ValidationMessageForHRiverHExitRcDTotal
+ [TestCase(2, 1, 2, 0.5, TestName = "AssessmntLvlPhreaticLevelExitEqualsSellmeijerReductionFactorTimesThicknessCoverageLayer_ValidateMsgHRiverHExitRcDTotal(2,1,2,0.5)")]
+ [TestCase(1, 1, 0, 2, TestName = "AssessmntLvlPhreaticLevelExitEqualsSellmeijerReductionFactorTimesThicknessCoverageLayer_ValidateMsgHRiverHExitRcDTotal(1,1,0,2)")]
+ [TestCase(8, 4, 2, 2, TestName = "AssessmntLvlPhreaticLevelExitEqualsSellmeijerReductionFactorTimesThicknessCoverageLayer_ValidateMsgHRiverHExitRcDTotal(8,4,2,2)")]
+ public void Validate_DifferenceAssessmentLevelAndPhreaticLevelExitEqualToSellmeijerReductionFactorTimesThicknessCoverageLayer_ValidationMessageForHRiverHExitRcDTotal(
+ double assessmentLevel, double phreaticLevelExit, double sellmeijerReductionFactor, double thicknessCoverageLayer)
+ {
+ // Setup
+ PipingCalculatorInput input = new TestPipingInput
+ {
+ AssessmentLevel = assessmentLevel,
+ PhreaticLevelExit = phreaticLevelExit,
+ SellmeijerReductionFactor = sellmeijerReductionFactor,
+ ThicknessCoverageLayer = thicknessCoverageLayer
+ }.AsRealInput();
+
+ var calculation = new PipingCalculator(input);
+
+ // Call
+ List validationMessages = calculation.Validate();
+
+ // Assert
+ Assert.AreEqual(1, validationMessages.Count);
+ Assert.IsTrue(validationMessages.Any(message => message.Contains("HRiver - HExit - (Rc*DTotal)")));
+ }
+
+ [Test]
+ public void Validate_NoSurfaceLineSet_ValidationMessageForHavingNoSurfaceLineSelected()
+ {
+ // Setup
+ PipingCalculatorInput input = new TestPipingInput
+ {
+ SurfaceLine = null,
+ }.AsRealInput();
+
+ var calculation = new PipingCalculator(input);
+
+ // Call
+ List validationMessages = calculation.Validate();
+
+ // Assert
+ Assert.AreEqual(1, validationMessages.Count);
+ Assert.AreEqual("Een profielmeting moet geselecteerd zijn om een Uplift berekening uit te kunnen voeren.", validationMessages[0]);
+ }
+
+ [Test]
+ public void Validate_NoSoilProfileSet_ValidationMessageForHavingNoSoilProfileSelected()
+ {
+ // Setup
+ PipingCalculatorInput input = new TestPipingInput
+ {
+ SoilProfile = null,
+ }.AsRealInput();
+
+ var calculation = new PipingCalculator(input);
+
+ // Call
+ List validationMessages = calculation.Validate();
+
+ // Assert
+ Assert.AreEqual(1, validationMessages.Count);
+ Assert.AreEqual("Een ondergrondschematisering moet geselecteerd zijn om een Uplift berekening uit te kunnen voeren.", validationMessages[0]);
+ }
+
+ [Test]
+ public void Validate_SoilProfileWithoutAquiferSet_ValidationWithDefaultNullReferenceMessage()
+ {
+ // Setup
+ PipingCalculatorInput input = new TestPipingInput
+ {
+ SoilProfile = new PipingSoilProfile(String.Empty, -1.0,new []
+ {
+ new PipingSoilLayer(0)
+ })
+ }.AsRealInput();
+
+ var calculation = new PipingCalculator(input);
+
+ // Call
+ List validationMessages = calculation.Validate();
+
+ // Assert
+ Assert.AreEqual(1, validationMessages.Count);
+ var nullReferenceException = new NullReferenceException();
+ Assert.IsTrue(validationMessages.Any(vm => vm.Contains(nullReferenceException.Message)));
+ }
+
+ [Test]
+ [TestCase(-1e-8)]
+ [TestCase(0)]
+ public void Validate_SoilProfileBottomAtTopLevel_ValidationMessageForHavingTooHighBottom(double bottom)
+ {
+ // Setup
+ var top = 0;
+ PipingCalculatorInput input = new TestPipingInput
+ {
+ SoilProfile = new PipingSoilProfile(String.Empty, bottom, new[]
+ {
+ new PipingSoilLayer(top)
+ })
+ }.AsRealInput();
+
+ var calculation = new PipingCalculator(input);
+
+ // Call
+ List validationMessages = calculation.Validate();
+
+ // Assert
+ var message = string.Format("The bottomlevel ({0}) of the profile is not deep enough. It must be below at least {1} m below the toplevel of the deepest layer ({2}).", bottom, 0.001, top);
+ Assert.AreEqual(1, validationMessages.Count);
+ Assert.IsTrue(validationMessages.Any(vm => vm.Contains(message)));
+ }
+
+ [Test]
+ public void Validate_AssessmentLevelPhreaticLevelExitSellmeijerReductionFactorThicknessCoverageLayerZero_ValidationMessageForHRiverHExitRcDTotalAndDTotal()
+ {
+ // Setup
+ PipingCalculatorInput input = new TestPipingInput
+ {
+ AssessmentLevel = 0,
+ PhreaticLevelExit = 0,
+ SellmeijerReductionFactor = 0,
+ ThicknessCoverageLayer = 0
+ }.AsRealInput();
+
+ var calculation = new PipingCalculator(input);
+
+ // Call
+ List validationMessages = calculation.Validate();
+
+ // Assert
+ Assert.AreEqual(2, validationMessages.Count);
+ Assert.IsTrue(validationMessages.Any(message => message.Contains("HRiver - HExit - (Rc*DTotal)")));
+ Assert.IsTrue(validationMessages.Any(message => message.Contains("Dtotal")));
+ }
+
+ }
+}
\ No newline at end of file
Index: Ringtoets/Piping/test/Ringtoets.Piping.Calculation.Test/Ringtoets.Piping.Calculation.Test.csproj
===================================================================
diff -u -r3479f17e22ed8f8f44470972f85f9478707af683 -re47cee04d169bb53197aeb1ce567f1a286217594
--- Ringtoets/Piping/test/Ringtoets.Piping.Calculation.Test/Ringtoets.Piping.Calculation.Test.csproj (.../Ringtoets.Piping.Calculation.Test.csproj) (revision 3479f17e22ed8f8f44470972f85f9478707af683)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Calculation.Test/Ringtoets.Piping.Calculation.Test.csproj (.../Ringtoets.Piping.Calculation.Test.csproj) (revision e47cee04d169bb53197aeb1ce567f1a286217594)
@@ -53,10 +53,10 @@
-
-
-
-
+
+
+
+
Index: Ringtoets/Piping/test/Ringtoets.Piping.Calculation.TestUtil/TestPipingInput.cs
===================================================================
diff -u -r3479f17e22ed8f8f44470972f85f9478707af683 -re47cee04d169bb53197aeb1ce567f1a286217594
--- Ringtoets/Piping/test/Ringtoets.Piping.Calculation.TestUtil/TestPipingInput.cs (.../TestPipingInput.cs) (revision 3479f17e22ed8f8f44470972f85f9478707af683)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Calculation.TestUtil/TestPipingInput.cs (.../TestPipingInput.cs) (revision e47cee04d169bb53197aeb1ce567f1a286217594)
@@ -107,11 +107,11 @@
}
///
- /// Returns the current set value as a
+ /// Returns the current set value as a
///
- public PipingCalculationInput AsRealInput()
+ public PipingCalculatorInput AsRealInput()
{
- return new PipingCalculationInput(
+ return new PipingCalculatorInput(
WaterVolumetricWeight,
UpliftModelFactor,
AssessmentLevel,