Example #1
0
 def test_s_functions(self):
     """Tests to verify all functions with the Parameters s of Region 4"""
     s = [1.0, 2.0, 3.0, 3.8, 4.0, 4.2, 7.0, 8.0, 9.0, 5.5, 5.0, 4.5]
     IF97 = [
         308.5509647,
         700.6304472,
         1198.359754,
         1685.025565,
         1816.891476,
         1949.352563,
         2723.729985,
         2599.04721,
         2511.861477,
         2687.69385,
         2451.623609,
         2144.360448,
     ]
     R4 = numpy.zeros(12)
     for i in range(0, 12):
         R4[i] = Region4.h4_s(s[i])
     h4_s_error = numpy.sum(numpy.absolute((R4 - IF97) / IF97))
     self.assertLess(
         h4_s_error,
         self.maxError,
         "Test of h(s) Function for Region 4 failed. Error was %(error)e allowed:"
         " %(max)e" % {
             "error": h4_s_error,
             "max": self.maxError
         },
     )
Example #2
0
 def test_s_functions(self):
     """ Tests to verify all functions with the Parameters s of Region 4"""
     s = [1.0, 2.0, 3.0, 3.8, 4.0, 4.2, 7.0, 8.0, 9.0, 5.5, 5.0, 4.5]
     IF97 = [308.5509647, 700.6304472, 1198.359754, 1685.025565, 1816.891476, 1949.352563, 2723.729985, 2599.04721, 2511.861477, 2687.69385, 2451.623609, 2144.360448]
     R4 = numpy.zeros(12)
     for i in range(0, 12):
         R4[i] = Region4.h4_s(s[i])
     h4_s_error = numpy.sum(numpy.absolute((R4 - IF97) / IF97))
     self.assertLess(h4_s_error, self.maxError, 'Test of h(s) Function for Region 4 failed. Error was %(error)e allowed: %(max)e' % {'error': h4_s_error, 'max': self.maxError})
Example #3
0
 def test_T_function(self):
     """ Tests to verify all functions with the Parameter T of Region 4 by comparing the Results to IF-97 Page 34 Table 35"""
     # %Saturation pressure, If97, Table 35, Page 34
     T = [300.0, 500.0, 600.0]
     IF97 = [0.00353658941, 2.63889776, 12.3443146]
     R4 = numpy.zeros(3)
     for i in range(0, 3):
         R4[i] = Region4.p4_T(T[i])
     p4_t_error = numpy.sum(numpy.absolute((R4 - IF97) / IF97))
     self.assertLess(p4_t_error, self.maxError, 'Test of p(T) Function for Region 4 failed. Error was %(error)e allowed: %(max)e' % {'error': p4_t_error, 'max': self.maxError})
Example #4
0
 def test_p_functions(self):
     """ Tests to verify all functions with the Parameters p of Region 4"""
     p = [0.1, 1.0, 10.0]
     IF97 = [372.755919, 453.035632, 584.149488]
     R4 = numpy.zeros(3)
     for i in range(0, 3):
         R4[i] = Region4.T4_p(p[i])
     T4_p_error = numpy.sum(numpy.absolute((R4 - IF97) / IF97))
     self.assertLess(
         T4_p_error, self.maxError,
         'Test of T(p) Function for Region 4 failed. Error was %(error)e allowed: %(max)e'
         % {
             'error': T4_p_error,
             'max': self.maxError
         })
Example #5
0
 def test_T_function(self):
     """ Tests to verify all functions with the Parameter T of Region 4 by comparing the Results to IF-97 Page 34 Table 35"""
     # %Saturation pressure, If97, Table 35, Page 34
     T = [300.0, 500.0, 600.0]
     IF97 = [0.00353658941, 2.63889776, 12.3443146]
     R4 = numpy.zeros(3)
     for i in range(0, 3):
         R4[i] = Region4.p4_T(T[i])
     p4_t_error = numpy.sum(numpy.absolute((R4 - IF97) / IF97))
     self.assertLess(
         p4_t_error, self.maxError,
         'Test of p(T) Function for Region 4 failed. Error was %(error)e allowed: %(max)e'
         % {
             'error': p4_t_error,
             'max': self.maxError
         })