Example #1
0
        /// <summary>回路網テスト2</summary>
        /// <remarks>水回路の水量計算</remarks>
        private static void circuitTest2()
        {
            //設備基礎理論pp.337より***********************************************
            //      ------A------
            //      |           |
            //  ->--1--B--2--C--3-->-
            //            |     |
            //            ---D--
            Circuit circuit = new Circuit("水回路の水量計算");

            //節点追加
            ImmutableNode node1 = circuit.AddNode(new Node("1", 0, 0));
            ImmutableNode node2 = circuit.AddNode(new Node("2", 0, 0));
            ImmutableNode node3 = circuit.AddNode(new Node("3", 0, 0));

            //流路作成
            Channel chA = new Channel("A", 167, 2);
            Channel chB = new Channel("B", 192, 2);
            Channel chC = new Channel("C", 840, 2);
            Channel chD = new Channel("D", 4950, 2);
            //外部の系への流出流量
            circuit.SetExternalFlow(-7.06, node1);
            circuit.SetExternalFlow(7.06, node3);

            //接続処理
            ImmutableChannel channelA = circuit.ConnectNodes(node1, node3, chA);
            ImmutableChannel channelB = circuit.ConnectNodes(node1, node2, chB);
            ImmutableChannel channelC = circuit.ConnectNodes(node2, node3, chC);
            ImmutableChannel channelD = circuit.ConnectNodes(node2, node3, chD);

            //ソルバを用意
            CircuitSolver cSolver = new CircuitSolver(circuit);
            cSolver.Solve();
            Console.WriteLine("流路A流量:" + channelA.GetFlow());
            Console.WriteLine("流路B流量:" + channelB.GetFlow());
            Console.WriteLine("流路C流量:" + channelC.GetFlow());
            Console.WriteLine("流路D流量:" + channelD.GetFlow());
            Console.Read();
        }
Example #2
0
        /// <summary>回路網テスト3</summary>
        /// <remarks>壁体の熱流計算</remarks>
        private static void circuitTest3()
        {
            Circuit circuit = new Circuit("壁体の熱流計算");

            //節点追加
            ImmutableNode[] nodes = new ImmutableNode[6];
            nodes[0] = circuit.AddNode(new Node("室1", 0));
            nodes[1] = circuit.AddNode(new Node("合板", 17.9));
            nodes[2] = circuit.AddNode(new Node("コンクリート", 232));
            nodes[3] = circuit.AddNode(new Node("空気層", 0));
            nodes[4] = circuit.AddNode(new Node("ロックウール", 4.2));
            nodes[5] = circuit.AddNode(new Node("室2", 0));

            //空気温度を境界条件とする
            circuit.SetBoundaryNode(true, nodes[0]);
            circuit.SetBoundaryNode(true, nodes[5]);
            //空気温度設定
            circuit.SetPotential(20, nodes[0]);
            circuit.SetPotential(10, nodes[5]);
            for (int i = 1; i < 5; i++) circuit.SetPotential(10, nodes[i]); //壁体内温度は10℃均一とする

            //接続処理
            ImmutableChannel channel01 = circuit.ConnectNodes(nodes[0], nodes[1], new Channel("室1-合板", 174, 1));
            ImmutableChannel channel12 = circuit.ConnectNodes(nodes[1], nodes[2], new Channel("合板-コンクリート", 109, 1));
            ImmutableChannel channel34 = circuit.ConnectNodes(nodes[2], nodes[3], new Channel("コンクリート-空気層", 86, 1));
            ImmutableChannel channel45 = circuit.ConnectNodes(nodes[3], nodes[4], new Channel("空気層-ロックウール", 638, 1));
            ImmutableChannel channel56 = circuit.ConnectNodes(nodes[4], nodes[5], new Channel("ロックウール-室2", 703, 1));

            CircuitSolver cSolver = new CircuitSolver(circuit);
            cSolver.TimeStep = 3600;

            for (int i = 0; i < nodes.Length; i++) Console.Write(nodes[i].Name + ", ");
            Console.WriteLine();
            for (int i = 0; i < 24; i++)
            {
                cSolver.Solve();
                Console.Write((i + 1) + "H, ");
                for (int j = 0; j < nodes.Length; j++) Console.Write(nodes[j].Potential.ToString("F1") + ", ");
                Console.WriteLine();
            }
            Console.Read();
        }
Example #3
0
        /// <summary>Circuit test 3</summary>
        /// <remarks>Calculating heat transfer through a wall</remarks>
        private static void circuitTest3()
        {
            Circuit circuit = new Circuit("Heat transfer network through wall");

            //Add nodes to circuit network
            ImmutableNode[] nodes = new ImmutableNode[6];
            nodes[0] = circuit.AddNode(new Node("Room 1", 0));
            nodes[1] = circuit.AddNode(new Node("Plywood", 17.9));
            nodes[2] = circuit.AddNode(new Node("Concrete", 232));
            nodes[3] = circuit.AddNode(new Node("Air gap", 0));
            nodes[4] = circuit.AddNode(new Node("Rock wool", 4.2));
            nodes[5] = circuit.AddNode(new Node("Room 2", 0));

            //Set boundary conditions (Room air temperatures).
            circuit.SetBoundaryNode(true, nodes[0]);
            circuit.SetBoundaryNode(true, nodes[5]);
            //Set air temperatures.
            circuit.SetPotential(20, nodes[0]);
            circuit.SetPotential(10, nodes[5]);
            for (int i = 1; i < 5; i++) circuit.SetPotential(10, nodes[i]); //Initialize wall temperatures to 10 C.

            //Connect nodes.
            ImmutableChannel channel01 = circuit.ConnectNodes(nodes[0], nodes[1], new Channel("Room 1-Plywood", 174, 1));
            ImmutableChannel channel12 = circuit.ConnectNodes(nodes[1], nodes[2], new Channel("Plywood-Concrete", 109, 1));
            ImmutableChannel channel34 = circuit.ConnectNodes(nodes[2], nodes[3], new Channel("Concrete-Air gap", 86, 1));
            ImmutableChannel channel45 = circuit.ConnectNodes(nodes[3], nodes[4], new Channel("Air gap-Rock wook", 638, 1));
            ImmutableChannel channel56 = circuit.ConnectNodes(nodes[4], nodes[5], new Channel("Rock wool-Room 2", 703, 1));

            CircuitSolver cSolver = new CircuitSolver(circuit);
            cSolver.TimeStep = 3600;

            for (int i = 0; i < nodes.Length; i++) Console.Write(nodes[i].Name + "  ");
            Console.WriteLine();
            for (int i = 0; i < 24; i++)
            {
                cSolver.Solve();
                Console.Write((i + 1) + "H : ");
                for (int j = 0; j < nodes.Length; j++) Console.Write(nodes[j].Potential.ToString("F1") + "  ");
                Console.WriteLine();
            }
            Console.Read();
        }
