Esempio n. 1
0
        public void EdgeDistanceTest_Roof_Success(double height, double expectedResult)
        {
            var building = new DuopitchRoof(length: 10, width: 5,
                                            outerHeight: height, middleHeight: height - 2,
                                            rotation: DuopitchRoof.Rotation.Degrees_0);

            Assert.That(building.EdgeDistance, Is.EqualTo(expectedResult));
        }
Esempio n. 2
0
        public void AngleInRadiansTest_Success()
        {
            var duopitchRoof = new DuopitchRoof(length: 2, width: 2,
                                                outerHeight: 3, middleHeight: 4,
                                                DuopitchRoof.Rotation.Degrees_0);

            Assert.That(duopitchRoof.AngleInRadians, Is.EqualTo(0.785).Within(0.001));
        }
Esempio n. 3
0
        public void AngleTest_90Degrees_Success()
        {
            var duopitchRoof = new DuopitchRoof(length: 2, width: 2,
                                                outerHeight: 3, middleHeight: 4,
                                                DuopitchRoof.Rotation.Degrees_90);

            Assert.That(duopitchRoof.Angle, Is.EqualTo(45));
        }
Esempio n. 4
0
        public void ConstrucorTest_Degrees90_Success()
        {
            var duopitchRoof = new DuopitchRoof(length: 1, width: 2,
                                                outerHeight: 3, middleHeight: 4,
                                                DuopitchRoof.Rotation.Degrees_90);

            Assert.That(duopitchRoof.Length, Is.EqualTo(2));
            Assert.That(duopitchRoof.Width, Is.EqualTo(1));
        }
Esempio n. 5
0
        public void GetReferenceHeightTest_Success()
        {
            var duopitchRoof = new DuopitchRoof(length: 1, width: 2,
                                                outerHeight: 3, middleHeight: 4,
                                                DuopitchRoof.Rotation.Degrees_0);

            var result = duopitchRoof.GetReferenceHeight();

            Assert.That(result, Is.EqualTo(2.4));
        }
Esempio n. 6
0
        public void AreasTest_Roof_Rotation90_Success()
        {
            var building = new DuopitchRoof(length: 10, width: 5,
                                            outerHeight: 6, middleHeight: 4,
                                            rotation: DuopitchRoof.Rotation.Degrees_90);

            Assert.That(building.Areas[Field.F], Is.EqualTo(2.692582).Within(0.000001));
            Assert.That(building.Areas[Field.G], Is.EqualTo(2.692582).Within(0.000001));
            Assert.That(building.Areas[Field.H], Is.EqualTo(21.540659).Within(0.000001));
            Assert.That(building.Areas[Field.I], Is.EqualTo(0));
            Assert.That(building.Areas.ContainsKey(Field.J), Is.False);
        }
Esempio n. 7
0
        public void AreasTest_Roof_Rotation0_Success()
        {
            var building = new DuopitchRoof(length: 10, width: 5,
                                            outerHeight: 3, middleHeight: 1,
                                            rotation: DuopitchRoof.Rotation.Degrees_0);

            Assert.That(building.Areas[Field.F], Is.EqualTo(0.673146).Within(0.000001));
            Assert.That(building.Areas[Field.G], Is.EqualTo(1.346291).Within(0.000001));
            Assert.That(building.Areas[Field.H], Is.EqualTo(24.233242).Within(0.000001));
            Assert.That(building.Areas[Field.I], Is.EqualTo(24.233242).Within(0.000001));
            Assert.That(building.Areas[Field.J], Is.EqualTo(2.692582).Within(0.000001));
        }
