Skip to content

Commit

Permalink
theta for GJ calculation in plasma injection corrected to account for…
Browse files Browse the repository at this point in the history
… chi
  • Loading branch information
RevathiJambunathan committed Oct 2, 2023
1 parent 68f2009 commit 3682a50
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Source/Particles/PulsarParameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2271,6 +2271,7 @@ Pulsar::FlagCellsForInjectionWithPcounts ()
amrex::Real sum_magnetization = m_sum_inj_magnetization;
amrex::Real GJdensitythreshold = m_injection_GJdensitythreshold;
// fill pcounts and injected cell flag
amrex::Real chi = m_Chi;
for (amrex::MFIter mfi(*m_injection_flag[lev], amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi)
{
const amrex::Box& tb = mfi.tilebox(iv);
Expand Down Expand Up @@ -2357,7 +2358,8 @@ Pulsar::FlagCellsForInjectionWithPcounts ()
//amrex::Real rho_GJ = rho_GJ_fac * (1. - 3. * std::cos(theta) * std::cos(theta) );
//amrex::Real n_GJ = amrex::Math::abs(rho_GJ)/q;
//amrex::Real num_part_real = 0.;
amrex::Real GJ_factor = amrex::Math::abs( 1. - 3. * std::cos(theta)*std::cos(theta));
amrex::Real shifted_theta = theta - chi;
amrex::Real GJ_factor = amrex::Math::abs( 1. - 3. * std::cos(shifted_theta)*std::cos(shifted_theta));
if (GJ_factor < GJdensitythreshold) GJ_factor = GJdensitythreshold;
amrex::Real sigma_factor = sigma_inj_ring(i,j,k)/sum_magnetization;
amrex::Real num_part_cell = (num_GJParticles * GJ_factor) + (PairPlasmaParticles * sigma_factor);
Expand Down

0 comments on commit 3682a50

Please sign in to comment.