def test_af_conductivity_without_antiresonant_gauss(phonons): cond = Conductivity(phonons=phonons, method='qhgk', storage='memory') cond.diffusivity_shape = 'gauss' cond.diffusivity_bandwidth = phonons.bandwidth.reshape( (phonons.n_k_points, phonons.n_modes)) cond = (cond.conductivity.sum(axis=0).diagonal().mean()) np.testing.assert_approx_equal(cond, 0.8305, significant=3)
def test_diffusivity_large_threshold(phonons): cond = Conductivity(phonons=phonons, method='qhgk', storage='memory') cond.diffusivity_threshold = 20 cond.diffusivity_bandwidth = phonons.bandwidth.reshape( (phonons.n_k_points, phonons.n_modes)) cond.conductivity np.testing.assert_array_almost_equal(cond.diffusivity.flatten().real[:10], calculated_diffusivities_full, decimal=3)
# 'folder': name of folder containing phonon property and thermal conductivity calculations # 'storage': Format to storage phonon properties ('formatted' for ASCII format data, 'numpy' # for python numpy array and 'memory' for quick calculations, no data stored) phonons_config = {'is_classic': False, 'temperature': 300, #'temperature'=300K 'folder': 'ALD_aSi512', 'third_bandwidth':0.5/4.135, # 0.5 eV is used here. 'broadening_shape':'triangle', 'storage': 'numpy'} # Set up phonon object by passing in configuration details and the forceconstants object computed above phonons = Phonons(forceconstants=forceconstants, **phonons_config) ### Set up the Conductivity object and thermal conductivity calculations #### # Compute thermal conductivity (t.c.) by solving Boltzmann Transport # Equation (BTE) with various of methods # 'phonons': phonon object obtained from the above calculations # 'method': specify methods to solve for BTE # ('qhgk' for Quasi-Harmonic Green Kubo (QHGK)) # 'storage': Format to storage phonon properties ('formatted' for ASCII format data, 'numpy' # for python numpy array and 'memory' for quick calculations, no data stored) print('\n') qhgk_cond = Conductivity(phonons=phonons, method='qhgk', storage='numpy') qhgk_cond.diffusivity_bandwidth = phonons.bandwidth print('Conductivity from QHGK (W/m-K): %.3f' % (np.mean(np.diag(qhgk_cond.conductivity.sum(axis=0))))) print(qhgk_cond.conductivity.sum(axis=0))