Cardinal
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
OpenMCCellAverageProblem Class Reference

Tally/filter includes. More...

#include <OpenMCCellAverageProblem.h>

Inheritance diagram for OpenMCCellAverageProblem:
[legend]

Public Types

typedef std::unordered_map< int32_t, std::vector< int32_t > > containedCells
 
typedef std::pair< int32_t, int32_t > cellInfo
 

Public Member Functions

 OpenMCCellAverageProblem (const InputParameters &params)
 
virtual void initialSetup () override
 
virtual void externalSolve () override
 
virtual void syncSolutions (ExternalProblem::Direction direction) override
 
virtual bool converged (unsigned int) override
 
void read2DBlockParameters (const std::string name, std::vector< std::vector< SubdomainName >> &names, std::vector< SubdomainID > &flattened_ids)
 
void checkBlocksInMesh (const std::string name, const std::vector< SubdomainID > &ids, const std::vector< SubdomainName > &names) const
 
void setupProblem ()
 Initialize the mapping of OpenMC to the MooseMesh and perform additional setup actions. More...
 
virtual void addExternalVariables () override
 
virtual Real cellVolume (const cellInfo &cell_info) const
 
virtual const OpenMCVolumeCalculationvolumeCalculation () const
 
virtual const std::map< cellInfo, std::vector< unsigned int > > & cellToElem () const
 
virtual std::unordered_set< SubdomainID > getCellToElementSub (const cellInfo &info)
 
virtual bool hasPointTransformations () const
 
virtual const std::vector< std::string > & getTallyScores () const
 
virtual Point transformPoint (const Point &pt) const
 
virtual void createQRules (QuadratureType type, Order order, Order volume_order, Order face_order, SubdomainID block, bool allow_negative_weights=true) override
 
int32_t elemToCellIndex (const int &elem_id) const
 
int32_t elemToCellID (const int &elem_id) const
 
int32_t elemToCellInstance (const int &elem_id) const
 
cellInfo elemToCellInfo (const int &elem_id) const
 
int32_t cellToMaterialIndex (const cellInfo &cell_info)
 
coupling::CouplingFields cellFeedback (const cellInfo &cell_info) const
 
bool hasDensityFeedback (const cellInfo &cell_info) const
 
bool hasTemperatureFeedback (const cellInfo &cell_info) const
 
bool hasFilter (const std::string &filter_name) const
 
std::shared_ptr< FilterBase > & getFilter (const std::string &filter_name)
 
const std::vector< std::shared_ptr< TallyBase > > & getLocalTally () const
 
double cellTemperature (const cellInfo &cell_info) const
 
double cellMappedVolume (const cellInfo &cell_info) const
 
void reloadDAGMC ()
 Reconstruct the DAGMC geometry after skinning. More...
 
void addFilter (const std::string &type, const std::string &name, InputParameters &moose_object_pars)
 
void addTally (const std::string &type, const std::string &name, InputParameters &moose_object_pars)
 
Real tallyMultiplier (unsigned int global_score) const
 
template<typename T >
void checkEmptyVector (const std::vector< T > &vector, const std::string &name) const
 
int fixedPointIteration () const
 
std::string subdomainName (const SubdomainID &id) const
 
void catchOpenMCError (const int &err, const std::string descriptor) const
 
bool isReactionRateScore (const std::string &score) const
 
bool isHeatingScore (const std::string &score) const
 
unsigned int addExternalVariable (const std::string &name, const std::vector< SubdomainName > *block=nullptr)
 
const Real & scaling () const
 
bool hasScaling () const
 
std::string enumToTallyScore (const std::string &score) const
 
std::string tallyScoreToEnum (const std::string &score) const
 
virtual void geometryType (bool &has_csg_universe, bool &has_dag_universe) const
 
bool firstSolve () const
 Whether this is the first time OpenMC is running. More...
 
openmc::TriggerMetric triggerMetric (trigger::TallyTriggerTypeEnum trigger) const
 
openmc::TriggerMetric triggerMetric (std::string trigger) const
 
openmc::TallyEstimator tallyEstimator (tally::TallyEstimatorEnum estimator) const
 
std::string estimatorToString (openmc::TallyEstimator estimator) const
 
void importProperties () const
 Import temperature and density from a properties.h5 file. More...
 
xt::xtensor< double, 1 > tallySum (openmc::Tally *tally, const unsigned int &score) const
 Compute the sum of a tally within each bin. More...
 
double tallySumAcrossBins (std::vector< openmc::Tally * > tally, const unsigned int &score) const
 
double tallyMeanAcrossBins (std::vector< openmc::Tally * > tally, const unsigned int &score) const
 
bool cellIsVoid (const cellInfo &cell_info) const
 
bool cellHasZeroInstances (const cellInfo &cell_info) const
 
std::string materialName (const int32_t index) const
 
xt::xtensor< double, 1 > relativeError (const xt::xtensor< double, 1 > &sum, const xt::xtensor< double, 1 > &sum_sq, const int &n_realizations) const
 
const Real & densityConversionFactor () const
 
int nParticles () const
 
int nTotalParticles () const
 
int32_t cellID (const int32_t index) const
 
int32_t materialID (const int32_t index) const
 
std::string printPoint (const Point &p) const
 
std::string printMaterial (const int32_t &index) const
 
void writeSourceBank (const std::string &filename)
 
unsigned int numElemsInSubdomain (const SubdomainID &id) const
 
bool isLocalElem (const Elem *elem) const
 
unsigned int globalElemID (const unsigned int &id) const
 
virtual void setCellTemperature (const int32_t &id, const int32_t &instance, const Real &T, const cellInfo &cell_info) const
 
virtual void setCellDensity (const Real &density, const cellInfo &cell_info) const
 
virtual std::string printCell (const cellInfo &cell_info, const bool brief=false) const
 
virtual std::vector< int32_t > cellFill (const cellInfo &cell_info, int &fill_type) const
 
bool materialFill (const cellInfo &cell_info, int32_t &material_index) const
 
long unsigned int numCells () const
 
template<typename T >
void checkDuplicateEntries (const std::vector< T > &var, const std::string &name) const
 
void checkDuplicateVariableName (const std::string &name) const
 
bool stringHasEnding (std::string const &full, std::string const &ending) const
 

Static Public Member Functions

static InputParameters validParams ()
 

Static Public Attributes

static constexpr int32_t UNMAPPED {-1}
 Constant flag to indicate that a cell/element was unmapped. More...
 
static constexpr int DIMENSION {3}
 Spatial dimension of the Monte Carlo problem. More...
 

Protected Member Functions

unsigned int getCellLevel (const Point &c) const
 
void readBlockVariables (const std::string &param, const std::string &default_name, std::map< std::string, std::vector< SubdomainName >> &vars_to_specified_blocks, std::vector< SubdomainID > &specified_blocks)
 
bool cellHasIdenticalFill (const cellInfo &cell_info) const
 
containedCells shiftCellInstances (const cellInfo &cell_info) const
 
bool cellMapsToSubdomain (const cellInfo &cell_info, const std::unordered_set< SubdomainID > &id) const
 
cellInfo firstContainedMaterialCell (const cellInfo &cell_info) const
 
containedCells containedMaterialCells (const cellInfo &cell_info) const
 
virtual void updateMaterials ()
 
std::vector< std::string > getMaterialInEachSubdomain () const
 
Point transformPointToOpenMC (const Point &pt) const
 
void checkNormalization (const Real &sum, unsigned int global_score) const
 
void printTrisoHelp (const std::chrono::time_point< std::chrono::high_resolution_clock > &start) const
 
void printAuxVariableIO ()
 
std::vector< int32_t > materialsInCells (const containedCells &contained_cells) const
 
void subdomainsToMaterials ()
 Loop over the mapped cells, and build a map between subdomains to OpenMC materials. More...
 
std::set< SubdomainID > coupledSubdomains () const
 
template<typename T >
void gatherCellSum (std::vector< T > &local, std::map< cellInfo, T > &global) const
 
template<typename T >
void gatherCellVector (std::vector< T > &local, std::vector< unsigned int > &n_local, std::map< cellInfo, std::vector< T >> &global)
 
coupling::CouplingFields elemFeedback (const Elem *elem) const
 
void getTallyTriggerParameters (const InputParameters &params)
 
void readBlockParameters (const std::string name, std::unordered_set< SubdomainID > &blocks)
 
void cacheContainedCells ()
 
void setContainedCells (const cellInfo &cell_info, const Point &hint, std::map< cellInfo, containedCells > &map)
 
void checkContainedCellsStructure (const cellInfo &cell_info, containedCells &reference, containedCells &compare) const
 
void setMinimumVolumeQRules (Order &volume_order, const std::string &type)
 
std::string printNewline () const
 For keeping the output neat when using verbose. More...
 
void storeElementPhase ()
 Loop over the elements in the MOOSE mesh and store the type of feedback applied by each. More...
 
void relaxAndNormalizeTally (unsigned int global_score, unsigned int local_score, std::shared_ptr< TallyBase > local_tally)
 
void getCellMappedPhase ()
 
void checkCellMappedPhase ()
 This function is used to ensure that each OpenMC cell only maps to a single phase. More...
 
void getCellMappedSubdomains ()
 Loop over all the OpenMC cells and get the element subdomain IDs that map to each cell. More...
 
void computeCellMappedVolumes ()
 
void initializeElementToCellMapping ()
 Set up the mapping from MOOSE elements to OpenMC cells. More...
 
void mapElemsToCells ()
 Populate maps of MOOSE elements to OpenMC cells. More...
 
void validateLocalTallies ()
 
void initializeTallies ()
 Add OpenMC tallies to facilitate the coupling. More...
 
void resetTallies ()
 
void getMaterialFills ()
 Find the material filling each cell which receives density feedback. More...
 
void getPointInCell ()
 
std::map< cellInfo, Real > computeVolumeWeightedCellInput (const std::map< SubdomainID, std::pair< unsigned int, std::string >> &var_num, const std::vector< coupling::CouplingFields > *phase) const
 
void sendTemperatureToOpenMC () const
 
void sendDensityToOpenMC () const
 
Real tallyNormalization (unsigned int global_score) const
 
void checkTallySum (const unsigned int &score) const
 
