Metallic materials are widely used in the industrial field due to their excellent electrical transport properties and superior thermal dissipation performance. However, experimental measurements of electrical and thermal conductivity under high-temperature and high-pressure conditions are challenging and costly. This makes numerical simulation an efficient alternative solution. In this study, we develop a computational software named TREX (TRansport at EXtremes). It is based on the Kubo-Greenwood (KG) formula combined with first-principles molecular dynamics. This software is used to calculate electrical conductivity and electronic thermal conductivity. Using magnesium and magnesium-aluminum alloy AZ31B as research subjects, we systematically investigate their electrical and thermal transport properties. The temperature and pressure are in a range of 300−1200 K and 0−50 GPa, respectively. The method involves using first-principles molecular dynamics simulations to obtain equilibrium configurations of high-temperature disordered structures. Electrical conductivity and electronic thermal conductivity are calculated using the KG formula. Lattice thermal conductivity is determined by the Slack equation. To validate the reliability of our approach, we perform comparative calculations by using the Boltzmann transport equation. The research results are cross-verified with experimental data from Sichuan University and the Aerospace Materials Test and Analysis Center. The findings demonstrate that the maximum relative error between computational and experimental results is within 20%. This confirms the accuracy of our method. Additionally, we elucidate the variation patterns of electrical and thermal conductivity in magnesium and AZ31B alloy with temperature and pressure. These patterns include the reduction in electrical conductivity due to aluminum doping, the significant enhancement of conductivity under high pressure, and the unique temperature-induced thermal conductivity enhancement in AZ31B alloy. The TREX program developed in this study and the established performance dataset provide essential tools and data support. They are useful for research on electrical and thermal transport mechanisms in metallic materials under extreme conditions, and also for engineering applications. All the data presented in this paper are openly available at
https://www.doi.org/10.57760/sciencedb.j00213.00128.