Example #1
0
        public void ExternalWindPressureCalculationsTest_Roof2_MaxValues_Success()
        {
            //Arrange:
            var windZone         = WindZone.III;
            var building         = new FlatRoof(20, 10, 15);
            var terrainOrography = new CliffEscarpmentOrography(
                actualLengthUpwindSlope: 15,
                effectiveFeatureHeight: 5,
                horizontalDistanceFromCrestTop: 2);
            var terrain           = new TerrainCategoryIII(terrainOrography);
            var directionalFactor = new DirectionalFactor(windZone, windDirection: 40);
            var buildingSite      = new BuildingSite(
                325, windZone, terrain,
                directionalFactor: directionalFactor);
            var windLoadData      = new WindLoadData(buildingSite, building);
            var flatRoofWindLoads = new FlatRoofWindLoads(building, windLoadData);

            //Act:
            var result = flatRoofWindLoads.GetExternalWindPressureMaxAt(building.Height);

            //Assert:
            Assert.Multiple(() =>
            {
                Assert.That(result[Field.F], Is.EqualTo(-0.818).Within(0.001));
                Assert.That(result[Field.G], Is.EqualTo(-0.530).Within(0.001));
                Assert.That(result[Field.H], Is.EqualTo(-0.258).Within(0.001));
                Assert.That(result[Field.I], Is.EqualTo(0.073).Within(0.001));
            });
        }
Example #2
0
        public void ConstructorTest_Roof_Success()
        {
            var building = new FlatRoof(length: 10, width: 5, height: 3);

            Assert.That(building.Length, Is.EqualTo(10));
            Assert.That(building.Width, Is.EqualTo(5));
            Assert.That(building.Height, Is.EqualTo(3));
            Assert.That(building.Areas.Count, Is.GreaterThan(0));
        }
Example #3
0
        public void AreasTest_Roof_Success()
        {
            var building = new FlatRoof(length: 10, width: 15, height: 5);

            Assert.That(building.Areas[Field.F], Is.EqualTo(2.5));
            Assert.That(building.Areas[Field.G], Is.EqualTo(10));
            Assert.That(building.Areas[Field.H], Is.EqualTo(60));
            Assert.That(building.Areas[Field.I], Is.EqualTo(75));
            Assert.That(building.Areas.ContainsKey(Field.J), Is.False);
        }
Example #4
0
        public void GetReferenceHeightTest_Roof_Success()
        {
            var building = new FlatRoof(length: 10, width: 15, height: 10);

            Assert.That(building.GetReferenceHeight(), Is.EqualTo(6));
        }
Example #5
0
        public void EdgeDistanceTest_Roof_Success(double height, double expectedResult)
        {
            var building = new FlatRoof(length: 10, width: 5, height: height);

            Assert.That(building.EdgeDistance, Is.EqualTo(expectedResult));
        }
