def test_one_borehole_one_segment(self, rel_tol=1.0e-4): """ Tests the value of the g-function of one borehole. """ from pygfunction.gfunction import uniform_temperature from pygfunction.boreholes import rectangle_field # Results of Cimmino and Bernier (2014) time = np.array([1070, 33554478]) * 3600. g_ref = np.array([3.65502692098609, 6.68675948788828]) # Calculation of the g-function at the same time values N_1 = 1 N_2 = 1 boreField = rectangle_field(N_1, N_2, self.B, self.B, self.H, self.D, self.r_b) g = uniform_temperature(boreField, time, self.alpha, nSegments=1) self.assertTrue(np.allclose(g, g_ref, rtol=rel_tol, atol=1e-10), msg='Incorrect values of the g-function of one ' 'borehole for uniform temperature (1 segment).')
def test_three_by_two_one_segment(self, rel_tol=1.0e-4): """ Tests the value of the g-function of a 3 by 2 bore field. """ from pygfunction.gfunction import uniform_temperature from pygfunction.boreholes import rectangle_field # Results of Cimmino and Bernier (2014) time = np.array([1070, 33554478]) * 3600. g_ref = np.array([3.6617432932388, 15.9710298219412]) # Calculation of the g-function at the same time values N_1 = 3 N_2 = 2 boreField = rectangle_field(N_1, N_2, self.B, self.B, self.H, self.D, self.r_b) g = uniform_temperature(boreField, time, self.alpha, nSegments=1) self.assertTrue(np.allclose(g, g_ref, rtol=rel_tol, atol=1e-10), msg='Incorrect values of the g-function of three by ' 'two field for uniform temperature (1 segment).')
def test_three_by_two_twelve_segments(self, rel_tol=1.0e-4): """ Tests the value of the g-function of a 3 by 2 bore field. """ from pygfunction.gfunction import uniform_temperature from pygfunction.boreholes import rectangle_field # Results of Cimmino and Bernier (2014) time = 33554478 * 3600. g_ref = 15.1697321426028 # Calculation of the g-function at the same time values N_1 = 3 N_2 = 2 boreField = rectangle_field(N_1, N_2, self.B, self.B, self.H, self.D, self.r_b) g = uniform_temperature(boreField, time, self.alpha, nSegments=12) self.assertTrue(np.allclose(g, g_ref, rtol=rel_tol, atol=1e-10), msg='Incorrect values of the g-function of three by ' 'two field for uniform temperature (12 segments).')