Skip to content

Commit 73e5cd8

Browse files
committed
Merge branch 'ComputationalRadiationPhysics:dev' into Fusion_interSpecies
2 parents 53878c1 + dc2bf77 commit 73e5cd8

File tree

4 files changed

+122
-156
lines changed

4 files changed

+122
-156
lines changed

docs/source/postprocessing/python.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
Python
44
======
55

6-
.. sectionauthor:: Axel Huebl, Klaus Steiniger
6+
.. sectionauthor:: Axel Huebl, Klaus Steiniger, Richard Pausch
7+
8+
If you are familiar with Python and would like to install the Python libraries that come with PIConGPU, please refer to the install instructions in our :doc:`python utilities section <../usage/python_utils>`.
9+
710

811
If you are new to python, get your hands on the tutorials of the following important libraries to get started.
912

@@ -17,7 +20,7 @@ https://mamba.readthedocs.io/en/latest/installation/micromamba-installation.html
1720

1821
and set up a Micromamba environment with the help of this Micromamba environment file
1922

20-
https://gist.github.com/steindev/d19263d41b0964bcecdfb1f47e18a86e
23+
https://gist.github.com/steindev/c1d678375fd0f974f4b9cb1480b3da03
2124

2225
(see documentation within the file).
2326

docs/source/usage/plugins/radiation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ Command line option Description
301301
Default: ``{}`` (no JSON/TOML configuration used)
302302
``--<species>_radiation.distributedAmplitude`` Activate the optional output of distributed amplitudes per MPI rank. in the openPMD output.
303303
Default: ``0`` (deactivated/no additional output)
304-
305-
========================================= ==============================================================================================================================
304+
305+
======================================================== ==============================================================================================================================
306306

307307
Memory Complexity
308308
^^^^^^^^^^^^^^^^^

docs/source/usage/workflows/fusionReactions.rst

Lines changed: 114 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ Overview
99
The PIConGPU Fusion Extension enables Monte Carlo simulation of nuclear fusion reactions between macro-particles based on [Wu2021]_ and [Higginson2019]_. The extension implements fully relativistic binary collision algorithms with local charge and (if possible) mass conservation, producing physically accurate fusion products with proper energy-momentum distributions.
1010

1111
**Use Cases:**
12-
- Inertial confinement fusion (ICF) plasma simulations
13-
- High-energy density physics with fusion heating
14-
- Thermonuclear burn studies in laser-plasma interactions
12+
- Inertial confinement fusion (ICF) plasma simulations
13+
- High-energy density physics with fusion heating
14+
- Thermonuclear burn studies in laser-plasma interactions
1515

1616
**Key Features:**
17-
- Relativistic collision algorithm and cross-section evaluation
18-
- Stoichiometric multiplicity with compile-time weight validation
19-
- Local charge conservation always; local mass conservation when non-degenerate
20-
- Support for multiple simultaneous fusion channels
17+
- Relativistic collision algorithm and cross-section evaluation
18+
- Stoichiometric multiplicity with compile-time weight validation
19+
- Local charge conservation always; local mass conservation when non-degenerate
20+
- Support for multiple simultaneous fusion channels
2121

2222
How to Use the Fusion Extension
2323
===============================
@@ -90,7 +90,7 @@ Configure fusion reactions in ``include/picongpu/param/fusion.param``:
9090

9191
Examples:
9292

93-
- T + T → n + ⁴He (also covers T + T → ⁴He + 2n): it suffices to write
93+
- T + T → ⁴He + 2n: it suffices to write
9494

9595
.. code-block:: cpp
9696
@@ -154,23 +154,21 @@ Configure fusion reactions in ``include/picongpu/param/fusion.param``:
154154
155155
.. note:: Fusion production multiplier (Fmult)
156156

157+
Increasing ``maxFmult`` allows more, lighter products to be created, down to the ``productMinWeighting`` threshold. Decreasing ``maxFmult`` results in fewer, heavier products.
157158
``Fmult`` controls how the consumed reactant weight (the minimum of the two reactant weights in a pair) is split into multiple product macro-particles while keeping total weight conserved.
158159

159160
Algorithm (per fused pair):
160161

161162
- Start with ``Fmult = maxFmult``
162163
- Compute ``productWeighting = minWeighting / Fmult``
163164
- If ``productWeighting < productMinWeighting``, reduce ``Fmult`` to ``max(1, minWeighting / productMinWeighting)`` and recompute ``productWeighting``
164-
- Guarantees: ``productWeighting ≥ productMinWeighting`` and ``Fmult ≥ 1`` while conserving the total produced weight ``minWeighting``
165165