Example #6
0
        public void ExternalWindPressureForceCalculationsTest_Success()
        {
            //Arrange:
            double   heightAboveSeaLevel = 250;
            double   length          = 30;
            double   width           = 30;
            double   height          = 10;
            double   curvature       = 2;
            WindZone windZone        = WindZone.I;
            double   referenceHeight = height;

            double actualLengthUpwindSlope        = 70;
            double actualLengthDownwindSlope      = 10;
            double effectiveFeatureHeight         = 10;
            double horizontalDistanceFromCrestTop = -7;

            double windDirection = 0;

            var building = new FlatRoof(
                length, width, height, FlatRoof.Rotation.Degrees_0);
            var orographyFactor = new HillRidgeOrography(
                actualLengthUpwindSlope,
                actualLengthDownwindSlope,
                effectiveFeatureHeight,
                horizontalDistanceFromCrestTop);
            var terrain           = new TerrainCategory0(orographyFactor);
            var directionalFactor = new DirectionalFactor(windZone, windDirection);
            var buildingSite      = new BuildingSite(heightAboveSeaLevel, windZone, terrain,
                                                     directionalFactor: directionalFactor);
            var referenceHeightDueToNeighbouringStructures =
                new ReferenceHeightDueToNeighbouringStructures(
                    highBuildingWidth: 20, highBuildingLength: 100,
                    highBuildingHeight: 100, distanceToBuilding: 30);
            var windLoadData = new WindLoadData(buildingSite, building,
                                                referenceHeightDueToNeighbouringStructures: referenceHeightDueToNeighbouringStructures);
            var flatRoofWindLoads = new FlatRoofWithCurvedEavesWindLoads(
                building, windLoadData, curvature);

            var structuralFactorCalculator = new StructuralFactorCalculator(
                building, terrain, windLoadData, StructuralType.SteelBuilding);

            var externalPressureWindForce =
                new ExternalPressureWindForce(
                    windLoadData,
                    flatRoofWindLoads,
                    structuralFactorCalculator);

            referenceHeight = windLoadData.GetReferenceHeightAt(referenceHeight);

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

            //Assert:
            Assert.Multiple(() =>
            {
                // e
                Assert.That(building.EdgeDistance, Is.EqualTo(20));
                // v_b,0
                Assert.That(buildingSite.FundamentalValueBasicWindVelocity, Is.EqualTo(22).Within(0.01));
                // c_dir
                Assert.That(directionalFactor.GetFactor(), Is.EqualTo(0.8));
                // v_b
                Assert.That(buildingSite.BasicWindVelocity, Is.EqualTo(17.6).Within(0.01));
                // z_e

                // c_r(z_e)
                Assert.That(terrain.GetRoughnessFactorAt(referenceHeight), Is.EqualTo(1.30).Within(0.01));
                // c_0(z_e)
                Assert.That(orographyFactor.GetFactorAt(referenceHeight), Is.EqualTo(1.17).Within(0.01));
                // v_m(z_e)
                Assert.That(windLoadData.GetMeanWindVelocityAt(referenceHeight),
                            Is.EqualTo(29.22).Within(0.01));
                // I_v(z_e)
                Assert.That(windLoadData.GetTurbulenceIntensityAt(referenceHeight),
                            Is.EqualTo(0.096).Within(0.001));
                // q_p(z_e)
                Assert.That(windLoadData.GetPeakVelocityPressureAt(referenceHeight),
                            Is.EqualTo(0.893).Within(0.001));
                // c_sc_d
                Assert.That(structuralFactorCalculator.GetStructuralFactor(true),
                            Is.EqualTo(1).Within(0.001));

                Assert.That(resultMax[Field.F], Is.EqualTo(-0.446).Within(0.001));
                Assert.That(resultMax[Field.G], Is.EqualTo(-0.446).Within(0.001));
                Assert.That(resultMax[Field.H], Is.EqualTo(-0.268).Within(0.001));
                Assert.That(resultMax[Field.I], Is.EqualTo(0.179).Within(0.001));

                Assert.That(resultMin[Field.F], Is.EqualTo(-0.446).Within(0.001));
                Assert.That(resultMin[Field.G], Is.EqualTo(-0.446).Within(0.001));
                Assert.That(resultMin[Field.H], Is.EqualTo(-0.268).Within(0.001));
                Assert.That(resultMin[Field.I], Is.EqualTo(-0.179).Within(0.001));
            });
        }
