def test_finite_line_source_image_part(self, rel_tol=1.0e-6):
     """ Tests the value of the image part of the FLS solution.
     """
     from pygfunction.boreholes import Borehole
     from pygfunction.heat_transfer import finite_line_source
     # Evaluate the double integral
     reference = dblquad(
         fls_double,
         self.D1,
         self.D1 + self.H1,
         lambda x: self.D2,
         lambda x: self.D2 + self.H2,
         args=(self.t, self.dis, self.alpha, False, True))[0] / self.H2
     # Evaluate using heat_transfer.finite_line_source
     borehole1 = Borehole(self.H1, self.D1, 0.05, 0., 0.)
     borehole2 = Borehole(self.H2, self.D2, 0.05, self.dis, 0.)
     calculated = finite_line_source(self.t,
                                     self.alpha,
                                     borehole1,
                                     borehole2,
                                     reaSource=False,
                                     imgSource=True)
     self.assertAlmostEqual(calculated,
                            reference,
                            delta=np.abs(rel_tol * reference),
                            msg='Incorrect value of the image part of the '
                            'finite line source solution.')
示例#2
0
 def test_finite_line_source_no_part(self, rel_tol=1.0e-6):
     """ Tests the value of the FLS solution when considering no source.
     """
     from pygfunction.boreholes import Borehole
     from pygfunction.heat_transfer import finite_line_source
     # Evaluate using heat_transfer.finite_line_source
     borehole1 = Borehole(self.H1, self.D1, 0.05, 0., 0.)
     borehole2 = Borehole(self.H2, self.D2, 0.05, self.dis, 0.)
     calculated = finite_line_source(self.t, self.alpha,
                                     borehole1, borehole2,
                                     reaSource=False, imgSource=False)
     self.assertEqual(calculated, 0.,
                            msg='Incorrect value of no part of the '
                                'finite line source solution.')