Exemplo n.º 1
0
        public void GetEffectiveThicknessCoverageLayer_SurfaceLineNull_ReturnsDistributionWithMeanNaN()
        {
            // Setup
            PipingInput input = PipingInputFactory.CreateInputWithAquiferAndCoverageLayer <TestPipingInput>();

            input.SurfaceLine = null;

            // Call
            LogNormalDistribution effectiveThicknessCoverageLayer = DerivedPipingInput.GetEffectiveThicknessCoverageLayer(input, new GeneralPipingInput());

            // Assert
            AssertEffectiveThicknessCoverageLayer(effectiveThicknessCoverageLayer);
        }
Exemplo n.º 2
0
        public void GetSaturatedVolumicWeightOfCoverageLayer_ExitPointLNaN_ReturnsDistributionWithParametersNaN()
        {
            // Setup
            PipingInput input = PipingInputFactory.CreateInputWithAquiferAndCoverageLayer <TestPipingInput>();

            input.ExitPointL = RoundedDouble.NaN;

            // Call
            LogNormalDistribution result = DerivedPipingInput.GetSaturatedVolumicWeightOfCoverageLayer(input);

            // Assert
            AssertSaturatedVolumicWeightOfCoverageLayer(result);
        }
Exemplo n.º 3
0
        public void GetDarcyPermeability_SurfaceLineNull_ReturnsDistributionWithParametersNaN()
        {
            // Setup
            PipingInput input = PipingInputFactory.CreateInputWithAquiferAndCoverageLayer <TestPipingInput>();

            input.SurfaceLine = null;

            // Call
            VariationCoefficientLogNormalDistribution result = DerivedPipingInput.GetDarcyPermeability(input);

            // Assert
            AssertDarcyPermeability(result);
        }
Exemplo n.º 4
0
        public void GetSeepageLength_ExitPointNaN_ReturnsDistributionWithMeanNaN()
        {
            // Setup
            PipingInput input = PipingInputFactory.CreateInputWithAquiferAndCoverageLayer <TestPipingInput>();

            input.ExitPointL = RoundedDouble.NaN;

            // Call
            VariationCoefficientLogNormalDistribution seepageLength = DerivedPipingInput.GetSeepageLength(input);

            // Assert
            AssertSeepageLength(seepageLength);
        }
Exemplo n.º 5
0
        public void GetSaturatedVolumicWeightOfCoverageLayer_SurfaceLineNull_ReturnsDistributionWithParametersNaN()
        {
            // Setup
            PipingInput input = PipingInputFactory.CreateInputWithAquiferAndCoverageLayer <TestPipingInput>();

            input.SurfaceLine = null;

            // Call
            LogNormalDistribution result = DerivedPipingInput.GetSaturatedVolumicWeightOfCoverageLayer(input);

            // Assert
            AssertSaturatedVolumicWeightOfCoverageLayer(result);
        }
        public void GetThicknessCoverageLayer_PipingInputWithCoverLayer_CreatePercentileBasedDesignVariableForThicknessCoverageLayer()
        {
            // Setup
            PipingInput pipingInput = PipingInputFactory.CreateInputWithAquiferAndCoverageLayer <TestPipingInput>();

            // Call
            DesignVariable <LogNormalDistribution> thicknessCoverageLayer = SemiProbabilisticPipingDesignVariableFactory.GetThicknessCoverageLayer(pipingInput);

            // Assert
            Assert.IsInstanceOf <PercentileBasedDesignVariable <LogNormalDistribution> >(thicknessCoverageLayer);
            DistributionAssert.AreEqual(DerivedPipingInput.GetThicknessCoverageLayer(pipingInput), thicknessCoverageLayer.Distribution);
            AssertPercentile(0.05, thicknessCoverageLayer);
        }