166-
Increasing ``maxFmult`` allows more, lighter products to be created, down to the ``productMinWeighting`` threshold. Decreasing ``maxFmult`` results in fewer, heavier products.
167-
168166
The base ``productWeighting`` is then distributed across the two reactant sites and product species using the site fractions ``W₁…W₄`` (see Particle Creation Algorithm). In symmetric cases this often results in roughly half of a species' weight at each reactant site.
169167

170168
**Parameter Guidelines:**
171-
- ``productMinWeighting``: Minimum allowed weight per two created product macro-particles; 16 let's the particle split in half 4 times before hitting the threshold. (see: ''Fusion Particle Creation Algorithm'')
172-
- ``maxFmult``: Upper bound for how many product macroparticles can be spawned per fused pair; higher values allow more (lighter) products down to ``productMinWeighting``.
173-
- ``cellListChunkSize``: Use ``TYPICAL_PARTICLES_PER_CELL`` for optimal memory usage.
169+
- ``productMinWeighting``: Minimum allowed weight per two created product macro-particles; 16 let's the particle split in half 4 times before beeing less than 1. (see: ''Fusion Particle Creation Algorithm'')
170+
- ``maxFmult``: Upper bound for how many product macroparticles can be spawned per fused pair; higher values allow more (lighter) products down to ``productMinWeighting``. Usually 10~100 times less than typical particle weighting.
171+
- ``cellListChunkSize``: Use ``TYPICAL_PARTICLES_PER_CELL`` for optimal memory usage.
174172

175173
Fusion Particle Creation Algorithm
176174
==================================
@@ -188,19 +186,19 @@ Problem Definition
188186
The Fusion algorithm determines the amount of fuel (reactants) to consume in the fusion process. This fuel has an associated weight W_p that represents the total weight of products (of each species) to be created. The fractional weights W₁, W₂, W₃, W₄ are then multiplied by W_p to determine the actual weights of the outgoing particles.
189187

190188
**Parameter Definitions:**
191-
- q₁ = charge of reactant 1
192-
- q₂ = charge of reactant 2
193-
- q₃ = charge of product species 1
194-
- q₄ = charge of product species 2
195-
- m₁ = mass of reactant 1
196-
- m₂ = mass of reactant 2
197-
- m₃ = mass of product species 1
198-
- m₄ = mass of product species 2
199-
- W_p = total weight of products (fuel consumption amount)
189+
- q₁ = charge of reactant 1
190+
- q₂ = charge of reactant 2
191+
- q₃ = charge of product species 1
192+
- q₄ = charge of product species 2
193+
- m₁ = mass of reactant 1
194+
- m₂ = mass of reactant 2
195+
- m₃ = mass of product species 1
196+
- m₄ = mass of product species 2
197+
- W_p = total weight of products (fuel consumption amount)
200198

201199
**Output:** Four product particles with final weights W₁×W_p, W₂×W_p, W₃×W_p, W₄×W_p
202-
- Product species 1: weights W₁×W_p at reactant 1 position, W₃×W_p at reactant 2 position
203-
- Product species 2: weights W₂×W_p at reactant 1 position, W₄×W_p at reactant 2 position
200+
- Product species 1: weights W₁×W_p at reactant 1 position, W₃×W_p at reactant 2 position
201+
- Product species 2: weights W₂×W_p at reactant 1 position, W₄×W_p at reactant 2 position
204202

205203
Stoichiometric Multiplicity Limits and Invariants
206204
----------------------------------
@@ -224,10 +222,10 @@ We derive compile-time multiplicity limits (c₃, c₄) from species charges (Z)
224222
c_3 = c_4 = \frac{m_1{+}m_2}{m_3{+}m_4}\quad (\text{if } q_3{+}q_4 \approx 0)
225223
226224
With multiplicity limits, the invariants are:
227-
- Weight bounds: 0 ≤ Wᵢ ≤ cᵢ (i ∈ {product 1, product 2} per site)
228-
- Weight conservation: W₁ + W₃ = c₃, W₂ + W₄ = c₄
229-
- Local charge: q₁ = W₁q₃ + W₂q₄ and q₂ = W₃q₃ + W₄q₄
230-
- Local mass (when Algorithm 1 is valid): m₁ = W₁m₃ + W₂m₄ and m₂ = W₃m₃ + W₄m₄
225+
- Weight bounds: 0 ≤ Wᵢ ≤ cᵢ (i ∈ {product 1, product 2} per site)
226+
- Weight conservation: W₁ + W₃ = c₃, W₂ + W₄ = c₄
227+
- Local charge: q₁ = W₁q₃ + W₂q₄ and q₂ = W₃q₃ + W₄q₄
228+
- Local mass (when Algorithm 1 is valid): m₁ = W₁m₃ + W₂m₄ and m₂ = W₃m₃ + W₄m₄
231229

