diff options
Diffstat (limited to 'Source/Particles/ElementaryProcess/QEDInternals/SchwingerProcessWrapper.H')
-rw-r--r-- | Source/Particles/ElementaryProcess/QEDInternals/SchwingerProcessWrapper.H | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/Source/Particles/ElementaryProcess/QEDInternals/SchwingerProcessWrapper.H b/Source/Particles/ElementaryProcess/QEDInternals/SchwingerProcessWrapper.H index 46960fa00..910ea5e1d 100644 --- a/Source/Particles/ElementaryProcess/QEDInternals/SchwingerProcessWrapper.H +++ b/Source/Particles/ElementaryProcess/QEDInternals/SchwingerProcessWrapper.H @@ -10,10 +10,7 @@ #include "QedWrapperCommons.H" -//#define PXRMP_CORE_ONLY allows importing only the 'core functions' of the -//Schwinger process engine of the QED PICSAR library. -#define PXRMP_CORE_ONLY -#include <schwinger_pair_engine.hpp> +#include <physics/schwinger/schwinger_pair_engine_core.hpp> #include <AMReX_Random.H> #include <cmath> @@ -22,7 +19,8 @@ * the number of Schwinger pairs created at a given timestep and in a given * cell as a function of the EM field in that cell. * - * @param[in] dVdt Volume of the cell multiplied by temporal step. + * @param[in] dV Volume of the cell. + * @param[in] dt temporal step. * @param[in] Ex x-component of the electric field on the cell. * @param[in] Ey y-component of the electric field on the cell. * @param[in] Ez z-component of the electric field on the cell. @@ -33,33 +31,30 @@ * pairs is below this parameter, a Poisson distribution is used * to draw the number of created pairs. Otherwise a Gaussian * distribution is used. + * @return the number of pairs generated via the Schwinger process */ -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real -getSchwingerProductionNumber (const amrex::Real dVdt, +AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE +amrex::Real +getSchwingerProductionNumber (const amrex::Real dV, const amrex::Real dt, const amrex::Real Ex, const amrex::Real Ey, const amrex::Real Ez, const amrex::Real Bx, const amrex::Real By, const amrex::Real Bz, const amrex::Real PoissonToGaussianThreshold) { using namespace amrex; - using namespace picsar::multi_physics; + namespace pxr_p = picsar::multi_physics::phys; + namespace pxr_sh = picsar::multi_physics::phys::schwinger; - //If SI units are used, PICSAR QED does not use a reference length. - // However, a "lambda" parameter must still be passed to some functions. - const auto dummy_lambda = 1._rt; - - const auto expectedPairNumber = dVdt * - schwinger_pair_engine<Real,QedUtils::DummyStruct>:: - internal_compute_schwinger_pair_production_rate( - Ex, Ey, Ez, Bx, By, Bz, dummy_lambda); + const auto expectedPairNumber = + pxr_sh::expected_pair_number<amrex::Real, pxr_p::unit_system::SI>( + Ex, Ey, Ez, Bx, By, Bz, dV, dt); if (expectedPairNumber <= PoissonToGaussianThreshold) { - return RandomPoisson(expectedPairNumber); - } - else { - const auto numpairs = RandomNormal(expectedPairNumber,sqrt(expectedPairNumber)); + return amrex::RandomPoisson(expectedPairNumber); + } else { + const auto numpairs = + amrex::RandomNormal(expectedPairNumber,sqrt(expectedPairNumber)); return numpairs > 0._rt ? numpairs : 0._rt; } - } #endif // WARPX_schwinger_process_wrapper_h_ |