Exemplo n.º 7
0
        public void GetThicknessAquiferLayer_ExitPointNaN_ReturnsDistributionWithMeanNaN()
        {
            // Setup
            PipingInput input = PipingInputFactory.CreateInputWithAquiferAndCoverageLayer <TestPipingInput>();

            input.ExitPointL = RoundedDouble.NaN;

            // Call
            LogNormalDistribution thicknessAquiferLayer = DerivedPipingInput.GetThicknessAquiferLayer(input);

            // Assert
            AssertThicknessAquiferLayer(thicknessAquiferLayer);
        }
Exemplo n.º 8
0
        public void GetThicknessAquiferLayer_SoilProfileNull_ReturnsDistributionWithMeanNaN()
        {
            // Setup
            PipingInput input = PipingInputFactory.CreateInputWithAquiferAndCoverageLayer <TestPipingInput>();

            input.StochasticSoilProfile = null;

            // Call
            LogNormalDistribution thicknessAquiferLayer = DerivedPipingInput.GetThicknessAquiferLayer(input);

            // Assert
            AssertThicknessAquiferLayer(thicknessAquiferLayer);
        }
Exemplo n.º 9
0
        public void GetDarcyPermeability_ExitPointLNaN_ReturnsDistributionWithParametersNaN()
        {
            // Setup
            PipingInput input = PipingInputFactory.CreateInputWithAquiferAndCoverageLayer <TestPipingInput>();

            input.ExitPointL = RoundedDouble.NaN;

            // Call
            VariationCoefficientLogNormalDistribution result = DerivedPipingInput.GetDarcyPermeability(input);

            // Assert
            AssertDarcyPermeability(result);
        }
Exemplo n.º 10
0
        public void GetDiameterD70_SoilProfileNull_ReturnsDistributionWithParametersNaN()
        {
            // Setup
            PipingInput input = PipingInputFactory.CreateInputWithAquiferAndCoverageLayer <TestPipingInput>();

            input.StochasticSoilProfile = null;

            // Call
            VariationCoefficientLogNormalDistribution result = DerivedPipingInput.GetDiameterD70(input);

            // Assert
            AssertDiameterD70(result);
        }
Exemplo n.º 11
0
        public void EntryPointL_EntryPointNotOnSurfaceLine_ThrowsArgumentOutOfRangeException(double value)
        {
            // Setup
            PipingInput input = PipingInputFactory.CreateInputWithAquiferAndCoverageLayer <TestPipingInput>();

            input.ExitPointL = RoundedDouble.NaN;

            // Call
            void Call() => input.EntryPointL = (RoundedDouble)value;

            // Assert
            const string expectedMessage = "Het gespecificeerde punt moet op het profiel liggen (bereik [0,0, 1,0]).";

            TestHelper.AssertThrowsArgumentExceptionAndTestMessage <ArgumentOutOfRangeException>(Call, expectedMessage);
        }
Exemplo n.º 12
0
        public void EntryPointL_SetToNew_ValueIsRounded(double entryPointValue)
        {
            // Setup
            PipingInput input = PipingInputFactory.CreateInputWithAquiferAndCoverageLayer <TestPipingInput>();

            input.ExitPointL = RoundedDouble.NaN;

            int originalNumberOfDecimalPlaces = input.EntryPointL.NumberOfDecimalPlaces;

            // Call
            input.EntryPointL = (RoundedDouble)entryPointValue;

            // Assert
            Assert.AreEqual(originalNumberOfDecimalPlaces, input.EntryPointL.NumberOfDecimalPlaces);
            Assert.AreEqual(entryPointValue, input.EntryPointL, input.EntryPointL.GetAccuracy());
        }
Exemplo n.º 13
0
        public void GetDarcyPermeability_NoAquiferLayers_ReturnsDistributionWithParametersNaN()
        {
            // Setup
            PipingInput input = PipingInputFactory.CreateInputWithAquiferAndCoverageLayer <TestPipingInput>();

            input.StochasticSoilProfile = new PipingStochasticSoilProfile(
                0.0, new PipingSoilProfile("", -2.0, new[]
            {
                new PipingSoilLayer(1.0)
            }, SoilProfileType.SoilProfile1D));

            // Call
            VariationCoefficientLogNormalDistribution result = DerivedPipingInput.GetDarcyPermeability(input);

            // Assert
            AssertDarcyPermeability(result);
        }
