Exemplo n.º 1
0
        public IResult Calculate()
        {
            BuildingSite  buildingSite  = GetBuildingSite();
            SnowLoad      snowLoad      = GetSnowLoad(buildingSite);
            Building      building      = GetBuilding(snowLoad);
            MonopitchRoof monopitchRoof = GetMonopitchRoof(building);

            if (!ExposureCoefficient.HasValue)
            {
                buildingSite.CalculateExposureCoefficient();
            }
            snowLoad.CalculateSnowLoad();
            building.CalculateThermalCoefficient();
            monopitchRoof.CalculateSnowLoad();

            var result = new Result();

            result.Properties.Add("C_e_", buildingSite.ExposureCoefficient);
            result.Properties.Add("s_k_", snowLoad.DefaultCharacteristicSnowLoad);
            result.Properties.Add("V", snowLoad.VariationCoefficient);
            result.Properties.Add("C_esl_", snowLoad.ExceptionalSnowLoadCoefficient);
            result.Properties.Add("s_n_", snowLoad.SnowLoadForSpecificReturnPeriod);
            result.Properties.Add("s_Ad_", snowLoad.DesignExceptionalSnowLoadForSpecificReturnPeriod);
            result.Properties.Add("t_i_", building.InternalTemperature);
            result.Properties.Add("∆_t_", building.TempreatureDifference);
            result.Properties.Add("U", building.OverallHeatTransferCoefficient);
            result.Properties.Add("C_t_", building.ThermalCoefficient);
            result.Properties.Add("μ_1_", monopitchRoof.ShapeCoefficient);
            result.Properties.Add("s", monopitchRoof.SnowLoadOnRoofValue);

            return(result);
        }
Exemplo n.º 2
0
 public SnowLoadMonopitchRoof()
 {
     BuildingData = new BuildingData();
     //BuildingSite = new BuildingSite();
     //SnowLoad = new SnowLoad(BuildingSite);
     //Building = new Building(SnowLoad);
     MonopitchRoof = new MonopitchRoof(BuildingData.Building, 0);
 }
Exemplo n.º 3
0
        public void AngleInRadiansTest_Success()
        {
            var monopitchRoof = new MonopitchRoof(length: 1, width: 2,
                                                  maxHeight: 2, minHeight: 1,
                                                  MonopitchRoof.Rotation.Degrees_0);

            Assert.That(monopitchRoof.AngleInRadians, Is.EqualTo(0.785).Within(0.001));
        }
Exemplo n.º 4
0
        public void EdgeDistanceTest_Roof_Success(double height, double expectedResult)
        {
            var building = new MonopitchRoof(length: 10, width: 5,
                                             maxHeight: height, minHeight: height - 2,
                                             rotation: MonopitchRoof.Rotation.Degrees_0);

            Assert.That(building.EdgeDistance, Is.EqualTo(expectedResult));
        }
Exemplo n.º 5
0
        public void AngleTest_90Degrees_Success()
        {
            var monopitchRoof = new MonopitchRoof(length: 1, width: 2,
                                                  maxHeight: 2, minHeight: 1,
                                                  MonopitchRoof.Rotation.Degrees_90);

            Assert.That(monopitchRoof.Angle, Is.EqualTo(45));
        }
Exemplo n.º 6
0
        public void MonopitchRoofTest_CalculateSnowLoad_Success()
        {
            var building = BuildingImplementation.CreateBuilding();

            var monopitchRoof = new MonopitchRoof(building, 15);

            monopitchRoof.CalculateSnowLoad();
            Assert.AreEqual(0.72, Math.Round(monopitchRoof.SnowLoadOnRoofValue, 3), "Snow load is not calculated properly.");
        }
Exemplo n.º 7
0
        public void ConstrucorTest_Degrees90_Success()
        {
            var monopitchRoof = new MonopitchRoof(length: 1, width: 2,
                                                  maxHeight: 4, minHeight: 3,
                                                  MonopitchRoof.Rotation.Degrees_90);

            Assert.That(monopitchRoof.Length, Is.EqualTo(2));
            Assert.That(monopitchRoof.Width, Is.EqualTo(1));
        }
Exemplo n.º 8
0
        public void MonopitchRoofTest_Constructor_Success()
        {
            var monopitchRoof = new MonopitchRoof(new BuildingImplementation()
            {
                SnowLoad = new SnowLoadImplementation()
            }, 15);

            Assert.IsNotNull(monopitchRoof, "MonopitchRoof should be created.");
            Assert.AreEqual(15, monopitchRoof.Slope, "Slope should be set at construction time.");
        }
Exemplo n.º 9
0
        public void GetReferenceHeightTest_Success()
        {
            var monopitchRoof = new MonopitchRoof(length: 1, width: 2,
                                                  maxHeight: 4, minHeight: 3,
                                                  MonopitchRoof.Rotation.Degrees_0);

            var result = monopitchRoof.GetReferenceHeight();

            Assert.That(result, Is.EqualTo(2.4));
        }
Exemplo n.º 10
0
        public void AreasTest_Roof_Rotation180_Success()
        {
            var building = new MonopitchRoof(length: 10, width: 5,
                                             maxHeight: 3, minHeight: 1,
                                             rotation: MonopitchRoof.Rotation.Degrees_180);

            Assert.That(building.Areas[Field.F], Is.EqualTo(0.637377).Within(0.000001));
            Assert.That(building.Areas[Field.G], Is.EqualTo(1.274755).Within(0.000001));
            Assert.That(building.Areas[Field.H], Is.EqualTo(48.440685).Within(0.000001));
            Assert.That(building.Areas.ContainsKey(Field.I), Is.False);
            Assert.That(building.Areas.ContainsKey(Field.J), Is.False);
        }