Example #7
0
        public void ExternalWindPressureForceCalculationsTest_Success()
        {
            //Arrange:
            double   heightAboveSeaLevel = 250;
            double   length          = 30;
            double   width           = 30;
            double   height          = 20;
            double   angle           = 30;
            WindZone windZone        = WindZone.I;
            double   referenceHeight = 8;

            var building = new FlatRoof(
                length, width, height, FlatRoof.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 FlatRoofWithMansardEavesWindLoads(
                building, windLoadData, angle);

            var externalPressureWindForce =
                new ExternalPressureWindForce(
                    windLoadData,
                    flatRoofWindLoads);

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

            //Assert:
            Assert.Multiple(() =>
            {
                // e
                Assert.That(building.EdgeDistance, Is.EqualTo(30));
                // h_dis
                Assert.That(heightDisplacement.GetFactor(), Is.EqualTo(12));
                // 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.20).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.440).Within(0.001));
                Assert.That(resultMax[Field.G], Is.EqualTo(-0.440).Within(0.001));
                Assert.That(resultMax[Field.H], Is.EqualTo(-0.132).Within(0.001));
                Assert.That(resultMax[Field.I], Is.EqualTo(0.088).Within(0.001));

                Assert.That(resultMin[Field.F], Is.EqualTo(-0.440).Within(0.001));
                Assert.That(resultMin[Field.G], Is.EqualTo(-0.440).Within(0.001));
                Assert.That(resultMin[Field.H], Is.EqualTo(-0.132).Within(0.001));
                Assert.That(resultMin[Field.I], Is.EqualTo(-0.088).Within(0.001));
            });
        }
Example #8
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);


            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            // enable Nutiteq SDK logging

            Log.EnableAll();

            // get MapView

            MapView view = FindViewById <MapView> (Resource.Id.mapView);

            // define mandatory parameters

            // Components keeps internal state and parameters for MapView
            view.Components = new Components();

            // define base projection, almost always EPSG3857, but others can be defined also
            EPSG3857 proj = new EPSG3857();


            // set online base layer with MapQuest Open Tiles
            view.Layers.BaseLayer = new TMSMapLayer(proj, 0, 18, 0, "http://otile1.mqcdn.com/tiles/1.0.0/osm/", "/", ".png");

            /*
             * //set offline base layer from MBTiles file
             * //TODO: set path properly
             * String MbTilePath = "/sdcard/europe-tilemill-mbtiles.sqlite";
             *
             * view.Layers.BaseLayer = new MBTilesMapLayer (proj, 0, 5, 1, MbTilePath, this);
             */

            // start map
            view.StartMapping();

            // add a marker

            // define marker style (image, size, color)
            Bitmap pointMarker = UnscaledBitmapLoader.DecodeResource(Resources, Resource.Drawable.olmarker);

            MarkerStyle.Builder markerStyleBuilder = new MarkerStyle.Builder();
            markerStyleBuilder.SetBitmap(pointMarker);
            markerStyleBuilder.SetColor(NutiteqComponents.Color.White);
            markerStyleBuilder.SetSize(0.5f);
            MarkerStyle markerStyle = markerStyleBuilder.Build();

            // define label what is shown when you click on marker
            Label markerLabel = new DefaultLabel("San Francisco", "Here is a marker");

            // define location of the marker, it must be converted to base map coordinate system
            MapPos SanFrancisco = view.Layers.BaseLayer.Projection.FromWgs84(-122.416667f, 37.766667f);
            MapPos London       = view.Layers.BaseLayer.Projection.FromWgs84(0.0f, 51.0f);

            // create layer and add object to the layer, finally add layer to the map.
            // All overlay layers must be same projection as base layer, so we reuse it
            MarkerLayer markerLayer = new MarkerLayer(view.Layers.BaseLayer.Projection);

            markerLayer.Add(new Marker(SanFrancisco, markerLabel, markerStyle, markerLayer));
            view.Layers.AddLayer(markerLayer);

            // 3d building layer

            Polygon3DStyle.Builder nml3dStyleBuilder = new Polygon3DStyle.Builder();
            Polygon3DStyle         nml3dStyle        = nml3dStyleBuilder.Build();

            StyleSet nmlStyleSet = new StyleSet();

            nmlStyleSet.SetZoomStyle(14, nml3dStyle);

            NMLModelOnlineLayer Online3dLayer = new NMLModelOnlineLayer(view.Layers.BaseLayer.Projection, "http://aws-lb.nutiteq.ee/nml/nmlserver2.php?data=demo&", nmlStyleSet);

            // persistent caching settings for the layer
            Online3dLayer.SetMemoryLimit(20 * 1024 * 1024);              // 20 MB
            Online3dLayer.SetPersistentCacheSize(50 * 1024 * 1024);      // 50 MB
            Online3dLayer.SetPersistentCachePath("/sdcard/nmlcache.db"); // mandatory to be set

            view.Layers.AddLayer(Online3dLayer);

            // OSM Polygon3D layer

            Polygon3DStyle.Builder poly3dStyleBuilder = new Polygon3DStyle.Builder();
            poly3dStyleBuilder.SetColor(NutiteqComponents.Color.White);
            Polygon3DStyle poly3dStyle = poly3dStyleBuilder.Build();

            StyleSet polyStyleSet = new StyleSet();

            polyStyleSet.SetZoomStyle(16, poly3dStyle);

            Roof DefaultRoof = new FlatRoof();

            Polygon3DOSMLayer Poly3DLayer = new Polygon3DOSMLayer(view.Layers.BaseLayer.Projection, 0.3f, DefaultRoof, unchecked ((int)0xffffffff) /* white */, unchecked ((int)0xff888888) /* gray */, 1500, polyStyleSet);

            view.Layers.AddLayer(Poly3DLayer);

            // set map center and zoom
            view.FocusPoint = SanFrancisco;
            view.Zoom       = 5.0f;

            // set listener for map events
            MapListener listener = new MyMapListener();

            view.Options.MapListener = listener;
        }
