From cac79bec2c0ae3f2a2fb3278591806007e9653ff Mon Sep 17 00:00:00 2001 From: RevathiJambunathan Date: Mon, 2 Oct 2023 16:15:36 -0700 Subject: [PATCH] add RR --- Source/Particles/PulsarParameters.H | 2 ++ Source/Particles/PulsarParameters.cpp | 4 ++++ .../Pusher/UpdateMomentumBorisWithRadiationReaction.H | 10 ++++++++++ 3 files changed, 16 insertions(+) diff --git a/Source/Particles/PulsarParameters.H b/Source/Particles/PulsarParameters.H index a208541f787..85c77a0c296 100644 --- a/Source/Particles/PulsarParameters.H +++ b/Source/Particles/PulsarParameters.H @@ -702,6 +702,8 @@ public: static amrex::Real m_depositbuffer_min; static amrex::Real m_depositbuffer_max; static int m_pml_cubic_sigma; + static amrex::Real m_gammarad_real; + static amrex::Real m_gammarad_scaled; private: }; diff --git a/Source/Particles/PulsarParameters.cpp b/Source/Particles/PulsarParameters.cpp index 5fb57517eb4..48aa76ee0e8 100644 --- a/Source/Particles/PulsarParameters.cpp +++ b/Source/Particles/PulsarParameters.cpp @@ -143,6 +143,8 @@ amrex::Real Pulsar::m_gatherbuffer_max = 0.; amrex::Real Pulsar::m_depositbuffer_min = 0.; amrex::Real Pulsar::m_depositbuffer_max = 0.; int Pulsar::m_pml_cubic_sigma; +amrex::Real Pulsar::m_gammarad_real = 1.; +amrex::Real Pulsar::m_gammarad_scaled = 1.; Pulsar::Pulsar () { @@ -374,6 +376,8 @@ Pulsar::ReadParameters () { pp.query("depositbuffer_min",m_depositbuffer_min); pp.query("depositbuffer_max",m_depositbuffer_max); pp.get("pml_cubic_sigma", m_pml_cubic_sigma); + pp.query("gammarad_real", m_gammarad_real); + pp.query("gammarad_scaled", m_gammarad_scaled); } diff --git a/Source/Particles/Pusher/UpdateMomentumBorisWithRadiationReaction.H b/Source/Particles/Pusher/UpdateMomentumBorisWithRadiationReaction.H index b637f865ae8..4d7aea45445 100644 --- a/Source/Particles/Pusher/UpdateMomentumBorisWithRadiationReaction.H +++ b/Source/Particles/Pusher/UpdateMomentumBorisWithRadiationReaction.H @@ -8,6 +8,9 @@ #define WARPX_PARTICLES_PUSHER_UPDATEMOMENTUM_BORIS_WITHRR_H_ #include "UpdateMomentumBoris.H" +#ifdef PULSAR +#include "Particles/PulsarParameters.H" +#endif #include @@ -68,7 +71,14 @@ void UpdateMomentumBorisWithRadiationReaction( //Calculation of auxiliary quantities const amrex::ParticleReal bdotE = (bx_n*Ex + by_n*Ey + bz_n*Ez); const amrex::ParticleReal bdotE2 = bdotE*bdotE; +#ifdef PULSAR + // To account for radiation reaction in the scaled pulsar simulation + // we scale the ultra-relativistic term, gamma_n with gamma_real/gamma_scaled + const amrex::ParticleReal gamma_scale_fac = Pulsar::m_gammarad_real/Pulsar::m_gammarad_scaled; + const amrex::ParticleReal coeff = gamma_scale_fac*gamma_scale_fac*gamma_n*gamma_n*(fl_q2-bdotE2); +#else const amrex::ParticleReal coeff = gamma_n*gamma_n*(fl_q2-bdotE2); +#endif //Radiation reaction constant const amrex::ParticleReal q_over_mc = q/(m*PhysConst::c);