LCOV - code coverage report
Current view: top level - include/actions - SetupMGXSAction.h (source / functions) Hit Total Coverage
Test: neams-th-coe/cardinal: be601f Lines: 1 1 100.0 %
Date: 2025-07-15 20:50:38 Functions: 0 0 -
Legend: Lines: hit not hit

          Line data    Source code
       1             : /********************************************************************/
       2             : /*                  SOFTWARE COPYRIGHT NOTIFICATION                 */
       3             : /*                             Cardinal                             */
       4             : /*                                                                  */
       5             : /*                  (c) 2021 UChicago Argonne, LLC                  */
       6             : /*                        ALL RIGHTS RESERVED                       */
       7             : /*                                                                  */
       8             : /*                 Prepared by UChicago Argonne, LLC                */
       9             : /*               Under Contract No. DE-AC02-06CH11357               */
      10             : /*                With the U. S. Department of Energy               */
      11             : /*                                                                  */
      12             : /*             Prepared by Battelle Energy Alliance, LLC            */
      13             : /*               Under Contract No. DE-AC07-05ID14517               */
      14             : /*                With the U. S. Department of Energy               */
      15             : /*                                                                  */
      16             : /*                 See LICENSE for full restrictions                */
      17             : /********************************************************************/
      18             : 
      19             : #pragma once
      20             : 
      21             : #include "CardinalAction.h"
      22             : 
      23             : #include "CardinalEnums.h"
      24             : #include "EnergyBinBase.h"
      25             : 
      26             : #include "TallyBase.h"
      27             : 
      28             : class OpenMCCellAverageProblem;
      29             : 
      30             : /**
      31             :  * This action automates the generation of multi-group cross sections
      32             :  * for an OpenMC case wrapped in Cardinal. These cross sections
      33             :  * are generated with Cardinal's mapped tally system.
      34             :  */
      35             : class SetupMGXSAction : public CardinalAction, public EnergyBinBase
      36             : {
      37             : public:
      38             :   static InputParameters validParams();
      39             : 
      40             :   SetupMGXSAction(const InputParameters & parameters);
      41             : 
      42             :   virtual void act() override;
      43             : 
      44          68 :   bool addingCellTallies() const { return _t_type == tally::cell; }
      45             : 
      46             : protected:
      47             :   /**
      48             :    * A function to cast the FEProblem to an OpenMCCellAverageProblem
      49             :    * @return a pointer to the OpenMCCellAverageProblem
      50             :    */
      51             :   OpenMCCellAverageProblem * openmcProblem();
      52             : 
      53             :   /// A function to add the filters necessary for MGXS generation.
      54             :   void addFilters();
      55             : 
      56             :   /// A function to add the tallies necessary for MGXS generation.
      57             :   void addTallies();
      58             : 
      59             :   /// A function which adds auxvariables that store the computed MGXS.
      60             :   void addAuxVars();
      61             : 
      62             :   /// A function which adds auxkernels that compute the MGXS.
      63             :   void addAuxKernels();
      64             : 
      65             :   /// Modify outputs to hide tally variables used to generate MGXS in outputs.
      66             :   void modifyOutputs();
      67             : 
      68             :   /// The tally type to add.
      69             :   const tally::TallyTypeEnum _t_type;
      70             : 
      71             :   /// The particle to filter for when generating cross sections.
      72             :   const MooseEnum _particle;
      73             : 
      74             :   /// The estimator to use when generating multi-group cross sections.
      75             :   MooseEnum _estimator;
      76             : 
      77             :   /// Whether or not group-wise scattering cross sections for the scattering matrix
      78             :   /// should be computed.
      79             :   const bool _add_scattering;
      80             : 
      81             :   /// The Legendre order.
      82             :   const unsigned int _l_order;
      83             : 
      84             :   /// Whether a P0 transport correction should be applied to isotropic scattering cross sections.
      85             :   bool _transport_correction;
      86             : 
      87             :   /// Whether or not group-wise nu-fission MGXS should be computed.
      88             :   const bool _add_fission;
      89             : 
      90             :   /// Whether or not group-wise kappa-fission values should be computed.
      91             :   const bool _add_kappa_fission;
      92             : 
      93             :   /// Whether or not group-wise inverse velocity values should be computed.
      94             :   const bool _add_inv_vel;
      95             : 
      96             :   /// Whether or not group-wise diffusion coefficients should be computed.
      97             :   const bool _add_diffusion;
      98             : 
      99             :   /// The value the diffusion coefficient should take in a void region.
     100             :   const Real & _void_diff;
     101             : 
     102             :   /// Whether or not group-wise absorption MGXS should be computed.
     103             :   const bool _add_absorption;
     104             : 
     105             :   /// Whether tally variables should be hidden.
     106             :   const bool _hide_tally_vars;
     107             : 
     108             :   /// A list of tallies added by this action.
     109             :   std::vector<const TallyBase *> _mgxs_tallies;
     110             : 
     111             :   /// Whether or not scattering reaction rates need to be at least order P1.
     112             :   bool _need_p1_scatter;
     113             : };

Generated by: LCOV version 1.14