Example #9
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            // Set our view from the "main" layout resource
            SetContentView (Resource.Layout.Main);

            // enable Nutiteq SDK logging

            Log.EnableAll ();

            // get MapView

            MapView view = FindViewById<MapView> (Resource.Id.mapView);

            // define mandatory parameters

            // Components keeps internal state and parameters for MapView
            view.Components = new Components ();

            // define base projection, almost always EPSG3857, but others can be defined also
            EPSG3857 proj = new EPSG3857 ();

            // set online base layer with MapQuest Open Tiles
            view.Layers.BaseLayer = new TMSMapLayer(proj, 0, 18, 0, "http://otile1.mqcdn.com/tiles/1.0.0/osm/", "/", ".png");

            /*
            //set offline base layer from MBTiles file
            //TODO: set path properly
            String MbTilePath = "/sdcard/europe-tilemill-mbtiles.sqlite";

            view.Layers.BaseLayer = new MBTilesMapLayer (proj, 0, 5, 1, MbTilePath, this);
            */

            // start map
            view.StartMapping ();

            // add a marker

            // define marker style (image, size, color)
            Bitmap pointMarker = UnscaledBitmapLoader.DecodeResource(Resources, Resource.Drawable.olmarker);

            MarkerStyle.Builder markerStyleBuilder = new MarkerStyle.Builder ();
            markerStyleBuilder.SetBitmap (pointMarker);
            markerStyleBuilder.SetColor (NutiteqComponents.Color.White);
            markerStyleBuilder.SetSize (0.5f);
            MarkerStyle markerStyle = markerStyleBuilder.Build ();

            // define label what is shown when you click on marker
            Label markerLabel = new DefaultLabel ("San Francisco", "Here is a marker");

            // define location of the marker, it must be converted to base map coordinate system
            MapPos SanFrancisco = view.Layers.BaseLayer.Projection.FromWgs84 (-122.416667f, 37.766667f);
            MapPos London = view.Layers.BaseLayer.Projection.FromWgs84 (0.0f, 51.0f);

            // create layer and add object to the layer, finally add layer to the map.
            // All overlay layers must be same projection as base layer, so we reuse it
            MarkerLayer markerLayer = new MarkerLayer(view.Layers.BaseLayer.Projection);

            markerLayer.Add(new Marker(SanFrancisco, markerLabel, markerStyle, markerLayer));
            view.Layers.AddLayer(markerLayer);

            // 3d building layer

            Polygon3DStyle.Builder nml3dStyleBuilder = new Polygon3DStyle.Builder ();
            Polygon3DStyle nml3dStyle = nml3dStyleBuilder.Build ();

            StyleSet nmlStyleSet = new StyleSet ();
            nmlStyleSet.SetZoomStyle (14, nml3dStyle);

            NMLModelOnlineLayer Online3dLayer = new NMLModelOnlineLayer (view.Layers.BaseLayer.Projection, "http://aws-lb.nutiteq.ee/nml/nmlserver2.php?data=demo&", nmlStyleSet);

            // persistent caching settings for the layer
            Online3dLayer.SetMemoryLimit (20*1024*1024); // 20 MB
            Online3dLayer.SetPersistentCacheSize (50*1024*1024); // 50 MB
            Online3dLayer.SetPersistentCachePath ("/sdcard/nmlcache.db"); // mandatory to be set

            view.Layers.AddLayer(Online3dLayer);

            // OSM Polygon3D layer

            Polygon3DStyle.Builder poly3dStyleBuilder = new Polygon3DStyle.Builder ();
            poly3dStyleBuilder.SetColor (NutiteqComponents.Color.White);
            Polygon3DStyle poly3dStyle = poly3dStyleBuilder.Build ();

            StyleSet polyStyleSet = new StyleSet ();
            polyStyleSet.SetZoomStyle (16, poly3dStyle);

            Roof DefaultRoof = new FlatRoof ();

            Polygon3DOSMLayer Poly3DLayer = new Polygon3DOSMLayer (view.Layers.BaseLayer.Projection, 0.3f, DefaultRoof, unchecked((int) 0xffffffff) /* white */, unchecked((int) 0xff888888) /* gray */, 1500, polyStyleSet);
            view.Layers.AddLayer (Poly3DLayer);

            // set map center and zoom
            view.FocusPoint = SanFrancisco;
            view.Zoom = 5.0f;

            // set listener for map events
            MapListener listener = new MyMapListener ();
            view.Options.MapListener = listener;
        }