Example #4
0
        /// <summary>回路網テスト4</summary>
        /// <remarks>壁体の熱流計算(潜熱変化付き)</remarks>
        private static void circuitTest4()
        {
            Circuit circuit = new Circuit("潜熱蓄熱材を持つ床の熱流計算");

            //節点追加 Initialize("", 0.350, 1600.0, mType);
            ImmutableNode[] nodes = new ImmutableNode[7];
            nodes[0] = circuit.AddNode(new Node("室内", 0));
            nodes[1] = circuit.AddNode(new Node("フレキシブルボード", 1600.0 * 0.0165));
            nodes[2] = circuit.AddNode(new Node("スミターマル20C", 0));
            nodes[3] = circuit.AddNode(new Node("発熱層", 0));
            nodes[4] = circuit.AddNode(new Node("スミターマル30C", 0));
            nodes[5] = circuit.AddNode(new Node("ロックウール", 84.0 * 0.065));
            nodes[6] = circuit.AddNode(new Node("床下", 0));

            //空気温度を境界条件とする
            circuit.SetBoundaryNode(true, nodes[0]);
            circuit.SetBoundaryNode(true, nodes[5]);
            //空気温度設定
            circuit.SetPotential(20, nodes[0]);
            circuit.SetPotential(10, nodes[5]);

            //接続処理
            ImmutableChannel channel01 = circuit.ConnectNodes(nodes[0], nodes[1], new Channel("室1-合板", 173.32, 1));
            ImmutableChannel channel12 = circuit.ConnectNodes(nodes[1], nodes[2], new Channel("合板-コンクリート", 108.65, 1));
            ImmutableChannel channel34 = circuit.ConnectNodes(nodes[2], nodes[3], new Channel("コンクリート-空気層", 128.86, 1));
            ImmutableChannel channel45 = circuit.ConnectNodes(nodes[3], nodes[4], new Channel("空気層-ロックウール", 681.24, 1));
            ImmutableChannel channel56 = circuit.ConnectNodes(nodes[4], nodes[5], new Channel("ロックウール-室2", 702.76, 1));
            ImmutableChannel channel67 = circuit.ConnectNodes(nodes[5], nodes[6], new Channel("ロックウール-室2", 702.76, 1));

            CircuitSolver cSolver = new CircuitSolver(circuit);
            cSolver.TimeStep = 3600;

            for (int i = 0; i < nodes.Length; i++) Console.Write(nodes[i].Name + "   ");
            Console.WriteLine();
            for (int i = 0; i < 24; i++)
            {
                cSolver.Solve();
                Console.Write((i + 1) + "H : ");
                for (int j = 0; j < nodes.Length; j++) Console.Write(nodes[j].Potential.ToString("F1") + "   ");
                Console.WriteLine();
            }
            Console.Read();
        }
Example #5
0
        /// <summary>Circuit test 2</summary>
        /// <remarks>Calculating water pipe network</remarks>
        private static void circuitTest2()
        {
            Circuit circuit = new Circuit("Circuit network of water pipe");

            //Add nodes to circuit network
            ImmutableNode node1 = circuit.AddNode(new Node("1", 0, 0));
            ImmutableNode node2 = circuit.AddNode(new Node("2", 0, 0));
            ImmutableNode node3 = circuit.AddNode(new Node("3", 0, 0));
            //Set external water flow
            circuit.SetExternalFlow(-7.06, node1);
            circuit.SetExternalFlow(7.06, node3);

            //Create channels
            Channel chA = new Channel("A", 167, 2);
            Channel chB = new Channel("B", 192, 2);
            Channel chC = new Channel("C", 840, 2);
            Channel chD = new Channel("D", 4950, 2);

            //Connect nodes with channels
            ImmutableChannel channelA = circuit.ConnectNodes(node1, node3, chA);
            ImmutableChannel channelB = circuit.ConnectNodes(node1, node2, chB);
            ImmutableChannel channelC = circuit.ConnectNodes(node2, node3, chC);
            ImmutableChannel channelD = circuit.ConnectNodes(node2, node3, chD);

            //Create solver
            CircuitSolver cSolver = new CircuitSolver(circuit);
            cSolver.Solve();
            Console.WriteLine("Water flow A is " + channelA.GetFlow().ToString("F2"));
            Console.WriteLine("Water flow B is " + channelB.GetFlow().ToString("F2"));
            Console.WriteLine("Water flow C is " + channelC.GetFlow().ToString("F2"));
            Console.WriteLine("Water flow D is " + channelD.GetFlow().ToString("F2"));
            Console.Read();
        }