Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collisions #715

Open
4 of 6 tasks
MaxThevenet opened this issue Mar 16, 2022 · 2 comments
Open
4 of 6 tasks

Collisions #715

MaxThevenet opened this issue Mar 16, 2022 · 2 comments
Labels
component: plasma About the plasma species

Comments

@MaxThevenet
Copy link
Member

MaxThevenet commented Mar 16, 2022

Here are remaining tests/tasks for the collision module (see PR #676), in order of priorities:

  • Inter-species 1: electrons and (heavy, so immobile) protons (species have opposite charges)
  • Inter-species 2: electrons and (light, so mobile) positrons
  • Inter-species 3: electrons and heavier ions (e.g. Helium)
  • Normalized units
  • Fix dt for relativistic collisions (probably doesn't matter)
  • Enable tiling & openMP on CPU
@MaxThevenet MaxThevenet added bug Something isn't working component: plasma About the plasma species labels Mar 16, 2022
@MaxThevenet
Copy link
Member Author

For normalized units:
This script with this input file can be used to run simulations w/ w/o collisions in SI/normalized units. The analysis can be done with

import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
import scipy.constants as scc
from openpmd_viewer import OpenPMDTimeSeries

tsh1 = OpenPMDTimeSeries('/p/scratch/plasmabbq/maxence/hipace_collisions/hipace_normalized/nocoll_diags')
tsh2 = OpenPMDTimeSeries('/p/scratch/plasmabbq/maxence/hipace_collisions/hipace_normalized/coll_diags')
tsh3 = OpenPMDTimeSeries('/p/scratch/plasmabbq/maxence/hipace_collisions/hipace_normalized/nocoll_diags_SI')
tsh4 = OpenPMDTimeSeries('/p/scratch/plasmabbq/maxence/hipace_collisions/hipace_normalized/coll_diags_SI')

it1 = 1000
kp_inv = 10.e-6
efac = scc.e*kp_inv/(scc.m_e*scc.c**2)

iteration = 0
Fh1, mh1 = tsh1.get_field(iteration=iteration, field='Ez')
Fh2, mh2 = tsh2.get_field(iteration=iteration, field='Ez')
Fh3, mh3 = tsh3.get_field(iteration=iteration, field='Ez')
Fh4, mh4 = tsh4.get_field(iteration=iteration, field='Ez')

clim = (-1.e6, 1.e6)
clim0 = (-1.e9,1.e9) # (-1.e11, 1.e11) # (-1.e9,1.e9)

plt.figure(figsize=(10,6))
plt.subplot(231)
plt.imshow(Fh1/efac, aspect='auto')
plt.clim(clim0)
plt.colorbar()
plt.title('HiPACE++ no collisions')
plt.xlabel('x')
plt.ylabel('z')
plt.subplot(232)
plt.imshow(Fh2/efac, aspect='auto')
plt.colorbar()
plt.xlabel('x')
plt.ylabel('z')
plt.clim(clim0)
plt.title('HiPACE++ collisions')
plt.subplot(233)
plt.imshow(Fh2/efac-Fh1/efac, aspect='auto')
plt.colorbar()
# plt.clim(clim)
plt.xlabel('x')
plt.ylabel('z')
plt.title('difference')
plt.subplot(234)
plt.imshow(Fh3, aspect='auto')
plt.clim(clim0)
plt.colorbar()
plt.title('HiPACE++ no collisions')
plt.xlabel('x')
plt.ylabel('z')
plt.subplot(235)
plt.imshow(Fh4, aspect='auto')
plt.colorbar()
plt.xlabel('x')
plt.ylabel('z')
plt.clim(clim0)
plt.title('HiPACE++ collisions')
plt.subplot(236)
plt.imshow(Fh4-Fh3, aspect='auto')
plt.colorbar()
plt.clim(clim)
plt.xlabel('x')
plt.ylabel('z')
plt.title('difference')
plt.tight_layout()

@SeverinDiederichs SeverinDiederichs removed the bug Something isn't working label Jun 6, 2023
@SeverinDiederichs
Copy link
Member

SeverinDiederichs commented Jun 6, 2023

Collisions in normalized units were enabled in #962.

With the fix of #967 and using plasma insitu-diagnostics, inter-species collisions were tested. Note that to avoid numerical noise etc and just test the collision module, the field solver was commented out. Using the following inputs script and testing vs analytical theory as done in the smilei documentation the following result was obtained for collisions between electrons and light ions (H+ with a mass 10*m_e):

thermalization

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: plasma About the plasma species
Projects
None yet
Development

No branches or pull requests

2 participants