Skip to content

Option to coarsen the calling of elastic collision operator - #1403

Open
ibranajmudin wants to merge 4 commits into
Hi-PACE:developmentfrom
ibranajmudin:collide_every
Open

ibranajmudin wants to merge 4 commits into
Hi-PACE:developmentfrom
ibranajmudin:collide_every

Conversation

@ibranajmudin

Copy link
Copy Markdown

Adds an option to have an interval (in xi-slices) between calling the elastic collision operator. Multiplies the timestep in the operator by the interval. Works to reduce the number of these computationally heavy operations performed and speed up single timestep (long plasma timescale) simulations. Example

hipace.collisions = <collision_name>
<collision_name>.species = species_1 species_2
<collision_name>.collide_every = 4

@ibranajmudin
ibranajmudin marked this pull request as draft September 17, 2026 12:41
@ibranajmudin
ibranajmudin marked this pull request as ready for review September 17, 2026 12:44
// default Coulomb log is -1, if < 0 (e.g. not specified), will be computed automatically
pp.query("CoulombLog", m_CoulombLog);
// how often the collision operator should be applied - every m_collide_every'th slice
pp.query("collide_every", m_collide_every);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change the name to "collision_period" to make it consistent with the output_period parameter name we use in the diagnostics? Additionally, can you add an entry in the documentation for it here https://github.com/Hi-PACE/hipace/blob/92d3da222f62481e9eacf3207b98aa22fea47b62/docs/source/run/parameters.rst?plain=1#L1457 

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I would be good to add an assert that it is >= 1.

BeamParticleContainer& species1, PlasmaParticleContainer& species2, amrex::Real CoulombLog,
amrex::Real background_density_SI)
{
if (islice%collide_every != 0) {return;}

@AlexanderSinn AlexanderSinn Sep 22, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For Beam Plasma collisions this is a bit tricky. Beam particles usually stay on the same slice between time steps, so with this some won't get any collisions while others would get them every time step. Maybe we should just not allow the use of the parameter for this case. Or do something like (islice + step) % collision_period == 0 or step % collision_period == 0 . dt would also also need to be rescaled for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants