Пример #1
0
def test__nondim_tec_spitzer(Z):
    """test _nondim_tec_spitzer function"""
    beta = _nondim_tec_spitzer(Z)
    if Z == 1:
        beta_check = 0.699
        rtol = 1e-3
    elif Z in [2, 4, np.inf]:
        beta_check = _nondim_tec_braginskii(0, Z, "par")
        rtol = 2e-2
    elif Z == 16:
        beta_check = _nondim_tec_ji_held(0, Z, "par")
        rtol = 2e-2
    assert np.isclose(beta, beta_check, rtol=rtol)
Пример #2
0
 def test_cross_vs_ji_held(self, Z):
     """cross should roughly agree with ji-held"""
     beta_hat_cross_brag = _nondim_tec_braginskii(self.big_hall, Z, "cross")
     beta_hat_cross_jh = _nondim_tec_ji_held(self.big_hall, Z, "cross")
     assert np.isclose(beta_hat_cross_brag, beta_hat_cross_jh, rtol=3e-2)
Пример #3
0
 def test_unmagnetized(self, Z):
     """confirm perp -> par as B -> 0"""
     beta_hat_par = _nondim_tec_braginskii(self.small_hall, Z, "par")
     beta_hat_perp = _nondim_tec_braginskii(self.small_hall, Z, "perp")
     assert np.isclose(beta_hat_par, beta_hat_perp, rtol=1e-3)
Пример #4
0
 def test_known_values_par(self, Z, field_orientation, expected):
     """check some known values"""
     beta_hat = _nondim_tec_braginskii(self.big_hall, Z, field_orientation)
     assert np.isclose(beta_hat, expected, atol=1e-1)