diff --git a/docs/source/usage/workflows/ionization.rst b/docs/source/usage/workflows/ionization.rst index a3540215600..b13f9407320 100644 --- a/docs/source/usage/workflows/ionization.rst +++ b/docs/source/usage/workflows/ionization.rst @@ -69,13 +69,13 @@ To include charge-state-only simulations in your simulations you must: float_X, 7, // number charge states Nitrogen, // name you may reference this by later, remember to prepend the namespace and append _t! - 14.53413 * UNITCONV_eV_to_AU, - 29.60125 * UNITCONV_eV_to_AU, - 47.4453 * UNITCONV_eV_to_AU, - 77.4735 * UNITCONV_eV_to_AU, - 97.89013 * UNITCONV_eV_to_AU, - 552.06731 * UNITCONV_eV_to_AU, - 667.04609 * UNITCONV_eV_to_AU); + sim.si.conv.ev2auEnergy(14.53413), + sim.si.conv.ev2auEnergy(29.60125), + sim.si.conv.ev2auEnergy(47.4453), + sim.si.conv.ev2auEnergy(77.4735), + sim.si.conv.ev2auEnergy(97.89013), + sim.si.conv.ev2auEnergy(552.06731), + sim.si.conv.ev2auEnergy(667.04609)); }; // namespace picongpu::ionization::energies::AU .. note:: diff --git a/include/picongpu/defines.hpp b/include/picongpu/defines.hpp index d16cfec7b11..8cd449d9f82 100644 --- a/include/picongpu/defines.hpp +++ b/include/picongpu/defines.hpp @@ -40,5 +40,4 @@ namespace picongpu #include "picongpu/param/speciesConstants.param" #include "picongpu/param/simulation.param" #include "picongpu/unitless/simulation.unitless" -#include "picongpu/unitless/physicalConstants.unitless" // clang-format on diff --git a/include/picongpu/param/ionizationEnergies.param b/include/picongpu/param/ionizationEnergies.param index 15bf40a5de0..bde5391c4da 100644 --- a/include/picongpu/param/ionizationEnergies.param +++ b/include/picongpu/param/ionizationEnergies.param @@ -39,7 +39,7 @@ namespace picongpu * Please follow these rules for defining ionization energies of atomic species, * unless your chosen ionization model requires a different unit system than `AU::` * - input of values in either atomic units or converting eV or Joule to them - * -> use either UNITCONV_eV_to_AU or SI::ATOMIC_UNIT_ENERGY for that purpose + * -> use either sim.si.conv.ev2auEnergy() or sim.si.conv.joule2auEnergy() for that purpose * - use `float_X` as the preferred data type * * example: @@ -72,211 +72,216 @@ namespace picongpu namespace AU { /* ionization energy for ground state hydrogen in atomic units */ - PMACC_CONST_VECTOR(float_X, 1, Hydrogen, 13.59843 * UNITCONV_eV_to_AU); + PMACC_CONST_VECTOR(float_X, 1, Hydrogen, sim.si.conv.ev2auEnergy(13.59843)); /* ionization energy for ground state deuterium in atomic units */ - PMACC_CONST_VECTOR(float_X, 1, Deuterium, 13.60213 * UNITCONV_eV_to_AU); + PMACC_CONST_VECTOR(float_X, 1, Deuterium, sim.si.conv.ev2auEnergy(13.60213)); /* ionization energy for ground state helium in atomic units */ - PMACC_CONST_VECTOR(float_X, 2, Helium, 24.58739 * UNITCONV_eV_to_AU, 54.41776 * UNITCONV_eV_to_AU); + PMACC_CONST_VECTOR( + float_X, + 2, + Helium, + sim.si.conv.ev2auEnergy(24.58739), + sim.si.conv.ev2auEnergy(54.41776)); /* ionization energy for carbon in atomic units */ PMACC_CONST_VECTOR( float_X, 6, Carbon, - 11.2603 * UNITCONV_eV_to_AU, - 24.3845 * UNITCONV_eV_to_AU, - 47.88778 * UNITCONV_eV_to_AU, - 64.49351 * UNITCONV_eV_to_AU, - 392.0905 * UNITCONV_eV_to_AU, - 489.993177 * UNITCONV_eV_to_AU); + sim.si.conv.ev2auEnergy(11.2603), + sim.si.conv.ev2auEnergy(24.3845), + sim.si.conv.ev2auEnergy(47.88778), + sim.si.conv.ev2auEnergy(64.49351), + sim.si.conv.ev2auEnergy(392.0905), + sim.si.conv.ev2auEnergy(489.993177)); /* ionization energy for nitrogen in atomic units */ PMACC_CONST_VECTOR( float_X, 7, Nitrogen, - 14.53413 * UNITCONV_eV_to_AU, - 29.60125 * UNITCONV_eV_to_AU, - 47.4453 * UNITCONV_eV_to_AU, - 77.4735 * UNITCONV_eV_to_AU, - 97.89013 * UNITCONV_eV_to_AU, - 552.06731 * UNITCONV_eV_to_AU, - 667.04609 * UNITCONV_eV_to_AU); + sim.si.conv.ev2auEnergy(14.53413), + sim.si.conv.ev2auEnergy(29.60125), + sim.si.conv.ev2auEnergy(47.4453), + sim.si.conv.ev2auEnergy(77.4735), + sim.si.conv.ev2auEnergy(97.89013), + sim.si.conv.ev2auEnergy(552.06731), + sim.si.conv.ev2auEnergy(667.04609)); /* ionization energy for oxygen in atomic units */ PMACC_CONST_VECTOR( float_X, 8, Oxygen, - 13.61805 * UNITCONV_eV_to_AU, - 35.12112 * UNITCONV_eV_to_AU, - 54.93554 * UNITCONV_eV_to_AU, - 77.41350 * UNITCONV_eV_to_AU, - 113.8989 * UNITCONV_eV_to_AU, - 138.1189 * UNITCONV_eV_to_AU, - 739.3268 * UNITCONV_eV_to_AU, - 871.4098 * UNITCONV_eV_to_AU); + sim.si.conv.ev2auEnergy(13.61805), + sim.si.conv.ev2auEnergy(35.12112), + sim.si.conv.ev2auEnergy(54.93554), + sim.si.conv.ev2auEnergy(77.41350), + sim.si.conv.ev2auEnergy(113.8989), + sim.si.conv.ev2auEnergy(138.1189), + sim.si.conv.ev2auEnergy(739.3268), + sim.si.conv.ev2auEnergy(871.4098)); /* ionization energy for aluminium in atomic units */ PMACC_CONST_VECTOR( float_X, 13, Aluminium, - 5.98577 * UNITCONV_eV_to_AU, - 18.8285 * UNITCONV_eV_to_AU, - 28.4476 * UNITCONV_eV_to_AU, - 119.992 * UNITCONV_eV_to_AU, - 153.825 * UNITCONV_eV_to_AU, - 190.495 * UNITCONV_eV_to_AU, - 241.769 * UNITCONV_eV_to_AU, - 284.647 * UNITCONV_eV_to_AU, - 330.214 * UNITCONV_eV_to_AU, - 398.656 * UNITCONV_eV_to_AU, - 442.006 * UNITCONV_eV_to_AU, - 2085.97 * UNITCONV_eV_to_AU, - 2304.14 * UNITCONV_eV_to_AU); + sim.si.conv.ev2auEnergy(5.98577), + sim.si.conv.ev2auEnergy(18.8285), + sim.si.conv.ev2auEnergy(28.4476), + sim.si.conv.ev2auEnergy(119.992), + sim.si.conv.ev2auEnergy(153.825), + sim.si.conv.ev2auEnergy(190.495), + sim.si.conv.ev2auEnergy(241.769), + sim.si.conv.ev2auEnergy(284.647), + sim.si.conv.ev2auEnergy(330.214), + sim.si.conv.ev2auEnergy(398.656), + sim.si.conv.ev2auEnergy(442.006), + sim.si.conv.ev2auEnergy(2085.97), + sim.si.conv.ev2auEnergy(2304.14)); /* ionization energy for silicon in atomic units */ PMACC_CONST_VECTOR( float_X, 14, Silicon, - 8.151683 * UNITCONV_eV_to_AU, - 16.345845 * UNITCONV_eV_to_AU, - 33.493 * UNITCONV_eV_to_AU, - 45.14179 * UNITCONV_eV_to_AU, - 166.767 * UNITCONV_eV_to_AU, - 205.267 * UNITCONV_eV_to_AU, - 246.32 * UNITCONV_eV_to_AU, - 303.66 * UNITCONV_eV_to_AU, - 351.1 * UNITCONV_eV_to_AU, - 401.38 * UNITCONV_eV_to_AU, - 476.18 * UNITCONV_eV_to_AU, - 523.415 * UNITCONV_eV_to_AU, - 2437.65804 * UNITCONV_eV_to_AU, - 2673.1774 * UNITCONV_eV_to_AU); + sim.si.conv.ev2auEnergy(8.151683), + sim.si.conv.ev2auEnergy(16.345845), + sim.si.conv.ev2auEnergy(33.493), + sim.si.conv.ev2auEnergy(45.14179), + sim.si.conv.ev2auEnergy(166.767), + sim.si.conv.ev2auEnergy(205.267), + sim.si.conv.ev2auEnergy(246.32), + sim.si.conv.ev2auEnergy(303.66), + sim.si.conv.ev2auEnergy(351.1), + sim.si.conv.ev2auEnergy(401.38), + sim.si.conv.ev2auEnergy(476.18), + sim.si.conv.ev2auEnergy(523.415), + sim.si.conv.ev2auEnergy(2437.65804), + sim.si.conv.ev2auEnergy(2673.1774)); /* ionization energy for copper in atomic units */ PMACC_CONST_VECTOR( float_X, 29, Copper, - 7.72638 * UNITCONV_eV_to_AU, - 20.2924 * UNITCONV_eV_to_AU, - 36.8411 * UNITCONV_eV_to_AU, - 57.385 * UNITCONV_eV_to_AU, - 79.87 * UNITCONV_eV_to_AU, - 103.010 * UNITCONV_eV_to_AU, - 139.012 * UNITCONV_eV_to_AU, - 166.021 * UNITCONV_eV_to_AU, - 198.022 * UNITCONV_eV_to_AU, - 232.25 * UNITCONV_eV_to_AU, - 265.332 * UNITCONV_eV_to_AU, - 367.09 * UNITCONV_eV_to_AU, - 401.03 * UNITCONV_eV_to_AU, - 436.06 * UNITCONV_eV_to_AU, - 483.19 * UNITCONV_eV_to_AU, - 518.712 * UNITCONV_eV_to_AU, - 552.821 * UNITCONV_eV_to_AU, - 632.56 * UNITCONV_eV_to_AU, - 670.608 * UNITCONV_eV_to_AU, - 1690.59 * UNITCONV_eV_to_AU, - 1800.3 * UNITCONV_eV_to_AU, - 1918.4 * UNITCONV_eV_to_AU, - 2044.6 * UNITCONV_eV_to_AU, - 2179.4 * UNITCONV_eV_to_AU, - 2307.32 * UNITCONV_eV_to_AU, - 2479.12 * UNITCONV_eV_to_AU, - 2586.95 * UNITCONV_eV_to_AU, - 11062.4 * UNITCONV_eV_to_AU, - 11567.6 * UNITCONV_eV_to_AU); + sim.si.conv.ev2auEnergy(7.72638), + sim.si.conv.ev2auEnergy(20.2924), + sim.si.conv.ev2auEnergy(36.8411), + sim.si.conv.ev2auEnergy(57.385), + sim.si.conv.ev2auEnergy(79.87), + sim.si.conv.ev2auEnergy(103.010), + sim.si.conv.ev2auEnergy(139.012), + sim.si.conv.ev2auEnergy(166.021), + sim.si.conv.ev2auEnergy(198.022), + sim.si.conv.ev2auEnergy(232.25), + sim.si.conv.ev2auEnergy(265.332), + sim.si.conv.ev2auEnergy(367.09), + sim.si.conv.ev2auEnergy(401.03), + sim.si.conv.ev2auEnergy(436.06), + sim.si.conv.ev2auEnergy(483.19), + sim.si.conv.ev2auEnergy(518.712), + sim.si.conv.ev2auEnergy(552.821), + sim.si.conv.ev2auEnergy(632.56), + sim.si.conv.ev2auEnergy(670.608), + sim.si.conv.ev2auEnergy(1690.59), + sim.si.conv.ev2auEnergy(1800.3), + sim.si.conv.ev2auEnergy(1918.4), + sim.si.conv.ev2auEnergy(2044.6), + sim.si.conv.ev2auEnergy(2179.4), + sim.si.conv.ev2auEnergy(2307.32), + sim.si.conv.ev2auEnergy(2479.12), + sim.si.conv.ev2auEnergy(2586.95), + sim.si.conv.ev2auEnergy(11062.4), + sim.si.conv.ev2auEnergy(11567.6)); /* ionization energy for gold in atomic units */ PMACC_CONST_VECTOR( float_X, 79, Gold, - 9.2256 * UNITCONV_eV_to_AU, - 20.203 * UNITCONV_eV_to_AU, - 30.016 * UNITCONV_eV_to_AU, - 45.017 * UNITCONV_eV_to_AU, - 60.019 * UNITCONV_eV_to_AU, - 74.020 * UNITCONV_eV_to_AU, - 94.020 * UNITCONV_eV_to_AU, - 112.02 * UNITCONV_eV_to_AU, - 130.12 * UNITCONV_eV_to_AU, - 149.02 * UNITCONV_eV_to_AU, - 168.21 * UNITCONV_eV_to_AU, - 248.01 * UNITCONV_eV_to_AU, - 275.14 * UNITCONV_eV_to_AU, - 299.15 * UNITCONV_eV_to_AU, - 324.16 * UNITCONV_eV_to_AU, - 365.19 * UNITCONV_eV_to_AU, - 392.20 * UNITCONV_eV_to_AU, - 433.21 * UNITCONV_eV_to_AU, - 487.25 * UNITCONV_eV_to_AU, - 517.30 * UNITCONV_eV_to_AU, - 546.30 * UNITCONV_eV_to_AU, - 600.30 * UNITCONV_eV_to_AU, - 650.40 * UNITCONV_eV_to_AU, - 710.40 * UNITCONV_eV_to_AU, - 760.40 * UNITCONV_eV_to_AU, - 820.40 * UNITCONV_eV_to_AU, - 870.40 * UNITCONV_eV_to_AU, - 930.50 * UNITCONV_eV_to_AU, - 990.50 * UNITCONV_eV_to_AU, - 1040.5 * UNITCONV_eV_to_AU, - 1100.5 * UNITCONV_eV_to_AU, - 1150.6 * UNITCONV_eV_to_AU, - 1210.6 * UNITCONV_eV_to_AU, - 1475.5 * UNITCONV_eV_to_AU, - 1527.5 * UNITCONV_eV_to_AU, - 1584.5 * UNITCONV_eV_to_AU, - 1644.5 * UNITCONV_eV_to_AU, - 1702.4 * UNITCONV_eV_to_AU, - 1758.4 * UNITCONV_eV_to_AU, - 1845.4 * UNITCONV_eV_to_AU, - 1904.4 * UNITCONV_eV_to_AU, - 1967.4 * UNITCONV_eV_to_AU, - 2026.4 * UNITCONV_eV_to_AU, - 2261.4 * UNITCONV_eV_to_AU, - 2320.4 * UNITCONV_eV_to_AU, - 2383.4 * UNITCONV_eV_to_AU, - 2443.4 * UNITCONV_eV_to_AU, - 2640.4 * UNITCONV_eV_to_AU, - 2708.4 * UNITCONV_eV_to_AU, - 2870.4 * UNITCONV_eV_to_AU, - 2941.0 * UNITCONV_eV_to_AU, - 4888.4 * UNITCONV_eV_to_AU, - 5013.4 * UNITCONV_eV_to_AU, - 5156.5 * UNITCONV_eV_to_AU, - 5307.5 * UNITCONV_eV_to_AU, - 5452.5 * UNITCONV_eV_to_AU, - 5594.5 * UNITCONV_eV_to_AU, - 5846.6 * UNITCONV_eV_to_AU, - 5994.6 * UNITCONV_eV_to_AU, - 6156.7 * UNITCONV_eV_to_AU, - 6305.1 * UNITCONV_eV_to_AU, - 6724.1 * UNITCONV_eV_to_AU, - 6854.1 * UNITCONV_eV_to_AU, - 6997.2 * UNITCONV_eV_to_AU, - 7130.2 * UNITCONV_eV_to_AU, - 7756.3 * UNITCONV_eV_to_AU, - 7910.4 * UNITCONV_eV_to_AU, - 8210.4 * UNITCONV_eV_to_AU, - 8360.5 * UNITCONV_eV_to_AU, - 18040. * UNITCONV_eV_to_AU, - 18401. * UNITCONV_eV_to_AU, - 18791. * UNITCONV_eV_to_AU, - 19151. * UNITCONV_eV_to_AU, - 21471. * UNITCONV_eV_to_AU, - 21921. * UNITCONV_eV_to_AU, - 22500. * UNITCONV_eV_to_AU, - 22868. * UNITCONV_eV_to_AU, - 91516. * UNITCONV_eV_to_AU, - 93254. * UNITCONV_eV_to_AU); + sim.si.conv.ev2auEnergy(9.2256), + sim.si.conv.ev2auEnergy(20.203), + sim.si.conv.ev2auEnergy(30.016), + sim.si.conv.ev2auEnergy(45.017), + sim.si.conv.ev2auEnergy(60.019), + sim.si.conv.ev2auEnergy(74.020), + sim.si.conv.ev2auEnergy(94.020), + sim.si.conv.ev2auEnergy(112.02), + sim.si.conv.ev2auEnergy(130.12), + sim.si.conv.ev2auEnergy(149.02), + sim.si.conv.ev2auEnergy(168.21), + sim.si.conv.ev2auEnergy(248.01), + sim.si.conv.ev2auEnergy(275.14), + sim.si.conv.ev2auEnergy(299.15), + sim.si.conv.ev2auEnergy(324.16), + sim.si.conv.ev2auEnergy(365.19), + sim.si.conv.ev2auEnergy(392.20), + sim.si.conv.ev2auEnergy(433.21), + sim.si.conv.ev2auEnergy(487.25), + sim.si.conv.ev2auEnergy(517.30), + sim.si.conv.ev2auEnergy(546.30), + sim.si.conv.ev2auEnergy(600.30), + sim.si.conv.ev2auEnergy(650.40), + sim.si.conv.ev2auEnergy(710.40), + sim.si.conv.ev2auEnergy(760.40), + sim.si.conv.ev2auEnergy(820.40), + sim.si.conv.ev2auEnergy(870.40), + sim.si.conv.ev2auEnergy(930.50), + sim.si.conv.ev2auEnergy(990.50), + sim.si.conv.ev2auEnergy(1040.5), + sim.si.conv.ev2auEnergy(1100.5), + sim.si.conv.ev2auEnergy(1150.6), + sim.si.conv.ev2auEnergy(1210.6), + sim.si.conv.ev2auEnergy(1475.5), + sim.si.conv.ev2auEnergy(1527.5), + sim.si.conv.ev2auEnergy(1584.5), + sim.si.conv.ev2auEnergy(1644.5), + sim.si.conv.ev2auEnergy(1702.4), + sim.si.conv.ev2auEnergy(1758.4), + sim.si.conv.ev2auEnergy(1845.4), + sim.si.conv.ev2auEnergy(1904.4), + sim.si.conv.ev2auEnergy(1967.4), + sim.si.conv.ev2auEnergy(2026.4), + sim.si.conv.ev2auEnergy(2261.4), + sim.si.conv.ev2auEnergy(2320.4), + sim.si.conv.ev2auEnergy(2383.4), + sim.si.conv.ev2auEnergy(2443.4), + sim.si.conv.ev2auEnergy(2640.4), + sim.si.conv.ev2auEnergy(2708.4), + sim.si.conv.ev2auEnergy(2870.4), + sim.si.conv.ev2auEnergy(2941.0), + sim.si.conv.ev2auEnergy(4888.4), + sim.si.conv.ev2auEnergy(5013.4), + sim.si.conv.ev2auEnergy(5156.5), + sim.si.conv.ev2auEnergy(5307.5), + sim.si.conv.ev2auEnergy(5452.5), + sim.si.conv.ev2auEnergy(5594.5), + sim.si.conv.ev2auEnergy(5846.6), + sim.si.conv.ev2auEnergy(5994.6), + sim.si.conv.ev2auEnergy(6156.7), + sim.si.conv.ev2auEnergy(6305.1), + sim.si.conv.ev2auEnergy(6724.1), + sim.si.conv.ev2auEnergy(6854.1), + sim.si.conv.ev2auEnergy(6997.2), + sim.si.conv.ev2auEnergy(7130.2), + sim.si.conv.ev2auEnergy(7756.3), + sim.si.conv.ev2auEnergy(7910.4), + sim.si.conv.ev2auEnergy(8210.4), + sim.si.conv.ev2auEnergy(8360.5), + sim.si.conv.ev2auEnergy(18040.), + sim.si.conv.ev2auEnergy(18401.), + sim.si.conv.ev2auEnergy(18791.), + sim.si.conv.ev2auEnergy(19151.), + sim.si.conv.ev2auEnergy(21471.), + sim.si.conv.ev2auEnergy(21921.), + sim.si.conv.ev2auEnergy(22500.), + sim.si.conv.ev2auEnergy(22868.), + sim.si.conv.ev2auEnergy(91516.), + sim.si.conv.ev2auEnergy(93254.)); } // namespace AU } // namespace energies diff --git a/include/picongpu/param/physicalConstants.param b/include/picongpu/param/physicalConstants.param index 2224caa3697..60508097b7a 100644 --- a/include/picongpu/param/physicalConstants.param +++ b/include/picongpu/param/physicalConstants.param @@ -46,26 +46,5 @@ namespace picongpu constexpr float_64 ELECTRON_MASS_SI = 9.1093837139e-31; //! unit: C, 2022 CODATA value, https://physics.nist.gov/cgi-bin/cuu/Value?e constexpr float_64 ELECTRON_CHARGE_SI = -1.602176634e-19; - - /* atomic unit for energy: - * 2 Rydberg = 27.21 eV --> converted to Joule - */ - constexpr float_64 ATOMIC_UNIT_ENERGY = 4.36e-18; - - /* atomic unit for electric field in V/m: - * field strength between electron and core in ground state hydrogen - */ - constexpr float_64 ATOMIC_UNIT_EFIELD = 5.14e11; - - /* atomic unit for time in s: - * 150 attoseconds (classical electron orbit time in hydrogen) / 2 PI - */ - constexpr float_64 ATOMIC_UNIT_TIME = 2.4189e-17; - } // namespace SI - - /* 1 atomic unit of energy is equal to 1 Hartree or 2 Rydberg - * which is twice the ground state binding energy of atomic hydrogen */ - constexpr float_64 UNITCONV_AU_to_eV = 27.21139; - constexpr float_64 UNITCONV_eV_to_AU = (1.0 / UNITCONV_AU_to_eV); } // namespace picongpu diff --git a/include/picongpu/particles/atomicPhysics/kernel/DecelerateElectrons.kernel b/include/picongpu/particles/atomicPhysics/kernel/DecelerateElectrons.kernel index dea2dd1a3cf..6083a38d0c6 100644 --- a/include/picongpu/particles/atomicPhysics/kernel/DecelerateElectrons.kernel +++ b/include/picongpu/particles/atomicPhysics/kernel/DecelerateElectrons.kernel @@ -142,7 +142,7 @@ namespace picongpu::particles::atomicPhysics::kernel // sqrt(E' * (E' + 2* m*c^2)) / c float_X const newElectronMomentum = math::sqrt(newEnergyElectron * (newEnergyElectron + 2 * mcSquaredElectron)) * scalingFactor; - // AU = ATOMIC_UNIT_ENERGY + // AU = sim.si.conv.auEnergy2Joule() // sqrt(eV * (eV + eV))/(sim.unit.length()/sim.unit.time()) * (sim.unit.energy()/eV) // = sqrt((eV)^2)/(eV) * sim.unit.time()/sim.unit.length() * sim.unit.energy() // = sim.unit.mass() * sim.unit.length()^2/sim.unit.time()^2 * sim.unit.time()/sim.unit.length() diff --git a/include/picongpu/particles/atomicPhysics/rateCalculation/BoundFreeFieldTransitionRates.hpp b/include/picongpu/particles/atomicPhysics/rateCalculation/BoundFreeFieldTransitionRates.hpp index d291e8fa3f7..8310f6cee13 100644 --- a/include/picongpu/particles/atomicPhysics/rateCalculation/BoundFreeFieldTransitionRates.hpp +++ b/include/picongpu/particles/atomicPhysics/rateCalculation/BoundFreeFieldTransitionRates.hpp @@ -92,8 +92,8 @@ namespace picongpu::particles::atomicPhysics::rateCalculation chargeStateDataBox); // unitless float_X const effectivePrincipalQuantumNumber - = screenedCharge / math::sqrt(2._X * ionizationEnergy * picongpu::UNITCONV_eV_to_AU); - float_X const eFieldNorm_AU = eFieldNorm / ATOMIC_UNIT_EFIELD; + = screenedCharge / math::sqrt(2._X * ionizationEnergy * sim.si.conv.ev2auEnergy(1.0)); + float_X const eFieldNorm_AU = sim.pic.conv.eField2auEField(eFieldNorm); float_X const screenedChargeCubed = pmacc::math::cPow(screenedCharge, 3u); float_X const dBase = 4.0_X * math::exp(1._X) * screenedChargeCubed / (eFieldNorm_AU * pmacc::math::cPow(effectivePrincipalQuantumNumber, 4u)); @@ -103,7 +103,7 @@ namespace picongpu::particles::atomicPhysics::rateCalculation constexpr float_X pi = pmacc::math::Pi::value; float_X const nEffCubed = pmacc::math::cPow(effectivePrincipalQuantumNumber, 3u); - // 1/ATOMIC_UNIT_TIME + // 1/atomicTime float_X rateADK_AU = eFieldNorm_AU * pmacc::math::cPow(dFromADK, 2u) / (8._X * pi * screenedCharge) * math::exp(-2._X * screenedChargeCubed / (3._X * nEffCubed * eFieldNorm_AU)); @@ -112,7 +112,7 @@ namespace picongpu::particles::atomicPhysics::rateCalculation u32(T_ADKLaserPolarization) == u32(atomicPhysics::enums::ADKLaserPolarization::linearPolarization)) rateADK_AU *= math::sqrt(3._X * nEffCubed * eFieldNorm_AU / (pi * screenedChargeCubed)); - return rateADK_AU / ATOMIC_UNIT_TIME; + return rateADK_AU / sim.pic.conv.auTime2Time(1.0); } }; } // namespace picongpu::particles::atomicPhysics::rateCalculation diff --git a/include/picongpu/particles/ionization/byField/ADK/AlgorithmADK.hpp b/include/picongpu/particles/ionization/byField/ADK/AlgorithmADK.hpp index a0f1ca36c7f..d5a414847d2 100644 --- a/include/picongpu/particles/ionization/byField/ADK/AlgorithmADK.hpp +++ b/include/picongpu/particles/ionization/byField/ADK/AlgorithmADK.hpp @@ -84,7 +84,7 @@ namespace picongpu constexpr float_X pi = pmacc::math::Pi::value; /* electric field in atomic units - only absolute value */ - float_X const eInAU = pmacc::math::l2norm(eField) / ATOMIC_UNIT_EFIELD; + float_X const eInAU = sim.pic.conv.eField2auEField(pmacc::math::l2norm(eField)); /* the charge that attracts the electron that is to be ionized: * equals `protonNumber - #allInnerElectrons` @@ -113,7 +113,7 @@ namespace picongpu } /* simulation time step in atomic units */ - auto const timeStepAU = float_X(sim.pic.getDt() / ATOMIC_UNIT_TIME); + auto const timeStepAU = sim.pic.conv.time2auTime(sim.pic.getDt()); /* ionization probability * * probability = rate * time step diff --git a/include/picongpu/particles/ionization/byField/BSI/AlgorithmBSI.hpp b/include/picongpu/particles/ionization/byField/BSI/AlgorithmBSI.hpp index 750121da03b..9054a5d7635 100644 --- a/include/picongpu/particles/ionization/byField/BSI/AlgorithmBSI.hpp +++ b/include/picongpu/particles/ionization/byField/BSI/AlgorithmBSI.hpp @@ -77,7 +77,7 @@ namespace picongpu /* critical field strength in atomic units */ float_X const critField = iEnergy * iEnergy / (float_X(4.0) * effectiveCharge); /* ionization condition */ - if(pmacc::math::l2norm(eField) / ATOMIC_UNIT_EFIELD >= critField) + if(sim.pic.conv.eField2auEField(pmacc::math::l2norm(eField)) >= critField) { /* return ionization energy and number of macro electrons to produce */ return IonizerReturn{iEnergy, 1u}; diff --git a/include/picongpu/particles/ionization/byField/BSI/AlgorithmBSIEffectiveZ.hpp b/include/picongpu/particles/ionization/byField/BSI/AlgorithmBSIEffectiveZ.hpp index eb5c330fa22..1a9ffadb89c 100644 --- a/include/picongpu/particles/ionization/byField/BSI/AlgorithmBSIEffectiveZ.hpp +++ b/include/picongpu/particles/ionization/byField/BSI/AlgorithmBSIEffectiveZ.hpp @@ -76,7 +76,7 @@ namespace picongpu float_X critField = iEnergy * iEnergy / (float_X(4.0) * ZEff); /* ionization condition */ - if(pmacc::math::l2norm(eField) / ATOMIC_UNIT_EFIELD >= critField) + if(sim.pic.conv.eField2auEField(pmacc::math::l2norm(eField)) >= critField) { /* return ionization energy and number of macro electrons to produce */ return IonizerReturn{iEnergy, 1u}; diff --git a/include/picongpu/particles/ionization/byField/BSI/AlgorithmBSIStarkShifted.hpp b/include/picongpu/particles/ionization/byField/BSI/AlgorithmBSIStarkShifted.hpp index 46602ed5cad..51684037d3d 100644 --- a/include/picongpu/particles/ionization/byField/BSI/AlgorithmBSIStarkShifted.hpp +++ b/include/picongpu/particles/ionization/byField/BSI/AlgorithmBSIStarkShifted.hpp @@ -75,7 +75,7 @@ namespace picongpu = (math::sqrt(float_X(2.)) - float_X(1.)) * math::pow(iEnergy, float_X(3. / 2.)); /* ionization condition */ - if(pmacc::math::l2norm(eField) / ATOMIC_UNIT_EFIELD >= critField) + if(sim.pic.conv.eField2auEField(pmacc::math::l2norm(eField)) >= critField) { /* return ionization energy number of electrons to produce */ return IonizerReturn{iEnergy, 1u}; diff --git a/include/picongpu/particles/ionization/byField/IonizationCurrent/IonizationCurrent.hpp b/include/picongpu/particles/ionization/byField/IonizationCurrent/IonizationCurrent.hpp index c90b7e37909..0c9c790fd6f 100644 --- a/include/picongpu/particles/ionization/byField/IonizationCurrent/IonizationCurrent.hpp +++ b/include/picongpu/particles/ionization/byField/IonizationCurrent/IonizationCurrent.hpp @@ -61,8 +61,7 @@ namespace picongpu * ionization current. */ if(retValue.ionizationEnergy != 0.0_X) { - auto ionizationEnergy = weighting * retValue.ionizationEnergy * SI::ATOMIC_UNIT_ENERGY - / sim.unit.energy(); // convert to PIConGPU units + auto ionizationEnergy = sim.pic.conv.auEnergy2Joule(weighting * retValue.ionizationEnergy); /* calculate ionization current at particle position */ float3_X jIonizationPar = JIonizationCalc{}(ionizationEnergy, eField); /* assign ionization current to grid points */ diff --git a/include/picongpu/particles/ionization/byField/Keldysh/AlgorithmKeldysh.hpp b/include/picongpu/particles/ionization/byField/Keldysh/AlgorithmKeldysh.hpp index ef626001e33..ac3c7f476aa 100644 --- a/include/picongpu/particles/ionization/byField/Keldysh/AlgorithmKeldysh.hpp +++ b/include/picongpu/particles/ionization/byField/Keldysh/AlgorithmKeldysh.hpp @@ -76,7 +76,7 @@ namespace picongpu constexpr float_X pi = pmacc::math::Pi::value; /* electric field in atomic units - only absolute value */ - float_X eInAU = pmacc::math::l2norm(eField) / ATOMIC_UNIT_EFIELD; + float_X eInAU = sim.pic.conv.eField2auEField(pmacc::math::l2norm(eField)); /* factor two avoid calculation math::pow(2,5./4.); */ const float_X twoToFiveQuarters = 2.3784142300054; @@ -89,7 +89,7 @@ namespace picongpu * math::sqrt(float_X(1.) / charExpArg) * math::exp(-float_X(2. / 3.) * charExpArg); /* simulation time step in atomic units */ - const auto timeStepAU = float_X(sim.pic.getDt() / ATOMIC_UNIT_TIME); + const auto timeStepAU = sim.pic.conv.time2auTime(sim.pic.getDt()); /* ionization probability * * probability = rate * time step diff --git a/include/picongpu/unitless/simulation.unitless b/include/picongpu/unitless/simulation.unitless index 6314f31e6f6..ceac3597ab3 100644 --- a/include/picongpu/unitless/simulation.unitless +++ b/include/picongpu/unitless/simulation.unitless @@ -127,6 +127,35 @@ namespace picongpu { return static_cast(si.getClassicalElectronRadius() / unit.length()); } + + struct Convert + { + template + constexpr T_Type eField2auEField(T_Type eField = 1.0) const + { + return static_cast(si.conv.eField2auEField(eField * unit.eField())); + } + + template + constexpr T_Type auEnergy2Joule(T_Type auEnergy = 1.0) const + { + return static_cast(si.conv.auEnergy2Joule(auEnergy) / unit.energy()); + } + + template + constexpr T_Type auTime2Time(T_Type auTime = 1.0) const + { + return static_cast(si.conv.auTime2Time(auTime) / unit.time()); + } + + template + constexpr T_Type time2auTime(T_Type time = 1.0) const + { + return static_cast(si.conv.time2auTime(time * unit.time())); + } + }; + + static constexpr Convert conv{}; }; struct SiUnits { @@ -289,6 +318,55 @@ namespace picongpu { return joule / ev2Joule(1.0); } + + /* atomic unit for energy: + * 2 Rydberg = 27.21 eV --> converted to Joule + */ + constexpr float_64 auEnergy2Joule(float_64 auEnergy = 1.0) const + { + return auEnergy * 2.0 * si.getRydbergEnergy(); + } + + constexpr float_64 joule2auEnergy(float_64 joule = 1.0) const + { + return joule / auEnergy2Joule(1.0); + } + + constexpr float_64 auEnergy2ev(float_64 auEnergy = 1.0) const + { + return joule2ev(auEnergy2Joule(auEnergy)); + } + + constexpr float_64 ev2auEnergy(float_64 ev = 1.0) const + { + return ev / auEnergy2ev(1.0); + } + + /* atomic unit for electric field in V/m: + * field strength between electron and core in ground state hydrogen + */ + constexpr float_64 auEField2EField(float_64 auEField = 1.0) const + { + return auEField * 5.14e11; + } + + constexpr float_64 eField2auEField(float_64 eField = 1.0) const + { + return eField / auEField2EField(); + } + + /* atomic unit for time in s: + * 150 attoseconds (classical electron orbit time in hydrogen) / 2 PI + */ + constexpr float_64 auTime2Time(float_64 auTime = 1.0) const + { + return auTime * 2.4189e-17; + } + + constexpr float_64 time2auTime(float_64 time = 1.0) const + { + return time / auTime2Time(1.0); + } }; static constexpr Convert conv{}; diff --git a/share/picongpu/tests/compileAtomicPhysics/include/picongpu/param/ionizationEnergies.param b/share/picongpu/tests/compileAtomicPhysics/include/picongpu/param/ionizationEnergies.param index f1bd9beccae..bacf5b50f9c 100644 --- a/share/picongpu/tests/compileAtomicPhysics/include/picongpu/param/ionizationEnergies.param +++ b/share/picongpu/tests/compileAtomicPhysics/include/picongpu/param/ionizationEnergies.param @@ -39,7 +39,7 @@ namespace picongpu * Please follow these rules for defining ionization energies of atomic species, * unless your chosen ionization model requires a different unit system than `AU::` * - input of values in either atomic units or converting eV or Joule to them - * -> use either UNITCONV_eV_to_AU or SI::ATOMIC_UNIT_ENERGY for that purpose + * -> use either sim.si.conv.ev2auEnergy() or sim.si.conv.joule2auEnergy() for that purpose * - use `float_X` as the preferred data type * * example: @@ -76,24 +76,24 @@ namespace picongpu float_X, 18, Argon, - 15.7596119 * UNITCONV_eV_to_AU, - 27.62967 * UNITCONV_eV_to_AU, - 40.735 * UNITCONV_eV_to_AU, - 59.58 * UNITCONV_eV_to_AU, - 74.84 * UNITCONV_eV_to_AU, - 91.290 * UNITCONV_eV_to_AU, - 124.41 * UNITCONV_eV_to_AU, - 143.4567 * UNITCONV_eV_to_AU, - 422.60 * UNITCONV_eV_to_AU, - 479.76 * UNITCONV_eV_to_AU, - 540.4 * UNITCONV_eV_to_AU, - 619.0 * UNITCONV_eV_to_AU, - 685.5 * UNITCONV_eV_to_AU, - 755.13 * UNITCONV_eV_to_AU, - 855.5 * UNITCONV_eV_to_AU, - 918.375 * UNITCONV_eV_to_AU, - 4120.6657 * UNITCONV_eV_to_AU, - 4426.2229 * UNITCONV_eV_to_AU); + sim.si.conv.ev2auEnergy(15.7596119), + sim.si.conv.ev2auEnergy(27.62967), + sim.si.conv.ev2auEnergy(40.735), + sim.si.conv.ev2auEnergy(59.58), + sim.si.conv.ev2auEnergy(74.84), + sim.si.conv.ev2auEnergy(91.290), + sim.si.conv.ev2auEnergy(124.41), + sim.si.conv.ev2auEnergy(143.4567), + sim.si.conv.ev2auEnergy(422.60), + sim.si.conv.ev2auEnergy(479.76), + sim.si.conv.ev2auEnergy(540.4), + sim.si.conv.ev2auEnergy(619.0), + sim.si.conv.ev2auEnergy(685.5), + sim.si.conv.ev2auEnergy(755.13), + sim.si.conv.ev2auEnergy(855.5), + sim.si.conv.ev2auEnergy(918.375), + sim.si.conv.ev2auEnergy(4120.6657), + sim.si.conv.ev2auEnergy(4426.2229)); } // namespace AU } // namespace energies