232230
Algorithm Implementation
233231
-----------------------------
@@ -261,7 +259,7 @@ Algorithm 1 is considered failed when:
261259

262260
Implementation Details
263261
---------------------
264-
262+
In `include/picongpu/particles/fusion/detail/Creation.hpp`
265263
Both algorithms are evaluated at **compile time** using constexpr functions:
266264

267265
- ``computeStoichiometryCaps()``: derives (c₃, c₄) from species
@@ -278,7 +276,7 @@ Fusion Extension Architecture
278276

279277
The fusion extension follows this execution flow::
280278

281-
simulation.hpp → Fusion.x.cpp → Collider.hpp → WithPeer.hpp → InterCollision.hpp
279+
simulation.hpp → Fusion.x.cpp → Collider.hpp → WithPeer.hpp
282280
└─ IntraCollision.hpp
283281

284282
**Core Components:**
@@ -298,139 +296,99 @@ The fusion extension follows this execution flow::
298296
Main Physical Algorithms
299297
========================
300298

301-
1. Fusion Process - Binary Particle Collisions
302-
-----------------------------------------------
299+
Algorithmic Overview (per cell)
300+
--------------------------------
303301

304-
**Physical Model:** Two reactant macro-particles undergo fusion, producing up to 4 product macro-particles
305-
- Reactant selection within computational cells
306-
- Energy-dependent fusion probability: σ(E) using empirical fits
307-
- Statistical weighting to handle macro-particle representation
302+
.. code-block:: text
308303
309-
2. Particle Creation Algorithm
310-
------------------------------
304+
1) Randomly pair reactants in the cell (Takizuka–Abe)
305+
2) Compute relativistic kinematics and sample fusion (Cannoni)
306+
3) Create product macroparticles with local conservation (new)
311307
312-
**Physical Model:** Local charge (and when possible local mass) conservation during particle creation under stoichiometric caps
308+
Each stage is summarized below with references and links to implementation.
313309

314-
**Algorithm 1 - Mass-Charge (under caps):**
315-
2×2 local solve for W₁,W₂; set W₃,W₄ from caps; accept if caps and site-2 checks pass
310+
1. Binary Pairing of Reactants (Takizuka–Abe, 1977)
311+
---------------------------------------------------
316312

317-
**Algorithm 2 - Charge-Only (under caps):**
318-
Neutral-aware, macro-minimizing case analysis; always respects caps and local charge
313+
Physical idea
314+
Within each cell we form unbiased binary encounters by random pairing of two reactant lists following Takizuka–Abe [Takizuka1977]_. If the lists have different sizes, particles from the shorter list are deterministically reused so that all particles participate; see :ref:`model-binaryCollisions::details:duplication` for details. For a broader description of the pairing algorithm, see :ref:`model-binaryCollisions`.
319315

320-
**Key Physics:**
321-
- Local charge conservation: q₁ = W₁q₃ + W₂q₄, q₂ = W₃q₃ + W₄q₄
322-
- Cap constraints: 0 ≤ Wᵢ ≤ cᵢ, W₁ + W₃ = c₃, W₂ + W₄ = c₄
323-
- Local mass conservation when Algorithm 1 is valid
316+
Algorithm (per cell)
317+
- Build two filtered lists A and B of reactant indices (intra-collision: A=B; inter-collision: A≠B).
318+
- Apply random permutations to the longer list.
319+
- Pair i-th entries up to N_p = min(|A|, |B|): pairs (A[i], B[i]).
320+
- If |A| ≠ |B|, handle duplicates of the shorter list so each long-list entry has a partner (The weight of a particle from the shorter list is divided; see implementation note below).
324321

325-
3. Relativistic Framework
326-
-------------------------
322+
Implementation
323+
- Shuffling and pairing are performed by the collision kernels: ``particles/fusion/InterCollision.hpp`` and ``IntraCollision.hpp``.
324+
- Deterministic duplication for |A|≠|B|: ``duplicationCorrection()``; randomized ordering via ``detail::shuffle``.
325+
- Number-density weighting used later is computed per cell to keep correct rates under unequal weights and counts.
327326

328-
**Physical Model:** Fully relativistic treatment using Lorentz invariants
327+
2. Relativistic Kinematics and Fusion Sampling (Cannoni, 2016)
328+
--------------------------------------------------------------
329329