Esempio n. 8
0
        public void ConstrucorTest_Success()
        {
            var duopitchRoof = new DuopitchRoof(length: 1, width: 2,
                                                outerHeight: 3, middleHeight: 4,
                                                DuopitchRoof.Rotation.Degrees_0);

            Assert.That(duopitchRoof.MiddleHeight, Is.EqualTo(4));
            Assert.That(duopitchRoof.OuterHeight, Is.EqualTo(3));
            Assert.That(duopitchRoof.Height, Is.EqualTo(4));
            Assert.That(duopitchRoof.CurrentRotation,
                        Is.EqualTo(DuopitchRoof.Rotation.Degrees_0));
            Assert.That(duopitchRoof.Angle, Is.EqualTo(63.434949).Within(0.000001));
        }
        public void ExternalWindPressureForceCalculationsTest_Success()
        {
            //Arrange:
            double   heightAboveSeaLevel = 250;
            double   length          = 30;
            double   width           = 30;
            double   outerHeight     = 17.355;
            double   middleHeight    = 20;
            WindZone windZone        = WindZone.I;
            double   referenceHeight = outerHeight;

            var building = new DuopitchRoof(
                length, width, outerHeight, middleHeight, DuopitchRoof.Rotation.Degrees_90);
            var heightDisplacement = new HeightDisplacement(
                building, horizontalDistanceToObstruction: 10, obstructionHeight: 15);
            var terrain           = new TerrainCategoryIV(heightDisplacement);
            var buildingSite      = new BuildingSite(heightAboveSeaLevel, windZone, terrain);
            var windLoadData      = new WindLoadData(buildingSite, building);
            var flatRoofWindLoads = new DuopitchRoofWindLoadsRotation90(
                building, windLoadData);

            var externalPressureWindForce =
                new ExternalPressureWindForce(
                    windLoadData,
                    flatRoofWindLoads);

            referenceHeight = windLoadData.GetReferenceHeightAt(referenceHeight)
                              - heightDisplacement.GetFactor();

            //Act:
            var resultMax = externalPressureWindForce.GetExternalPressureWindForceMaxAt(
                building.Height, calculateStructuralFactor: true);
            var resultMin = externalPressureWindForce.GetExternalPressureWindForceMinAt(
                building.Height, calculateStructuralFactor: true);

            //Assert:
            Assert.Multiple(() =>
            {
                // e
                Assert.That(building.EdgeDistance, Is.EqualTo(30));
                // v_b,0
                Assert.That(buildingSite.FundamentalValueBasicWindVelocity, Is.EqualTo(22).Within(0.01));
                // c_dir

                // v_b
                Assert.That(buildingSite.BasicWindVelocity, Is.EqualTo(22).Within(0.01));
                // z_e

                // c_r(z_e)
                Assert.That(terrain.GetRoughnessFactorAt(referenceHeight), Is.EqualTo(0.6).Within(0.01));
                // c_0(z_e)

                // v_m(z_e)
                Assert.That(windLoadData.GetMeanWindVelocityAt(referenceHeight),
                            Is.EqualTo(13.2).Within(0.01));
                // I_v(z_e)
                Assert.That(windLoadData.GetTurbulenceIntensityAt(referenceHeight),
                            Is.EqualTo(0.434).Within(0.001));
                // q_p(z_e)
                Assert.That(windLoadData.GetPeakVelocityPressureAt(referenceHeight),
                            Is.EqualTo(0.440).Within(0.001));
                // c_sc_d

                Assert.That(resultMax[Field.F], Is.EqualTo(-0.638).Within(0.001));
                Assert.That(resultMax[Field.G], Is.EqualTo(-0.572).Within(0.001));
                Assert.That(resultMax[Field.H], Is.EqualTo(-0.286).Within(0.001));
                Assert.That(resultMax[Field.I], Is.EqualTo(-0.242).Within(0.001));

                Assert.That(resultMin[Field.F], Is.EqualTo(-0.638).Within(0.001));
                Assert.That(resultMin[Field.G], Is.EqualTo(-0.572).Within(0.001));
                Assert.That(resultMin[Field.H], Is.EqualTo(-0.286).Within(0.001));
                Assert.That(resultMin[Field.I], Is.EqualTo(-0.242).Within(0.001));
            });
        }