void latticeOuterCheck (const Point &c, int level) const
 
void latticeOuterError (const Point &c, int level) const
 
bool findCell (const Point &point)
 
void compareContainedCells (std::map< cellInfo, containedCells > &reference, std::map< cellInfo, containedCells > &compare) const
 
void getOpenMCUserObjects ()
 Find all userobjects which are changing OpenMC data structures. More...
 
void sendNuclideDensitiesToOpenMC ()
 Set the nuclide densities for any materials being modified via MOOSE. More...
 
void sendTallyNuclidesToOpenMC ()
 Set the tally nuclides for any tallies being modified via MOOSE. More...
 
void fillElementalAuxVariable (const unsigned int &var_num, const std::vector< unsigned int > &elem_ids, const Real &value)
 
std::string sourceBankFileName () const
 

Protected Attributes

std::unique_ptr< NumericVector< Number > > _serialized_solution
 
const bool & _output_cell_mapping
 
const coupling::OpenMCInitialCondition _initial_condition
 
const relaxation::RelaxationEnum _relaxation
 Type of relaxation to apply to the OpenMC tallies. More...
 
const trigger::TallyTriggerTypeEnum _k_trigger
 
unsigned int _cell_level
 
const bool & _export_properties
 
const bool _normalize_by_global
 
const bool _need_to_reinit_coupling
 
const bool _check_tally_sum
 
const Real & _relaxation_factor
 Constant relaxation factor. More...
 
const bool _has_identical_cell_fills
 
const bool & _check_identical_cell_fills
 
const bool & _assume_separate_tallies
 
bool _map_density_by_cell
 
const bool _specified_density_feedback
 
const bool _specified_temperature_feedback
 
bool _has_cell_tallies = false
 Whether any cell tallies exist. More...
 
bool _needs_to_map_cells
 Whether any spatial mapping from OpenMC's cells to the mesh is needed. More...
 
const bool _needs_global_tally
 
std::map< std::string, std::shared_ptr< FilterBase > > _filters
 
std::vector< std::shared_ptr< TallyBase > > _local_tallies
 A vector of the tally objects created by the [Problem/Tallies] block. More...
 
std::vector< std::string > _all_tally_scores
 A list of all of the scores contained by the local tallies added in the [Tallies] block. More...
 
std::vector< std::map< std::string, int > > _local_tally_score_map
 
std::vector< std::vector< unsigned int > > _tally_var_ids
 A vector of auxvariable ids added by the [Tallies] block. More...
 
std::vector< std::vector< std::vector< unsigned int > > > _tally_ext_var_ids
 A vector of external (output-based) auxvariable ids added by the [Tallies] block. More...
 
std::vector< SubdomainID > _density_blocks
 Blocks in MOOSE mesh that provide density feedback. More...
 
std::vector< SubdomainID > _temp_blocks
 Blocks in MOOSE mesh that provide temperature feedback. More...
 
std::unordered_set< SubdomainID > _identical_cell_fill_blocks
 Blocks for which the cell fills are identical. More...
 
std::vector< cellInfo_elem_to_cell {}
 Mapping of MOOSE elements to the OpenMC cell they map to (if any) More...
 
std::map< cellInfo, coupling::CouplingFields_cell_phase
 Phase of each cell. More...
 
int _n_moose_density_elems
 Number of elements in the MOOSE mesh that exclusively provide density feedback. More...
 
int _n_moose_temp_elems
 Number of elements in the MOOSE mesh that exclusively provide temperature feedback. More...
 
int _n_moose_temp_density_elems
 Number of elements in the MOOSE mesh which provide temperature+density feedback. More...
 
int _n_moose_none_elems
 Number of no-coupling elements in the MOOSE mesh. More...
 
int _n_mapped_temp_elems
 
int _n_mapped_density_elems
 
int _n_mapped_temp_density_elems
 
int _n_mapped_none_elems
 Number of no-coupling elements mapped to OpenMC cells. More...
 
Real _uncoupled_volume
 Total volume of uncoupled MOOSE mesh elements. More...
 
bool _material_cells_only {true}
 Whether non-material cells are mapped. More...
 
std::map< cellInfo, std::vector< unsigned int > > _cell_to_elem
 Mapping of OpenMC cell indices to a vector of MOOSE element IDs. More...
 
std::map< cellInfo, std::vector< unsigned int > > _local_cell_to_elem
 Mapping of OpenMC cell indices to a vector of MOOSE element IDs, on each local rank. More...
 
std::map< cellInfo, std::unordered_set< SubdomainID > > _cell_to_elem_subdomain
 Mapping of OpenMC cell indices to the subdomain IDs each maps to. More...
 
std::map< SubdomainID, std::set< int32_t > > _subdomain_to_material
 Mapping of elem subdomains to materials. More...
 
std::map< cellInfo, Point > _cell_to_point
 
std::map< cellInfo, Real > _cell_to_elem_volume
 
std::map< cellInfo, Real > _cell_volume
 
std::map< cellInfo, int32_t > _cell_to_material
 
std::map< cellInfo, containedCells_cell_to_contained_material_cells
 
std::map< cellInfo, int32_t > _cell_to_n_contained
 Number of material-type cells contained within a cell. More...
 
std::vector< openmc::Tally * > _global_tallies
 
std::vector< std::vector< std::string > > _global_tally_scores
 Global tally scores corresponding to '_global_tallies'. More...
 
std::vector< openmc::TallyEstimator > _global_tally_estimators
 Global tally estimators corresponding to '_global_tallies'. More...
 
std::vector< Real > _global_sum_tally
 Sum value of the global tally(s), across all bins. More...
 
std::vector< Real > _local_sum_tally
 Sum value of the local tally(s), across all bins. More...
 
std::vector< Real > _local_mean_tally
 Mean value of the local tally(s), across all bins; only used for fixed source mode. More...
 
openmc::Particle _particle
 Dummy particle to reduce number of allocations of particles for cell lookup routines. More...
 
unsigned int _n_particles_1
 Number of particles simulated in the first iteration. More...
 
std::map< std::string, std::vector< SubdomainName > > _temp_vars_to_blocks
 Mapping from temperature variable name to the subdomains on which to read it from. More...
 
std::map< std::string, std::vector< SubdomainName > > _density_vars_to_blocks
 Mapping from density variable name to the subdomains on which to read it from. More...
 
OpenMCVolumeCalculation_volume_calc
 Optional volume calculation for cells which map to MOOSE. More...
 
const SymmetryPointGenerator_symmetry
 Userobject that maps from a partial-symmetry OpenMC model to a whole-domain [Mesh]. More...
 
std::map< cellInfo, int > _n_temp
 Number of temperature-only feedback elements in each mapped OpenMC cell (global) More...
 
std::map< cellInfo, int > _n_rho
 Number of density-only feedback elements in each mapped OpenMC cell (global) More...
 
std::map< cellInfo, int > _n_temp_rho
 Number of temperature+density feedback elements in each mapped OpenMC cell (global) More...
 
std::map< cellInfo, int > _n_none
 Number of none elements in each mapped OpenMC cell (global) More...
 
unsigned int _global_tally_index = 0
 Index in OpenMC tallies corresponding to the first global tally added by Cardinal. More...
 
unsigned int _source_rate_index
 Index in tally_score pointing to the score used for normalizing flux tallies in eigenvalue mode. More...
 
long unsigned int _n_openmc_cells
 Total number of unique OpenMC cell IDs + instances combinations. More...
 
int32_t _dagmc_universe_index
 Index in the OpenMC universes corresponding to the DAGMC universe. More...
 
const bool & _verbose
 Whether to print diagnostic information about model setup and the transfers. More...
 
const Real * _power
 Power by which to normalize the OpenMC results, for k-eigenvalue mode. More...
 
const Real * _source_strength
 Source strength by which to normalize the OpenMC results, for fixed source mode. More...
 
bool _reuse_source
 
const bool _specified_scaling
 Whether a mesh scaling was specified by the user. More...
 
const Real & _scaling
 
const bool & _skip_statepoint
 Whether to skip writing statepoints from OpenMC. More...
 
int _fixed_point_iteration
 
unsigned int _total_n_particles
 Total number of particles simulated. More...
 
int _n_cell_digits
 
openmc::RunMode _run_mode
 OpenMC run mode. More...
 
std::vector< OpenMCNuclideDensities * > _nuclide_densities_uos
 Userobjects for changing OpenMC material compositions. More...
 
std::vector< OpenMCTallyNuclides * > _tally_nuclides_uos
 Userobjects for changing OpenMC tally nuclides. More...
 
std::vector< unsigned int > _local_to_global_elem
 Mapping from local element indices to global element indices for this rank. More...
 

Static Protected Attributes

static bool _first_transfer
 Whether the present transfer is the first transfer. More...
 
static bool _printed_initial
 Whether the diagnostic tables on initialization have already been printed. More...
 
static bool _printed_triso_warning
 Whether a warning has already been printed about very long setup times (for TRISOs) More...
 
static constexpr Real EV_TO_JOULE = 1.6022e-19
 Conversion rate from eV to Joule. More...
 
static constexpr Real ZERO_TALLY_THRESHOLD = 1e-12
 Tolerance for setting zero tally. More...
 
static constexpr Real _density_conversion_factor {0.001}
 Conversion unit to transfer between kg/m3 and g/cm3. More...
 
static constexpr int MATERIAL_VOID {-1}
 ID used by OpenMC to indicate that a material fill is VOID. More...
 

Detailed Description

Tally/filter includes.

Mapping of OpenMC to a collection of MOOSE elements, with temperature and/or density feedback. The mappind is established authomatically by looping over all the MOOSE elements and finding the OpenMC cell at each element's centroid.

All feedback into OpenMC is performed via element averages. The 'temperature_blocks' parameter is used to indicate which MOOSE blocks should provide temperature feedback, while the 'density_blocks' parameter is used to indicate which MOOSE blocks should provide density feedback. Tallies are automatically added to OpenMC using either cell or mesh tallies.

Each OpenMC cell shall not have ambiguous data transfers. That is, a cell should map to a set of elements that are ALL/NONE providing temperature feedback, ALL/NONE providing density feedback, ALL/NONE providing cell tallies, and ALL/NONE being uncoupled altogether.