Exemplo n.º 11
0
        public void AreasTest_Roof_Rotation90_Success()
        {
            var building = new MonopitchRoof(length: 10, width: 5,
                                             maxHeight: 5, minHeight: 3,
                                             rotation: MonopitchRoof.Rotation.Degrees_90);

            Assert.That(building.Areas[Field.Fup], Is.EqualTo(2.549510).Within(0.000001));
            Assert.That(building.Areas[Field.Flow], Is.EqualTo(2.549510).Within(0.000001));
            Assert.That(building.Areas[Field.G], Is.EqualTo(5.099020).Within(0.000001));
            Assert.That(building.Areas[Field.H], Is.EqualTo(40.792156).Within(0.000001));
            Assert.That(building.Areas[Field.I], Is.EqualTo(0));
            Assert.That(building.Areas.ContainsKey(Field.J), Is.False);
        }
Exemplo n.º 12
0
        public void ConstrucorTest_Success()
        {
            var monopitchRoof = new MonopitchRoof(length: 1, width: 2,
                                                  maxHeight: 4, minHeight: 3,
                                                  MonopitchRoof.Rotation.Degrees_0);

            Assert.That(monopitchRoof.MaxHeight, Is.EqualTo(4));
            Assert.That(monopitchRoof.MinHeight, Is.EqualTo(3));
            Assert.That(monopitchRoof.Height, Is.EqualTo(4));
            Assert.That(monopitchRoof.CurrentRotation,
                        Is.EqualTo(MonopitchRoof.Rotation.Degrees_0));
            Assert.That(monopitchRoof.Angle, Is.EqualTo(45).Within(0.000001));
        }
Exemplo n.º 13
0
        public void ExampleTest4_CalculateSnowLoad_Success()
        {
            var buildingSite  = new BuildingSite(Zones.SecondZone, Topographies.Normal, altitudeAboveSea: 175);
            var snowLoad      = new SnowLoad(buildingSite);
            var building      = new Building(snowLoad);
            var monopitchRoof = new MonopitchRoof(building, 10);

            buildingSite.CalculateExposureCoefficient();
            snowLoad.CalculateSnowLoad();
            building.CalculateThermalCoefficient();
            monopitchRoof.CalculateSnowLoad();
            Assert.AreEqual(0.72, Math.Round(monopitchRoof.SnowLoadOnRoofValue, 3),
                            "Snow load is not calculated properly.");
        }
Exemplo n.º 14
0
        public void ExampleTest2_CalculateSnowLoad_Success()
        {
            var buildingSite = new BuildingSite(Zones.ThirdZone, Topographies.Normal, 360);
            var snowLoad     = new SnowLoad(buildingSite);
            var building     = new Building(snowLoad);

            var monopitchRoof = new MonopitchRoof(building, 5);

            buildingSite.CalculateExposureCoefficient();
            snowLoad.CalculateSnowLoad();
            building.CalculateThermalCoefficient();
            monopitchRoof.CalculateSnowLoad();
            Assert.AreEqual(1.248, Math.Round(monopitchRoof.SnowLoadOnRoofValue, 3),
                            "Snow load for roof is not calculated properly.");
        }
Exemplo n.º 15
0
        public void ExampleTest2_CalculateSnowOverhanging_Success()
        {
            var buildingSite = new BuildingSite(Zones.ThirdZone, Topographies.Normal, 360);

            buildingSite.CalculateExposureCoefficient();
            var snowLoad = new SnowLoad(buildingSite, snowDensity: 3);

            snowLoad.CalculateSnowLoad();
            var building = new Building(snowLoad);

            building.CalculateThermalCoefficient();

            var monopitchRoof = new MonopitchRoof(building, 5);

            monopitchRoof.CalculateSnowLoad();

            var snowOverhanging = new SnowOverhanging(building, monopitchRoof.SnowLoadOnRoofValue);

            snowOverhanging.CalculateSnowLoad();

            Assert.AreEqual(0.648, Math.Round(snowOverhanging.SnowLoad, 3),
                            "Snow overhanging is not calculated properly.");
        }
        public void ExternalWindPressureForceCalculationsTest_Success()
        {
            //Arrange:
            double   heightAboveSeaLevel = 250;
            double   length          = 30;
            double   width           = 30;
            double   maxHeight       = 20;
            double   minHeight       = 14.71;
            WindZone windZone        = WindZone.I;
            double   referenceHeight = maxHeight;

            var building = new MonopitchRoof(
                length, width, maxHeight, minHeight, MonopitchRoof.Rotation.Degrees_0);
            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 MonopitchedRoofWindLoadsRotation0(
                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.044).Within(0.001));
                Assert.That(resultMax[Field.G], Is.EqualTo(0.044).Within(0.001));
                Assert.That(resultMax[Field.H], Is.EqualTo(0.044).Within(0.001));

                Assert.That(resultMin[Field.F], Is.EqualTo(-0.572).Within(0.001));
                Assert.That(resultMin[Field.G], Is.EqualTo(-0.440).Within(0.001));
                Assert.That(resultMin[Field.H], Is.EqualTo(-0.198).Within(0.001));
            });
        }