示例#1
0
    def test_second_order_multipole(self):
        """ Tests the value of the internal resistances and conductances.
        """
        from pygfunction.pipes import thermal_resistances

        # Reference solution (Claesson and Hellstrom, 2011)
        R_ref = np.array([[25.590e-2, 01.561e-2],
                          [01.561e-2, 25.309e-2]])
        S_ref = np.array([[3.681, 0.242],
                          [0.242, 3.724]])
        # Calculate using pipes.fluid_friction_factor_circular_pipe()
        R, Rd = thermal_resistances(self.pos_2pipes, self.r_out, self.r_b,
                                    self.k_s, self.k_g, self.Rfp, J=2)
        S = 1/Rd
        self.assertTrue(np.allclose(R, R_ref, rtol=1e-8, atol=1e-5),
                        msg='Incorrect value of the internal thermal '
                            'resistances.')
        self.assertTrue(np.allclose(S, S_ref, rtol=1e-8, atol=1e-3),
                        msg='Incorrect value of the delta-circuit thermal '
                            'resistances.')
示例#2
0
    def test_line_source_approximation(self):
        """ Tests the value of the internal resistances and conductances.
        """
        from pygfunction.pipes import thermal_resistances

        # Reference solution (Claesson and Hellstrom, 2011)
        R_ref = np.array([[25.486e-2, 01.538e-2],
                          [01.538e-2, 25.207e-2]])
        S_ref = np.array([[3.698, 0.240],
                          [0.240, 3.742]])
        # Calculate using pipes.fluid_friction_factor_circular_pipe()
        R, Rd = thermal_resistances(self.pos_2pipes, self.r_out, self.r_b,
                                    self.k_s, self.k_g, self.Rfp, J=0)
        S = 1/Rd
        self.assertTrue(np.allclose(R, R_ref, rtol=1e-8, atol=1e-5),
                        msg='Incorrect value of the internal thermal '
                            'resistances.')
        self.assertTrue(np.allclose(S, S_ref, rtol=1e-8, atol=1e-3),
                        msg='Incorrect value of the delta-circuit thermal '
                            'resistances.')