TODO: If this is too restrictive in the future, we could implement some type of weighted averaging process. Also, if a cell maps to a phase and an unmapped region, perhaps we want to allow that.

Other considerations you should be aware of:

Member Typedef Documentation

◆ cellInfo

typedef std::pair<int32_t, int32_t> OpenMCProblemBase::cellInfo
inherited

Type definition for storing the relevant aspects of the OpenMC geometry; the first value is the cell index, while the second is the cell instance.

◆ containedCells

typedef std::unordered_map<int32_t, std::vector<int32_t> > OpenMCCellAverageProblem::containedCells

Type definition for cells contained within a parent cell; the first value is the cell index, while the second is the set of cell instances

Constructor & Destructor Documentation

◆ OpenMCCellAverageProblem()

OpenMCCellAverageProblem::OpenMCCellAverageProblem ( const InputParameters &  params)

Member Function Documentation

◆ addExternalVariable()

unsigned int OpenMCProblemBase::addExternalVariable ( const std::string &  name,
const std::vector< SubdomainName > *  block = nullptr 
)
inherited

Add a constant monomial auxiliary variable

Parameters
[in]namename of the variable
[in]blockoptional subdomain names on which to restrict the variable
Returns
numeric index for the variable in the auxiliary system

◆ addExternalVariables()

virtual void OpenMCCellAverageProblem::addExternalVariables ( )
overridevirtual

Add the tally variable(s) (to receive OpenMC tally values), temperature variable(s) (to write into OpenMC cells), and density variable(s) (to write into OpenMC materials)

◆ addFilter()

void OpenMCCellAverageProblem::addFilter ( const std::string &  type,
const std::string &  name,
InputParameters &  moose_object_pars 
)

Add a Filter object using the filter system.

Parameters
[in]typethe new tally type
[in]namethe name of the new tally
[in]moose_object_parsthe input parameters of the new tally

◆ addTally()

void OpenMCCellAverageProblem::addTally ( const std::string &  type,
const std::string &  name,
InputParameters &  moose_object_pars 
)

Add a Tally object using the tally system.

Parameters
[in]typethe new tally type
[in]namethe name of the new tally
[in]moose_object_parsthe input parameters of the new tally

◆ cacheContainedCells()

void OpenMCCellAverageProblem::cacheContainedCells ( )
protected

Cache the material cells contained within each coupling cell; depending on user settings, this may attempt to take shortcuts by assuming each cell has the same fills

◆ catchOpenMCError()

void OpenMCProblemBase::catchOpenMCError ( const int &  err,
const std::string  descriptor 
) const
inherited

Print a full error message when catching errors from OpenMC

Parameters
[in]errOpenMC error code
[in]descriptordescriptive message for error

◆ cellFeedback()

coupling::CouplingFields OpenMCCellAverageProblem::cellFeedback ( const cellInfo cell_info) const

Get the fields coupled for each cell; because we require that each cell maps to a consistent set, we simply look up the coupled fields of the first element that this cell maps to. Note that this function requires a valid instance, index pair for cellInfo - you cannot pass in an unmapped cell, i.e. (UNMAPPED, UNMAPPED)

Parameters
[in]cell_infocell index, instance pair
Returns
coupling fields

◆ cellFill()

virtual std::vector<int32_t> OpenMCProblemBase::cellFill ( const cellInfo cell_info,
int &  fill_type 
) const
virtualinherited

Get the fill of an OpenMC cell

Parameters
[in]cell_infocell ID, instance
[out]fill_typefill type of the cell, one of MATERIAL, UNIVERSE, or LATTICE
Returns
indices of what is filling the cell

◆ cellHasIdenticalFill()

bool OpenMCCellAverageProblem::cellHasIdenticalFill ( const cellInfo cell_info) const
protected

Whether this cell has an identical fill

Parameters
[in]cell_infocell index, instance pair
Returns
whether this cell has an identical fill

◆ cellHasZeroInstances()

bool OpenMCProblemBase::cellHasZeroInstances ( const cellInfo cell_info) const
inherited

Whether this cell has zero instances

Parameters
[in]cell_infocell info
Returns
whether this cell has zero instances

◆ cellID()

int32_t OpenMCProblemBase::cellID ( const int32_t  index) const
inherited

Get the cell ID from the cell index

Parameters
[in]indexcell index
Returns
cell ID

◆ cellIsVoid()

bool OpenMCProblemBase::cellIsVoid ( const cellInfo cell_info) const
inherited

Whether a cell is filled with VOID (vacuum)

Parameters
[in]cell_infocell ID, instance
Returns
whether cell is void

◆ cellMappedVolume()

double OpenMCCellAverageProblem::cellMappedVolume ( const cellInfo cell_info) const

Get the volume that each OpenMC cell mapped to

Parameters
[in]cell_infocell index, instance pair

◆ cellMapsToSubdomain()

bool OpenMCCellAverageProblem::cellMapsToSubdomain ( const cellInfo cell_info,
const std::unordered_set< SubdomainID > &  id 
) const
protected

Whether this cell overlaps with ANY value in the given subdomain set

Parameters
[in]cell_infocell index, instance pair
[in]idsubdomain IDs
Returns
whether the cell overlaps with the subdomain

◆ cellTemperature()

double OpenMCCellAverageProblem::cellTemperature ( const cellInfo cell_info) const

Get the temperature of a cell; for cells not filled with materials, this will return the temperature of the first material-type cell

Parameters
[in]cell_infocell index, instance pair

◆ cellToElem()

virtual const std::map<cellInfo, std::vector<unsigned int> >& OpenMCCellAverageProblem::cellToElem ( ) const
inlinevirtual

Get the mapping of cells to MOOSE elements

Returns
mapping of cells to MOOSE elements

◆ cellToMaterialIndex()

int32_t OpenMCCellAverageProblem::cellToMaterialIndex ( const cellInfo cell_info)
inline

Get the cell material index based on index, instance pair. Note that this function requires a valid instance, index pair for cellInfo - you cannot pass in an unmapped cell, i.e. (UNMAPPED, UNMAPPED)

Parameters
[in]cell_infocell index, instance pair
Returns
material index

◆ cellVolume()

virtual Real OpenMCCellAverageProblem::cellVolume ( const cellInfo cell_info) const
virtual

Get the cell volume from a stochastic calculation

Parameters
[in]cell_infocell index, instance pair
Returns
stochastically-computed OpenMC cell volume

◆ checkBlocksInMesh()

void OpenMCCellAverageProblem::checkBlocksInMesh ( const std::string  name,
const std::vector< SubdomainID > &  ids,
const std::vector< SubdomainName > &  names 
) const

Check that the specified blocks are in the mesh

Parameters
[in]namename for throwing an error
[in]idsblock IDs to check
[in]namesblock subdomain names for throwing an error

◆ checkCellMappedPhase()

void OpenMCCellAverageProblem::checkCellMappedPhase ( )
protected

This function is used to ensure that each OpenMC cell only maps to a single phase.

◆ checkContainedCellsStructure()

void OpenMCCellAverageProblem::checkContainedCellsStructure ( const cellInfo cell_info,
containedCells reference,
containedCells compare 
) const
protected

Check that the structure of the contained material cells for two cell matches; i.e. this checks that the keys are the same and that the number of instances of each filling material cell match.

Parameters
[in]cell_infocell index, instance pair
[in]referencemap we want to check against
[in]comparemap we want to check

◆ checkDuplicateEntries()

template<typename T >
void CardinalProblem::checkDuplicateEntries ( const std::vector< T > &  var,
const std::string &  name 
) const
inlineinherited

Check for duplicate entries in a 1-d vector

Parameters
[in]varinput vector
[in]namestring to use for printing error message

◆ checkDuplicateVariableName()

void CardinalProblem::checkDuplicateVariableName ( const std::string &  name) const
inherited

Check whether the user has already created a variable using one of the protected names that the wrapping is using.

Parameters
[in]namevariable name

◆ checkEmptyVector()

template<typename T >
void OpenMCCellAverageProblem::checkEmptyVector ( const std::vector< T > &  vector,
const std::string &  name 
) const
inline

Check whether a vector extracted with getParam is empty

Parameters
[in]vectorvector
[in]namename to use for printing error if empty

◆ checkNormalization()

void OpenMCCellAverageProblem::checkNormalization ( const Real &  sum,
unsigned int  global_score 
) const
protected

Check that the tally normalization gives a total tally sum of 1.0 (when normalized against the total tally value).

Parameters
[in]sumsum of the tally
[in]scoretally score

◆ checkTallySum()

void OpenMCCellAverageProblem::checkTallySum ( const unsigned int &  score) const
protected

Check the sum of the tallies against the global tally

Parameters
[in]scoretally score

◆ compareContainedCells()

void OpenMCCellAverageProblem::compareContainedCells ( std::map< cellInfo, containedCells > &  reference,
std::map< cellInfo, containedCells > &  compare 
) const
protected

