Exemplo n.º 1
0
 def test_cross_vs_ji_held(self, Z):
     """cross should roughly agree with ji-held"""
     kappa_e_hat_cross_brag = _nondim_tc_e_braginskii(self.big_hall, Z, "cross")
     kappa_e_hat_cross_jh = _nondim_tc_e_ji_held(self.big_hall, Z, "cross")
     testTrue = np.isclose(kappa_e_hat_cross_brag, kappa_e_hat_cross_jh, rtol=2e-2)
     errStr = (
         f"braginskii cross {kappa_e_hat_cross_brag} should agree "
         f"with ji-held {kappa_e_hat_cross_jh}."
     )
     assert testTrue, errStr
Exemplo n.º 2
0
def test__nondim_tc_e_spitzer(Z):
    """test _nondim_tc_e_spitzer function"""
    kappa = _nondim_tc_e_spitzer(Z)
    if Z == 1:
        kappa_check = 3.203
        rtol = 1e-3
    elif Z in [2, 4]:
        kappa_check = _nondim_tc_e_braginskii(0, Z, "par")
        rtol = 2e-2
    elif Z == 16:
        kappa_check = _nondim_tc_e_ji_held(0, Z, "par")
        rtol = 2e-2
    elif Z == np.inf:
        kappa_check = _nondim_tc_e_ji_held(0, 1e6, "par")
        rtol = 2e-2
    assert np.isclose(kappa, kappa_check, rtol=rtol)
Exemplo n.º 3
0
 def test_unmagnetized(self, Z):
     """confirm perp -> par as B -> 0"""
     kappa_e_hat_par = _nondim_tc_e_braginskii(self.small_hall, Z, "par")
     kappa_e_hat_perp = _nondim_tc_e_braginskii(self.small_hall, Z, "perp")
     assert np.isclose(kappa_e_hat_par, kappa_e_hat_perp, rtol=1e-3)
Exemplo n.º 4
0
 def test_known_values_perp(self, Z, field_orientation, expected):
     """check some known values"""
     kappa_e_hat = _nondim_tc_e_braginskii(self.big_hall, Z,
                                           field_orientation)
     assert np.isclose(kappa_e_hat * self.big_hall**2, expected, atol=1e-1)