Skip to content

Commit e1e5543

Browse files
author
optolowicz1
committed
Clean up fusion.param and improve documentation
- Remove all verbose comments and examples from fusion.param - Move complete D-T fusion example to documentation
1 parent d3ad252 commit e1e5543

File tree

3 files changed

+53
-144
lines changed

3 files changed

+53
-144
lines changed

docs/source/usage/workflows/fusionReactions.rst

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,56 @@ Configure fusion reactions in ``include/picongpu/param/fusion.param``.
8383
8484
using products = pmacc::mp_list<Pair<PIC_He4, PIC_He4>>;
8585
86+
Complete Example: D-T Fusion Reaction
87+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
88+
89+
Here is a complete example for the Deuterium-Tritium fusion reaction (D + T → n + He⁴).
90+
This is the easiest fusion reaction to achieve and is commonly used in fusion energy research.
91+
92+
The cross-section parameters are based on the Bosch-Hale parameterization from experimental data
93+
(Source: https://hdl.handle.net/11858/00-001M-0000-0027-6535-1, page 29).
94+
95+
.. code-block:: cpp
96+
97+
struct DT
98+
{
99+
//! Reactant species: Deuterium and Tritium
100+
using reactants = pmacc::mp_list<Pair<PIC_Tritons, PIC_Deuterons>>;
101+
102+
//! Filter for reactants (mandatory for ColliderFromStruct)
103+
//! Use filter::All to include all particles, or define custom filters
104+
using FilterPair = OneFilter<filter::All>;
105+
106+
//! Product species: Neutron and Helium-4
107+
using products = pmacc::mp_list<Pair<PIC_Neutrons, PIC_He4>>;
108+
109+
/** Cross-section parameters for D-T fusion */
110+
struct Params
111+
{
112+
//! Gamow constant: BG = π·α·Z₁·Z₂·√(2·μ·c²) in keV^(1/2)
113+
//! where α is the fine structure constant, Z₁,Z₂ are charges, μ is reduced mass
114+
static constexpr float_X BG = 34.3827_X;
115+
116+
//! Bosch-Hale parameterization coefficients for D-T cross-section
117+
//! These coefficients fit experimental cross-section data
118+
static constexpr float_X A1 = 6.927e4_X;
119+
static constexpr float_X A2 = 7.454e8_X;
120+
static constexpr float_X A3 = 2.050e6_X;
121+
static constexpr float_X A4 = 5.2002e4_X;
122+
static constexpr float_X A5 = 0.0_X;
123+
124+
//! Additional Bosch-Hale coefficients
125+
static constexpr float_X B1 = 6.38e1_X;
126+
static constexpr float_X B2 = -9.95e-1_X;
127+
static constexpr float_X B3 = 6.981e-5_X;
128+
static constexpr float_X B4 = 1.728e-4_X;
129+
};
130+
131+
//! Cross-section calculation using Bosch-Hale parameterization
132+
//! Returns cross-section in milli-barns
133+
using CrossSectionInterpolator = relativistic::FusionFunctor<Params>;
134+
};
135+
86136
2) Configure the fusion pipeline
87137

88138
.. code-block:: cpp

include/picongpu/param/fusion.param