Exemplo n.º 14
0
        public void GetSaturatedVolumicWeightOfCoverageLayer_MultipleLayersEqualStandardDeviationAndShift_ReturnsDistributionWithWeightedMean()
        {
            // Setup
            PipingInput input = PipingInputFactory.CreateInputWithAquiferAndCoverageLayer <TestPipingInput>();

            var    random = new Random(21);
            double belowPhreaticLevelMeanA = 0.1 + random.NextDouble();
            double belowPhreaticLevelMeanB = 0.1 + random.NextDouble();
            double deviation = random.NextDouble();
            double shift     = random.NextDouble();

            input.StochasticSoilProfile = new PipingStochasticSoilProfile(
                0.0, new PipingSoilProfile("", -2.0, new[]
            {
                new PipingSoilLayer(2.5)
                {
                    BelowPhreaticLevel = new LogNormalDistribution
                    {
                        Mean = (RoundedDouble)belowPhreaticLevelMeanA,
                        StandardDeviation = (RoundedDouble)deviation,
                        Shift             = (RoundedDouble)shift
                    }
                },
                new PipingSoilLayer(-0.5)
                {
                    BelowPhreaticLevel = new LogNormalDistribution
                    {
                        Mean = (RoundedDouble)belowPhreaticLevelMeanB,
                        StandardDeviation = (RoundedDouble)deviation,
                        Shift             = (RoundedDouble)shift
                    }
                },
                new PipingSoilLayer(-1.5)
                {
                    IsAquifer = true
                }
            }, SoilProfileType.SoilProfile1D));

            // Call
            LogNormalDistribution result = DerivedPipingInput.GetSaturatedVolumicWeightOfCoverageLayer(input);

            // Assert
            double expectedMean = (belowPhreaticLevelMeanA * 2.5 + belowPhreaticLevelMeanB * 1.0) / 3.5;

            AssertSaturatedVolumicWeightOfCoverageLayer(result, expectedMean, deviation, shift);
        }
Exemplo n.º 15
0
        public void GetSaturatedVolumicWeightOfCoverageLayer_MultipleLayersInequalStandardDeviationOrShift_ReturnsDistributionWithParametersNaN(double deviationDelta, double shiftDelta)
        {
            // Setup
            PipingInput input = PipingInputFactory.CreateInputWithAquiferAndCoverageLayer <TestPipingInput>();

            var    random = new Random(21);
            double belowPhreaticLevelMeanA = 0.1 + random.NextDouble();
            double belowPhreaticLevelMeanB = 0.1 + random.NextDouble();
            double deviation = random.NextDouble();
            double shift     = random.NextDouble();

            input.StochasticSoilProfile = new PipingStochasticSoilProfile(
                0.0, new PipingSoilProfile("", -2.0, new[]
            {
                new PipingSoilLayer(2.5)
                {
                    BelowPhreaticLevel = new LogNormalDistribution
                    {
                        Mean = (RoundedDouble)belowPhreaticLevelMeanA,
                        StandardDeviation = (RoundedDouble)deviation,
                        Shift             = (RoundedDouble)shift
                    }
                },
                new PipingSoilLayer(-0.5)
                {
                    BelowPhreaticLevel = new LogNormalDistribution
                    {
                        Mean = (RoundedDouble)belowPhreaticLevelMeanB,
                        StandardDeviation = (RoundedDouble)(deviation + deviationDelta),
                        Shift             = (RoundedDouble)(shift + shiftDelta)
                    }
                },
                new PipingSoilLayer(-1.5)
                {
                    IsAquifer = true
                }
            }, SoilProfileType.SoilProfile1D));

            // Call
            LogNormalDistribution result = DerivedPipingInput.GetSaturatedVolumicWeightOfCoverageLayer(input);

            // Assert
            AssertSaturatedVolumicWeightOfCoverageLayer(result);
        }
        public void GetSaturatedVolumicWeightOfCoverageLayer_PipingInputWithCoverLayerWithSaturatedDefinition_CreateDesignVariableForSaturatedVolumicWeightOfCoverageLayer()
        {
            // Setup
            PipingInput pipingInput = PipingInputFactory.CreateInputWithAquiferAndCoverageLayer <TestPipingInput>();

            pipingInput.StochasticSoilProfile.SoilProfile.Layers.First().BelowPhreaticLevel = new LogNormalDistribution
            {
                Mean = (RoundedDouble)3.2
            };

            // Call
            DesignVariable <LogNormalDistribution> saturatedVolumicWeightOfCoverageLayer =
                SemiProbabilisticPipingDesignVariableFactory.GetSaturatedVolumicWeightOfCoverageLayer(pipingInput);

            // Assert
            DistributionAssert.AreEqual(DerivedPipingInput.GetSaturatedVolumicWeightOfCoverageLayer(pipingInput),
                                        saturatedVolumicWeightOfCoverageLayer.Distribution);
            AssertPercentile(0.05, saturatedVolumicWeightOfCoverageLayer);
        }
