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

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

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

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

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

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

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

            var    random          = new Random(21);
            double diameterD70Mean = 0.1 + random.NextDouble();
            double diameterD70CoefficientOfVariation = random.NextDouble();

            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
                    }
                }
            }, SoilProfileType.SoilProfile1D));

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

            // Assert
            AssertDiameterD70(result, diameterD70Mean, diameterD70CoefficientOfVariation);
        }
Exemplo n.º 4
0
        public void GetSaturatedVolumicWeightOfCoverageLayer_SingleLayer_ReturnsDistributionWithParametersFromLayer()
        {
            // Setup
            PipingInput input = PipingInputFactory.CreateInputWithAquiferAndCoverageLayer <TestPipingInput>();

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

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

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

            // Assert
            AssertSaturatedVolumicWeightOfCoverageLayer(result, belowPhreaticLevelMean, deviation, shift);
        }
Exemplo n.º 5
0
        public void GetThicknessAquiferLayer_InputResultsInZeroAquiferThickness_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
                },
                new PipingSoilLayer(0.0)
                {
                    IsAquifer = true
                }
            }, SoilProfileType.SoilProfile1D)
                );

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

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

            var    random           = new Random(21);
            double permeabilityMean = 0.1 + random.NextDouble();
            double permeabilityCoefficientOfVariation = random.NextDouble();

            input.StochasticSoilProfile = new PipingStochasticSoilProfile(
                0.0, new PipingSoilProfile("", -2.0, new[]
            {
                new PipingSoilLayer(1.0)
                {
                    IsAquifer    = true,
                    Permeability = new VariationCoefficientLogNormalDistribution
                    {
                        Mean = (RoundedDouble)permeabilityMean,
                        CoefficientOfVariation = (RoundedDouble)permeabilityCoefficientOfVariation
                    }
                }
            }, SoilProfileType.SoilProfile1D));

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

            // Assert
            var expectedMean = new RoundedDouble(6, permeabilityMean);
            var expectedCoefficientOfVariation = new RoundedDouble(6, permeabilityCoefficientOfVariation);

            AssertDarcyPermeability(result, expectedMean, expectedCoefficientOfVariation);
        }
Exemplo n.º 7
0
        public void GetThicknessAquiferLayer_SoilProfileSingleAquiferAndCoverageUnderSurfaceLine_ReturnsDistributionWithExpectedMean()
        {
            // Setup
            PipingInput input = PipingInputFactory.CreateInputWithAquiferAndCoverageLayer <TestPipingInput>();

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

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

            // Call
            RoundedDouble piezometricHead = DerivedSemiProbabilisticPipingInput.GetPiezometricHeadExit(input, RoundedDouble.NaN);

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

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

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

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

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

            input.SurfaceLine = null;

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

            // Assert
            AssertSaturatedVolumicWeightOfCoverageLayer(result);
        }
Exemplo n.º 12
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.º 13
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.º 14
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.º 15
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.º 16
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.º 17
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.º 18
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.º 19
0
        public void GetDiameterD70_SoilProfileNull_ReturnsDistributionWithParametersNaN()
        {
            // Setup
            PipingInput input = PipingInputFactory.CreateInputWithAquiferAndCoverageLayer <TestPipingInput>();

            input.StochasticSoilProfile = null;

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

            // Assert
            AssertDiameterD70(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.º 21
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.º 22
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.º 23
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.º 24
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.º 25
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);
        }
Exemplo n.º 26
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);
        }
        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.º 28
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.º 29
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.º 30
0
        public void GetEffectiveThicknessCoverageLayer_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 effectiveThicknessCoverageLayer = DerivedPipingInput.GetEffectiveThicknessCoverageLayer(input, new GeneralPipingInput());

            // Assert
            AssertEffectiveThicknessCoverageLayer(effectiveThicknessCoverageLayer);
        }