Checks that the contained material cells exactly match between a reference obtained by calling openmc::Cell::get_contained_cells for each cell and a shortcut approach that assumes all identical cells (which aren't simply just material fills) has exactly the same contained material cells.

Parameters
[in]referencereference map to compare against
[in]compareshortcut map to compare

◆ computeCellMappedVolumes()

void OpenMCCellAverageProblem::computeCellMappedVolumes ( )
protected

Loop over all the OpenMC cells and compute the volume of the MOOSE elements that each cell maps to

◆ computeVolumeWeightedCellInput()

std::map<cellInfo, Real> OpenMCCellAverageProblem::computeVolumeWeightedCellInput ( const std::map< SubdomainID, std::pair< unsigned int, std::string >> &  var_num,
const std::vector< coupling::CouplingFields > *  phase 
) const
protected

Compute the product of volume with a field across ranks and sum into a global map

Parameters
[in]var_numvariable to weight with volume, mapped by subdomain ID
[in]phasephases to compute the operation for
Returns
volume-weighted field for each cell, in a global sense

◆ containedMaterialCells()

containedCells OpenMCCellAverageProblem::containedMaterialCells ( const cellInfo cell_info) const
protected

Get all of the material cells contained within this cell

Parameters
[in]cell_infocell index, instance pair
Returns
all material cells contained in the given cell

◆ converged()

virtual bool OpenMCCellAverageProblem::converged ( unsigned int  )
inlineoverridevirtual

◆ coupledSubdomains()

std::set<SubdomainID> OpenMCCellAverageProblem::coupledSubdomains ( ) const
protected

Get a set of all subdomains that have at least 1 element coupled to an OpenMC cell

Returns
subdomains with at least 1 element coupled to OpenMC

◆ createQRules()

virtual void OpenMCCellAverageProblem::createQRules ( QuadratureType  type,
Order  order,
Order  volume_order,
Order  face_order,
SubdomainID  block,
bool  allow_negative_weights = true 
)
overridevirtual

This class uses elem->volume() in order to normalize the tally values. However, elem->volume() is expensive, so whenever MOOSE does integration, they set _current_elem_volume to the volume as set by the sum of the quadrature weights. The quadrature rule that MOOSE provides when you only have CONSTANT MONOMIALS is insufficient for exactly integrating the element Jacobian mapping type (which is FIRST LAGRANGE for a first order element), so you get an error relative to the libmesh volume computation.

So, we need to make sure that a minimum order quadrature rule is used so that the total tally as computed by an ElementIntegralVariablePostprocessor actually matches the specified total (for low quadrature orders, there can be an error up to about 5% or so in total power). This override simply forces the volume quadrature order to be 2 or higher when using Gauss (default), monomial, or Gauss-Lobatto quadrature.

For other quadrature rules, the approximations made in elem->volume() are never going to match the volume integrations in MOOSE (unless the quadrature order is very very high). For these orders, we print an error message informing the user that they should switch to a different order.

◆ densityConversionFactor()

const Real& OpenMCProblemBase::densityConversionFactor ( ) const
inlineinherited

Get the density conversion factor (multiplicative factor)

Returns
density conversion factor from kg/m3 to g/cm3

◆ elemFeedback()

coupling::CouplingFields OpenMCCellAverageProblem::elemFeedback ( const Elem *  elem) const
protected

Get the feedback which this element provides to OpenMC

Parameters
[in]elem
Returns
coupling phase

◆ elemToCellID()

int32_t OpenMCCellAverageProblem::elemToCellID ( const int &  elem_id) const
inline

Get the cell ID from the element ID. Note that this function requires that the elem_id maps to an OpenMC cell, or else an error will be raised from OpenMC in cellID.

Parameters
[in]elem_idelement ID
Returns
cell ID

◆ elemToCellIndex()

int32_t OpenMCCellAverageProblem::elemToCellIndex ( const int &  elem_id) const
inline

Get the cell index from the element ID; will return UNMAPPED for unmapped elements

Parameters
[in]elem_idelement ID
Returns
cell index

◆ elemToCellInfo()

cellInfo OpenMCCellAverageProblem::elemToCellInfo ( const int &  elem_id) const
inline

Get the cell index, instance pair from element ID; if the element doesn't map to an OpenMC cell, the index and instance are both set to UNMAPPED

Parameters
[in]elem_idelement ID
Returns
cell index, instance pair

◆ elemToCellInstance()

int32_t OpenMCCellAverageProblem::elemToCellInstance ( const int &  elem_id) const
inline

Get the cell instance from the element ID; will return UNMAPPED for unmapped elements

Parameters
[in]elem_idelement ID
Returns
cell instance

◆ enumToTallyScore()

std::string OpenMCProblemBase::enumToTallyScore ( const std::string &  score) const
inherited

Convert from a MOOSE-type enum into a valid OpenMC tally score string

Parameters
[in]scoreMOOSE-type enum string
Returns
OpenMC tally score string

◆ estimatorToString()

std::string OpenMCProblemBase::estimatorToString ( openmc::TallyEstimator  estimator) const
inherited

Convert a tally estimator to a string (for output purposes).

Parameters
[in]estimatorOpenMC tally estimator enum
Returns
a string form of the OpenMC tally estimator enum

◆ externalSolve()

virtual void OpenMCCellAverageProblem::externalSolve ( )
overridevirtual

◆ fillElementalAuxVariable()

void OpenMCProblemBase::fillElementalAuxVariable ( const unsigned int &  var_num,
const std::vector< unsigned int > &  elem_ids,
const Real &  value 
)
protectedinherited

Set an auxiliary elemental variable to a specified value

Parameters
[in]var_numvariable number
[in]elem_idselement IDs to set
[in]valuevalue to set

◆ findCell()

bool OpenMCCellAverageProblem::findCell ( const Point &  point)
protected

Find the OpenMC cell at a given point in space

Parameters
[in]pointpoint
Returns
whether OpenMC reported an error

◆ firstContainedMaterialCell()

cellInfo OpenMCCellAverageProblem::firstContainedMaterialCell ( const cellInfo cell_info) const
protected

Get the first material cell contained in the given cell

Parameters
[in]cell_infocell index, instance pair
Returns
material cell index, instance pair

◆ firstSolve()

bool OpenMCProblemBase::firstSolve ( ) const
inherited

Whether this is the first time OpenMC is running.

◆ fixedPointIteration()

int OpenMCCellAverageProblem::fixedPointIteration ( ) const
inline

◆ gatherCellSum()

template<typename T >
void OpenMCCellAverageProblem::gatherCellSum ( std::vector< T > &  local,
std::map< cellInfo, T > &  global 
) const
protected

Gather a vector of values to be summed for each cell

Parameters
[in]locallocal values to be summed for the cells
[out]globalglobal mapping of the summed values to the cells

◆ gatherCellVector()

template<typename T >
void OpenMCCellAverageProblem::gatherCellVector ( std::vector< T > &  local,
std::vector< unsigned int > &  n_local,
std::map< cellInfo, std::vector< T >> &  global 
)
protected

Gather a vector of values to be pushed back to for each cell

Parameters
[in]locallocal values to be pushed back for the cells
[in]n_localnumber of local values contributed to each cell
[out]globalglobal mapping of the pushed back values to the cells

◆ geometryType()

virtual void OpenMCProblemBase::geometryType ( bool &  has_csg_universe,
bool &  has_dag_universe 
) const
virtualinherited

Find the geometry type in the OpenMC model

Parameters
[out]has_csg_universewhether there is at least 1 CSG universe
[out]has_dag_universewhether there is at least 1 DagMC universe

◆ getCellLevel()

unsigned int OpenMCCellAverageProblem::getCellLevel ( const Point &  c) const
protected

Get the cell level in OpenMC to use for coupling

Parameters
[in]cpoint
Returns
cell level

◆ getCellMappedPhase()

void OpenMCCellAverageProblem::getCellMappedPhase ( )
protected

Loop over all the OpenMC cells and count the number of MOOSE elements to which the cell is mapped based on phase.

◆ getCellMappedSubdomains()

void OpenMCCellAverageProblem::getCellMappedSubdomains ( )
protected

Loop over all the OpenMC cells and get the element subdomain IDs that map to each cell.

◆ getCellToElementSub()

virtual std::unordered_set<SubdomainID> OpenMCCellAverageProblem::getCellToElementSub ( const cellInfo info)
inlinevirtual

Get the MOOSE subdomains associated with an OpenMC cell

Parameters
infothe cell info
Returns
MOOSE subdomains associated with an OpenMC cell

◆ getFilter()

std::shared_ptr<FilterBase>& OpenMCCellAverageProblem::getFilter ( const std::string &  filter_name)
inline

Get a filter added by the [Problem/Filters] block by it's MOOSE object name.

Parameters
[in]filter_namethe MOOSE object name of the filter
Returns
the filter object

◆ getLocalTally()

const std::vector<std::shared_ptr<TallyBase> >& OpenMCCellAverageProblem::getLocalTally ( ) const
inline

Get the local tally

Returns
local tally

◆ getMaterialFills()

void OpenMCCellAverageProblem::getMaterialFills ( )
protected

Find the material filling each cell which receives density feedback.

◆ getMaterialInEachSubdomain()

std::vector<std::string> OpenMCCellAverageProblem::getMaterialInEachSubdomain ( ) const
protected

Get a list of each material in the problem, sorted by subdomain. This function also checks that there is just one OpenMC material in each subdomain, necessary for the DAGMC skinning.

Returns
material in each subdomain

◆ getOpenMCUserObjects()

void OpenMCProblemBase::getOpenMCUserObjects ( )
protectedinherited

Find all userobjects which are changing OpenMC data structures.

◆ getPointInCell()

void OpenMCCellAverageProblem::getPointInCell ( )
protected

Get one point inside each cell, for accelerating the particle search routine. This function will get the centroid of the first global element in the lowest rank in the cell.

◆ getTallyScores()

virtual const std::vector<std::string>& OpenMCCellAverageProblem::getTallyScores ( ) const
inlinevirtual

Get all the scores added to the tally

Returns
scores

◆ getTallyTriggerParameters()

void OpenMCCellAverageProblem::getTallyTriggerParameters ( const InputParameters &  params)
protected

Read the parameters needed for triggers

Parameters
[in]paramsinput parameters

◆ globalElemID()

unsigned int OpenMCProblemBase::globalElemID ( const unsigned int &  id) const
inlineinherited

Get the global element ID from the local element ID

Parameters
[in]idlocal element ID
Returns
global element ID

◆ hasDensityFeedback()

bool OpenMCCellAverageProblem::hasDensityFeedback ( const cellInfo cell_info) const
inline

Whether a cell has density feedback

Parameters
[in]cell_infocell index,instance pair
Returns
if cell has density feedback

◆ hasFilter()

bool OpenMCCellAverageProblem::hasFilter ( const std::string &  filter_name) const
inline

Checks if the [Problem/Filters] block contains a specific filter.

Parameters
[in]filter_namethe MOOSE object name of the filter
Returns
whether the problem contains the specified filter

◆ hasPointTransformations()

virtual bool OpenMCCellAverageProblem::hasPointTransformations ( ) const
inlinevirtual

Whether transformations are applied to the [Mesh] points when mapping to OpenMC

Returns
whether transformations are applied

◆ hasScaling()

bool OpenMCProblemBase::hasScaling ( ) const
inlineinherited

Whether the problem has user defined scaling or not.

Returns
whether the user has set the problem scaling or not

◆ hasTemperatureFeedback()

bool OpenMCCellAverageProblem::hasTemperatureFeedback ( const cellInfo cell_info) const
inline

Whether a cell has temperature feedback

Parameters
[in]cell_infocell index,instance pair
Returns
if cell has temperature feedback

◆ importProperties()

void OpenMCProblemBase::importProperties ( ) const
inherited

Import temperature and density from a properties.h5 file.

◆ initializeElementToCellMapping()

void OpenMCCellAverageProblem::initializeElementToCellMapping ( )
protected

Set up the mapping from MOOSE elements to OpenMC cells.

◆ initializeTallies()

void OpenMCCellAverageProblem::initializeTallies ( )
protected

Add OpenMC tallies to facilitate the coupling.

◆ initialSetup()

virtual void OpenMCCellAverageProblem::initialSetup ( )
overridevirtual

◆ isHeatingScore()

bool OpenMCProblemBase::isHeatingScore ( const std::string &  score) const
inherited

Whether the score is a heating-type score

Returns
whether the tally from OpenMC has units of eV/src

◆ isLocalElem()

bool OpenMCProblemBase::isLocalElem ( const Elem *  elem) const
inherited

Whether the element is owned by this rank

Returns
whether element is owned by this rank

◆ isReactionRateScore()

bool OpenMCProblemBase::isReactionRateScore ( const std::string &  score) const
inherited

Whether the score is a reaction rate score

Returns
whether the tally from OpenMC has units of 1/src

◆ latticeOuterCheck()

void OpenMCCellAverageProblem::latticeOuterCheck ( const Point &  c,
int  level 
) const
protected

Check if a mapped location is in the outer universe of a lattice

Parameters
[in]levellattice level
Returns
whether the location is in the outer universe

◆ latticeOuterError()

void OpenMCCellAverageProblem::latticeOuterError ( const Point &  c,
int  level 
) const
protected

Report an error for a mapped location in an outer universe of a lattice

Parameters
[in]cMapped location
[in]levellevel of the mapped cell

◆ mapElemsToCells()

void OpenMCCellAverageProblem::mapElemsToCells ( )
protected

Populate maps of MOOSE elements to OpenMC cells.

◆ materialFill()

bool OpenMCProblemBase::materialFill ( const cellInfo cell_info,
int32_t &  material_index 
) const
inherited

Whether the cell has a material fill (if so, then get the material index). Void counts as a material, with a material index of -1.

Parameters
[in]cell_infocell ID, instance
[out]material_indexmaterial index in the cell
Returns
whether the cell is filled by a material

◆ materialID()

int32_t OpenMCProblemBase::materialID ( const int32_t  index) const
inherited

Get the material ID from the material index; for VOID cells, this returns -1

Parameters
[in]indexmaterial index
Returns
cell material ID

◆ materialName()

std::string OpenMCProblemBase::materialName ( const int32_t  index) const
inherited

Get the material name given its index. If the material does not have a name, return the ID.

Parameters
[in]index
Returns
material name

◆ materialsInCells()

std::vector<int32_t> OpenMCCellAverageProblem::materialsInCells ( const containedCells contained_cells) const
protected

Get all the material indices within the set of cells

Parameters
[in]contained_cellsset of cells
Returns
contained materials

◆ nParticles()

int OpenMCProblemBase::nParticles ( ) const
inherited

Get the number of particles used in the current Monte Carlo calculation

Returns
number of particles

◆ nTotalParticles()

int OpenMCProblemBase::nTotalParticles ( ) const
inlineinherited

Total number of particles run (not multiplied by batches)

Returns
total number of particles

◆ numCells()

long unsigned int OpenMCProblemBase::numCells ( ) const
inherited

Calculate the number of unique OpenMC cells (each with a unique ID & instance)

Returns
number of unique OpenMC Cells in entire model

◆ numElemsInSubdomain()

unsigned int OpenMCProblemBase::numElemsInSubdomain ( const SubdomainID &  id) const
inherited

Get the total (i.e. summed across all ranks, if distributed) number of elements in a given block

Parameters
[in]idsubdomainID return number of elements in block

◆ printAuxVariableIO()

void OpenMCCellAverageProblem::printAuxVariableIO ( )
protected

Print to the console the names of the auxvariables used for I/O with OpenMC. We only print these tables once, upon initialization, because this data does not change if re-initializing the spatial mapping for moving-mesh problems, adaptive refinement, skinning, etc.

◆ printCell()

virtual std::string OpenMCProblemBase::printCell ( const cellInfo cell_info,
const bool  brief = false 
) const
virtualinherited

Get a descriptive, formatted, string describing a cell

Parameters
[in]cell_infocell index, instance pair
[in]briefwhether to print a shorter string
Returns
descriptive string describing cell

◆ printMaterial()

std::string OpenMCProblemBase::printMaterial ( const int32_t &  index) const
inherited

Get a descriptive, formatted, string describing a material

Parameters
[in]indexmaterial index
Returns
descriptive string

◆ printNewline()

std::string OpenMCCellAverageProblem::printNewline ( ) const
inlineprotected

For keeping the output neat when using verbose.

◆ printPoint()

std::string OpenMCProblemBase::printPoint ( const Point &  p) const
inherited

Print point coordinates with a neater formatting than the default MOOSE printing

Returns
formatted point string

◆ printTrisoHelp()

void OpenMCCellAverageProblem::printTrisoHelp ( const std::chrono::time_point< std::chrono::high_resolution_clock > &  start) const
protected

For geometries with fine-scale details (e.g. TRISO), Cardinal's default settings can take a very long time to initialize the problem (but we can't change those defaults because they are not 100% applicable all the time). So, we print out a message to the user to point them in the right direction if their initialization is taking a long time.

