picongpu icon indicating copy to clipboard operation
picongpu copied to clipboard

[PICMI] Add ionization model configuration support

Open BrianMarre opened this issue 1 year ago • 10 comments

adds the ability to configure ionization model interactions in the PIConGPU-PICMI interface.

replaces PR #4985

  • [x] update documentation
  • [x] add LWFA PICMI script as user example
  • [x] add Test for Ionization configuration
  • [ ] verify correct rendering of LWFA with Richard

also fixes a bug in the initialization configuration of the boundElectrons attribute, noticed in the refactoring of the SetBoundElectrons Operation, renamed in this PR to SetChargeState.

BrianMarre avatar Jul 25 '24 18:07 BrianMarre

I reviewed the contents for PICMI collisional ionization.

mafshari64 avatar Jul 31 '24 10:07 mafshari64

Just for the record: @PrometheusPi takes over the merge after verifying that the rendered input files look correct.

chillenzer avatar Aug 08 '24 13:08 chillenzer

The tbg issue is not caused by the pull request but a general bug in PIConGPU right now: #5026 Thus, I removed my "changes required".

PrometheusPi avatar Aug 13 '24 14:08 PrometheusPi

I looked into the pngs at iteration 3520, and they differ (not only in color) but in where the elecrons ae created: dev: grafik

picmi: grafik

PrometheusPi avatar Aug 19 '24 13:08 PrometheusPi

In contrast to a previous (now corrected) post, I do not belief that the error is with PIConGPU dev case 2, but with picmi.

The PICMI setup states:

ENABLE_IONS = True
ENABLE_IONIZATION = True

But, while there are ions included, according to the macro particle counter, electrons are initially present which should not be the case for the ENABLE_IONIZATION = True (as long as the laser in not there):

grafik

PrometheusPi avatar Aug 19 '24 14:08 PrometheusPi

The example mistakenly always added electrons even if ionization was activated. Fixed

BrianMarre avatar Aug 19 '24 14:08 BrianMarre

@BrianMarre You last commit now causes an error when running the script:

$ python lwfa_picmi_setup2.py
Traceback (most recent call last):
  File "/...//_pr_5007/lwfa_picmi_setup2.py", line 204, in <module>
    sim.write_input_file(OUTPUT_DIRECTORY_PATH)
  File "/...//_pr_5007/picongpu/lib/python/picongpu/picmi/simulation.py", line 394, in write_input_file
    pypicongpu_simulation = self.get_as_pypicongpu()
  File "/...//_pr_5007/picongpu/lib/python/picongpu/picmi/simulation.py", line 458, in get_as_pypicongpu
    s.init_manager = self.__get_init_manager()
  File "/...//_pr_5007/picongpu/lib/python/picongpu/picmi/simulation.py", line 361, in __get_init_manager
    self.__fill_in_ionization_electrons(pypicongpu_by_picmi_species, ionization_model_conversion_by_species)
  File "/...//_pr_5007/picongpu/lib/python/picongpu/picmi/simulation.py", line 339, in __fill_in_ionization_electrons
    self.picongpu_interaction.fill_in_ionization_electron_species(
  File "/...//_pr_5007/picongpu/lib/python/picongpu/picmi/interaction/interaction.py", line 126, in fill_in_ionization_electron_species
    pypicongpu_ionization_electron_species = pypicongpu_by_picmi_species[
KeyError: <picongpu.picmi.species.Species object at 0x2aaab29bbd90>

PrometheusPi avatar Aug 19 '24 15:08 PrometheusPi

@PrometheusPi forgot to add a non placed electron species in the enable ionization case, fixed the example script and improved the error message printed to the user to make the error easier to understand.

BrianMarre avatar Aug 21 '24 08:08 BrianMarre

Your second change fixed the setup.

PrometheusPi avatar Aug 21 '24 10:08 PrometheusPi

One CI job failed to acess the github repository, @PrometheusPi coulde you please restart it?

BrianMarre avatar Aug 23 '24 12:08 BrianMarre

@BrianMarre @PrometheusPi What's the status of this?

chillenzer avatar Sep 10 '24 13:09 chillenzer

Richard is still in the process of doing an intial review, then I will split up the PR in several independent PRs. At least that is the current plan

BrianMarre avatar Sep 10 '24 15:09 BrianMarre

Thanks for the update. I'll keep quiet then.

chillenzer avatar Sep 10 '24 16:09 chillenzer

Well ... since you ask, you could take over part of the review. ;)

BrianMarre avatar Sep 10 '24 16:09 BrianMarre

I set this PR to draft that it not get merged see: https://github.com/ComputationalRadiationPhysics/picongpu/pull/5007#issuecomment-2341357981

psychocoderHPC avatar Sep 10 '24 20:09 psychocoderHPC

rebased PR against current dev

BrianMarre avatar Sep 11 '24 08:09 BrianMarre

FYI: do to the sheer size of this PR, I just took a brief look at the later files as I already saw that his needs to be splitt up anyway.

PrometheusPi avatar Sep 24 '24 11:09 PrometheusPi

Rebased to the current dev,

All reviewer comment changes are in last commit for easier review of last changes.

BrianMarre avatar Sep 24 '24 15:09 BrianMarre

Switched from pdg to particle due to pdg using the distutils removed with python 3.12 causing installs of pdg to fail

BrianMarre avatar Sep 27 '24 10:09 BrianMarre

@psychocoderHPC please restart the Ci jobs, the failed due to an un specified timeout without an error log

BrianMarre avatar Sep 29 '24 13:09 BrianMarre