330-
**Implementation in ``FusionAlgorithm.hpp``:**
330+
Physical model
331+
For each candidate pair we compute kinematics using Lorentz-invariant quantities to avoid loss of precision at high γ, following Cannoni’s formulation of invariant relative velocity [Cannoni2016]_. We adopt the metric signature (+, −, −, −) and four-momentum convention :math:`p_i^\mu = (E_i/c, \vec{p}_i)`.
331332

332-
**Mandelstam Variable Approach:**
333-
[Cannoni2016]_
334-
- Uses Lorentz invariant s = E²_total - (pc)² instead of double transformations
335-
- Avoids numerical errors in highly relativistic regime
336-
- Calculates relative velocity through invariant: γᵣ = (s - m₁²c⁴ - m₂²c⁴)/(2m₁m₂c⁴)
333+
Key kinematic invariants (computed from lab-frame inputs)
334+
- Total four-momentum: :math:`P^\mu = p_1^\mu + p_2^\mu = (E_{\mathrm{tot}}/c, \vec{p}_{\mathrm{tot}})`.
335+
- Mandelstam s (energy-squared invariant):
337336

338-
**Lorentz Transformations:**
339-
- Lab frame → Center-of-mass frame for isotropic product generation
340-
- CM frame → Lab frame for final product momenta
341-
- Boost formulas: **p**_lab = **p**_cm + [(**V**_cm·**p**_cm)γ_cm/(γ_cm+1) + γ_cm E_cm/c]**V**_cm/c
337+
.. math::
342338
343-
**Key Physics:**
344-
- Energy-momentum conservation in all reference frames
345-
- Relativistic energy: E = √[(pc)² + (mc²)²]
346-
- Isotropic angular distribution in CM frame
339+
s \;:=\; c^2 P^\mu P_\mu
340+
\,=\, E_{\mathrm{tot}}^2 - |\vec{p}_{\mathrm{tot}}|^2 c^2 \,=\, (p_1^\mu + p_2^\mu)^2 c^2.
347341
348-
Common Fusion Reaction Examples
349-
--------------------------------
342+
- Center-of-mass (CM) energy and velocity:
343+
344+
.. math::
345+
346+
E_{\mathrm{cm}} = \sqrt{s},\quad
347+
\vec{V}_{\mathrm{cm}} = \frac{c^2\,\vec{p}_{\mathrm{tot}}}{E_{\mathrm{tot}}},\quad
348+
\gamma_{\mathrm{cm}} = \left(1- \frac{|\vec{V}_{\mathrm{cm}}|^2}{c^2}\right)^{-1/2}.
349+
350+
- Relative Lorentz factor (Cannoni):
351+
352+
.. math::
353+
354+
\gamma_r \,=\, \frac{s - m_1^2 c^4 - m_2^2 c^4}{2 m_1 m_2 c^4}, \qquad
355+
|v_{\mathrm{rel}}| \,=\, c\,\sqrt{1 - \gamma_r^{-2}}.
356+
357+
Associated Møller (invariant) relative speed (used for rates):
358+
359+
.. math::
360+
361+
v_{M} \,=\, |v_{\mathrm{rel}}|\,\gamma_{\mathrm{cm}}.
362+
363+
Fusion probability and sampling
364+
- The microscopic cross section functor :math:`\sigma(E_{\mathrm{cm}})` (e.g., Bosch–Hale) is evaluated at the pair’s CM energy :math:`\sqrt{s}`.
365+
- Over a timestep :math:`\Delta t`, the acceptance probability scales as
366+
367+
.. math::
368+
369+
P \;\propto\; \sigma(E_{\mathrm{cm}})\, v_M\, \Delta t
370+
371+
where the factors account for unequal list sizes, macro-weights, and multiplicity splitting and are computed in the collision kernel.
372+
- On acceptance, sample an isotropic direction in the CM frame; compute product total energies
373+
374+
.. math::
375+
376+
E_{3,\mathrm{cm}} = \frac{s + (m_3^2 - m_4^2)c^4}{2\,\sqrt{s}}, \qquad
377+
E_{4,\mathrm{cm}} = E_{\mathrm{cm}} - E_{3,\mathrm{cm}},
378+
379+
and the common CM momentum magnitude from :math:`E^2 = p^2 c^2 + m^2 c^4`.\
380+
Notation (CM frame). Let :math:`\vec{P}_1` denote the three-momentum of product 1 and :math:`\vec{P}_2` that of product 2, then:
381+
382+
.. math::
383+
384+
\vec{P}_1 = -\vec{P}_2,\qquad |\vec{P}_1| = |\vec{P}_2| = \frac{\sqrt{E_{3,\mathrm{cm}}^2 - m_3^2 c^4}}{c} = \frac{\sqrt{E_{4,\mathrm{cm}}^2 - m_4^2 c^4}}{c}.
385+
386+
Finally, boost both product four-momenta back to the lab frame with :math:`\vec{V}_{\mathrm{cm}}`.
387+
388+
Implementation
389+
- Accumulators and boosts: ``particles/fusion/relativistic/FusionAlgorithm.hpp`` (``acc::Variables`` and ``FusionAlg::fuse``).
390+
- Unit conversions (e.g., eV/keV, millibarn→area) are handled internally before σ and P are evaluated.
350391