Parameters
[in]starttime to use for evaluating whether we've exceeded our limit for printing the message

◆ read2DBlockParameters()

void OpenMCCellAverageProblem::read2DBlockParameters ( const std::string  name,
std::vector< std::vector< SubdomainName >> &  names,
std::vector< SubdomainID > &  flattened_ids 
)

Read a 2d vector of subdomain names, and check that there are no duplications and that all provided values exist on the mesh.

Parameters
[in]namestring name for the 2d vector parameter
[out]namessubdomain names
[out]flattened_idsflattened 1d vector of subdomain IDs

◆ readBlockParameters()

void OpenMCCellAverageProblem::readBlockParameters ( const std::string  name,
std::unordered_set< SubdomainID > &  blocks 
)
protected

Read the block parameters based on user settings

Parameters
[in]namename of input parameter representing a vector of subdomain names
[in]blockslist of block ids to write

◆ readBlockVariables()

void OpenMCCellAverageProblem::readBlockVariables ( const std::string &  param,
const std::string &  default_name,
std::map< std::string, std::vector< SubdomainName >> &  vars_to_specified_blocks,
std::vector< SubdomainID > &  specified_blocks 
)
protected

Read the names of the MOOSE variables used for sending feedback into OpenMC

Parameters
[in]paramfeedback term to read
[in]default_namedefault name to use for MOOSE variables holding this field
[out]vars_to_specified_blocksmap from MOOSE variable names to the blocks on which they are defined
[out]specified_blocksuser-specified blocks for feedback

◆ relativeError()

xt::xtensor<double, 1> OpenMCProblemBase::relativeError ( const xt::xtensor< double, 1 > &  sum,
const xt::xtensor< double, 1 > &  sum_sq,
const int &  n_realizations 
) const
inherited

Compute relative error

Parameters
[in]sumsum of scores
[in]sum_sqsum of scores squared
[in]n_realizationsnumber of realizations

◆ relaxAndNormalizeTally()

void OpenMCCellAverageProblem::relaxAndNormalizeTally ( unsigned int  global_score,
unsigned int  local_score,
std::shared_ptr< TallyBase local_tally 
)
protected

Relax the tally and normalize it according to some "global" tally. If you set 'normalize_by_global_tally = true', you will be normalizing by a tally over the ENTIRE OpenMC geometry. Otherwise, you normalize only by the sum of the tally bins themselves.

NOTE: This function relaxes the tally distribution, and not the actual magnitude of the sum. That is, we relax the shape distribution and then multiply it by the power (for k-eigenvalue) or source strength (for fixed source) of the current step before applying it to MOOSE. If the magnitude of the power or source strength is constant in time, there is zero error in this. But if the magnitude of the tally varies in time, we are basically relaxing the distribution of the tally, but then multiplying it by the current mean tally magnitude.

There will be very small errors in these approximations unless the power/source strength change dramatically with iteration. But because relaxation is itself a numerical approximation, this is still inconsequential at the end of the day as long as your problem has converged the relaxed tally to the raw (unrelaxed) tally.

Parameters
[in]global_scorethe global index of the tally score
[in]local_scorethe local index of the tally score
[in]local_tallythe tally to relax and normalize

◆ reloadDAGMC()

void OpenMCCellAverageProblem::reloadDAGMC ( )

Reconstruct the DAGMC geometry after skinning.

◆ resetTallies()

void OpenMCCellAverageProblem::resetTallies ( )
protected

Reset any tallies previously added by Cardinal, by deleting them from OpenMC. Also delete any mesh filters and meshes added to OpenMC for mesh filters.

◆ scaling()

const Real& OpenMCProblemBase::scaling ( ) const
inlineinherited

Get the scaling value applied to the [Mesh] to convert to OpenMC's centimeters units

Returns
scaling value

◆ sendDensityToOpenMC()

void OpenMCCellAverageProblem::sendDensityToOpenMC ( ) const
protected

Send density from MOOSE to OpenMC by computing a volume average and applying a single density per OpenMC cell.

◆ sendNuclideDensitiesToOpenMC()

void OpenMCProblemBase::sendNuclideDensitiesToOpenMC ( )
protectedinherited

Set the nuclide densities for any materials being modified via MOOSE.

◆ sendTallyNuclidesToOpenMC()

void OpenMCProblemBase::sendTallyNuclidesToOpenMC ( )
protectedinherited

Set the tally nuclides for any tallies being modified via MOOSE.

◆ sendTemperatureToOpenMC()

void OpenMCCellAverageProblem::sendTemperatureToOpenMC ( ) const
protected

