Particles don't reset interaction between timesteps,

added possibility to stride the injection of new
beta particles
This commit is contained in:
2025-08-20 14:54:03 +02:00
parent ddfa5672df
commit abab8810f3
7 changed files with 160 additions and 166 deletions
+2 -15
View File
@@ -19,7 +19,6 @@ BorisMover::BorisMover(double maximal_time_step_s)
"The maximal timestep for boris push must be positive.");
}
// TBD: include F_g (simply add to electric force)
void BorisMover::move(particle::Particle* particle,
double collision_time_s,
ElectricField* electric_field,
@@ -37,7 +36,7 @@ void BorisMover::move(particle::Particle* particle,
// can only life a time dt < min(distance/v, maximal_timestep), which might even be
// a lot larger than dt, which would increase the influence of the particle on the
// density)
double max_time_alive = particle->specie()->dynamicDensityField()->physicalTime() -
double max_time_alive = delta_timeresolution -//particle->specie()->dynamicDensityField()->physicalTime() -
particle->timeAlive();
double leftover_time = collision_time_s;
@@ -131,19 +130,6 @@ void BorisMover::move(particle::Particle* particle,
changed_energy_bin =
particle->specie()->dynamicDensityField()->changedEnergyBin(
old_kinetic_energy, particle->kineticEnergy_eV());
// #ifdef debug
// if(changed_energy_bin &&
// particle->specie()->type() == species::ImplementedSpecies::Tplus) {
// std::stringstream out;
// out << "Changed energy bin from: " << particle->specie()->dynamicDensityField()
// ->energyBinning()->bin(old_kinetic_energy);
// out << " (" << old_kinetic_energy << ") to: ";
// out << particle->specie()->dynamicDensityField()->energyBinning()
// ->bin(particle->kineticEnergy_eV());
// out << " (" << particle->kineticEnergy_eV() << ")\n";
// DEBUG(out.str());
// }
// #endif
left_simulation_domain =
particle->specie()->terminator()->leftSimulationDomain(particle);
@@ -152,6 +138,7 @@ void BorisMover::move(particle::Particle* particle,
particle->specie()->terminator()->reachedMaxTimeAlive(particle);
leftover_time -= timestep;
particle->reduceTimeUntilCollision(timestep);
// if max_time_alive == 0 but the difference between the time alive and
// the endtime > 0 (think can happen due to numerical accuracy)