Exemplo n.º 17
0
        public void GetSaturatedVolumicWeightOfCoverageLayer_MultipleLayersInequalStandardDeviationOrShiftButEqualWhenRounded_ReturnsDistributionWithWeightedMean()
        {
            // Setup
            PipingInput input = PipingInputFactory.CreateInputWithAquiferAndCoverageLayer <TestPipingInput>();

            const double belowPhreaticLevelMeanA = 2.5;
            const double belowPhreaticLevelMeanB = 3.4;

            input.StochasticSoilProfile = new PipingStochasticSoilProfile(
                0.0, new PipingSoilProfile("", -2.0, new[]
            {
                new PipingSoilLayer(2.5)
                {
                    BelowPhreaticLevel = new LogNormalDistribution
                    {
                        Mean = (RoundedDouble)belowPhreaticLevelMeanA,
                        StandardDeviation = (RoundedDouble)1.014,
                        Shift             = (RoundedDouble)1.014
                    }
                },
                new PipingSoilLayer(-0.5)
                {
                    BelowPhreaticLevel = new LogNormalDistribution
                    {
                        Mean = (RoundedDouble)belowPhreaticLevelMeanB,
                        StandardDeviation = (RoundedDouble)1.006,
                        Shift             = (RoundedDouble)1.006
                    }
                },
                new PipingSoilLayer(-1.5)
                {
                    IsAquifer = true
                }
            }, SoilProfileType.SoilProfile1D));

            // Call
            LogNormalDistribution result = DerivedPipingInput.GetSaturatedVolumicWeightOfCoverageLayer(input);

            // Assert
            double expectedMean = (belowPhreaticLevelMeanA * 2.5 + belowPhreaticLevelMeanB * 1.0) / 3.5;

            AssertSaturatedVolumicWeightOfCoverageLayer(result, expectedMean, (RoundedDouble)1.01, (RoundedDouble)1.01);
        }
Exemplo n.º 18
0
        public void GetSaturatedVolumicWeightOfCoverageLayer_NoAquiferLayers_ReturnsDistributionWithParametersNaN()
        {
            // Setup
            PipingInput input = PipingInputFactory.CreateInputWithAquiferAndCoverageLayer <TestPipingInput>();

            input.StochasticSoilProfile = new PipingStochasticSoilProfile(
                0.0, new PipingSoilProfile("", -2.0, new[]
            {
                new PipingSoilLayer(1.0)
                {
                    IsAquifer = false
                }
            }, SoilProfileType.SoilProfile1D));

            // Call
            LogNormalDistribution result = DerivedPipingInput.GetSaturatedVolumicWeightOfCoverageLayer(input);

            // Assert
            AssertSaturatedVolumicWeightOfCoverageLayer(result);
        }