Send temperature from MOOSE to OpenMC by computing a volume average and applying a single temperature per OpenMC cell

◆ setCellDensity()

virtual void OpenMCProblemBase::setCellDensity ( const Real &  density,
const cellInfo cell_info 
) const
virtualinherited

Set the cell density, and print helpful error message if a failure occurs

Parameters
[in]densitydensity
[in]cell_infocell info for which we are setting the density

◆ setCellTemperature()

virtual void OpenMCProblemBase::setCellTemperature ( const int32_t &  id,
const int32_t &  instance,
const Real &  T,
const cellInfo cell_info 
) const
virtualinherited

Set the cell temperature, and print helpful error message if a failure occurs; this sets the temperature for the id + instance, which could be one of N cells filling the 'cell_info' parent cell (which is what we actually use for error printing)

Parameters
[in]idcell ID
[in]instancecell instance
[in]Ttemperature
[in]cell_infocell info for which we are setting interior temperature, for error printing

◆ setContainedCells()

void OpenMCCellAverageProblem::setContainedCells ( const cellInfo cell_info,
const Point &  hint,
std::map< cellInfo, containedCells > &  map 
)
protected

Fill the cached contained cells data structure for a given cell

Parameters
[in]cell_infocell index, instance pair
[in]hintlocation hint used to accelerate the search
[out]mapcontained cell map

◆ setMinimumVolumeQRules()

void OpenMCCellAverageProblem::setMinimumVolumeQRules ( Order &  volume_order,
const std::string &  type 
)
protected

Set a minimum order for a volume quadrature rule

Parameters
[in]volume_orderorder of the volume quadrature rule
[in]typestring type of quadrature rule for printing a console message

◆ setupProblem()

void OpenMCCellAverageProblem::setupProblem ( )

Initialize the mapping of OpenMC to the MooseMesh and perform additional setup actions.

◆ shiftCellInstances()

containedCells OpenMCCellAverageProblem::shiftCellInstances ( const cellInfo cell_info) const
protected

When using the 'identical_cell_fills' feature, this is used to determine the contained material cells in each parent cell by applying a uniform shift

Parameters
[in]cell_infocell index, instance pair
Returns
material cells contained within the given cell

◆ sourceBankFileName()

std::string OpenMCProblemBase::sourceBankFileName ( ) const
inlineprotectedinherited

Get name of source bank file to write

Parameters
[out]filename

◆ storeElementPhase()

void OpenMCCellAverageProblem::storeElementPhase ( )
protected

Loop over the elements in the MOOSE mesh and store the type of feedback applied by each.

◆ stringHasEnding()

bool CardinalProblem::stringHasEnding ( std::string const &  full,
std::string const &  ending 
) const
inherited

Whether a string ends in a particular sub-string

Parameters
[in]fullfull string
[in]endingsub-string ending
Returns
whether full string has ending

◆ subdomainName()

std::string OpenMCProblemBase::subdomainName ( const SubdomainID &  id) const
inherited

Get the subdomain name for a given ID. If not named, we return the ID

Parameters
[in]idsubdomain ID
Returns
name

◆ subdomainsToMaterials()

void OpenMCCellAverageProblem::subdomainsToMaterials ( )
protected

Loop over the mapped cells, and build a map between subdomains to OpenMC materials.

◆ syncSolutions()

virtual void OpenMCCellAverageProblem::syncSolutions ( ExternalProblem::Direction  direction)
overridevirtual

◆ tallyEstimator()

openmc::TallyEstimator OpenMCProblemBase::tallyEstimator ( tally::TallyEstimatorEnum  estimator) const
inherited

Convert from a MooseEnum for tally estimator to an OpenMC enum

Parameters
[in]estimatorMOOSE estimator enum
Returns
OpenMC enum

◆ tallyMeanAcrossBins()

double OpenMCProblemBase::tallyMeanAcrossBins ( std::vector< openmc::Tally * >  tally,
const unsigned int &  score 
) const
inherited

Compute the mean of a tally across all of its bins

Parameters
[in]tallyOpenMC tallies (multiple if repeated mesh tallies)
[in]scoretally score
Returns
tally mean

◆ tallyMultiplier()

Real OpenMCCellAverageProblem::tallyMultiplier ( unsigned int  global_score) const

Multiplier on the normalized tally results; for fixed source runs, we multiply the tally (which has units of eV/source) by the source strength and the eV to joule conversion, while for k-eigenvalue runs, we multiply the normalized tally (which is unitless and has an integral value of 1.0) by the power.

Parameters
[in]global_scoretally score

◆ tallyNormalization()

Real OpenMCCellAverageProblem::tallyNormalization ( unsigned int  global_score) const
protected

Factor by which to normalize a tally

Parameters
[in]global_scoreglobal index for the tally score
Returns
value to divide tally sum by for normalization

◆ tallyScoreToEnum()

std::string OpenMCProblemBase::tallyScoreToEnum ( const std::string &  score) const
inherited

Convert into a MOOSE-type enum from a valid OpenMC tally score string

Parameters
[in]scoreOpenMC tally score string
Returns
MOOSE-type enum string

◆ tallySum()

xt::xtensor<double, 1> OpenMCProblemBase::tallySum ( openmc::Tally *  tally,
const unsigned int &  score 
) const
inherited

Compute the sum of a tally within each bin.

For example, suppose we have a cell tally with 4 bins, one for each of 4 different cells. This function will return the sum of the tally in each of those bins, so the return xtensor will have a length of 4, with each value representing the sum for that bin.

Parameters
[in]tallyOpenMC tally
[in]scoretally score
Returns
tally sum within each bin

◆ tallySumAcrossBins()

double OpenMCProblemBase::tallySumAcrossBins ( std::vector< openmc::Tally * >  tally,
const unsigned int &  score 
) const
inherited

Compute the sum of a tally across all of its bins

Parameters
[in]tallyOpenMC tallies (multiple if repeated mesh tallies)
[in]scoretally score
Returns
tally sum

◆ transformPoint()

virtual Point OpenMCCellAverageProblem::transformPoint ( const Point &  pt) const
inlinevirtual

Apply transformations to point

Parameters
[in]ptpoint
Returns
transformed point

◆ transformPointToOpenMC()

Point OpenMCCellAverageProblem::transformPointToOpenMC ( const Point &  pt) const
protected

Apply transformations and scale point from MOOSE into the OpenMC domain

Parameters
[in]ptpoint
Returns
transformed point

◆ triggerMetric() [1/2]

openmc::TriggerMetric OpenMCProblemBase::triggerMetric ( trigger::TallyTriggerTypeEnum  trigger) const
inherited

Convert from a MooseEnum for a trigger metric to an OpenMC enum

Parameters
[in]triggertrigger metric
Returns
OpenMC enum

◆ triggerMetric() [2/2]

openmc::TriggerMetric OpenMCProblemBase::triggerMetric ( std::string  trigger) const
inherited

◆ updateMaterials()

virtual void OpenMCCellAverageProblem::updateMaterials ( )
protectedvirtual

Re-generate the OpenMC materials in-place, needed for skinning operation where we create new OpenMC materials on-the-fly in order to receive density feedback.

◆ validateLocalTallies()

void OpenMCCellAverageProblem::validateLocalTallies ( )
protected

A function which validates local tallies. This is done to ensure that at least one of the tallies contains a heating score when running in eigenvalue mode. This must be done outside of the constructor as tallies are added from an external system.

◆ validParams()

static InputParameters OpenMCCellAverageProblem::validParams ( )
static

◆ volumeCalculation()

virtual const OpenMCVolumeCalculation* OpenMCCellAverageProblem::volumeCalculation ( ) const
inlinevirtual

Reference to stochastic volume calculation

Returns
reference to stochastic volume calculation

◆ writeSourceBank()

void OpenMCProblemBase::writeSourceBank ( const std::string &  filename)
inherited

Write the source bank to HDF5 for postprocessing or for use in subsequent solves

Parameters
[in]filenamefile name

Member Data Documentation

◆ _all_tally_scores

std::vector<std::string> OpenMCCellAverageProblem::_all_tally_scores
protected

A list of all of the scores contained by the local tallies added in the [Tallies] block.

◆ _assume_separate_tallies

const bool& OpenMCCellAverageProblem::_assume_separate_tallies
protected

Whether it can be assumed that all of the tallies (both those set by the user in the XML file, as well as those created automatically by Cardinal) are spatially separate. This means that once a particle scores to one tally bin, it wouldn't score to ANY other tally bins. This can dramatically increase tracking rates for problems with many tallies.

◆ _cell_level

unsigned int OpenMCCellAverageProblem::_cell_level
protected

Coordinate level in the OpenMC domain to use for mapping cells to mesh. When using 'lowest_cell_level', this parameter indicates that the lowest cell level is used, up until _cell_level.

◆ _cell_phase

std::map<cellInfo, coupling::CouplingFields> OpenMCCellAverageProblem::_cell_phase
protected

Phase of each cell.

◆ _cell_to_contained_material_cells

std::map<cellInfo, containedCells> OpenMCCellAverageProblem::_cell_to_contained_material_cells
protected

Material-type cells contained within a cell; this is only populated if a cell is NOT indicated as having an identical fill

◆ _cell_to_elem

std::map<cellInfo, std::vector<unsigned int> > OpenMCCellAverageProblem::_cell_to_elem
protected

Mapping of OpenMC cell indices to a vector of MOOSE element IDs.

◆ _cell_to_elem_subdomain

std::map<cellInfo, std::unordered_set<SubdomainID> > OpenMCCellAverageProblem::_cell_to_elem_subdomain
protected

Mapping of OpenMC cell indices to the subdomain IDs each maps to.

◆ _cell_to_elem_volume

std::map<cellInfo, Real> OpenMCCellAverageProblem::_cell_to_elem_volume
protected

Volume associated with the mapped element space for each OpenMC cell; the unit for this volume is whatever is used in the [Mesh] block

◆ _cell_to_material

std::map<cellInfo, int32_t> OpenMCCellAverageProblem::_cell_to_material
protected

Material filling each cell to receive density feedback. We enforce that these cells are filled with a material (cannot be filled with a lattice or universe).

◆ _cell_to_n_contained