Lines changed: 2 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -31,161 +31,23 @@ namespace picongpu
3131
{
3232
namespace fusion
3333
{
34-
//! ===================================================================
35-
//! PRECISION SETTINGS
36-
//! ===================================================================
3734
namespace precision
3835
{
39-
//! Use double precision for fusion collision calculations
4036
using float_COLL = float_64;
4137
} // namespace precision
4238

4339
using namespace picongpu::plugins;
4440

45-
//! ===================================================================
46-
//! FUSION REACTION DEFINITIONS
47-
//! ===================================================================
48-
49-
/** Deuterium-Tritium Fusion Reaction
50-
*
51-
* This defines the D + T -> n + He4 fusion reaction
52-
*
53-
* USAGE: Uncomment this struct to enable D-T fusion in your simulation
54-
*
55-
* The cross-section parameters are based on the Bosch-Hale
56-
* parameterization from experimental data.
57-
* Source: https://hdl.handle.net/11858/00-001M-0000-0027-6535-1 (page 29)
41+
/** Define your fusion reactions here.
42+
* See documentation: https://picongpu.readthedocs.io/en/latest/usage/workflows/fusionReactions.html
5843
*/
59-
// struct DT
60-
// {
61-
// //! Reactant species: Deuterium and Tritium
62-
// using reactants = pmacc::mp_list<Pair<PIC_Tritons, PIC_Deuterons>>;
63-
//
64-
// //! Product species: Neutron and Helium-4
65-
// using products = pmacc::mp_list<Pair<PIC_Neutrons, PIC_He4>>;
66-
//
67-
// /** Cross-section parameters for D-T fusion */
68-
// struct Params
69-
// {
70-
// //! Gamov constant: BG = pi*alpha*Z1*Z2*sqrt(2*mu*c^2) in keV^(1/2)
71-
// //! where alpha is fine structure constant, Z1,Z2 are charges, mu is reduced mass
72-
// static constexpr float_X BG = 34.3827_X;
73-
//
74-
// //! Bosch-Hale parameterization coefficients for D-T cross-section
75-
// //! These coefficients fit experimental cross-section data
76-
// static constexpr float_X A1 = 6.927e4_X;
77-
// static constexpr float_X A2 = 7.454e8_X;
78-
// static constexpr float_X A3 = 2.050e6_X;
79-
// static constexpr float_X A4 = 5.2002e4_X;
80-
// static constexpr float_X A5 = 0.0_X;
81-
//
82-
// //! Additional Bosch-Hale coefficients
83-
// static constexpr float_X B1 = 6.38e1_X;
84-
// static constexpr float_X B2 = -9.95e-1_X;
85-
// static constexpr float_X B3 = 6.981e-5_X;
86-
// static constexpr float_X B4 = 1.728e-4_X;
87-
// };
88-
// //! For now it's the only cross-section interpolator available
89-
// //! Cross-section calculation using Bosch-Hale parameterization.
90-
// //! Returns cross-section in milli-barns.
91-
// using CrossSectionInterpolator = relativistic::FusionFunctor<Params>;
92-
// };
9344

94-
// empty pipeline - no fusion
9545
using FusionPipeline = pmacc::mp_list<>;
9646

97-
//! ===================================================================
98-
//! FUSION PIPELINE CONFIGURATION
99-
//! ===================================================================
100-
101-
/** FusionPipeline: Defines the sequence of fusion reactions
102-
*
103-
* This controls which fusion reactions occur and in what order.
104-
* Each reaction is processed sequentially from first to last.
105-
*
106-
* USAGE EXAMPLES:
107-
*
108-
* 1. Single D-T reaction:
109-
* using FusionPipeline = pmacc::mp_list<ColliderFromStruct<DT>>;
110-
*
111-
* 2. Multiple reactions (processed in order):
112-
* using FusionPipeline = pmacc::mp_list<
113-
* ColliderFromStruct<DT>,
114-
* ColliderFromStruct<DD>,
115-
* ColliderFromStruct<DHe3>
116-
* >;
117-
*
118-
* 3. Manual collider specification:
119-
* using FusionPipeline = pmacc::mp_list<
120-
* Collider<DT::CrossSectionInterpolator,
121-
* DT::reactants,
122-
* DT::products,
123-
* OneFilter<filter::All>>
124-
* >;
125-
*/
126-
127-
128-
//! Method 1: Using ColliderFromStruct (recommended - cleaner syntax)
129-
// using FusionPipeline = pmacc::mp_list<ColliderFromStruct<DT>>;
130-
131-
//! Method 2: Manual collider specification
132-
// using FusionPipeline = pmacc::mp_list<
133-
// Collider<DT::CrossSectionInterpolator, DT::reactants, DT::products, OneFilter<filter::All>>
134-
// >;
135-
136-
// empty pipeline - no fusion
137-
using FusionPipeline = pmacc::mp_list<>;
138-
139-
//! ===================================================================
140-
//! SIMULATION PARAMETERS
141-
//! ===================================================================
142-
143-
/** Memory Management Parameters */
144-
145-
/** Cell list chunk size for memory allocation
146-
*
147-
* Controls memory allocation strategy for collision algorithm.
148-
* The algorithm allocates multiples of this value to store
149-
* particle ID lists, reducing memory fragmentation on GPUs.
150-
*
151-
* Larger values = less fragmentation but more memory overhead
152-
*/
15347
constexpr uint32_t cellListChunkSize = TYPICAL_PARTICLES_PER_CELL;
154-
155-
/** Product Weighting Parameters */
156-
157-
/** Minimum weighting threshold for fusion products
158-
*
159-
* When fusion product weighting <= productMinWeighting, the
160-
* multiplication factor is set to:
161-
* Fmult = max(1, productWeighting/productMinWeighting)
162-
*
163-
* Fmult is then used to scale the fusion probability:
164-
* larger Fmult means we produce more products with smaller weighting.
165-
*
166-
* note: This does not ensure that the product weighting is always above this threshold - see docs "Fusion
167-
* Particle Creation Algorithm"
168-
*/
16948
constexpr float_X productMinWeighting = 16.1;
170-
171-
/** Maximum multiplication factor for products
172-
* the algorithm tries to use this multiplier and if the product weighting is smaller than
173-
* productMinWeighting, Fusion multiplier will be reduced.
174-
*
175-
* Usually set to a value ~10~100x less than the typical particle weighting in a cell.
176-
*/
17749
constexpr uint32_t maxFmult = 1e6;
178-
179-
/** Debug and Control Flags */
180-
181-
/** Enable detailed fusion debugging output
182-
* When true: Prints detailed information about fusion events - warning: large output!
183-
*/
18450
constexpr bool debugFusion = false;
185-
186-
/** Force fusion probability to 100%
187-
* All collision attempts result in fusion
188-
*/
18951
constexpr bool alwaysFuseQ = false;
19052
} // namespace fusion
19153
} // namespace particles

include/picongpu/particles/fusion/relativistic/FusionFunctor.def

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@ namespace picongpu
3333

3434
/** Host side binary collision functor for using a constant coulomb logarithm value
3535
*
36-
* @tparam T_Param param class with a static constexpr member coulombLog
37-
* @tparam ifDebug if true the simulation output will include a file (or files, one for each collided
38-
* pair of species) with an average coulomb log and s parameter (averaged over all collisions
39-
* in the whole simulation, for each timestep)
36+
* @tparam T_Param param class with a static constexpr member 'CalcCrossSection'
4037
*/
4138
template<typename T_Param>
4239
using FusionFunctor = FusionFunctorImpl<T_Param>;

0 commit comments

Comments
 (0)