コード例 #1
0
ファイル: Program.cs プロジェクト: windripple/popolo
        /// <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();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: windripple/popolo
        /// <summary>壁熱貫流テスト(潜熱蓄熱材)</summary>
        private static void wallHeatTransferTest3()
        {
            //初期温度
            const double INIT_TEMP = 35;

            //壁層を作成
            WallLayers wl = new WallLayers();
            wl.AddLayer(new WallLayers.Layer(new WallMaterial(WallMaterial.PredefinedMaterials.FrexibleBoard), 0.0165));
            wl.AddLayer(new WallLayers.Layer(new WallMaterial("ダミー材料", 1, 1), 0.02));
            wl.AddLayer(new WallLayers.Layer(new WallMaterial("ダミー材料", 1, 1), 0.02));
            wl.AddLayer(new WallLayers.Layer(new WallMaterial(WallMaterial.PredefinedMaterials.ExtrudedPolystyreneFoam_3), 0.02));
            wl.AddLayer(new WallLayers.Layer(new WallMaterial(WallMaterial.PredefinedMaterials.Plywood), 0.009));
            wl.AddLayer(new WallLayers.Layer(new WallMaterial(WallMaterial.PredefinedMaterials.AirGap), 0.015));
            wl.AddLayer(new WallLayers.Layer(new WallMaterial(WallMaterial.PredefinedMaterials.Plywood), 0.009));

            //壁体を作成
            Wall wall = new Wall(wl);
            wall.TimeStep = 1200;
            wall.AirTemperature1 = 20;
            wall.AirTemperature2 = 20;
            wall.SurfaceArea = 6.48;

            //潜熱蓄熱材1を作成して設定
            LatentHeatStorageMaterial material1;
            material1 = new LatentHeatStorageMaterial(19, new WallMaterial("パッシブ・スミターマル(凝固)", 0.19, 3.6 * 1400));
            material1.AddMaterial(23, new WallMaterial("パッシブ・スミターマル(遷移)", (0.19 + 0.22) / 2d, 15.1 * 1400));
            material1.AddMaterial(100, new WallMaterial("パッシブ・スミターマル(融解)", 0.22, 3.6 * 1400));
            material1.Initialize(INIT_TEMP);
            wall.SetLatentHeatStorageMaterial(1, material1);

            //潜熱蓄熱材2を作成して設定
            LatentHeatStorageMaterial material2;
            material2 = new LatentHeatStorageMaterial(30, new WallMaterial("スミターマル(凝固)", 0.19, 3.6 * 1390));
            material2.AddMaterial(32, new WallMaterial("スミターマル(遷移)", (0.19 + 0.22) / 2d, 63.25 * 1400));
            material2.AddMaterial(100, new WallMaterial("スミターマル(融解)", 0.22, 3.5 * 1410));
            material2.Initialize(INIT_TEMP);
            wall.SetLatentHeatStorageMaterial(2, material2);

            //潜熱蓄熱材の間に配管を埋設
            Tube tube = new Tube(0.84, 0.346, 4186);
            wall.AddTube(tube, 1);
            tube.SetFlowRate(0);
            tube.FluidTemperature = 40;

            //壁体温度を初期化
            wall.InitializeTemperature(INIT_TEMP);

            for (int i = 0; i < wall.Layers.LayerNumber; i++) Console.Write("温度" + i + ", ");
            Console.WriteLine("蓄熱量[kJ]");
            for (int i = 0; i < 200; i++)
            {
                if (i == 100)
                {
                    tube.SetFlowRate(0.54);    //通水開始
                    wall.AirTemperature1 = 30;
                    wall.AirTemperature2 = 30;
                }
                wall.Update();
                double[] tmp = wall.GetTemperatures();
                for (int j = 0; j < tmp.Length - 1; j++) Console.Write(((tmp[j] + tmp[j + 1]) / 2d).ToString("F1") + ", ");
                Console.Write(wall.GetHeatStorage(INIT_TEMP).ToString("F0"));
                Console.WriteLine();
            }
            Console.Read();
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: windripple/popolo
        /// <summary>壁熱貫流テスト(冷温水配管埋設)</summary>
        private static void wallHeatTransferTest2()
        {
            WallLayers wl = new WallLayers();
            wl.AddLayer(new WallLayers.Layer(new WallMaterial(WallMaterial.PredefinedMaterials.FrexibleBoard), 0.0165));
            wl.AddLayer(new WallLayers.Layer(new WallMaterial("水", 0.59, 4186), 0.02));
            wl.AddLayer(new WallLayers.Layer(new WallMaterial("水", 0.59, 4186), 0.02));
            wl.AddLayer(new WallLayers.Layer(new WallMaterial(WallMaterial.PredefinedMaterials.ExtrudedPolystyreneFoam_3), 0.02));
            wl.AddLayer(new WallLayers.Layer(new WallMaterial(WallMaterial.PredefinedMaterials.Plywood), 0.009));
            wl.AddLayer(new WallLayers.Layer(new WallMaterial(WallMaterial.PredefinedMaterials.AirGap), 0.015));
            wl.AddLayer(new WallLayers.Layer(new WallMaterial(WallMaterial.PredefinedMaterials.Plywood), 0.009));
            Wall wall = new Wall(wl);
            wall.TimeStep = 300;
            wall.AirTemperature1 = 20;
            wall.AirTemperature2 = 10;
            wall.SurfaceArea = 6.48;

            //配管を埋設
            Tube tube = new Tube(0.84, 0.346, 4186);
            wall.AddTube(tube, 1);
            tube.SetFlowRate(0);    //最初は流量0
            tube.FluidTemperature = 30;

            wall.InitializeTemperature(20); //壁体温度を初期化

            for (int i = 0; i < wall.Layers.LayerNumber; i++) Console.Write("温度" + i + ", ");
            Console.WriteLine("配管への熱移動量[W], 配管出口温度[C]");
            for (int i = 0; i < 100; i++)
            {
                if (i == 50) tube.SetFlowRate(0.54);    //通水開始
                wall.Update();
                double[] tmp = wall.GetTemperatures();
                for (int j = 0; j < tmp.Length - 1; j++) Console.Write(((tmp[j] + tmp[j + 1]) / 2d).ToString("F1") + ", ");
                Console.Write(wall.GetHeatTransferToTube(1).ToString("F0") + ", " + tube.GetOutletFluidTemperature().ToString("F1"));
                Console.WriteLine();
            }
            Console.Read();
        }
コード例 #4
0
ファイル: Wall.cs プロジェクト: windripple/popolo
 /// <summary>壁層に配管を埋め込む</summary>
 /// <param name="tube">配管</param>
 /// <param name="index">壁層番号(壁体の分割数を加算した番号)</param>
 public void AddTube(Tube tube, uint index)
 {
     if (tubes.ContainsKey(index))
     {
         tubes[index].FlowRateChangeEvent -= flowRateChangeEvent;
     }
     tubes[index] = tube;
     hasTubeFlowRateChanged = true;
     tubes[index].FlowRateChangeEvent += flowRateChangeEvent;
 }
コード例 #5
0
ファイル: Program.cs プロジェクト: windripple/popolo
        /// <summary>Sample program calculating the unsteady heat conduction of wall with latent heat storage material</summary>
        private static void wallTest3()
        {
            //Initial temperature
            const double INIT_TEMP = 35;

            //Create an instance of WallLayers class
            WallLayers wl = new WallLayers();
            wl.AddLayer(new WallLayers.Layer(new WallMaterial(WallMaterial.PredefinedMaterials.FrexibleBoard), 0.0165));
            wl.AddLayer(new WallLayers.Layer(new WallMaterial("dummy", 1, 1), 0.02));
            wl.AddLayer(new WallLayers.Layer(new WallMaterial("dummy", 1, 1), 0.02));
            wl.AddLayer(new WallLayers.Layer(new WallMaterial(WallMaterial.PredefinedMaterials.ExtrudedPolystyreneFoam_3), 0.02));
            wl.AddLayer(new WallLayers.Layer(new WallMaterial(WallMaterial.PredefinedMaterials.Plywood), 0.009));
            wl.AddLayer(new WallLayers.Layer(new WallMaterial(WallMaterial.PredefinedMaterials.AirGap), 0.015));
            wl.AddLayer(new WallLayers.Layer(new WallMaterial(WallMaterial.PredefinedMaterials.Plywood), 0.009));

            //Create an instance of Wall class
            Wall wall = new Wall(wl);
            wall.TimeStep = 1200;
            wall.AirTemperature1 = 20;
            wall.AirTemperature2 = 20;
            wall.SurfaceArea = 6.48;

            //Create an instance of LatentHeatStorageMaterial class
            LatentHeatStorageMaterial pmc1;
            pmc1 = new LatentHeatStorageMaterial(19, new WallMaterial("PCM1 (Solid)", 0.19, 3.6 * 1400));
            pmc1.AddMaterial(23, new WallMaterial("PCM1 (Two phase)", (0.19 + 0.22) / 2d, 15.1 * 1400));
            pmc1.AddMaterial(100, new WallMaterial("PCM1 (Liquid)", 0.22, 3.6 * 1400));
            pmc1.Initialize(INIT_TEMP);
            //Set PCM to second wall layer
            wall.SetLatentHeatStorageMaterial(1, pmc1);

            //Create an instance of LatentHeatStorageMaterial class
            LatentHeatStorageMaterial pcm2;
            pcm2 = new LatentHeatStorageMaterial(30, new WallMaterial("PCM2 (Solid)", 0.19, 3.6 * 1390));
            pcm2.AddMaterial(32, new WallMaterial("PCM2 (Two phase)", (0.19 + 0.22) / 2d, 63.25 * 1400));
            pcm2.AddMaterial(100, new WallMaterial("PCM2 (Liquid)", 0.22, 3.5 * 1410));
            pcm2.Initialize(INIT_TEMP);
            //Set PCM to third wall layer
            wall.SetLatentHeatStorageMaterial(2, pcm2);

            //Install heating tube between PMCs
            Tube tube = new Tube(0.84, 0.346, 4186);
            wall.AddTube(tube, 1);
            tube.SetFlowRate(0);
            tube.FluidTemperature = 40;

            //Initialize wall temperature
            wall.InitializeTemperature(INIT_TEMP);

            for (int i = 0; i < wall.Layers.LayerNumber; i++) Console.Write("Temperature" + i + ", ");
            Console.WriteLine("Heat storage[kJ]");
            for (int i = 0; i < 200; i++)
            {
                if (i == 100)
                {
                    tube.SetFlowRate(0.54); //Start heating
                    wall.AirTemperature1 = 30;
                    wall.AirTemperature2 = 30;
                }
                wall.Update();
                double[] tmp = wall.GetTemperatures();
                for (int j = 0; j < tmp.Length - 1; j++) Console.Write(((tmp[j] + tmp[j + 1]) / 2d).ToString("F1") + ", ");
                Console.Write(wall.GetHeatStorage(INIT_TEMP).ToString("F0"));
                Console.WriteLine();
            }
            Console.Read();
        }
コード例 #6
0
ファイル: Program.cs プロジェクト: windripple/popolo
        /// <summary>Sample program calculating the unsteady heat conduction of wall with heating tube</summary>
        private static void wallTest2()
        {
            WallLayers wl = new WallLayers();
            wl.AddLayer(new WallLayers.Layer(new WallMaterial(WallMaterial.PredefinedMaterials.FrexibleBoard), 0.0165));
            wl.AddLayer(new WallLayers.Layer(new WallMaterial("Water", 0.59, 4186), 0.02));
            wl.AddLayer(new WallLayers.Layer(new WallMaterial("Water", 0.59, 4186), 0.02));
            wl.AddLayer(new WallLayers.Layer(new WallMaterial(WallMaterial.PredefinedMaterials.ExtrudedPolystyreneFoam_3), 0.02));
            wl.AddLayer(new WallLayers.Layer(new WallMaterial(WallMaterial.PredefinedMaterials.Plywood), 0.009));
            wl.AddLayer(new WallLayers.Layer(new WallMaterial(WallMaterial.PredefinedMaterials.AirGap), 0.015));
            wl.AddLayer(new WallLayers.Layer(new WallMaterial(WallMaterial.PredefinedMaterials.Plywood), 0.009));
            Wall wall = new Wall(wl);
            wall.TimeStep = 300;
            wall.AirTemperature1 = 20;
            wall.AirTemperature2 = 10;
            wall.SurfaceArea = 6.48;

            Tube tube = new Tube(0.84, 0.346, 4186);
            //installing tube to wall
            wall.AddTube(tube, 1);
            tube.SetFlowRate(0);  //initial flow rate is 0 kg/s
            tube.FluidTemperature = 30;

            wall.InitializeTemperature(20); //initialize temperature of the wall

            for (int i = 0; i < wall.Layers.LayerNumber; i++) Console.Write("temperature" + i + ", ");
            Console.WriteLine("heat transfer to the tube[W], outlet temperature of fluid[C]");
            for (int i = 0; i < 100; i++)
            {
                if (i == 50) tube.SetFlowRate(0.54);  //start heating
                wall.Update();
                double[] tmp = wall.GetTemperatures();
                for (int j = 0; j < tmp.Length - 1; j++) Console.Write(((tmp[j] + tmp[j + 1]) / 2d).ToString("F1") + ", ");
                Console.Write(wall.GetHeatTransferToTube(1).ToString("F0") + ", " + tube.GetOutletFluidTemperature().ToString("F1"));
                Console.WriteLine();
            }
            Console.Read();
        }