def test_two_unequal_boreholes_four_segments(self, rel_tol=1.0e-6): """ Tests the value of the thermal response factor matrix for two boreholes of unequal lengths with and without similarities. """ from pygfunction.heat_transfer import thermal_response_factors from pygfunction.gfunction import _borehole_segments from pygfunction.boreholes import Borehole borehole1 = Borehole(self.H, self.D, self.r_b, 0., 0.) borehole2 = Borehole(self.H * 1.432, self.D, self.r_b, self.B, 0.) boreField = [borehole1, borehole2] boreSegments = _borehole_segments(boreField, nSegments=4) time = np.array([33554478]) * 3600. # Calculation of thermal response factor matrix using similarities h = thermal_response_factors(boreSegments, time, self.alpha, use_similarities=True) # Calculation of thermal response factor matrix without similarities h_none = thermal_response_factors(boreSegments, time, self.alpha, use_similarities=False) self.assertTrue(np.allclose(h, h_none, rtol=rel_tol, atol=1e-10), msg='Incorrect values of the thermal response factors ' 'two unequal boreholes (4 segments).')
def test_three_by_two_four_segments(self, rel_tol=1.0e-6): """ Tests the value of the thermal response factor matrix for three by two field with and without similarities. """ from pygfunction.heat_transfer import thermal_response_factors from pygfunction.gfunction import _borehole_segments from pygfunction.boreholes import rectangle_field N_1 = 3 N_2 = 2 boreField = rectangle_field(N_1, N_2, self.B, self.B, self.H, self.D, self.r_b) boreSegments = _borehole_segments(boreField, nSegments=4) time = np.array([33554478]) * 3600. # Calculation of thermal response factor matrix using similarities h = thermal_response_factors(boreSegments, time, self.alpha, use_similarities=True) # Calculation of thermal response factor matrix without similarities h_none = thermal_response_factors(boreSegments, time, self.alpha, use_similarities=False) self.assertTrue(np.allclose(h, h_none, rtol=rel_tol, atol=1e-10), msg='Incorrect values of the thermal response factors ' 'for three by two field (4 segments).')