std::map<cellInfo, int32_t> OpenMCCellAverageProblem::_cell_to_n_contained
protected

Number of material-type cells contained within a cell.

◆ _cell_to_point

std::map<cellInfo, Point> OpenMCCellAverageProblem::_cell_to_point
protected

A point inside the cell, taken simply as the centroid of the first global element inside the cell. This is stored to accelerate the particle search.

◆ _cell_volume

std::map<cellInfo, Real> OpenMCCellAverageProblem::_cell_volume
protected

Volume associated with the actual OpenMC cell, computed by an optional OpenMCVolumeCalculation user object

◆ _check_identical_cell_fills

const bool& OpenMCCellAverageProblem::_check_identical_cell_fills
protected

Whether we should rigorously check that each tally cell has identical fills; this is SLOW for large TRISO problems, but is essential to ensure the accuracy of 'identical_cell_fills'. Please set 'check_identical_cell_fills' to 'true' at least once before running production cases to be sure the optimization can be applied.

◆ _check_tally_sum

const bool OpenMCCellAverageProblem::_check_tally_sum
protected

Whether to check the tallies against the global tally; if set to true, and the tallies added for the 'tally_blocks' do not sum to the global tally, an error is thrown. If you are only performing multiphysics feedback for, say, a single assembly in a full-core OpenMC model, you must set this check to false, because there are known fission sources outside the domain of interest.

