Esempio n. 1
0
        /// <summary>多数室テスト</summary>
        /// <remarks>
        /// 東西2室で壁・窓表面の相互放射を考慮した計算を行う。
        /// 東側は南北で2ゾーンに分割する。
        /// 壁体は全て200mmのコンクリートとする。
        /// 幅×奥行き×高さ = 8m×7m×3mとする。
        /// 地面(床)は考慮しない。
        /// 
        ///        N1           N2
        ///   -------------------------
        ///   |           |           |
        ///   |           |    znE1   | E1
        ///   |           |           |
        /// W |    znW    |- - - - - -|
        ///   |           |           |
        ///   |           |    znE2   | E2
        ///   |           |           |
        ///   ----+++++----------------
        ///        S1           S2
        /// 
        /// </remarks>
        private static void multiRoomTest()
        {
            const double TIME_STEP = 3600;
            const double INIT_TEMP = 15;
            const double H_GAIN = 0;
            const int ITER_NUM = 100;
            const double W_AI = 8;
            const double E_AI = 9.3;
            const double W_AO = 20;
            const double E_AO = 23;
            bool USE_TUBE = false;

            //モデル作成処理*********************************************************

            //屋外
            Outdoor outDoor = new Outdoor();
            Sun sun = new Sun(Sun.City.Tokyo);
            sun.Update(new DateTime(2001, 1, 1, 0, 0, 0));
            outDoor.Sun = sun;

            //壁リスト
            Wall[] walls = new Wall[12];

            //ゾーンを作成
            Zone znW = new Zone();
            znW.Volume = 7 * 4 * 3;
            znW.SensibleHeatCapacity = znW.Volume * 12000;//単位容積あたり12kJ
            Zone znE1 = new Zone();
            znE1.Volume = 3.5 * 4 * 3;
            znE1.SensibleHeatCapacity = znE1.Volume * 12000;//単位容積あたり12kJ
            Zone znE2 = new Zone();
            znE2.Volume = 3.5 * 4 * 3;
            znE2.SensibleHeatCapacity = znE2.Volume * 12000;//単位容積あたり12kJ
            znW.TimeStep = znE1.TimeStep = znE2.TimeStep = TIME_STEP;

            //壁構成を作成(コンクリート)
            WallLayers layers;
            WallLayers.Layer layer;
            layers = new WallLayers();
            layer = new WallLayers.Layer(new WallMaterial("コンクリート", 1.4, 1934), 0.150, 2);
            layers.AddLayer(layer);

            //西外壁
            walls[0] = new Wall(layers);
            walls[0].SurfaceArea = 7 * 3;
            WallSurface ews = walls[0].GetSurface(true);
            WallSurface iws = walls[0].GetSurface(false);
            ews.FilmCoefficient = W_AO;
            iws.FilmCoefficient = W_AI;
            walls[0].SetIncline(new Incline(Incline.Orientation.W, 0.5 * Math.PI), true);
            znW.AddSurface(iws);
            outDoor.AddWallSurface(ews);

            //東外壁1
            walls[1] = new Wall(layers);
            walls[1].SurfaceArea = 3.5 * 3;
            ews = walls[1].GetSurface(true);
            iws = walls[1].GetSurface(false);
            ews.FilmCoefficient = E_AO;
            iws.FilmCoefficient = E_AI;
            walls[1].SetIncline(new Incline(Incline.Orientation.E, 0.5 * Math.PI), true);
            znE1.AddSurface(iws);
            outDoor.AddWallSurface(ews);

            //東外壁2
            walls[2] = new Wall(layers);
            walls[2].SurfaceArea = 3.5 * 3;
            ews = walls[2].GetSurface(true);
            iws = walls[2].GetSurface(false);
            ews.FilmCoefficient = E_AO;
            iws.FilmCoefficient = E_AI;
            walls[2].SetIncline(new Incline(Incline.Orientation.E, 0.5 * Math.PI), true);
            znE2.AddSurface(iws);
            outDoor.AddWallSurface(ews);

            //北外壁1
            walls[3] = new Wall(layers);
            walls[3].SurfaceArea = 4 * 3;
            ews = walls[3].GetSurface(true);
            iws = walls[3].GetSurface(false);
            ews.FilmCoefficient = W_AO;
            iws.FilmCoefficient = W_AI;
            walls[3].SetIncline(new Incline(Incline.Orientation.N, 0.5 * Math.PI), true);
            znW.AddSurface(iws);
            outDoor.AddWallSurface(ews);

            //北外壁2
            walls[4] = new Wall(layers);
            walls[4].SurfaceArea = 4 * 3;
            ews = walls[4].GetSurface(true);
            iws = walls[4].GetSurface(false);
            ews.FilmCoefficient = E_AO;
            iws.FilmCoefficient = E_AI;
            walls[4].SetIncline(new Incline(Incline.Orientation.N, 0.5 * Math.PI), true);
            znE1.AddSurface(iws);
            outDoor.AddWallSurface(ews);

            //南外壁1
            walls[5] = new Wall(layers);
            walls[5].SurfaceArea = 4 * 3;
            ews = walls[5].GetSurface(true);
            iws = walls[5].GetSurface(false);
            ews.FilmCoefficient = W_AO;
            iws.FilmCoefficient = W_AI;
            walls[5].SetIncline(new Incline(Incline.Orientation.S, 0.5 * Math.PI), true);
            znW.AddSurface(iws);
            outDoor.AddWallSurface(ews);

            //南外壁2
            walls[6] = new Wall(layers);
            walls[6].SurfaceArea = 4 * 3;
            ews = walls[6].GetSurface(true);
            iws = walls[6].GetSurface(false);
            ews.FilmCoefficient = E_AO;
            iws.FilmCoefficient = E_AI;
            walls[6].SetIncline(new Incline(Incline.Orientation.S, 0.5 * Math.PI), true);
            znE2.AddSurface(iws);
            outDoor.AddWallSurface(ews);

            //屋根1
            walls[7] = new Wall(layers);
            walls[7].SurfaceArea = 4 * 7;
            ews = walls[7].GetSurface(true);
            iws = walls[7].GetSurface(false);
            ews.FilmCoefficient = W_AO;
            iws.FilmCoefficient = W_AI;
            walls[7].SetIncline(new Incline(Incline.Orientation.N, 0), true);
            znW.AddSurface(iws);
            outDoor.AddWallSurface(ews);

            //屋根2
            walls[8] = new Wall(layers);
            walls[8].SurfaceArea = 4 * 3.5;
            ews = walls[8].GetSurface(true);
            iws = walls[8].GetSurface(false);
            ews.FilmCoefficient = E_AO;
            iws.FilmCoefficient = E_AI;
            walls[8].SetIncline(new Incline(Incline.Orientation.N, 0), true);
            znE1.AddSurface(iws);
            outDoor.AddWallSurface(ews);

            //屋根3
            walls[9] = new Wall(layers);
            walls[9].SurfaceArea = 4 * 3.5;
            ews = walls[9].GetSurface(true);
            iws = walls[9].GetSurface(false);
            ews.FilmCoefficient = E_AO;
            iws.FilmCoefficient = E_AI;
            walls[9].SetIncline(new Incline(Incline.Orientation.N, 0), true);
            znE2.AddSurface(iws);
            outDoor.AddWallSurface(ews);

            //内壁1
            walls[10] = new Wall(layers);
            walls[10].SurfaceArea = 7 * 3.5;
            ews = walls[10].GetSurface(true);
            iws = walls[10].GetSurface(false);
            ews.FilmCoefficient = E_AI;
            iws.FilmCoefficient = W_AI;
            znW.AddSurface(iws);
            znE1.AddSurface(ews);

            //内壁2
            walls[11] = new Wall(layers);
            walls[11].SurfaceArea = 7 * 3.5;
            ews = walls[11].GetSurface(true);
            iws = walls[11].GetSurface(false);
            ews.FilmCoefficient = E_AI;
            iws.FilmCoefficient = W_AI;
            znW.AddSurface(iws);
            znE2.AddSurface(ews);

            //南窓
            GlassPanes gPanes = new GlassPanes(new GlassPanes.Pane[] {
                new GlassPanes.Pane(GlassPanes.Pane.PredifinedGlassPane.TransparentGlass03mm),
                new GlassPanes.Pane(GlassPanes.Pane.PredifinedGlassPane.HeatAbsorbingGlass03mm)
            });
            //外側ブラインド
            GlassPanes gPanesWithBlind = new GlassPanes(new GlassPanes.Pane[] {
                new GlassPanes.Pane(GlassPanes.Pane.PredifinedGlassPane.TransparentGlass03mm),
                new GlassPanes.Pane(GlassPanes.Pane.PredifinedGlassPane.HeatAbsorbingGlass03mm),
                new GlassPanes.Pane(0.05, 0.35, 9999)
            });
            Window window = new Window(gPanes, new Incline(Incline.Orientation.S, 0.5 * Math.PI));
            window.SurfaceArea = 1 * 3;
            WindowSurface ws1 = window.GetSurface(true);
            WindowSurface ws2 = window.GetSurface(false);
            ws1.LongWaveEmissivity = 0.7;
            ws1.FilmCoefficient = W_AO;
            ws2.FilmCoefficient = W_AI;
            znW.AddWindow(window);
            outDoor.AddWindow(window);

            /*//debug
            for (int i = 0; i < walls.Length; i++)
            {
                walls[i].GetSurface(true).ConvectiveRate = 0;
                walls[i].GetSurface(false).ConvectiveRate = 0;
            }
            //window.GetSurface(false).ConvectiveRate = 0;
            //debug*/

            //発熱体*****************************************************************
            znW.AddHeatGain(new ConstantHeatGain(0, H_GAIN, 0));

            //制御*******************************************************************
            znE1.ControlDrybulbTemperature = false;
            znE1.DrybulbTemperatureSetPoint = 20;
            znE2.ControlDrybulbTemperature = false;
            znE2.DrybulbTemperatureSetPoint = 20;
            znW.ControlDrybulbTemperature = false;
            znW.DrybulbTemperatureSetPoint = 20;

            //外界条件設定***********************************************************
            outDoor.AirState = new MoistAir(30, 0.020);
            outDoor.SetWallSurfaceBoundaryState();

            //天井に冷水配管を設置
            if (USE_TUBE)
            {
                Tube tube = new Tube(0.999, 0.275, 4186);
                tube.SetFlowRate(0.222);
                tube.FluidTemperature = 10;
                walls[7].AddTube(tube, 0);
                walls[8].AddTube(tube, 0);
                walls[9].AddTube(tube, 0);
            }

            //室温・壁温初期化*******************************************************
            for (int i = 0; i < walls.Length; i++) walls[i].InitializeTemperature(INIT_TEMP);
            znE1.InitializeAirState(INIT_TEMP, 0.015);
            znE2.InitializeAirState(INIT_TEMP, 0.015);
            znW.InitializeAirState(INIT_TEMP, 0.015);

            //多数室オブジェクトを作成・初期化
            Room[] rooms = new Room[2];
            rooms[0] = new Room(new Zone[] { znW });
            rooms[1] = new Room(new Zone[] { znE1, znE2 });
            MultiRoom mRoom = new MultiRoom(rooms);
            mRoom.SetTimeStep(TIME_STEP);
            //初期化
            mRoom.Initialize();

            //室間換気設定***********************************************************
            znW.VentilationVolume = znW.Volume * 0;
            znE1.VentilationVolume = znE1.Volume * 0;
            znE2.VentilationVolume = znE2.Volume * 0;
            znW.VentilationAirState = outDoor.AirState;
            znE1.VentilationAirState = outDoor.AirState;
            znE2.VentilationAirState = outDoor.AirState;
            //mRoom.SetAirFlow(znE1, znE2, 10);
            //mRoom.SetAirFlow(znE2, znW, 10);
            //mRoom.SetAirFlow(znW, znE1, 10);

            //熱収支確認用変数*******************************************************
            double heatTransferToExWall = 0;
            double heatTransferToTube = 0;
            double heatTransferToWindow = 0;
            double oaLoad = 0;

            //外気データ読み込み*****************************************************
            StreamReader sReader = new StreamReader("BESTestWeather.csv");
            sReader.ReadLine();

            //室温更新テスト*********************************************************
            for (int i = 0; i < ITER_NUM; i++)
            {
                //外気条件設定
                string[] wData = sReader.ReadLine().Split(',');
                outDoor.AirState = new MoistAir(double.Parse(wData[2]), double.Parse(wData[3]));
                sun.DirectNormalRadiation = double.Parse(wData[4]);
                sun.GlobalHorizontalRadiation = double.Parse(wData[5]);
                sun.DiffuseHorizontalRadiation = double.Parse(wData[6]);
                outDoor.NocturnalRadiation = double.Parse(wData[8]);

                //12~13時は外側ブラインドを利用
                if (sun.CurrentDateTime.Hour == 12 && sun.CurrentDateTime.Minute == 0) window.Initialize(gPanesWithBlind);
                if (sun.CurrentDateTime.Hour == 13 && sun.CurrentDateTime.Minute == 0) window.Initialize(gPanes);

                Console.WriteLine(
                    znW.CurrentDrybulbTemperature.ToString("F3").PadLeft(5) + " | "
                    + znE1.CurrentDrybulbTemperature.ToString("F3").PadLeft(5) + " | "
                    + znE2.CurrentDrybulbTemperature.ToString("F3").PadLeft(5) + " | "
                    + znW.CurrentSensibleHeatLoad.ToString("F2").PadLeft(5) + " | "
                    + znE1.CurrentSensibleHeatLoad.ToString("F2").PadLeft(5) + " | "
                    + znE2.CurrentSensibleHeatLoad.ToString("F2").PadLeft(5) + " | "
                    + walls[0].GetWallTemprature(true).ToString("F2").PadLeft(5) + " | "
                    + walls[0].GetWallTemprature(false).ToString("F2").PadLeft(5) + " | "
                    );

                //壁体状態更新
                for (int j = 0; j < walls.Length; j++) walls[j].Update();
                //外気条件を壁に設定
                outDoor.SetWallSurfaceBoundaryState();
                //室状態更新
                mRoom.UpdateRoomTemperatures();
                mRoom.UpdateRoomHumidities();

                //壁体への熱移動量を積算
                for (int j = 0; j < 10; j++) heatTransferToExWall += walls[j].GetHeatTransfer(true);
                //窓面への熱移動量を積算
                heatTransferToWindow += window.AbsorbedHeatGain + window.TransferHeatGain + window.TransmissionHeatGain;
                heatTransferToWindow -= rooms[0].TransmissionHeatLossFromWindow + rooms[1].TransmissionHeatLossFromWindow;
                //チューブへの熱移動量を積算
                heatTransferToTube += walls[7].GetHeatTransferToTube(0) + walls[8].GetHeatTransferToTube(0) + walls[9].GetHeatTransferToTube(0);
                //外気負荷を計算
                Zone[] zns = new Zone[] { znE1, znE2, znW };
                for (int j = 0; j < zns.Length; j++)
                {
                    if (zns[j].VentilationVolume != 0)
                    {
                        double airDS = 1d / (MoistAir.GetAirStateFromDBHR(zns[j].CurrentDrybulbTemperature, zns[j].CurrentHumidityRatio, MoistAir.Property.SpecificVolume));
                        double cpAir = MoistAir.GetSpecificHeat(zns[j].CurrentHumidityRatio);
                        oaLoad += zns[j].VentilationVolume * airDS * cpAir * (zns[j].VentilationAirState.DryBulbTemperature - zns[j].CurrentDrybulbTemperature);
                    }
                }

                //日時更新
                sun.Update(sun.CurrentDateTime.AddSeconds(TIME_STEP));
            }
            sReader.Close();

            //熱収支を書き出し
            //屋外から壁体への熱移動量[MJ]
            heatTransferToExWall *= TIME_STEP / 1000000d;
            //窓面への熱移動量[MJ]
            heatTransferToWindow *= TIME_STEP / 1000000d;
            //壁体からチューブへの熱移動量[MJ]
            heatTransferToTube *= TIME_STEP / 1000000d;
            //外気負荷[MJ]
            oaLoad *= TIME_STEP / 1000000d / 3.6;
            //壁体蓄熱量[MJ]
            double wallHeatStorage = 0;
            for (int i = 0; i < walls.Length; i++) wallHeatStorage += walls[i].GetHeatStorage(INIT_TEMP);
            wallHeatStorage /= 1000d;
            //室蓄熱量[MJ]
            double zoneHeatStorage = (znE1.GetHeatStorage(INIT_TEMP) + znE2.GetHeatStorage(INIT_TEMP) + znW.GetHeatStorage(INIT_TEMP)) / 1000d;
            //発熱量
            double heatGain = (H_GAIN * TIME_STEP * ITER_NUM) / 1000000;

            //書き出し
            Console.WriteLine("壁体への熱移動[MJ] | 窓面への熱移動[MJ] | 壁体の蓄熱量[MJ] | 室の蓄熱量[MJ] | 発熱量[MJ] | チューブへの熱移動[MJ] | 外気負荷[MJ]");
            Console.WriteLine(heatTransferToExWall.ToString("F2") + " | " +  heatTransferToWindow.ToString("F2") + " | " +
                wallHeatStorage.ToString("F2") + " | " + zoneHeatStorage.ToString("F2") + " | " + heatGain + " | " + heatTransferToTube.ToString("F2") + " | " + oaLoad.ToString("F2"));
            Console.WriteLine("熱収支[MJ] = " + (heatTransferToExWall + heatTransferToWindow - heatTransferToTube - wallHeatStorage - zoneHeatStorage + heatGain + oaLoad));

            Console.Read();
        }
