Skip to content

Commit

Permalink
change t_lab
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiqunZhang committed Dec 7, 2023
1 parent 6498c22 commit c99df9c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Source/Particles/RigidInjectedParticleContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,19 @@ RigidInjectedParticleContainer::RemapParticles()

// For now, start with the assumption that this will only happen
// at the start of the simulation.
const ParticleReal t_lab = 0._prt;
ParticleReal t_lab = 0._prt;
{ // unless particles are injected from recording plane
const ParmParse pp_species_name(species_name);
std::string injection_style;
bool injection_from_recording_plane = false;
pp_species_name.query("injection_style", injection_style);
pp_species_name.query("injection_from_recording_plane", injection_from_recording_plane);
if (injection_style == "external_file" && injection_from_recording_plane) {
const amrex::Real t_boost = WarpX::GetInstance().gett_new(0);
const amrex::Real zmax_boost = WarpX::GetInstance().Geom(0).ProbHi(WARPX_ZINDEX);
t_lab = WarpX::gamma_boost*(t_boost + WarpX::beta_boost*zmax_boost/PhysConst::c);
}
}

const ParticleReal uz_boost = WarpX::gamma_boost*WarpX::beta_boost*PhysConst::c;
const ParticleReal csqi = 1._prt/(PhysConst::c*PhysConst::c);
Expand Down

0 comments on commit c99df9c

Please sign in to comment.