Пример #1
0
def test__nondim_resist_spitzer(Z):
    """test _nondim_resist_spitzer function"""
    alpha = _nondim_resist_spitzer(Z, 'par')
    if Z == 1:
        alpha_check = 0.5064
        rtol = 1e-3
    elif Z == 2 or Z == 4 or Z == np.inf:
        alpha_check = _nondim_resist_braginskii(0, Z, 'par')
        rtol = 2e-2
    elif Z == 16:
        alpha_check = _nondim_resist_ji_held(0, Z, 'par')
        rtol = 2e-2
    assert np.isclose(alpha, alpha_check, rtol=rtol)
Пример #2
0
 def test_unmagnetized(self, Z):
     """confirm perp -> par as B -> 0"""
     alpha_hat_par = _nondim_resist_braginskii(self.small_hall, Z, 'par')
     alpha_hat_perp = _nondim_resist_braginskii(self.small_hall, Z, 'perp')
     assert np.isclose(alpha_hat_par, alpha_hat_perp, rtol=1e-3)
Пример #3
0
 def test_cross_vs_ji_held(self, Z):
     """cross should roughly agree with ji-held at hall 0.1"""
     alpha_hat_cross_brag = _nondim_resist_braginskii(0.1, Z, 'cross')
     alpha_hat_cross_jh = _nondim_resist_ji_held(0.1, Z, 'cross')
     assert np.isclose(alpha_hat_cross_brag, alpha_hat_cross_jh, rtol=5e-2)
Пример #4
0
 def test_known_values_par(self, Z, field_orientation, expected):
     """check some known values"""
     beta_hat = _nondim_resist_braginskii(self.big_hall, Z,
                                          field_orientation)
     assert np.isclose(beta_hat, expected, atol=1e-2)