Example #10
0
        public void ExternalWindPressureForceCalculationsTest_Example2019_04_28_Success()
        {
            //Arrange:
            double   heightAboveSeaLevel = 123;
            double   length          = 40;
            double   width           = 50;
            double   height          = 30;
            WindZone windZone        = WindZone.II;
            double   referenceHeight = 30;

            double actualLengthUpwindSlope        = 20;
            double actualLengthDownwindSlope      = 10;
            double effectiveFeatureHeight         = 10;
            double horizontalDistanceFromCrestTop = 2;

            double windDirection = 220;

            var building = new FlatRoof(
                length, width, height);
            var orographyFactor = new HillRidgeOrography(
                actualLengthUpwindSlope,
                actualLengthDownwindSlope,
                effectiveFeatureHeight,
                horizontalDistanceFromCrestTop);
            var terrain           = new TerrainCategoryIII(orographyFactor);
            var directionalFactor = new DirectionalFactor(windZone, windDirection);
            var buildingSite      = new BuildingSite(heightAboveSeaLevel, windZone, terrain,
                                                     directionalFactor: directionalFactor);
            var windLoadData      = new WindLoadData(buildingSite, building);
            var flatRoofWindLoads = new FlatRoofWindLoads(building, windLoadData);

            var structuralFactorCalculator = new StructuralFactorCalculator(
                building, terrain, windLoadData, StructuralType.ReinforcementConcreteBuilding);

            var externalPressureWindForce =
                new ExternalPressureWindForce(
                    windLoadData,
                    flatRoofWindLoads,
                    structuralFactorCalculator);

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

            //Assert:
            Assert.Multiple(() =>
            {
                // e
                Assert.That(building.EdgeDistance, Is.EqualTo(50));
                // v_b,0
                Assert.That(buildingSite.FundamentalValueBasicWindVelocity, Is.EqualTo(26).Within(0.01));
                // c_dir
                Assert.That(directionalFactor.GetFactor(), Is.EqualTo(0.8));
                // v_b
                Assert.That(buildingSite.BasicWindVelocity, Is.EqualTo(20.8).Within(0.01));
                // z_e

                // c_r(z_e)
                Assert.That(terrain.GetRoughnessFactorAt(referenceHeight), Is.EqualTo(0.99).Within(0.01));
                // c_0(z_e)
                Assert.That(orographyFactor.GetFactorAt(referenceHeight), Is.EqualTo(1.11).Within(0.01));
                // v_m(z_e)
                Assert.That(windLoadData.GetMeanWindVelocityAt(referenceHeight),
                            Is.EqualTo(22.85).Within(0.01));
                // I_v(z_e)
                Assert.That(windLoadData.GetTurbulenceIntensityAt(referenceHeight),
                            Is.EqualTo(0.195).Within(0.001));
                // q_p(z_e)
                Assert.That(windLoadData.GetPeakVelocityPressureAt(referenceHeight),
                            Is.EqualTo(0.771).Within(0.001));
                // c_sc_d
                Assert.That(structuralFactorCalculator.GetStructuralFactor(true),
                            Is.EqualTo(0.817).Within(0.001));

                Assert.That(resultMax[Field.F], Is.EqualTo(-1.134).Within(0.001));
                Assert.That(resultMax[Field.G], Is.EqualTo(-0.756).Within(0.001));
                Assert.That(resultMax[Field.H], Is.EqualTo(-0.441).Within(0.001));
                Assert.That(resultMax[Field.I], Is.EqualTo(0.126).Within(0.001));

                Assert.That(resultMin[Field.F], Is.EqualTo(-1.134).Within(0.001));
                Assert.That(resultMin[Field.G], Is.EqualTo(-0.756).Within(0.001));
                Assert.That(resultMin[Field.H], Is.EqualTo(-0.441).Within(0.001));
                Assert.That(resultMin[Field.I], Is.EqualTo(-0.126).Within(0.001));
            });
        }