Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 35 additions & 5 deletions docs/source/run/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -500,20 +500,23 @@ When both are specified, the per-species value is used.
the specific ionization energy of each state.
Options are: ``electron``, ``positron``, ``H``, ``D``, ``T``, ``He``, ``Li``, ``Be``, ``B``, ….

* ``<plasma name>.can_ionize`` (`bool`) optional (default `0`)
Whether this plasma can ionize. Can also be set to 1 by specifying ``<plasma name>.ionization_product``.
* ``<plasma name>.can_field_ionize`` (`bool`) optional (default `0`)
Whether this plasma can be ionized by fields, as for example from a driving particle beam.

* ``<plasma name>.can_laser_ionize`` (`bool`) optional (default `<plasma name>.can_ionize`)
* ``<plasma name>.can_laser_ionize`` (`bool`) optional (default `0`)
Whether this plasma can be ionized by a laser.

* ``<plasma name>.can_impact_ionize`` (`bool`) optional (default `0`)
Whether this plasma can be ionized by impact ionization between plasma particles.

* ``<plasma name>.initial_ion_level`` (`int`) optional (default `-1`)
The initial ionization state of the plasma. `0` for neutral gasses.
If set, the plasma charge gets multiplied by this number. If the plasma species is not ionizable,
the initial ionization level is set to 1.

* ``<plasma name>.ionization_product`` (`string`) optional (default "")
Name of the plasma species that contains the new electrons that are produced
when this plasma gets ionized. Only needed if this plasma is ionizable.
when this plasma gets field or laser ionized. Only needed if this plasma is ionizable.

* ``<plasma name> or plasmas.neutralize_background`` (`bool`) optional (default `1`)
Whether to add a neutralizing background of immobile particles of opposite charge.
Expand Down Expand Up @@ -1307,9 +1310,10 @@ WARNING: this module is in development.
HiPACE++ proposes an implementation of [Perez et al., Phys. Plasmas 19, 083104 (2012)], inherited from WarpX,
for collisions between plasma-plasma and beam-plasma.
As collisions depend on the physical density, in normalized units `hipace.background_density_SI` must be specified.
Please note that the impact ionization module is currently under development, and SI units are always required.

* ``hipace.collisions`` (list of `strings`) optional
List of names of binary Coulomb collisions.
List of names of binary elastic Coulomb collisions.
Each will represent collisions between 2 species.