Esempio n. 2
0
        /// <summary>室の温湿度変動テスト(MultiRoomクラス)</summary>
        private static void RoomModelTest2()
        {
            //気象データ:乾球温度,絶対湿度,夜間放射,直達日射,天空日射
            double[] dbt = new double[] { 24.2, 24.1, 24.1, 24.2, 24.3, 24.2, 24.4, 25.1, 26.1, 27.1, 28.8, 29.9,
                30.7, 31.2, 31.6, 31.4, 31.3, 30.8, 29.4, 28.1, 27.5, 27.1, 26.6, 26.3 };
            double[] ahd = new double[] { 0.0134, 0.0136, 0.0134, 0.0133, 0.0131, 0.0134, 0.0138, 0.0142, 0.0142, 0.0140, 0.0147, 0.0149,
                0.0142, 0.0146, 0.0140, 0.0145, 0.0144, 0.0146, 0.0142, 0.0136, 0.0136, 0.0135, 0.0136, 0.0140 };
            double[] nrd = new double[] { 32, 30, 30, 29, 26, 24, 24, 25, 25, 25, 24, 24, 24, 23, 24, 24, 24, 24, 23, 23, 24, 26, 25, 23 };
            double[] dnr = new double[] { 0, 0, 0, 0, 0, 0, 106, 185, 202, 369, 427, 499, 557, 522, 517, 480, 398, 255, 142, 2, 0, 0, 0, 0 };
            double[] drd = new double[] { 0, 0, 0, 0, 0, 0, 36, 115, 198, 259, 314, 340, 340, 349, 319, 277, 228, 167, 87, 16, 0, 0, 0, 0 };

            //屋外を作成
            Outdoor outdoor = new Outdoor();
            Sun sun = new Sun(Sun.City.Tokyo);
            outdoor.Sun = sun;
            outdoor.GroundTemperature = 25;

            //傾斜を作成
            Incline nIn = new Incline(Incline.Orientation.N, 0.5 * Math.PI);    //北
            Incline eIn = new Incline(Incline.Orientation.E, 0.5 * Math.PI);    //東
            Incline wIn = new Incline(Incline.Orientation.W, 0.5 * Math.PI);    //西
            Incline sIn = new Incline(Incline.Orientation.S, 0.5 * Math.PI);    //南
            Incline hIn = new Incline(Incline.Orientation.S, 0);                //水平

            //ゾーンを作成
            Zone[] zones = new Zone[4];
            Zone wpZone = zones[0] = new Zone("西室ペリメータ");
            wpZone.Volume = 3 * 5 * 3;
            Zone wiZone = zones[1] = new Zone("西室インテリア");
            wiZone.Volume = 4 * 5 * 3;
            Zone epZone = zones[2] = new Zone("東室ペリメータ");
            epZone.Volume = 3 * 5 * 3;
            Zone eiZone = zones[3] = new Zone("東室インテリア");
            eiZone.Volume = 4 * 5 * 3;
            foreach (Zone zn in zones)
            {
                zn.TimeStep = 3600;
                zn.DrybulbTemperatureSetPoint = 26;
                zn.HumidityRatioSetPoint = 0.01;
            }

            //東側インテリアに発熱体を設定
            eiZone.AddHeatGain(new ConstantHeatGain(100, 100, 20));

            //壁構成を作成:400mmコンクリート
            WallLayers wl = new WallLayers();
            wl.AddLayer(new WallLayers.Layer(new WallMaterial(WallMaterial.PredefinedMaterials.ReinforcedConcrete), 0.4));

            //窓構成を作成
            GlassPanes gPanes = new GlassPanes(new GlassPanes.Pane(GlassPanes.Pane.PredifinedGlassPane.HeatReflectingGlass06mm));

            //壁体をゾーンに追加
            Wall[] walls = new Wall[18];
            List<WallSurface> outdoorSurfaces = new List<WallSurface>();
            Wall wpwWall = walls[0] = new Wall(wl, "西室ペリメータ西壁");
            wpwWall.SurfaceArea = 3 * 3;
            outdoorSurfaces.Add(wpwWall.GetSurface(true));
            wpZone.AddSurface(wpwWall.GetSurface(false));
            wpwWall.SetIncline(wIn, true);

            Wall wpcWall = walls[1] = new Wall(wl, "西室ペリメータ天井");
            wpcWall.SurfaceArea = 3 * 5;
            outdoorSurfaces.Add(wpcWall.GetSurface(true));
            wpZone.AddSurface(wpcWall.GetSurface(false));
            wpcWall.SetIncline(hIn, true);

            Wall wpfWall = walls[2] = new Wall(wl, "西室ペリメータ床");
            wpfWall.SurfaceArea = 3 * 5;
            outdoor.AddGroundWallSurface(wpfWall.GetSurface(true));
            wpZone.AddSurface(wpfWall.GetSurface(false));

            Wall winWall = walls[3] = new Wall(wl, "西室インテリア北壁");
            winWall.SurfaceArea = 3 * 5;
            outdoorSurfaces.Add(winWall.GetSurface(true));
            wiZone.AddSurface(winWall.GetSurface(false));
            winWall.SetIncline(nIn, true);

            Wall wiwWall = walls[4] = new Wall(wl, "西室インテリア西壁");
            wiwWall.SurfaceArea = 3 * 4;
            outdoorSurfaces.Add(wiwWall.GetSurface(true));
            wiZone.AddSurface(wiwWall.GetSurface(false));
            wiwWall.SetIncline(wIn, true);

            Wall wicWall = walls[5] = new Wall(wl, "西室インテリア天井");
            wicWall.SurfaceArea = 4 * 5;
            outdoorSurfaces.Add(wicWall.GetSurface(true));
            wiZone.AddSurface(wicWall.GetSurface(false));
            wicWall.SetIncline(hIn, true);

            Wall wifWall = walls[6] = new Wall(wl, "西室インテリア床");
            wifWall.SurfaceArea = 4 * 5;
            outdoor.AddGroundWallSurface(wifWall.GetSurface(true));
            wiZone.AddSurface(wifWall.GetSurface(false));

            Wall epwWall = walls[7] = new Wall(wl, "東室ペリメータ東壁");
            epwWall.SurfaceArea = 3 * 3;
            outdoorSurfaces.Add(epwWall.GetSurface(true));
            epZone.AddSurface(epwWall.GetSurface(false));
            epwWall.SetIncline(eIn, true);

            Wall epcWall = walls[8] = new Wall(wl, "東室ペリメータ天井");
            epcWall.SurfaceArea = 3 * 5;
            outdoorSurfaces.Add(epcWall.GetSurface(true));
            epZone.AddSurface(epcWall.GetSurface(false));
            epcWall.SetIncline(hIn, true);

            Wall epfWall = walls[9] = new Wall(wl, "東室ペリメータ床");
            epfWall.SurfaceArea = 3 * 5;
            outdoor.AddGroundWallSurface(epfWall.GetSurface(true));
            epZone.AddSurface(epfWall.GetSurface(false));

            Wall einWall = walls[10] = new Wall(wl, "東室インテリア北壁");
            einWall.SurfaceArea = 5 * 3;
            outdoorSurfaces.Add(einWall.GetSurface(true));
            eiZone.AddSurface(einWall.GetSurface(false));
            einWall.SetIncline(nIn, true);

            Wall eiwWall = walls[11] = new Wall(wl, "東室インテリア東壁");
            eiwWall.SurfaceArea = 4 * 3;
            outdoorSurfaces.Add(eiwWall.GetSurface(true));
            eiZone.AddSurface(eiwWall.GetSurface(false));
            eiwWall.SetIncline(eIn, true);

            Wall eicWall = walls[12] = new Wall(wl, "東室インテリア天井");
            eicWall.SurfaceArea = 4 * 5;
            outdoorSurfaces.Add(eicWall.GetSurface(true));
            eiZone.AddSurface(eicWall.GetSurface(false));
            eicWall.SetIncline(hIn, true);

            Wall eifWall = walls[13] = new Wall(wl, "東室インテリア床");
            eifWall.SurfaceArea = 4 * 5;
            outdoor.AddGroundWallSurface(eifWall.GetSurface(true));
            eiZone.AddSurface(eifWall.GetSurface(false));

            Wall cpWall = walls[14] = new Wall(wl, "ペリメータ部の内壁");
            cpWall.SurfaceArea = 3 * 3;
            wpZone.AddSurface(cpWall.GetSurface(true));
            epZone.AddSurface(cpWall.GetSurface(false));

            Wall ciWall = walls[15] = new Wall(wl, "インテリア部の内壁");
            ciWall.SurfaceArea = 4 * 3;
            wiZone.AddSurface(ciWall.GetSurface(true));
            eiZone.AddSurface(ciWall.GetSurface(false));

            Wall wpsWall = walls[16] = new Wall(wl, "西側ペリメータ南壁");
            wpsWall.SurfaceArea = 5 * 3 - 3 * 2;
            outdoorSurfaces.Add(wpsWall.GetSurface(true));
            wpZone.AddSurface(wpsWall.GetSurface(false));
            wpsWall.SetIncline(sIn, true);

            Wall epsWall = walls[17] = new Wall(wl, "東側ペリメータ南壁");
            epsWall.SurfaceArea = 5 * 3 - 3 * 2;
            outdoorSurfaces.Add(epsWall.GetSurface(true));
            epZone.AddSurface(epsWall.GetSurface(false));
            epsWall.SetIncline(sIn, true);

            //外表面を初期化
            foreach (WallSurface ws in outdoorSurfaces)
            {
                //屋外に追加
                outdoor.AddWallSurface(ws);
                //放射率を初期化
                ws.InitializeEmissivity(WallSurface.SurfaceMaterial.Concrete);
            }

            //窓をゾーンに追加
            Window wWind = new Window(gPanes, "西室ペリメータ南窓");
            wWind.SurfaceArea = 3 * 2;
            wpZone.AddWindow(wWind);
            outdoor.AddWindow(wWind);

            Window eWind = new Window(gPanes, "東室ペリメータ南窓");
            eWind.SurfaceArea = 3 * 2;
            eWind.Shade = SunShade.MakeHorizontalSunShade(3, 2, 1, 1, 1, 0.5, sIn);
            wpZone.AddWindow(eWind);
            outdoor.AddWindow(eWind);

            //多数室オブジェクトを作成
            Room eRm = new Room(new Zone[] { epZone, eiZone }); //東側の室
            Room wRm = new Room(new Zone[] { wpZone, wiZone }); //西側の室
            MultiRoom mRoom = new MultiRoom(new Room[] { eRm, wRm });   //多数室
            mRoom.SetTimeStep(3600);

            //換気の設定
            wpZone.VentilationVolume = 10;  //西室ペリメータのみ外気導入
            mRoom.SetAirFlow(wpZone, wiZone, 10);
            mRoom.SetAirFlow(epZone, eiZone, 10);
            mRoom.SetAirFlow(eiZone, epZone, 10);

            //短波長放射の入射比率を調整:ペリメータ床面6割、その他は面積比率
            double sfSum = 0;
            foreach (ISurface isf in eRm.GetSurface()) sfSum += isf.Area;
            sfSum -= epfWall.SurfaceArea;
            foreach (ISurface isf in eRm.GetSurface()) eRm.SetShortWaveRadiationRate(isf, isf.Area / sfSum * 0.4);
            eRm.SetShortWaveRadiationRate(epfWall.GetSurface(false), 0.6);
            sfSum = 0;
            foreach (ISurface isf in wRm.GetSurface()) sfSum += isf.Area;
            sfSum -= wpfWall.SurfaceArea;
            foreach (ISurface isf in wRm.GetSurface()) wRm.SetShortWaveRadiationRate(isf, isf.Area / sfSum * 0.4);
            wRm.SetShortWaveRadiationRate(wpfWall.GetSurface(false), 0.6);

            //タイトル行書き出し
            StreamWriter sWriter = new StreamWriter("室の温湿度変動テスト2.csv", false, Encoding.GetEncoding("Shift_JIS"));
            foreach (Zone zn in zones) sWriter.Write(zn.Name + "乾球温度[C], " + zn.Name + "絶対湿度[kg/kgDA], " + zn.Name + "顕熱負荷[W], " + zn.Name + "潜熱負荷[W], ");
            sWriter.WriteLine();

            //計算実行
            for (int i = 0; i < 100; i++)
            {
                DateTime dTime = new DateTime(2007, 8, 3, 0, 0, 0);
                for (int j = 0; j < 24; j++)
                {
                    //時刻を設定
                    sun.Update(dTime);
                    mRoom.SetCurrentDateTime(dTime);

                    //空調設定
                    bool operating = (8 <= dTime.Hour && dTime.Hour <= 19);
                    foreach (Zone zn in zones)
                    {
                        zn.ControlHumidityRatio = operating;
                        zn.ControlDrybulbTemperature = operating;
                    }

                    //気象条件を設定
                    outdoor.AirState = new MoistAir(dbt[j], ahd[j]);
                    outdoor.NocturnalRadiation = nrd[j];
                    sun.SetGlobalHorizontalRadiation(drd[j], dnr[j]);

                    //換気の設定
                    wpZone.VentilationAirState = outdoor.AirState;

                    //外壁表面の状態を設定
                    outdoor.SetWallSurfaceBoundaryState();

                    //壁体を更新
                    foreach (Wall wal in walls) wal.Update();

                    //多数室を更新
                    mRoom.UpdateRoomTemperatures();
                    mRoom.UpdateRoomHumidities();

                    //時刻を更新
                    dTime = dTime.AddHours(1);

                    //書き出し設定
                    if (i == 99)
                    {
                        foreach (Zone zn in zones)
                        {
                            sWriter.Write(zn.CurrentDrybulbTemperature.ToString("F1") + ", " + zn.CurrentHumidityRatio.ToString("F3") + ", " +
                                zn.CurrentSensibleHeatLoad.ToString("F0") + ", " + zn.CurrentLatentHeatLoad.ToString("F0") + ", ");
                        }
                        sWriter.WriteLine();
                    }
                }
            }

            sWriter.Close();
        }
