Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-07 10:11:34

0001 //------------------------------- -*- C++ -*- -------------------------------//
0002 // Copyright Celeritas contributors: see top-level COPYRIGHT file for details
0003 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
0004 //---------------------------------------------------------------------------//
0005 //! \file celeritas/inp/MucfPhysics.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include <string>
0010 #include <vector>
0011 
0012 #include "corecel/inp/Grid.hh"
0013 #include "corecel/math/Quantity.hh"
0014 #include "celeritas/Quantities.hh"
0015 #include "celeritas/UnitTypes.hh"
0016 #include "celeritas/mucf/Types.hh"
0017 
0018 namespace celeritas
0019 {
0020 namespace inp
0021 {
0022 //---------------------------------------------------------------------------//
0023 /*!
0024  * Muon-catalyzed fusion scalars.
0025  */
0026 struct MucfScalars
0027 {
0028     using AmuMass = Quantity<units::Amu, double>;
0029     using InvCcDensity = Quantity<units::InvCentimeterCubed, double>;
0030 
0031     // Atomic masses
0032     AmuMass protium;  //!< Protium atomic mass [AMU]
0033     AmuMass deuterium;  //!< Deuterium atomic mass [AMU]
0034     AmuMass tritium;  //!< Tritium atomic mass [AMU]
0035     InvCcDensity liquid_hydrogen_density;  //!< LHD unit [1/cm^3]
0036 
0037     //! Whether scalars have been defined
0038     explicit operator bool() const
0039     {
0040         return protium > zero_quantity() && deuterium > zero_quantity()
0041                && tritium > zero_quantity()
0042                && liquid_hydrogen_density > zero_quantity();
0043     }
0044 
0045     // Initialize with hardcoded values
0046     static MucfScalars from_default();
0047 };
0048 
0049 //---------------------------------------------------------------------------//
0050 /*!
0051  * Safely access cycle rate tables.
0052  */
0053 enum class CycleTableType
0054 {
0055     protium_deuterium,
0056     protium_tritium,
0057     deuterium_deuterium,
0058     deuterium_tritium,
0059     tritium_tritium,
0060     size_
0061 };
0062 
0063 //---------------------------------------------------------------------------//
0064 /*!
0065  * Muon-catalyzed fusion mean cycle rate data.
0066  *
0067  * Mean cycle rates are as a function of temperature, with each grid assigned
0068  * to a muonic molecule and its spin (e.g. \f$ (dt)_\mu, F = 0 \f$).
0069  *
0070  * The inverse of the rate provides the time it takes for a muon-catalyzed
0071  * fusion to happen, from atom formation to fusion. This number is used to
0072  * update the track time in the stepping loop and allows the competition
0073  * between fusion and muon decay.
0074  *
0075  * Since the cycle rate is per-material, these grids are host-only, with only
0076  * the final cycle rate (a \c real_type ) for each molecule + spin combination
0077  * needed in the stepping loop.
0078  */
0079 struct MucfCycleRate
0080 {
0081     CycleTableType type;  //!< Cycle table type
0082     Grid rate;  //!< x = temperature [K], y = mean cycle rate [1/time]
0083     units::HalfSpinInt spin_state;  // Spin state F, in unit of hbar/2
0084 
0085     //! True if data is assigned
0086     explicit operator bool() const
0087     {
0088         return type < CycleTableType::size_ && rate;
0089     }
0090 };
0091 
0092 //---------------------------------------------------------------------------//
0093 /*!
0094  * Muon-catalyzed fusion mean atom transfer data.
0095  *
0096  * Atom transfer is not a direct process, encompassing multiple steps:
0097  * initial_atom --> isotope1 --> isotope2 --> final_atom
0098  *
0099  * The transfer rates are as a function of temperature, with a separate grid
0100  * for each combination of the 4 steps aforementioned
0101  * (e.g. protium --> deuterium --> tritium --> tritium).
0102  *
0103  * Each struct holds one of such combinations, with the full set of
0104  * combinations being the \c vector<MucfAtomTransferRate> in \c MucfPhysics .
0105  *
0106  * \note These grids are host-only, with only the final exchange rate (a
0107  * \c real_type ) for each combination being needed in the stepping loop. This
0108  * is because these rates are material dependent, and thus can be cached at
0109  * model construction.
0110  */
0111 struct MucfAtomTransferRate
0112 {
0113     //! \todo Implement
0114 
0115     //! True if data is assigned \todo Implement
0116     explicit operator bool() const { return true; }
0117 };
0118 
0119 //---------------------------------------------------------------------------//
0120 /*!
0121  * Muon-catalyzed fusion mean atom spin flip data.
0122  *
0123  * Spin flip rates are as a function of temperature, with each grid/table
0124  * representing an atom pair combination and its spin (e.g. deuterium-tritium,
0125  * spin 1). Ordering is important, thus same spin deuterium-tritium and
0126  * tritium-deuterium have different tables, which leads to a different final
0127  * spin flip rate for a given material definition.
0128  *
0129  * Each struct holds one of such combinations, with the full set of
0130  * combinations being the \c vector<MucfAtomSpinFlipRate> in \c MucfPhysics .
0131  *
0132  * \note These grids are host-only, with only the final spin flip rate per
0133  * state (which is just a \c real_type ) for each combination being needed in
0134  * the stepping loop. This is because these rates are material dependent, and
0135  * thus can be cached at model construction.
0136  */
0137 struct MucfAtomSpinFlipRate
0138 {
0139     //! \todo Implement
0140 
0141     //! True if data is assigned \todo Implement
0142     explicit operator bool() const { return true; }
0143 };
0144 
0145 //---------------------------------------------------------------------------//
0146 /*!
0147  * Muon-catalyzed fusion physics options and data import.
0148  *
0149  * Minimum requirements for muon-catalyzed fusion:
0150  * - Muon energy CDF data, required for sampling the outgoing muCF muon,
0151  * and
0152  * - Mean cycle rate data for dd, dt, and tt muonic molecules.
0153  *
0154  * Muonic atom transfer and muonic atom spin flip are secondary effects and not
0155  * required for muCF to function.
0156  */
0157 struct MucfPhysics
0158 {
0159     template<class T>
0160     using Vec = std::vector<T>;
0161 
0162     MucfScalars scalars;
0163     Grid muon_energy_cdf;  //!< CDF for sampling the outgoing muCF muon
0164     Vec<MucfCycleRate> cycle_rates;  //!< Mean cycle rates for muonic molecules
0165     Vec<MucfAtomTransferRate> atom_transfer;  //!< Muonic atom transfer rates
0166     Vec<MucfAtomSpinFlipRate> atom_spin_flip;  //!< Muonic atom spin flip rates
0167 
0168     //! Whether muon-catalyzed fusion physics is enabled
0169     explicit operator bool() const
0170     {
0171         return scalars && muon_energy_cdf && !cycle_rates.empty();
0172     }
0173 
0174     //! Construct hardcoded muon-catalyzed fusion physics data
0175     static MucfPhysics from_default();
0176 };
0177 
0178 //---------------------------------------------------------------------------//
0179 }  // namespace inp
0180 }  // namespace celeritas