Exemplo n.º 19
0
        public void GetDarcyPermeability_MultipleAquiferLayersWithSameVariation_ReturnsDistributionWithWeightedMean()
        {
            // Setup
            PipingInput input = PipingInputFactory.CreateInputWithAquiferAndCoverageLayer <TestPipingInput>();

            var          random = new Random(21);
            double       mean   = 0.1 + random.NextDouble();
            double       mean2  = 0.1 + random.NextDouble();
            const double coefficientOfVariation = 0.5;

            input.StochasticSoilProfile = new PipingStochasticSoilProfile(
                0.0, new PipingSoilProfile("", 0.0, new[]
            {
                new PipingSoilLayer(0.5)
                {
                    IsAquifer    = true,
                    Permeability = new VariationCoefficientLogNormalDistribution
                    {
                        Mean = (RoundedDouble)mean,
                        CoefficientOfVariation = (RoundedDouble)coefficientOfVariation
                    }
                },
                new PipingSoilLayer(1.5)
                {
                    IsAquifer    = true,
                    Permeability = new VariationCoefficientLogNormalDistribution
                    {
                        Mean = (RoundedDouble)mean2,
                        CoefficientOfVariation = (RoundedDouble)coefficientOfVariation
                    }
                }
            }, SoilProfileType.SoilProfile1D));

            // Call
            VariationCoefficientLogNormalDistribution result = DerivedPipingInput.GetDarcyPermeability(input);

            // Assert
            double weightedMean = (mean * 0.5 + mean2) / 1.5;

            AssertDarcyPermeability(result, weightedMean, coefficientOfVariation);
        }
Exemplo n.º 20
0
        public void GetThicknessAquiferLayer_ProfileWithoutAquiferLayer_ReturnsDistributionWithMeanNaN()
        {
            // Setup
            PipingInput input = PipingInputFactory.CreateInputWithAquiferAndCoverageLayer <TestPipingInput>();

            input.StochasticSoilProfile = new PipingStochasticSoilProfile(
                0.0, new PipingSoilProfile(string.Empty, 0, new[]
            {
                new PipingSoilLayer(2.0)
                {
                    IsAquifer = false
                }
            }, SoilProfileType.SoilProfile1D)
                );

            // Call
            LogNormalDistribution thicknessAquiferLayer = DerivedPipingInput.GetThicknessAquiferLayer(input);

            // Assert
            AssertThicknessAquiferLayer(thicknessAquiferLayer);
        }
Exemplo n.º 21
0
        public void GetDiameterD70_MultipleAquiferLayers_ReturnsWithParametersFromTopmostLayer()
        {
            // Setup
            PipingInput input = PipingInputFactory.CreateInputWithAquiferAndCoverageLayer <TestPipingInput>();

            const double diameterD70Mean = 0.5;
            const double diameterD70CoefficientOfVariation = 0.2;

            input.StochasticSoilProfile = new PipingStochasticSoilProfile(
                0.0, new PipingSoilProfile("", -2.0, new[]
            {
                new PipingSoilLayer(1.0)
                {
                    IsAquifer   = true,
                    DiameterD70 = new VariationCoefficientLogNormalDistribution
                    {
                        Mean = (RoundedDouble)diameterD70Mean,
                        CoefficientOfVariation = (RoundedDouble)diameterD70CoefficientOfVariation
                    }
                },
                new PipingSoilLayer(0.0)
                {
                    IsAquifer   = true,
                    DiameterD70 = new VariationCoefficientLogNormalDistribution
                    {
                        Mean = (RoundedDouble)12.5,
                        CoefficientOfVariation = (RoundedDouble)2.3
                    }
                }
            }, SoilProfileType.SoilProfile1D));

            // Call
            VariationCoefficientLogNormalDistribution result = DerivedPipingInput.GetDiameterD70(input);

            // Assert
            AssertDiameterD70(result, diameterD70Mean, diameterD70CoefficientOfVariation);
        }