24 #include "PostprocessorInterface.h" 28 #include "openmc/bank.h" 29 #include "openmc/capi.h" 30 #include "openmc/cell.h" 31 #include "openmc/geometry.h" 32 #include "openmc/geometry_aux.h" 33 #include "openmc/hdf5_interface.h" 34 #include "openmc/material.h" 35 #include "openmc/mesh.h" 36 #include "openmc/settings.h" 37 #include "openmc/simulation.h" 38 #include "openmc/source.h" 39 #include "openmc/state_point.h" 40 #include "openmc/tallies/tally.h" 41 #include "openmc/tallies/filter_cell_instance.h" 47 class OpenMCCellTransform;
50 typedef openmc::tensor::Tensor<double>
OMCTensor;
91 const std::string & system,
92 const std::vector<SubdomainName> * block =
nullptr);
125 virtual void geometryType(
bool & has_csg_universe,
bool & has_dag_universe)
const;
159 virtual void syncSolutions(ExternalProblem::Direction direction)
override;
186 const unsigned int & score)
const;
195 const unsigned int & score)
const;
240 Real
relativeError(
const Real & sum,
const Real & sum_sq,
const int & n_realizations)
const;
274 int32_t
cellID(
const int32_t index)
const;
281 int32_t
materialID(
const int32_t index)
const;
287 std::string
printPoint(
const Point & p)
const;
334 const int32_t & instance,
351 virtual std::string
printCell(
const cellInfo & cell_info,
const bool brief =
false)
const;
359 virtual std::vector<int32_t>
cellFill(
const cellInfo & cell_info,
int & fill_type)
const;
435 const std::vector<unsigned int> & elem_ids,
444 return openmc::settings::path_output +
"initial_source_" +
TallyTriggerTypeEnum
Type of trigger to apply.
Definition: CardinalEnums.h:190
unsigned int _total_n_particles
Total number of particles simulated.
Definition: OpenMCProblemBase.h:502
const int64_t _initial_seed
The initial OpenMC seed.
Definition: OpenMCProblemBase.h:550
int _fixed_point_iteration
Definition: OpenMCProblemBase.h:499
std::string materialName(const int32_t index) const
bool isReactionRateScore(const std::string &score) const
void writeSourceBank(const std::string &filename)
const bool _specified_scaling
Whether a mesh scaling was specified by the user.
Definition: OpenMCProblemBase.h:467
const bool & _skip_statepoint
Whether to skip writing statepoints from OpenMC.
Definition: OpenMCProblemBase.h:491
const Real & densityConversionFactor() const
Definition: OpenMCProblemBase.h:246
const bool _calc_kinetics_params
A flag to indicate if OpenMC is calculating kinetics parameters.
Definition: OpenMCProblemBase.h:544
bool materialFill(const cellInfo &cell_info, int32_t &material_index) const
long unsigned int numCells() const
virtual ~OpenMCProblemBase() override
void checkOpenMCUserObjectIDs() const
Ensure that the IDs of OpenMC objects in UserObjects don't clash.
openmc::Tally * _ifp_common_tally
The global tally used to accumulate the common scores required for kinetics parameters.
Definition: OpenMCProblemBase.h:562
static InputParameters validParams()
int32_t materialID(const int32_t index) const
bool isHeatingScore(const std::string &score) const
Definition: OpenMCTallyEditor.h:30
virtual std::vector< int32_t > cellFill(const cellInfo &cell_info, int &fill_type) const
OMCTensor tallySum(const openmc::Tally *tally, const unsigned int &score) const
Compute the sum of a tally within each bin.
openmc::RunMode runMode() const
Definition: OpenMCProblemBase.h:267
virtual bool adaptMesh() override
unsigned int addExternalVariable(const std::string &name, const std::string &system, const std::vector< SubdomainName > *block=nullptr)
std::vector< unsigned int > _local_to_global_elem
Mapping from local element indices to global element indices for this rank.
Definition: OpenMCProblemBase.h:531
bool computeKineticsParams() const
Definition: OpenMCProblemBase.h:386
const bool _has_adaptivity
Whether or not the problem contains mesh adaptivity.
Definition: OpenMCProblemBase.h:534
std::string sourceBankFileName() const
Definition: OpenMCProblemBase.h:442
Definition: OpenMCNuclideDensities.h:28
OpenMCProblemBase(const InputParameters ¶ms)
void sendNuclideDensitiesToOpenMC()
Set the nuclide densities for any materials being modified via MOOSE.
static constexpr int MATERIAL_VOID
ID used by OpenMC to indicate that a material fill is VOID.
Definition: OpenMCProblemBase.h:574
virtual void geometryType(bool &has_csg_universe, bool &has_dag_universe) const
virtual void setCellTemperature(const int32_t &id, const int32_t &instance, const Real &T, const cellInfo &cell_info) const
int _n_cell_digits
Definition: OpenMCProblemBase.h:513
void getOpenMCUserObjects()
Find all userobjects which are changing OpenMC data structures.
bool hasCellTransform() const
Whether OpenMC cell transforms are being applied to the geometry.
void checkTallyEditorIDs() const
Ensure that any tally editors don't apply to Cardinal-mapped tallies.
Definition: CardinalEnums.h:233
Definition: OpenMCDomainFilterEditor.h:32
OMCTensor relativeError(const OMCTensor &sum, const OMCTensor &sum_sq, const int &n_realizations) const
std::vector< OpenMCTallyEditor * > _tally_editor_uos
Userobjects for creating/changing OpenMC tallies.
Definition: OpenMCProblemBase.h:525
int32_t cellID(const int32_t index) const
virtual std::string printCell(const cellInfo &cell_info, const bool brief=false) const
Definition: CardinalProblem.h:26
void executeTallyEditors()
Execute all tally editor userobjects.
CriticalitySearchBase * _criticality_search
Object to use for a criticality search.
Definition: OpenMCProblemBase.h:577
openmc::TriggerMetric triggerMetric(trigger::TallyTriggerTypeEnum trigger) const
std::vector< OpenMCNuclideDensities * > _nuclide_densities_uos
Userobjects for changing OpenMC material compositions.
Definition: OpenMCProblemBase.h:519
const Real & scaling() const
Definition: OpenMCProblemBase.h:98
std::string printPoint(const Point &p) const
bool cellIsVoid(const cellInfo &cell_info) const
const openmc::Tally & getMGBetaTally()
Definition: OpenMCProblemBase.h:55
void importProperties() const
Import temperature and density from a properties.h5 file.
Definition: CriticalitySearchBase.h:29
openmc::Tally * _ifp_mg_beta_tally
The global tally used to accumulate the score required for \beta_eff.
Definition: OpenMCProblemBase.h:565
TallyEstimatorEnum
Type of estimator to use for OpenMC tallies.
Definition: CardinalEnums.h:167
int nTotalParticles() const
Definition: OpenMCProblemBase.h:261
bool cellHasZeroInstances(const cellInfo &cell_info) const
const Real & _scaling
Definition: OpenMCProblemBase.h:488
static constexpr Real _density_conversion_factor
Conversion unit to transfer between kg/m3 and g/cm3.
Definition: OpenMCProblemBase.h:571
void sendTallyNuclidesToOpenMC()
Set the tally nuclides for any tallies being modified via MOOSE.
long unsigned int _n_openmc_cells
Total number of unique OpenMC cell IDs + instances combinations.
Definition: OpenMCProblemBase.h:505
int _ifp_mg_beta_tally_index
Definition: OpenMCProblemBase.h:559
unsigned int numElemsInSubdomain(const SubdomainID &id) const
std::vector< OpenMCCellTransform * > _cell_transform_uos
Userobjects for updating OpenMC cell transforms.
Definition: OpenMCProblemBase.h:528
bool hasScaling() const
Definition: OpenMCProblemBase.h:104
const bool & _verbose
Whether to print diagnostic information about model setup and the transfers.
Definition: OpenMCProblemBase.h:449
double tallySumAcrossBins(std::vector< const openmc::Tally * > tally, const unsigned int &score) const
bool _reuse_source
Definition: OpenMCProblemBase.h:464
int _ifp_common_tally_index
The index of a global tally which accumulates the common scores required for kinetics parameters.
Definition: OpenMCProblemBase.h:553
virtual void syncSolutions(ExternalProblem::Direction direction) override
Set the 'mesh changed' adaptivity flag.
openmc::tensor::Tensor< double > OMCTensor
Definition: OpenMCProblemBase.h:48
void fillElementalAuxVariable(const unsigned int &var_num, const std::vector< unsigned int > &elem_ids, const Real &value)
std::vector< OpenMCDomainFilterEditor * > _filter_editor_uos
Userobjects for creating/changing OpenMC filters.
Definition: OpenMCProblemBase.h:522
virtual std::vector< int32_t > getMappedTallyIDs() const =0
std::string printMaterial(const int32_t &index) const
const openmc::Tally & getCommonKineticsTally()
openmc::TallyEstimator tallyEstimator(tally::TallyEstimatorEnum estimator) const
const bool & _reset_seed
Whether to reset the seed each time a new OpenMC calculation runs.
Definition: OpenMCProblemBase.h:547
unsigned int globalElemID(const unsigned int &id) const
Definition: OpenMCProblemBase.h:321
double tallyMeanAcrossBins(std::vector< const openmc::Tally * > tally, const unsigned int &score) const
Definition: CardinalEnums.h:187
bool _run_on_adaptivity_cycle
Definition: OpenMCProblemBase.h:541
std::string subdomainName(const SubdomainID &id) const
virtual void setCellDensity(const Real &density, const cellInfo &cell_info) const
Definition: CardinalEnums.h:157
bool firstSolve() const
Whether this is the first time OpenMC is running.
openmc::RunMode _run_mode
OpenMC run mode.
Definition: OpenMCProblemBase.h:516
const Real * _particles
Number of particles that OpenMC will run in each batch.
Definition: OpenMCProblemBase.h:249
const Real * _source_strength
Source strength by which to normalize the OpenMC results, for fixed source mode.
Definition: OpenMCProblemBase.h:455
const std::string & _xml_directory
Directory in which OpenMC settings xml files are located.
Definition: OpenMCProblemBase.h:568
virtual void initialSetup() override
Set up an OpenMC simulation.
std::pair< int32_t, int32_t > cellInfo
Definition: OpenMCProblemBase.h:201
std::string estimatorToString(openmc::TallyEstimator estimator) const
void externalSolve() override
Run an OpenMC simulation.
const Real * _power
Power by which to normalize the OpenMC results, for k-eigenvalue mode.
Definition: OpenMCProblemBase.h:452
void executeFilterEditors()
Execute all filter editor userobjects.
bool isLocalElem(const Elem *elem) const
std::string enumToTallyScore(const std::string &score) const
std::string tallyScoreToEnum(const std::string &score) const