If not specified, then this is set to 'true' if normalizing by a global tally, and to 'false' if normalizing by the local tally (because when we choose to normalize by the local tally, we're probably using mesh tallies). But you can of course still set a value for this parameter to override the default.

◆ _dagmc_universe_index

int32_t OpenMCCellAverageProblem::_dagmc_universe_index
protected

Index in the OpenMC universes corresponding to the DAGMC universe.

◆ _density_blocks

std::vector<SubdomainID> OpenMCCellAverageProblem::_density_blocks
protected

Blocks in MOOSE mesh that provide density feedback.

◆ _density_conversion_factor

constexpr Real OpenMCProblemBase::_density_conversion_factor {0.001}
staticprotectedinherited

Conversion unit to transfer between kg/m3 and g/cm3.

◆ _density_vars_to_blocks

std::map<std::string, std::vector<SubdomainName> > OpenMCCellAverageProblem::_density_vars_to_blocks
protected

Mapping from density variable name to the subdomains on which to read it from.

◆ _elem_to_cell

std::vector<cellInfo> OpenMCCellAverageProblem::_elem_to_cell {}
protected

Mapping of MOOSE elements to the OpenMC cell they map to (if any)

◆ _export_properties

const bool& OpenMCCellAverageProblem::_export_properties
protected

Whether OpenMC properties (temperature and density) should be exported after being updated in syncSolutions.

◆ _filters

std::map<std::string, std::shared_ptr<FilterBase> > OpenMCCellAverageProblem::_filters
protected

A map of the filter objects created by the [Problem/Filters] block. The key for each filter is it's corresponding MOOSE name to allow tallies to look up filters.

◆ _first_transfer

bool OpenMCCellAverageProblem::_first_transfer
staticprotected

Whether the present transfer is the first transfer.

◆ _fixed_point_iteration

int OpenMCProblemBase::_fixed_point_iteration
protectedinherited

Fixed point iteration index used in relaxation; because we sometimes run OpenMC in a pseudo-transient coupling with NekRS, we simply increment this by 1 each time we call openmc::run(). This uses a zero indexing, so after the first iteration, we have finished iteration 0, and so on.

◆ _global_sum_tally

std::vector<Real> OpenMCCellAverageProblem::_global_sum_tally
protected

Sum value of the global tally(s), across all bins.

◆ _global_tallies

std::vector<openmc::Tally *> OpenMCCellAverageProblem::_global_tallies
protected

Global tallies. We add one per tally added in the [Tallies] block to enable global noramlization.

◆ _global_tally_estimators

std::vector<openmc::TallyEstimator> OpenMCCellAverageProblem::_global_tally_estimators
protected

Global tally estimators corresponding to '_global_tallies'.

◆ _global_tally_index

unsigned int OpenMCCellAverageProblem::_global_tally_index = 0
protected

Index in OpenMC tallies corresponding to the first global tally added by Cardinal.

◆ _global_tally_scores

std::vector<std::vector<std::string> > OpenMCCellAverageProblem::_global_tally_scores
protected

Global tally scores corresponding to '_global_tallies'.

◆ _has_cell_tallies

bool OpenMCCellAverageProblem::_has_cell_tallies = false
protected

Whether any cell tallies exist.

◆ _has_identical_cell_fills

const bool OpenMCCellAverageProblem::_has_identical_cell_fills
protected

If known a priori by the user, whether the tally cells (which are not simply material fills) have EXACTLY the same contained material cells. This is a big optimization for TRISO problems in setting up homogenized temperature/density feedback to OpenMC.

The concept can best be explained with a pebble bed reactor. If every pebble is filled with an identical TRISO universe, then the material fills in each pebble are identical to one another except for a constant offset. This idea can be used to then skip all but the first two openmc::Cell::get_contained_cells calls (which are required in order to figure out the pattern by which pebble N is incremented relative to pebble 1).

When using this parameter, we HIGHLY recommend setting 'check_identical_cell_fills = true' the first time you run your model. This will figure out the material cell fills using a method that calls openmc::Cell::get_contained_cells for every tally cell, i.e. without assuming anything about repeated structure in your OpenMC model. Setting 'identical_cell_fills' without also setting 'check_identical_cell_fills = true' may result in SILENT errors!!! So it is essential to be sure you've removed any error sources before you turn the error check off to actually leverage the speedup.

Note: for any tally cells that are just filled with a material, we use the approach where openmc::Cell::get_contained_cells is called in full.

This optimization will not work (and 'check_identical_cell_fills = true' will catch these) for:

  • any situation where tallied, non-material-fill pebbles have different fills (such as if you have different TRISO lattices in each pebble)
  • any situation where there is a "gap" in the incrementing of the material fill instances (such as if pebble 89 does not map to 'tally_blocks', then the instance shift for pebble 90 relative to pebble 1 is 89, when it should have been 90).

◆ _identical_cell_fill_blocks

std::unordered_set<SubdomainID> OpenMCCellAverageProblem::_identical_cell_fill_blocks
protected

Blocks for which the cell fills are identical.

◆ _initial_condition

const coupling::OpenMCInitialCondition OpenMCCellAverageProblem::_initial_condition
protected

Where to get the initial OpenMC temperatures and densities from; can be either hdf5 (from a properties.h5 file), xml (whatever is already set in the XML files), or moose (meaning whatever ICs are set on the 'temperature_variables' and 'density_variables'

◆ _k_trigger

const trigger::TallyTriggerTypeEnum OpenMCCellAverageProblem::_k_trigger
protected

Type of trigger to apply to k eigenvalue to indicate when the simulation is complete. These can be used to on-the-fly adjust the number of active batches in order to reach some desired criteria (which is specified by this parameter).

◆ _local_cell_to_elem

std::map<cellInfo, std::vector<unsigned int> > OpenMCCellAverageProblem::_local_cell_to_elem
protected

Mapping of OpenMC cell indices to a vector of MOOSE element IDs, on each local rank.

◆ _local_mean_tally

std::vector<Real> OpenMCCellAverageProblem::_local_mean_tally
protected

Mean value of the local tally(s), across all bins; only used for fixed source mode.

◆ _local_sum_tally

std::vector<Real> OpenMCCellAverageProblem::_local_sum_tally
protected

Sum value of the local tally(s), across all bins.

◆ _local_tallies

std::vector<std::shared_ptr<TallyBase> > OpenMCCellAverageProblem::_local_tallies
protected

A vector of the tally objects created by the [Problem/Tallies] block.

◆ _local_tally_score_map

std::vector<std::map<std::string, int> > OpenMCCellAverageProblem::_local_tally_score_map
protected

The [Tallies] block allows tallies with different scores, and so we can't assume they have the same indices in each tally's arrays. This variable map between the name of each score and it's index in each local tally.

◆ _local_to_global_elem

std::vector<unsigned int> OpenMCProblemBase::_local_to_global_elem
protectedinherited

Mapping from local element indices to global element indices for this rank.

◆ _map_density_by_cell

bool OpenMCCellAverageProblem::_map_density_by_cell
protected

Whether to map density according to each individual OpenMC cell (in which case an error is thrown if you don't have a unique material in each cell) or by material.

◆ _material_cells_only

bool OpenMCCellAverageProblem::_material_cells_only {true}
protected

Whether non-material cells are mapped.

◆ _n_cell_digits

int OpenMCProblemBase::_n_cell_digits
protectedinherited

Number of digits to use to display the cell ID for diagnostic messages; this is estimated conservatively based on the total number of cells, even though there may be distributed cells such that the maximum cell ID is far smaller than the total number of cells.

◆ _n_mapped_density_elems

int OpenMCCellAverageProblem::_n_mapped_density_elems
protected

Number of MOOSE elements that exclusively provide density feedback, and which successfully mapped to OpenMC cells

◆ _n_mapped_none_elems

int OpenMCCellAverageProblem::_n_mapped_none_elems
protected

Number of no-coupling elements mapped to OpenMC cells.

◆ _n_mapped_temp_density_elems

int OpenMCCellAverageProblem::_n_mapped_temp_density_elems
protected

Number of MOOSE elements that provide temperature+density feedback, and which successfully mapped to OpenMC cells

◆ _n_mapped_temp_elems

int OpenMCCellAverageProblem::_n_mapped_temp_elems
protected

Number of MOOSE elements that exclusively provide temperature feedback, and which successfully mapped to OpenMC cells

◆ _n_moose_density_elems

int OpenMCCellAverageProblem::_n_moose_density_elems
protected

Number of elements in the MOOSE mesh that exclusively provide density feedback.

◆ _n_moose_none_elems

int OpenMCCellAverageProblem::_n_moose_none_elems
protected

Number of no-coupling elements in the MOOSE mesh.

◆ _n_moose_temp_density_elems

int OpenMCCellAverageProblem::_n_moose_temp_density_elems
protected

Number of elements in the MOOSE mesh which provide temperature+density feedback.

◆ _n_moose_temp_elems

int OpenMCCellAverageProblem::_n_moose_temp_elems
protected

Number of elements in the MOOSE mesh that exclusively provide temperature feedback.

◆ _n_none

std::map<cellInfo, int> OpenMCCellAverageProblem::_n_none
protected

Number of none elements in each mapped OpenMC cell (global)

◆ _n_openmc_cells

long unsigned int OpenMCCellAverageProblem::_n_openmc_cells
protected

Total number of unique OpenMC cell IDs + instances combinations.

◆ _n_particles_1

unsigned int OpenMCCellAverageProblem::_n_particles_1
protected

Number of particles simulated in the first iteration.

◆ _n_rho

std::map<cellInfo, int> OpenMCCellAverageProblem::_n_rho
protected

Number of density-only feedback elements in each mapped OpenMC cell (global)

◆ _n_temp

std::map<cellInfo, int> OpenMCCellAverageProblem::_n_temp
protected

Number of temperature-only feedback elements in each mapped OpenMC cell (global)

◆ _n_temp_rho

std::map<cellInfo, int> OpenMCCellAverageProblem::_n_temp_rho
protected

Number of temperature+density feedback elements in each mapped OpenMC cell (global)

◆ _need_to_reinit_coupling

const bool OpenMCCellAverageProblem::_need_to_reinit_coupling
protected

If 'fixed_mesh' is false, this indicates that the [Mesh] is changing during the simulation (either from adaptive refinement or from deformation). When the mesh changes during the simulation, the mapping from OpenMC cells to the [Mesh] must be re-established after each OpenMC run.

◆ _needs_global_tally

const bool OpenMCCellAverageProblem::_needs_global_tally
protected

Whether a global tally is required for the sake of normalization and/or checking the tally sum

◆ _needs_to_map_cells

bool OpenMCCellAverageProblem::_needs_to_map_cells
protected

Whether any spatial mapping from OpenMC's cells to the mesh is needed.

◆ _normalize_by_global

const bool OpenMCCellAverageProblem::_normalize_by_global
protected

How to normalize the OpenMC tally into units of W/volume. If 'true', normalization is performed by dividing each local tally against a problem-global tally. The advantage of this approach is that some non-zero tally regions of the OpenMC domain can be excluded from multiphysics feedback (without us having to guess what the power of the included part of the domain is). This can let us do "zooming" type calculations, where perhaps we only want to send T/H feedback to one bundle in a full core.

If 'false', normalization is performed by dividing each local tally by the sum of the local tally itself. The advantage of this approach becomes evident when using mesh tallies. If a mesh tally does not perfectly align with an OpenMC cell - for instance, a first-order sphere mesh will not perfectly match the volume of a TRISO pebble - then not all of the power actually produced in the pebble is tallies on the mesh approximation to that pebble. Therefore, if you set a core power of 1 MW and you normalized based on a global tally, you'd always miss some of that power when sending to MOOSE. So, in this case, it is better to normalize against the local tally itself so that the correct power is preserved.

◆ _nuclide_densities_uos

std::vector<OpenMCNuclideDensities *> OpenMCProblemBase::_nuclide_densities_uos
protectedinherited

Userobjects for changing OpenMC material compositions.

◆ _output_cell_mapping

const bool& OpenMCCellAverageProblem::_output_cell_mapping
protected

Whether to automatically compute the mapping of OpenMC cell IDs and instances to the [Mesh].

◆ _particle

openmc::Particle OpenMCCellAverageProblem::_particle
protected

Dummy particle to reduce number of allocations of particles for cell lookup routines.

◆ _power

const Real* OpenMCProblemBase::_power
protectedinherited

Power by which to normalize the OpenMC results, for k-eigenvalue mode.

◆ _printed_initial

bool OpenMCCellAverageProblem::_printed_initial
staticprotected

Whether the diagnostic tables on initialization have already been printed.

◆ _printed_triso_warning

bool OpenMCCellAverageProblem::_printed_triso_warning
staticprotected

Whether a warning has already been printed about very long setup times (for TRISOs)

◆ _relaxation

const relaxation::RelaxationEnum OpenMCCellAverageProblem::_relaxation
protected

Type of relaxation to apply to the OpenMC tallies.

◆ _relaxation_factor

const Real& OpenMCCellAverageProblem::_relaxation_factor
protected

Constant relaxation factor.

◆ _reuse_source

bool OpenMCProblemBase::_reuse_source
protectedinherited

Whether to take the starting fission source from iteration \(n\) as the fission source converged from iteration \(n-1\). Setting this to true will in most cases lead to improved convergence of the initial source as iterations progress because you don't "start from scratch" each iteration and do the same identical (within a random number seed) converging of the fission source.

◆ _run_mode

openmc::RunMode OpenMCProblemBase::_run_mode
protectedinherited

OpenMC run mode.

◆ _scaling

const Real& OpenMCProblemBase::_scaling
protectedinherited

Multiplicative factor to apply to the mesh in the [Mesh] block in order to convert whatever units that mesh is in into OpenMC's length scale of centimeters. For instance, it is commonplace to develop fuel performance models with a length scale of meters. Rather than onerously convert all MOOSE inputs to which OpenMC will be coupled to units of centimeters, this parameter allows us to scale the mesh we couple to OpenMC. Note that this does not actually scale the mesh itself, but simply multiplies the mesh coordinates by this parameter when identifying the mapping between elements and cells.

By default, this parameter is set to 1.0, meaning that OpenMC is coupled to another MOOSE application with an input written in terms of centimeters. Set this parameter to 100 if the coupled MOOSE application is in units of meters, for instance.

To summarize by example - if the MOOSE application uses units of meters, with a mesh named mesh.exo, then the OpenMC-wrapped input file should also use that mesh (with units of meters) in its [Mesh] block (or perhaps a coarser version of that mesh if the resolution of coupling does not need to match - the units just have to be the same). Then, you should set 'scaling = 100.0' so that the mapping is performed correctly.

◆ _serialized_solution

std::unique_ptr<NumericVector<Number> > OpenMCCellAverageProblem::_serialized_solution
protected

◆ _skip_statepoint

const bool& OpenMCProblemBase::_skip_statepoint
protectedinherited

Whether to skip writing statepoints from OpenMC.

◆ _source_rate_index

unsigned int OpenMCCellAverageProblem::_source_rate_index
protected

Index in tally_score pointing to the score used for normalizing flux tallies in eigenvalue mode.

◆ _source_strength

const Real* OpenMCProblemBase::_source_strength
protectedinherited

Source strength by which to normalize the OpenMC results, for fixed source mode.

◆ _specified_density_feedback

const bool OpenMCCellAverageProblem::_specified_density_feedback
protected

Whether the problem has density feedback blocks specified; note that this is NOT necessarily indicative that the mapping was successful in finding any cells corresponding to those blocks

◆ _specified_scaling

const bool OpenMCProblemBase::_specified_scaling
protectedinherited

Whether a mesh scaling was specified by the user.

◆ _specified_temperature_feedback

const bool OpenMCCellAverageProblem::_specified_temperature_feedback
protected

Whether the problem has temperature feedback blocks specified; note that this is NOT necessarily indicative that the mapping was successful in finding any cells corresponding to those blocks

◆ _subdomain_to_material

std::map<SubdomainID, std::set<int32_t> > OpenMCCellAverageProblem::_subdomain_to_material
protected

Mapping of elem subdomains to materials.

◆ _symmetry

const SymmetryPointGenerator* OpenMCCellAverageProblem::_symmetry
protected

Userobject that maps from a partial-symmetry OpenMC model to a whole-domain [Mesh].

◆ _tally_ext_var_ids

std::vector<std::vector<std::vector<unsigned int> > > OpenMCCellAverageProblem::_tally_ext_var_ids
protected

A vector of external (output-based) auxvariable ids added by the [Tallies] block.

◆ _tally_nuclides_uos

std::vector<OpenMCTallyNuclides *> OpenMCProblemBase::_tally_nuclides_uos
protectedinherited

Userobjects for changing OpenMC tally nuclides.

◆ _tally_var_ids

std::vector<std::vector<unsigned int> > OpenMCCellAverageProblem::_tally_var_ids
protected

A vector of auxvariable ids added by the [Tallies] block.

◆ _temp_blocks

std::vector<SubdomainID> OpenMCCellAverageProblem::_temp_blocks
protected

Blocks in MOOSE mesh that provide temperature feedback.

◆ _temp_vars_to_blocks

std::map<std::string, std::vector<SubdomainName> > OpenMCCellAverageProblem::_temp_vars_to_blocks
protected

Mapping from temperature variable name to the subdomains on which to read it from.

◆ _total_n_particles

unsigned int OpenMCProblemBase::_total_n_particles
protectedinherited

Total number of particles simulated.

◆ _uncoupled_volume

Real OpenMCCellAverageProblem::_uncoupled_volume
protected

Total volume of uncoupled MOOSE mesh elements.

◆ _verbose

const bool& OpenMCProblemBase::_verbose
protectedinherited

Whether to print diagnostic information about model setup and the transfers.

◆ _volume_calc

OpenMCVolumeCalculation* OpenMCCellAverageProblem::_volume_calc
protected

Optional volume calculation for cells which map to MOOSE.

◆ DIMENSION

constexpr int OpenMCCellAverageProblem::DIMENSION {3}
static

Spatial dimension of the Monte Carlo problem.

◆ EV_TO_JOULE

constexpr Real OpenMCCellAverageProblem::EV_TO_JOULE = 1.6022e-19
staticprotected

Conversion rate from eV to Joule.

◆ MATERIAL_VOID

constexpr int OpenMCProblemBase::MATERIAL_VOID {-1}
staticprotectedinherited

ID used by OpenMC to indicate that a material fill is VOID.

◆ UNMAPPED

constexpr int32_t OpenMCCellAverageProblem::UNMAPPED {-1}
static

Constant flag to indicate that a cell/element was unmapped.

◆ ZERO_TALLY_THRESHOLD

constexpr Real OpenMCCellAverageProblem::ZERO_TALLY_THRESHOLD = 1e-12
staticprotected

Tolerance for setting zero tally.


The documentation for this class was generated from the following file: