24 #include "PostprocessorInterface.h" 30 #include "openmc/bank.h" 31 #include "openmc/capi.h" 32 #include "openmc/cell.h" 33 #include "openmc/geometry.h" 34 #include "openmc/geometry_aux.h" 35 #include "openmc/hdf5_interface.h" 36 #include "openmc/material.h" 37 #include "openmc/mesh.h" 38 #include "openmc/settings.h" 39 #include "openmc/simulation.h" 40 #include "openmc/source.h" 41 #include "openmc/state_point.h" 42 #include "openmc/tallies/tally.h" 43 #include "openmc/tallies/filter_cell_instance.h" 44 #include "xtensor/xview.hpp" 90 unsigned int addExternalVariable(
const std::string & name,
const std::vector<SubdomainName> * block =
nullptr);
123 virtual void geometryType(
bool & has_csg_universe,
bool & has_dag_universe)
const;
168 xt::xtensor<double, 1>
tallySum(openmc::Tally *
tally,
const unsigned int & score)
const;
220 xt::xtensor<double, 1>
relativeError(
const xt::xtensor<double, 1> & sum,
221 const xt::xtensor<double, 1> & sum_sq,
const int & n_realizations)
const;
246 int32_t
cellID(
const int32_t index)
const;
253 int32_t
materialID(
const int32_t index)
const;
259 std::string
printPoint(
const Point & p)
const;
304 virtual void setCellTemperature(
const int32_t &
id,
const int32_t & instance,
const Real & T,
320 virtual std::string
printCell(
const cellInfo & cell_info,
const bool brief =
false)
const;
328 virtual std::vector<int32_t>
cellFill(
const cellInfo & cell_info,
int & fill_type)
const;
362 const std::vector<unsigned int> & elem_ids,
371 return openmc::settings::path_output +
"initial_source_" +
TallyTriggerTypeEnum
Type of trigger to apply.
Definition: CardinalEnums.h:163
unsigned int _total_n_particles
Total number of particles simulated.
Definition: OpenMCProblemBase.h:429
int _fixed_point_iteration
Definition: OpenMCProblemBase.h:426
std::string materialName(const int32_t index) const
bool isReactionRateScore(const std::string &score) const
void writeSourceBank(const std::string &filename)
double tallyMeanAcrossBins(std::vector< openmc::Tally * > tally, const unsigned int &score) const
const bool _specified_scaling
Whether a mesh scaling was specified by the user.
Definition: OpenMCProblemBase.h:394
std::vector< OpenMCTallyNuclides * > _tally_nuclides_uos
Userobjects for changing OpenMC tally nuclides.
Definition: OpenMCProblemBase.h:449
const bool & _skip_statepoint
Whether to skip writing statepoints from OpenMC.
Definition: OpenMCProblemBase.h:418
const Real & densityConversionFactor() const
Definition: OpenMCProblemBase.h:227
bool materialFill(const cellInfo &cell_info, int32_t &material_index) const
long unsigned int numCells() const
virtual ~OpenMCProblemBase() override
static InputParameters validParams()
int32_t materialID(const int32_t index) const
bool isHeatingScore(const std::string &score) const
unsigned int addExternalVariable(const std::string &name, const std::vector< SubdomainName > *block=nullptr)
virtual std::vector< int32_t > cellFill(const cellInfo &cell_info, int &fill_type) const
std::vector< unsigned int > _local_to_global_elem
Mapping from local element indices to global element indices for this rank.
Definition: OpenMCProblemBase.h:452
std::string sourceBankFileName() const
Definition: OpenMCProblemBase.h:369
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:458
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:440
void getOpenMCUserObjects()
Find all userobjects which are changing OpenMC data structures.
Definition: CardinalEnums.h:206
xt::xtensor< double, 1 > relativeError(const xt::xtensor< double, 1 > &sum, const xt::xtensor< double, 1 > &sum_sq, const int &n_realizations) const
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
openmc::TriggerMetric triggerMetric(trigger::TallyTriggerTypeEnum trigger) const
std::vector< OpenMCNuclideDensities * > _nuclide_densities_uos
Userobjects for changing OpenMC material compositions.
Definition: OpenMCProblemBase.h:446
const Real & scaling() const
Definition: OpenMCProblemBase.h:96
std::string printPoint(const Point &p) const
bool cellIsVoid(const cellInfo &cell_info) const
Definition: OpenMCProblemBase.h:49
void importProperties() const
Import temperature and density from a properties.h5 file.
TallyEstimatorEnum
Type of estimator to use for OpenMC tallies.
Definition: CardinalEnums.h:140
int nTotalParticles() const
Definition: OpenMCProblemBase.h:239
bool cellHasZeroInstances(const cellInfo &cell_info) const
const Real & _scaling
Definition: OpenMCProblemBase.h:415
static constexpr Real _density_conversion_factor
Conversion unit to transfer between kg/m3 and g/cm3.
Definition: OpenMCProblemBase.h:455
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:432
unsigned int numElemsInSubdomain(const SubdomainID &id) const
bool hasScaling() const
Definition: OpenMCProblemBase.h:102
const bool & _verbose
Whether to print diagnostic information about model setup and the transfers.
Definition: OpenMCProblemBase.h:376
bool _reuse_source
Definition: OpenMCProblemBase.h:391
void fillElementalAuxVariable(const unsigned int &var_num, const std::vector< unsigned int > &elem_ids, const Real &value)
xt::xtensor< double, 1 > tallySum(openmc::Tally *tally, const unsigned int &score) const
Compute the sum of a tally within each bin.
std::string printMaterial(const int32_t &index) const
openmc::TallyEstimator tallyEstimator(tally::TallyEstimatorEnum estimator) const
unsigned int globalElemID(const unsigned int &id) const
Definition: OpenMCProblemBase.h:293
Definition: CardinalEnums.h:160
std::string subdomainName(const SubdomainID &id) const
void catchOpenMCError(const int &err, const std::string descriptor) const
virtual void setCellDensity(const Real &density, const cellInfo &cell_info) const
Definition: CardinalEnums.h:129
bool firstSolve() const
Whether this is the first time OpenMC is running.
openmc::RunMode _run_mode
OpenMC run mode.
Definition: OpenMCProblemBase.h:443
const Real * _source_strength
Source strength by which to normalize the OpenMC results, for fixed source mode.
Definition: OpenMCProblemBase.h:382
std::pair< int32_t, int32_t > cellInfo
Definition: OpenMCProblemBase.h:190
std::string estimatorToString(openmc::TallyEstimator estimator) const
void externalSolve() override
Run a k-eigenvalue OpenMC simulation.
const Real * _power
Power by which to normalize the OpenMC results, for k-eigenvalue mode.
Definition: OpenMCProblemBase.h:379
bool isLocalElem(const Elem *elem) const
std::string enumToTallyScore(const std::string &score) const
double tallySumAcrossBins(std::vector< openmc::Tally * > tally, const unsigned int &score) const
std::string tallyScoreToEnum(const std::string &score) const