Skip to content

Commit 29537ad

Browse files
committed
Merge branch 'develop' into smilei_Poisson_AM
2 parents ed13e08 + 058a59c commit 29537ad

File tree

5 files changed

+345
-415
lines changed

5 files changed

+345
-415
lines changed

doc/Sphinx/namelist.rst

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,8 +1034,9 @@ Each particle injector has to be defined in a ``ParticleInjector`` block::
10341034
Particle Merging
10351035
^^^^^^^^^^^^^^^^
10361036

1037-
The macro-particle merging method is documented in the :doc:`corresponding page <particle_merging>`.
1038-
It is defined in the ``Species`` block::
1037+
The macro-particle merging method is documented in
1038+
the :doc:`corresponding page <particle_merging>`.
1039+
It is optionnally specified in the ``Species`` block::
10391040

10401041
Species(
10411042
....
@@ -1055,19 +1056,20 @@ It is defined in the ``Species`` block::
10551056

10561057
.. py:data:: merging_method
10571058
1058-
:default: ``None``
1059+
:default: ``"none"``
10591060

10601061
The particle merging method to use:
10611062

1062-
* ``none``: the merging process is not activated
1063-
* ``vranic_cartesian``: merging process using the method of M. Vranic with a cartesian momentum space decomposition
1064-
* ``vranic_spherical``: merging process using the method of M. Vranic with a spherical momentum space decomposition
1063+
* ``"none"``: no merging
1064+
* ``"vranic_cartesian"``: method of M. Vranic with a cartesian momentum-space decomposition
1065+
* ``"vranic_spherical"``: method of M. Vranic with a spherical momentum-space decomposition
10651066

10661067
.. py:data:: merge_every
10671068
10681069
:default: ``0``
10691070

1070-
The particle merging time selection (:ref:`time selection <TimeSelections>`).
1071+
Number of timesteps between each merging event
1072+
**or** a :ref:`time selection <TimeSelections>`.
10711073

10721074
.. py:data:: min_particles_per_cell
10731075
@@ -1091,38 +1093,38 @@ It is defined in the ``Species`` block::
10911093
10921094
:default: ``[16,16,16]``
10931095

1094-
The momentum space discretization.
1096+
A list of 3 integers defining the number of sub-groups in each direction
1097+
for the momentum-space discretization.
10951098

10961099
.. py:data:: merge_discretization_scale
10971100
1098-
:default: ``linear``
1101+
:default: ``"linear"``
10991102

1100-
The momentum discretization scale. The scale can be ``linear`` or ``log``.
1101-
The ``log`` scale only works with the spherical discretization for the moment.
1102-
In logarithmic scale, Smilei needs a minimum momentum value to avoid 0.
1103-
This value is provided by the parameter ``merge_min_momentum``.
1104-
By default, this value is set to :math:`10^{-5}`.
1103+
The momentum discretization scale:: ``"linear"`` or ``"log"``.
1104+
The ``"log"`` scale only works with the spherical discretization at the moment.
11051105

11061106
.. py:data:: merge_min_momentum
11071107
11081108
:default: ``1e-5``
11091109

1110-
:red:`[for experts]` The minimum momentum value when the log scale is chosen (``merge_discretization_scale = log``).
1111-
To set a minimum value is compulsory to avoid the potential 0 value in the log domain.
1110+
:red:`[for experts]` The minimum momentum value when the log scale
1111+
is chosen (``merge_discretization_scale = log``).
1112+
This avoids a potential 0 value in the log domain.
11121113

11131114
.. py:data:: merge_min_momentum_cell_length
11141115
11151116
:default: ``[1e-10,1e-10,1e-10]``
11161117

1117-
:red:`[for experts]` The minimum momentum cell length for the discretization.
1118-
If the specified discretization induces smaller momentum cell length,
1119-
then the number of momentum cell (momentum cell size) is set to 1 in this direction.
1118+
:red:`[for experts]` The minimum sub-group length for the momentum-space
1119+
discretization (below which the number of sub-groups is set to 1).
11201120

11211121
.. py:data:: merge_accumulation_correction
11221122
11231123
:default: ``True``
11241124

1125-
:red:`[for experts]` Activation of the accumulation correction (see :ref:`vranic_accululation_effect` for more information). The correction only works in linear scale.
1125+
:red:`[for experts]` Activates the accumulation correction
1126+
(see :ref:`vranic_accululation_effect` for more information).
1127+
The correction only works in linear scale.
11261128

11271129

11281130

doc/Sphinx/particle_injector.rst

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,42 @@
11
Particle Injector
22
================================================================================
33

4-
Particle injectors enable to inject continuously a flow of fresh macro-particles from the boundaries
5-
into the simulation domain.
4+
Particle injectors provide a continuous flow of fresh
5+
macro-particles from the boundaries into the simulation domain.
66

7-
1. Understand the method implemented in Smilei
8-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7+
----
98

10-
In the PIC loop structure, the particle injection is located at the end of the process
11-
after the current and charge projection. It is in the third part of the PIc structure after
12-
the particle sorting and exchange finalization.
13-
14-
Injected macro-particles therefore do not contribute to the current and fields of the current iteration
15-
but they are taken into account in the diagnostics.
9+
The method implemented in Smilei
10+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1611

17-
The method implemented in Smilei in schematically shown in :ref:`fig_particle_injector`.
12+
In the PIC loop structure, the particle injection occurs
13+
after current projection on the grid, particle sorting and synchronizations.
14+
Injected macro-particles therefore do not contribute to the current and fields
15+
of the current iteration but they are taken into account in the diagnostics.
1816

1917
.. _fig_particle_injector:
2018

2119
.. figure:: _static/figures/particle_injector.png
2220
:width: 100%
2321

24-
Description of the particle injection method.
25-
26-
For each patch near the boundaries, macro-particles for injectors are first initialized behind domain boundaries.
27-
For the moment, momentum initialization is limited to Maxwellian distributions with a derive.
28-
Macro-particles are pushed using their momentum of a time step :math:`\Delta t` without fields.
29-
Macro-particles that stay behind the domain boundary (due to their momentum direction or because they did not
30-
cross the boundary during this artificial timestep) are not taken into account and removed.
31-
Macro-particles in the domain are kept and considered injected.
32-
They are put in the patch list of macro-particles for the next timestep.
33-
34-
2. Recommendation
35-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3622

37-
- Although the code can inject a single species, we recommend to use injectors to inject neutral plasmas. This means that positive and negative species should be simultaneously injected at the same boundary. To strengthen neutrality, species can be created at the same position.
23+
----
3824

39-
3. Implementation
25+
Recommendation
4026
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4127

42-
The particle injector algorithm is coded in the file `Patch/VectorPatch.cpp` in the function `injectParticlesFromBoundaries`.
28+
* Although a single species may be injected, we recommend to inject both
29+
positively and negatively charged species at the same time to ensure
30+
a neutral plasma. To strengthen neutrality, species may be created at
31+
the same positions.
32+
33+
----
34+
35+
Implementation
36+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4337

44-
The class `ParticleInjector` enables to manage the different injector parameters and properties.
38+
The particle injector algorithm is coded in the file
39+
``Patch/VectorPatch.cpp`` in the function ``injectParticlesFromBoundaries``.
4540

46-
Particle injectors use the class `ParticleCreator` to initialize the macro-particles.
41+
The class ``ParticleInjector`` manages the injector's parameters and properties,
42+
while new macro-particles are initialized using the class ``ParticleCreator``.

0 commit comments

Comments
 (0)