Esempio n. 3
0
        private static void setAirFlow(MultiRoom mRoom, Dictionary<string, Zone> zones)
        {
            bool setAirFlow = true;

            if (setAirFlow)
            {
                //外気
                zones["床下"].VentilationVolume = zones["床下"].Volume * 2.0;
                zones["屋根裏"].VentilationVolume = zones["屋根裏"].Volume * 2.0;
                zones["1F台所"].VentilationVolume = 9;
                zones["1F居間"].VentilationVolume = 25;
                zones["1F和室"].VentilationVolume = 15;
                zones["1F廊下"].VentilationVolume = 9;
                zones["1F洗面所"].VentilationVolume = 10;
                zones["2F主寝室"].VentilationVolume = 23;
                zones["2F子供室1"].VentilationVolume = 13;
                zones["2F子供室2"].VentilationVolume = 13;
                zones["2F予備室"].VentilationVolume = 13;
                zones["2F廊下"].VentilationVolume = 7;

                //1F室間換気
                mRoom.SetAirFlow(zones["1F居間"], zones["1F廊下"], 25);
                mRoom.SetAirFlow(zones["1F台所"], zones["1F廊下"], 9);
                mRoom.SetAirFlow(zones["1F和室"], zones["1F廊下"], 15);
                mRoom.SetAirFlow(zones["1F廊下"], zones["1FWC"], 29);
                mRoom.SetAirFlow(zones["1F廊下"], zones["1F洗面所"], 29);
                mRoom.SetAirFlow(zones["1F洗面所"], zones["1F浴室"], 39);

                //2F室間換気
                mRoom.SetAirFlow(zones["階段室"], zones["2F廊下"], 7);
                mRoom.SetAirFlow(zones["2F主寝室"], zones["2F廊下"], 23);
                mRoom.SetAirFlow(zones["2F子供室1"], zones["2F廊下"], 13);
                mRoom.SetAirFlow(zones["2F子供室2"], zones["2F廊下"], 13);
                mRoom.SetAirFlow(zones["2F予備室"], zones["2F廊下"], 13);
                mRoom.SetAirFlow(zones["2F廊下"], zones["2FWC"], 69);
            }
            else
            {
                foreach (string key in zones.Keys)
                {
                    Zone zn = zones[key];
                    zn.VentilationVolume = zn.Volume * 0.3;
                }
                zones["1F台所"].VentilationVolume = zones["1F台所"].Volume * 0.5;
                zones["1F居間"].VentilationVolume = zones["1F居間"].Volume * 0.5;
                zones["1F和室"].VentilationVolume = zones["1F和室"].Volume * 0.5;
                zones["2F主寝室"].VentilationVolume = zones["2F主寝室"].Volume * 0.5;
                zones["2F子供室1"].VentilationVolume = zones["2F子供室1"].Volume * 0.5;
                zones["2F子供室2"].VentilationVolume = zones["2F子供室2"].Volume * 0.5;
                zones["2F予備室"].VentilationVolume = zones["2F予備室"].Volume * 0.5;
            }
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            //makeWeatherData();

            //Create an instance of the Outdoor class
            Outdoor outdoor = new Outdoor();
            Sun sun = new Sun(Sun.City.Tokyo);  //Located in Tokyo
            outdoor.Sun = sun;
            outdoor.GroundTemperature = 20;     //Ground temperature is assumed to be constant

            //Create an instance of the Incline class
            Dictionary<string, Incline> inclines = new Dictionary<string, Incline>();
            inclines.Add("N", new Incline(Incline.Orientation.N, 0.5 * Math.PI)); //North, Vertical
            inclines.Add("E", new Incline(Incline.Orientation.E, 0.5 * Math.PI)); //East, Vertical
            inclines.Add("W", new Incline(Incline.Orientation.W, 0.5 * Math.PI)); //West, Vertical
            inclines.Add("S", new Incline(Incline.Orientation.S, 0.5 * Math.PI)); //South, Vertical
            inclines.Add("H", new Incline(Incline.Orientation.S, 0)); //Horizontal

            //壁層を作成
            Dictionary<string, WallLayers> wallLayers;
            makeWallLayers(out wallLayers);

            //室を作成
            Dictionary<string, Zone> zones;
            makeZones(out zones);

            //窓を作成
            Dictionary<string, Window> windows;
            Dictionary<string, Wall> frames;
            makeWindows(zones, inclines, outdoor, wallLayers, out windows, out frames);

            //建具を作成
            Dictionary<string, Wall> doors;
            makeDoors(zones, wallLayers, inclines, outdoor, out doors);

            //外壁を作成
            Dictionary<string, Wall> exWalls;
            makeExWalls(zones, wallLayers, inclines, windows, frames, doors, outdoor, out exWalls);

            //内壁を作成
            Dictionary<string, Wall> inWalls;
            makeInWalls(zones, wallLayers, doors, out inWalls);

            //床を作成
            Dictionary<string, Wall> floors;
            makeFloors(zones, wallLayers, out floors);

            //Creat an insances of the Room class and MultiRoom class
            List<Room> rooms = new List<Room>();
            foreach (string key in zones.Keys) rooms.Add(new Room(new Zone[] { zones[key] }));
            MultiRoom mRoom = new MultiRoom(rooms.ToArray());
            mRoom.SetTimeStep(TIME_STEP);

            //換気経路を設定
            setAirFlow(mRoom, zones);

            //空調制御OFF
            foreach (string key in zones.Keys) zones[key].ControlDrybulbTemperature = false;

            //Output title wrine to standard output stream
            using (StreamWriter sWriter = new StreamWriter("out.csv", false, Encoding.GetEncoding("Shift_JIS")))
            {
                sWriter.Write("日時,");
                foreach (string key in zones.Keys) sWriter.Write(zones[key].Name + "室温[C], " + zones[key].Name + "顕熱負荷[W], ");
                sWriter.WriteLine();

                DateTime dTime = new DateTime(1999, 11, 1, 0, 0, 0);

                List<string[]> wData = new List<string[]>();
                using (StreamReader sReader = new StreamReader("weather.csv"))
                {
                    //タイトル行
                    sReader.ReadLine();
                    string strBuff;
                    while ((strBuff = sReader.ReadLine()) != null) wData.Add(strBuff.Split(','));
                }

                //反復計算
                int iterNum = 0;
                bool iter = true;
                bool output = false;
                double lastTemp = 9999;
                while (iter)
                {
                    iterNum++;

                    if (output) iter = false;
                    for (int j = 0; j < wData.Count; j++)
                    {
                        string[] strData = wData[j];

                        dTime = DateTime.Parse(strData[0]);
                        sun.Update(dTime);
                        mRoom.SetCurrentDateTime(dTime);

                        //Set weather state.
                        outdoor.AirState = new MoistAir(double.Parse(strData[1]), double.Parse(strData[2]));
                        outdoor.NocturnalRadiation = double.Parse(strData[5]);
                        outdoor.GroundTemperature = double.Parse(strData[1]);
                        sun.SetGlobalHorizontalRadiation(double.Parse(strData[3]), double.Parse(strData[4]));

                        //Set ventilation air state.
                        foreach (string key in zones.Keys) zones[key].VentilationAirState = outdoor.AirState;

                        //空調制御
                        setHVACControl(dTime, zones);

                        //Update boundary state of outdoor facing surfaces.
                        outdoor.SetWallSurfaceBoundaryState();

                        //Update the walls.
                        foreach (string key in frames.Keys) frames[key].Update();
                        foreach (string key in doors.Keys) doors[key].Update();
                        foreach (string key in exWalls.Keys) exWalls[key].Update();
                        foreach (string key in inWalls.Keys) inWalls[key].Update();
                        foreach (string key in floors.Keys) floors[key].Update();

                        //Update the MultiRoom object.
                        mRoom.UpdateRoomTemperatures();
                        mRoom.UpdateRoomHumidities();

                        if (output)
                        {
                            sWriter.Write(dTime.ToString() + ",");
                            foreach (string key in zones.Keys) sWriter.Write(zones[key].CurrentDrybulbTemperature + ", " + zones[key].CurrentSensibleHeatLoad + ", ");
                            sWriter.WriteLine();
                        }
                    }
                    double err = Math.Abs(zones["床下"].CurrentDrybulbTemperature - lastTemp);
                    if (err < 0.01) output = true;
                    lastTemp = zones["床下"].CurrentDrybulbTemperature;
                    Console.WriteLine(iterNum + ":" + err);
                }
            }
        }
Esempio n. 5
0
        /// <summary>Sample program calculating the air state and heat load of the building (MultiRoom class)</summary>
        private static void AirStateAndHeatLoadTest2()
        {
            //A sample weather data
            //Drybulb temperature [C]
            double[] dbt = new double[] { 24.2, 24.1, 24.1, 24.2, 24.3, 24.2, 24.4, 25.1, 26.1, 27.1, 28.8, 29.9,
                30.7, 31.2, 31.6, 31.4, 31.3, 30.8, 29.4, 28.1, 27.5, 27.1, 26.6, 26.3 };
            //Humidity ratio [kg/kg(DA)]
            double[] hum = new double[] { 0.0134, 0.0136, 0.0134, 0.0133, 0.0131, 0.0134, 0.0138, 0.0142, 0.0142, 0.0140, 0.0147, 0.0149,
                0.0142, 0.0146, 0.0140, 0.0145, 0.0144, 0.0146, 0.0142, 0.0136, 0.0136, 0.0135, 0.0136, 0.0140 };
            //Nocturnal radiation [W/m2]
            double[] nrd = new double[] { 32, 30, 30, 29, 26, 24, 24, 25, 25, 25, 24, 24, 24, 23, 24, 24, 24, 24, 23, 23, 24, 26, 25, 23 };
            //Direct normal radiation [W/m2]
            double[] dnr = new double[] { 0, 0, 0, 0, 0, 0, 106, 185, 202, 369, 427, 499, 557, 522, 517, 480, 398, 255, 142, 2, 0, 0, 0, 0 };
            //Diffuse horizontal radiation [W/m2]
            double[] drd = new double[] { 0, 0, 0, 0, 0, 0, 36, 115, 198, 259, 314, 340, 340, 349, 319, 277, 228, 167, 87, 16, 0, 0, 0, 0 };

            //Create an instance of the Outdoor class
            Outdoor outdoor = new Outdoor();
            Sun sun = new Sun(Sun.City.Tokyo);  //Located in Tokyo
            outdoor.Sun = sun;
            outdoor.GroundTemperature = 25;     //Ground temperature is assumed to be constant

            //Create an instance of the Incline class
            Incline nIn = new Incline(Incline.Orientation.N, 0.5 * Math.PI); //North, Vertical
            Incline eIn = new Incline(Incline.Orientation.E, 0.5 * Math.PI); //East, Vertical
            Incline wIn = new Incline(Incline.Orientation.W, 0.5 * Math.PI); //West, Vertical
            Incline sIn = new Incline(Incline.Orientation.S, 0.5 * Math.PI); //South, Vertical
            Incline hIn = new Incline(Incline.Orientation.S, 0);  //Horizontal

            //Create an instance of the Zone class
            Zone[] zones = new Zone[4];
            Zone wpZone = zones[0] = new Zone("West perimeter zone");
            wpZone.Volume = 3 * 5 * 3;  //Ceiling height is 3m
            Zone wiZone = zones[1] = new Zone("West interior zone");
            wiZone.Volume = 4 * 5 * 3;
            Zone epZone = zones[2] = new Zone("East perimeter zone");
            epZone.Volume = 3 * 5 * 3;
            Zone eiZone = zones[3] = new Zone("East interior zone");
            eiZone.Volume = 4 * 5 * 3;
            foreach (Zone zn in zones)
            {
                zn.VentilationVolume = 10; //Ventilation volume[CMH]
                zn.TimeStep = 3600;
                zn.DrybulbTemperatureSetPoint = 26;
                zn.HumidityRatioSetPoint = 0.01;
            }

            //Set a heat production element to the east interior zone
            //Convective sensible heat=100W, Radiative sensible heat=100W, Latent heat=20W
            eiZone.AddHeatGain(new ConstantHeatGain(100, 100, 20));

            //Create an instance of the WallLayers class : Concrete,400mm
            WallLayers wl = new WallLayers();
            wl.AddLayer(new WallLayers.Layer(new WallMaterial(WallMaterial.PredefinedMaterials.ReinforcedConcrete), 0.4));

            //Create an instance of the GlassPanes class:Low-emissivity coating single glass
            GlassPanes gPanes = new GlassPanes(new GlassPanes.Pane(GlassPanes.Pane.PredifinedGlassPane.HeatReflectingGlass06mm));

            //Set wall surfaces to the zone objects
            Wall[] walls = new Wall[18];
            List<WallSurface> outdoorSurfaces = new List<WallSurface>();
            Wall wpwWall = walls[0] = new Wall(wl, "West wall in the west perimeter zone");
            wpwWall.SurfaceArea = 3 * 3;
            outdoorSurfaces.Add(wpwWall.GetSurface(true));
            wpZone.AddSurface(wpwWall.GetSurface(false));
            wpwWall.SetIncline(wIn, true);

            Wall wpcWall = walls[1] = new Wall(wl, "Ceiling in the west perimeter zone");
            wpcWall.SurfaceArea = 3 * 5;
            outdoorSurfaces.Add(wpcWall.GetSurface(true));
            wpZone.AddSurface(wpcWall.GetSurface(false));
            wpcWall.SetIncline(hIn, true);

            Wall wpfWall = walls[2] = new Wall(wl, "Floor in the west perimeter zone");
            wpfWall.SurfaceArea = 3 * 5;
            outdoor.AddGroundWallSurface(wpfWall.GetSurface(true));
            wpZone.AddSurface(wpfWall.GetSurface(false));

            Wall winWall = walls[3] = new Wall(wl, "North wall in the west interior zone");
            winWall.SurfaceArea = 3 * 5;
            outdoorSurfaces.Add(winWall.GetSurface(true));
            wiZone.AddSurface(winWall.GetSurface(false));
            winWall.SetIncline(nIn, true);

            Wall wiwWall = walls[4] = new Wall(wl, "West wall in the west interior zone");
            wiwWall.SurfaceArea = 3 * 4;
            outdoorSurfaces.Add(wiwWall.GetSurface(true));
            wiZone.AddSurface(wiwWall.GetSurface(false));
            wiwWall.SetIncline(wIn, true);

            Wall wicWall = walls[5] = new Wall(wl, "Ceiling in the west interior zone");
            wicWall.SurfaceArea = 4 * 5;
            outdoorSurfaces.Add(wicWall.GetSurface(true));
            wiZone.AddSurface(wicWall.GetSurface(false));
            wicWall.SetIncline(hIn, true);

            Wall wifWall = walls[6] = new Wall(wl, "Floor in the west interior zone");
            wifWall.SurfaceArea = 4 * 5;
            outdoor.AddGroundWallSurface(wifWall.GetSurface(true));
            wiZone.AddSurface(wifWall.GetSurface(false));

            Wall epwWall = walls[7] = new Wall(wl, "East wall in the east perimeter zone");
            epwWall.SurfaceArea = 3 * 3;
            outdoorSurfaces.Add(epwWall.GetSurface(true));
            epZone.AddSurface(epwWall.GetSurface(false));
            epwWall.SetIncline(eIn, true);

            Wall epcWall = walls[8] = new Wall(wl, "Ceiling in the east perimeter zone");
            epcWall.SurfaceArea = 3 * 5;
            outdoorSurfaces.Add(epcWall.GetSurface(true));
            epZone.AddSurface(epcWall.GetSurface(false));
            epcWall.SetIncline(hIn, true);

            Wall epfWall = walls[9] = new Wall(wl, "Floor in the east perimeter zone");
            epfWall.SurfaceArea = 3 * 5;
            outdoor.AddGroundWallSurface(epfWall.GetSurface(true));
            epZone.AddSurface(epfWall.GetSurface(false));

            Wall einWall = walls[10] = new Wall(wl, "North wall in the east interior zone");
            einWall.SurfaceArea = 5 * 3;
            outdoorSurfaces.Add(einWall.GetSurface(true));
            eiZone.AddSurface(einWall.GetSurface(false));
            einWall.SetIncline(nIn, true);

            Wall eiwWall = walls[11] = new Wall(wl, "East wall in the east interior zone");
            eiwWall.SurfaceArea = 4 * 3;
            outdoorSurfaces.Add(eiwWall.GetSurface(true));
            eiZone.AddSurface(eiwWall.GetSurface(false));
            eiwWall.SetIncline(eIn, true);

            Wall eicWall = walls[12] = new Wall(wl, "Ceiling in the east interior zone");
            eicWall.SurfaceArea = 4 * 5;
            outdoorSurfaces.Add(eicWall.GetSurface(true));
            eiZone.AddSurface(eicWall.GetSurface(false));
            eicWall.SetIncline(hIn, true);

            Wall eifWall = walls[13] = new Wall(wl, "Floor in the east interior zone");
            eifWall.SurfaceArea = 4 * 5;
            outdoor.AddGroundWallSurface(eifWall.GetSurface(true));
            eiZone.AddSurface(eifWall.GetSurface(false));

            Wall cpWall = walls[14] = new Wall(wl, "Inner wall at perimeter");
            cpWall.SurfaceArea = 3 * 3;
            wpZone.AddSurface(cpWall.GetSurface(true));
            epZone.AddSurface(cpWall.GetSurface(false));

            Wall ciWall = walls[15] = new Wall(wl, "Inner wall at interior");
            ciWall.SurfaceArea = 4 * 3;
            wiZone.AddSurface(ciWall.GetSurface(true));
            eiZone.AddSurface(ciWall.GetSurface(false));

            Wall wpsWall = walls[16] = new Wall(wl, "South wall in the west perimeter zone");
            wpsWall.SurfaceArea = 5 * 3 - 3 * 2;    //Reduce window surface area
            outdoorSurfaces.Add(wpsWall.GetSurface(true));
            wpZone.AddSurface(wpsWall.GetSurface(false));
            wpsWall.SetIncline(sIn, true);

            Wall epsWall = walls[17] = new Wall(wl, "South wall in the east perimeter zone");
            epsWall.SurfaceArea = 5 * 3 - 3 * 2;    //Reduce window surface area
            outdoorSurfaces.Add(epsWall.GetSurface(true));
            epZone.AddSurface(epsWall.GetSurface(false));
            epsWall.SetIncline(sIn, true);

            //Initialize outdoor surfaces
            foreach (WallSurface ws in outdoorSurfaces)
            {
                //Add wall surfaces to Outdoor object
                outdoor.AddWallSurface(ws);
                //Initialize emissivity of surface
                ws.InitializeEmissivity(WallSurface.SurfaceMaterial.Concrete);
            }

            //Add windows to the west zone
            Window wWind = new Window(gPanes, "Window in the west perimeter zone");
            wWind.SurfaceArea = 3 * 2;
            wpZone.AddWindow(wWind);
            outdoor.AddWindow(wWind);
            //Add windows to the east zone
            Window eWind = new Window(gPanes, "Window in the east perimeter zone");
            eWind.SurfaceArea = 3 * 2;
            //Set horizontal sun shade.
            eWind.Shade = SunShade.MakeHorizontalSunShade(3, 2, 1, 1, 1, 0.5, sIn);
            wpZone.AddWindow(eWind);
            outdoor.AddWindow(eWind);

            //Creat an insances of the Room class and MultiRoom class
            Room eRm = new Room(new Zone[] { epZone, eiZone }); //East room
            Room wRm = new Room(new Zone[] { wpZone, wiZone }); //Weast room
            MultiRoom mRoom = new MultiRoom(new Room[] { eRm, wRm }); //Multi room (east and west rooms)
            mRoom.SetTimeStep(3600);

            //Set ventilation volume
            wpZone.VentilationVolume = 10; //Only west perimeter zone has outdoor air ventilation
            mRoom.SetAirFlow(wpZone, wiZone, 10);
            mRoom.SetAirFlow(epZone, eiZone, 10);
            mRoom.SetAirFlow(eiZone, epZone, 10);

            //Set short wave radiation distribution:60% of short wave is distributed to perimeter floor.
            double sfSum = 0;
            foreach (ISurface isf in eRm.GetSurface()) sfSum += isf.Area;
            sfSum -= epfWall.SurfaceArea;
            foreach (ISurface isf in eRm.GetSurface()) eRm.SetShortWaveRadiationRate(isf, isf.Area / sfSum * 0.4);
            eRm.SetShortWaveRadiationRate(epfWall.GetSurface(false), 0.6);
            sfSum = 0;
            foreach (ISurface isf in wRm.GetSurface()) sfSum += isf.Area;
            sfSum -= wpfWall.SurfaceArea;
            foreach (ISurface isf in wRm.GetSurface()) wRm.SetShortWaveRadiationRate(isf, isf.Area / sfSum * 0.4);
            wRm.SetShortWaveRadiationRate(wpfWall.GetSurface(false), 0.6);

            //Output title wrine to standard output stream
            StreamWriter sWriter = new StreamWriter("AirStateAndHeatLoadTest2.csv");
            foreach (Zone zn in zones) sWriter.Write(zn.Name + "Drybulb temperature[C], " + zn.Name +
                                      "Humidity ratio[kg/kgDA], " + zn.Name + "Sensible heat load[W], " + zn.Name + "Latent heat load[W], ");
            sWriter.WriteLine();

            //Update the state (Iterate 100 times to make state steady)
            for (int i = 0; i < 100; i++)
            {
                DateTime dTime = new DateTime(2007, 8, 3, 0, 0, 0);
                for (int j = 0; j < 24; j++)
                {
                    //Set date and time to Sun and Zone object.
                    sun.Update(dTime);
                    mRoom.SetCurrentDateTime(dTime);

                    //Operate HVAC system (8:00~19:00)
                    bool operating = (8 <= dTime.Hour && dTime.Hour <= 19);
                    foreach (Zone zn in zones)
                    {
                        zn.ControlHumidityRatio = operating;
                        zn.ControlDrybulbTemperature = operating;
                    }

                    //Set weather state.
                    outdoor.AirState = new MoistAir(dbt[j], hum[j]);
                    outdoor.NocturnalRadiation = nrd[j];
                    sun.SetGlobalHorizontalRadiation(drd[j], dnr[j]);

                    //Set ventilation air state.
                    wpZone.VentilationAirState = outdoor.AirState;

                    //Update boundary state of outdoor facing surfaces.
                    outdoor.SetWallSurfaceBoundaryState();

                    //Update the walls.
                    foreach (Wall wal in walls) wal.Update();

                    //Update the MultiRoom object.
                    mRoom.UpdateRoomTemperatures();
                    mRoom.UpdateRoomHumidities();

                    //Update date and time
                    dTime = dTime.AddHours(1);

                    //If it is last iteration, output result to CSV text.
                    if (i == 99)
                    {
                        foreach (Zone zn in zones)
                        {
                            sWriter.Write(zn.CurrentDrybulbTemperature.ToString("F1") + ", " + zn.CurrentHumidityRatio.ToString("F3") + ", " +
                            zn.CurrentSensibleHeatLoad.ToString("F0") + ", " + zn.CurrentLatentHeatLoad.ToString("F0") + ", ");
                        }
                        sWriter.WriteLine();
                    }
                }
            }

            sWriter.Close();
        }