351-
.. list-table:: Weight Assignments for Common Fusion Reactions (under multiplicity limits)
352-
:header-rows: 1
353-
:widths: 25 20 10 10 10 10
354-
355-
* - Reaction
356-
- Charges (q₁,q₂,q₃,q₄)
357-
- W₁
358-
- W₂
359-
- W₃
360-
- W₄
361-
* - D + T → ⁴He + n
362-
- (1,1,2,0)
363-
- 0.5
364-
- 0
365-
- 0.5
366-
- 1
367-
* - D + D → T + p
368-
- (1,1,1,1)
369-
- 0.5
370-
- 0.5
371-
- 0.5
372-
- 0.5
373-
* - D + D → ³He + n
374-
- (1,1,2,0)
375-
- 0.5
376-
- 0.5
377-
- 0.5
378-
- 0.5
379-
* - ³He + D → ⁴He + p
380-
- (2,1,2,1)
381-
- 0.5
382-
- 1
383-
- 0.5
384-
- 0
385-
* - ³He + T → ⁴He + D
386-
- (2,1,2,1)
387-
- 1
388-
- 0
389-
- 0
390-
- 1
391-
* - T + T → ⁴He + 2n
392-
- (1,1,2,0)
393-
- 0.5
394-
- 1
395-
- 0.5
396-
- 1
397-
* - ³He + ³He → ⁴He + 2p
398-
- (2,2,2,1)
399-
- 0.5
400-
- 1
401-
- 0.5
402-
- 1
403-
* - p + ⁶Li → ³He + ⁴He
404-
- (1,3,2,2)
405-
- 0.5
406-
- 0
407-
- 0.5
408-
- 1
409-
* - D + ⁶Li → ⁴He + ⁴He
410-
- (1,3,2,2)
411-
- 0.5
412-
- 0
413-
- 0.5
414-
- 1
415-
* - p + ⁷Li → ⁴He + ⁴He
416-
- (1,3,2,2)
417-
- 0.5
418-
- 0
419-
- 0.5
420-
- 1
421-
* - p + ¹¹B → 3×⁴He
422-
- (1,5,2,2)
423-
- 0.5
424-
- 0
425-
- 1
426-
- 1.5
427-
428-
**Weight Interpretation:**
429-
- W₁, W₃: weights of product 1 at reactant positions 1, 2
430-
- W₂, W₄: weights of product 2 at reactant positions 1, 2
431-
- Multiplicity limits can be fractional and > 1; weights may exceed 1 accordingly
432-
- If Algorithm 1 is valid, neutrals can split across sites (mass+charge enforced)
433-
- Otherwise, Algorithm 2 minimizes the number of neutral macroparticles (all neutrals at one site)
434392

435393
References
436394
----------
@@ -452,3 +410,9 @@ References
452410
*Lorentz invariant relative velocity and relativistic binary collisions.*
453411
arXiv:1605.00569 [hep-ph] (2016).
454412
https://arxiv.org/abs/1605.00569v2
413+
414+
.. [Takizuka1977]
415+
T. Takizuka and H. Abe.
416+
*A binary collision model for plasma simulation with a particle code.*
417+
Journal of Computational Physics 25(3), 205–219 (1977).
418+
https://doi.org/10.1016/0021-9991(77)90099-7

include/picongpu/particles/fusion/relativistic/FusionAlgorithm.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,7 @@ namespace picongpu::particles::fusion::relativistic
170170
}
171171

172172
// Relativistic formula for the TOTAL energy of product 0 in the CM frame
173-
float_COLL const E_p0_tot_cm
174-
= (E_cm_tot * E_cm_tot + (mP0 * mP0 - mP1 * mP1) * c4) / (2.0_COLL * E_cm_tot);
173+
float_COLL const E_p0_tot_cm = (E_cm_tot_sq + (mP0 * mP0 - mP1 * mP1) * c4) / (2.0_COLL * E_cm_tot);
175174
// TOTAL energy of product 1
176175
float_COLL const E_p1_tot_cm = E_cm_tot - E_p0_tot_cm;
177176

0 commit comments

Comments
 (0)