* ``<collision name>.species`` (two `strings`) optional
Expand All @@ -1321,6 +1325,32 @@ As collisions depend on the physical density, in normalized units `hipace.backgr
Coulomb logarithm used for this collision.
If not specified, the Coulomb logarithm is determined from the temperature in each cell.

* ``hipace.impact_ionization`` (list of `strings`) optional
List of names of binary inelastic Coulomb collisions.
Each will represent collisions between 2 plasma species.
Three species must be specified: the projectile, the target (ion or neutral atom), and the product (electron).
Currently only impact ionization between electrons and another species, which might be ions or neutral atoms, is implemented.
Please note that the impact ionization module is currently under development, and SI units are always required.

* ``<impact_name>.type`` (string) optional
Type of impact ionization. Currently, only `electron_impact` is implemented.

* ``<impact name>.projectile`` (string) optional
The name of the projectile species for impact ionization.
The species must be defined according to `Plasma parameters`.

* ``<impact name>.target`` (string) optional
The name of the target species for impact ionization.
The species must be defined according to `Plasma parameters`.

* ``<impact name>.new_electron`` (string) optional
The name of the product species for impact ionization.
The species must be defined according to `Plasma parameters` and should be an electron species.
In electron impacts, initial and newly created electrons can be treated as on single species
simply by using the same name for the projectile and the new electrons.
However, to treat the new electrons as a separate species, a different name can be used.
In that case, the new electrons won't be contributing to further ionizations.

Radiation reaction
^^^^^^^^^^^^^^^^^^

Expand Down
4 changes: 4 additions & 0 deletions src/Hipace.H
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "utils/MultiBuffer.H"
#include "diagnostics/Diagnostic.H"
#include "diagnostics/OpenPMDWriter.H"
#include "particles/collisions/Collision.H"

#include <AMReX_AmrCore.H>
#ifdef AMREX_USE_LINEAR_SOLVERS
Expand Down Expand Up @@ -363,6 +364,9 @@ private:
std::vector<std::string> m_collision_names;
/** Vector of binary collisions */
amrex::Vector< CoulombCollision > m_all_collisions;
/** Impact ionization */
amrex::Vector<std::string> m_impact_names;
amrex::Vector<Collision> m_all_impacts;

void InitDiagnostics (const int step, const amrex::Real time, const bool is_last_step);
void FillFieldDiagnostics (const int current_N_level, int islice);
Expand Down
10 changes: 10 additions & 0 deletions src/Hipace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,12 @@ Hipace::ReadParameters ()
"be specified via 'hipace.background_density_SI'");
}

queryWithParser(pph, "impact_ionization", m_impact_names);
for (int i = 0; i != m_impact_names.size(); ++i) {
m_all_impacts.emplace_back(Collision());
m_all_impacts.back().ReadParameters(m_multi_plasma.m_names, m_impact_names[i]);
}

// external fields applied to the grid
amrex::Array<std::string, 5> field_str = {"0", "0", "0", "0", "0"};
m_use_grid_external_fields = queryWithParser(pph, "grid_external_fields(x,y,z,t)", field_str);
Expand Down Expand Up @@ -844,6 +850,10 @@ Hipace::SolveOneSlice (int islice, int step, bool is_first_step, bool is_last_st
// collisions for plasmas and beams
doCoulombCollision();

for (auto& impact : m_all_impacts) {
impact.doCollision(0, m_slice_geom[0], m_multi_plasma);
}

// get minimum beam uz after push
m_adaptive_time_step.GatherMinUzSlice(m_multi_beam, false);

Expand Down
1 change: 1 addition & 0 deletions src/particles/collisions/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
target_sources(HiPACE
PRIVATE
CoulombCollision.cpp
Collision.cpp
)
74 changes: 74 additions & 0 deletions src/particles/collisions/Collision.H
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#ifndef HIPACE_COLLISION_H_
#define HIPACE_COLLISION_H_

#include "particles/plasma/MultiPlasma.H"

#include <AMReX.H>

#include <string>

/**
* \brief This class handles inelastic Coulomb collisions between 2 plasma species,
* and eventually leads to an ionization event.
*/
class Collision
{
std::string m_projectile_name = "";
std::string m_target_name = "";
std::string m_new_electron_name = "";
std::string m_collision_type = "";
std::string m_physical_element ="";
bool m_has_collision_product = false;
amrex::Gpu::Buffer<amrex::Real> m_binding_energies;
amrex::Gpu::Buffer<amrex::Real> m_ionization_energies;

public:

/** Read parameters from the input file */
void ReadParameters (
const std::vector<std::string>& plasma_species_names,
std::string const collision_name);

/**
* \param[in] lev MR level
* \param[in] geom corresponding geometry object
* \param[in,out] multi_plasma all plasmas
**/
void doCollision (
int lev, const amrex::Geometry& geom,
MultiPlasma& multi_plasma);

/**
* \param[in] lev MR level
* \param[in] geom corresponding geometry object
* \param[in,out] multi_plasma all plasmas
* \param[in] collision_function return if a pair of particles collides
* \param[in] ionizaiton_function initialize product particle
**/
template <class F, class G>
void doCollisionImp (
int lev, const amrex::Geometry& geom,
MultiPlasma& multi_plasma,
F const& collision_function,
G const& ionizaiton_function);

/**
* \param[in] lev MR level
* \param[in] geom corresponding geometry object
* \param[in,out] multi_plasma all plasmas
**/
void doCollisionA (
int lev, const amrex::Geometry& geom,
MultiPlasma& multi_plasma);

/**
* \param[in] lev MR level
* \param[in] geom corresponding geometry object
* \param[in,out] multi_plasma all plasmas
**/
void doCollisionB (
int lev, const amrex::Geometry& geom,
MultiPlasma& multi_plasma);
};

#endif // HIPACE_COLLISION_H_
Loading
Loading