Cardinal
OpenMCVolumeCalculation.h
Go to the documentation of this file.
1 /********************************************************************/
2 /* SOFTWARE COPYRIGHT NOTIFICATION */
3 /* Cardinal */
4 /* */
5 /* (c) 2021 UChicago Argonne, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by UChicago Argonne, LLC */
9 /* Under Contract No. DE-AC02-06CH11357 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* Prepared by Battelle Energy Alliance, LLC */
13 /* Under Contract No. DE-AC07-05ID14517 */
14 /* With the U. S. Department of Energy */
15 /* */
16 /* See LICENSE for full restrictions */
17 /********************************************************************/
18 
19 #pragma once
20 
21 #include "GeneralUserObject.h"
22 #include "openmc/volume_calc.h"
23 
28 class OpenMCVolumeCalculation : public GeneralUserObject
29 {
30 public:
31  static InputParameters validParams();
32 
33  OpenMCVolumeCalculation(const InputParameters & parameters);
34 
35  virtual void initialize() {}
36  virtual void finalize() {}
37  virtual void execute() {}
38 
40  virtual void initializeVolumeCalculation();
41 
43  virtual void computeVolumes();
44 
46  virtual void resetVolumeCalculation();
47 
53  openmc::Position position(const Point & pt) const;
54 
61  void cellVolume(const unsigned int & index, Real & vol, Real & std_dev) const;
62 
63 protected:
65  const unsigned int & _n_samples;
66 
68  const MooseEnum _trigger;
69 
72 
74  Real _scaling;
75 
77  Point _lower_left;
78 
80  Point _upper_right;
81 
83  std::unique_ptr<openmc::VolumeCalculation> _volume_calc;
84 
86  std::vector<openmc::VolumeCalculation::Result> _results;
87 
89  std::map<int, int> _index_to_calc_index;
90 
92  unsigned int _calc_index;
93 };
std::vector< openmc::VolumeCalculation::Result > _results
Results of the volume calculation.
Definition: OpenMCVolumeCalculation.h:86
Real _trigger_threshold
Threshold for terminating the trigger.
Definition: OpenMCVolumeCalculation.h:71
Real _scaling
Length multiplier applied to [Mesh] to get into OpenMC centimeters.
Definition: OpenMCVolumeCalculation.h:74
const MooseEnum _trigger
Trigger for deciding when to terminate the stochastic volume calculation.
Definition: OpenMCVolumeCalculation.h:68
virtual void resetVolumeCalculation()
Erase previously-added volume calculation.
const unsigned int & _n_samples
Number of stochastic samples for calculation.
Definition: OpenMCVolumeCalculation.h:65
unsigned int _calc_index
Index of volume calculation we add in OpenMC.
Definition: OpenMCVolumeCalculation.h:92
Definition: CardinalEnums.h:166
openmc::Position position(const Point &pt) const
static InputParameters validParams()
OpenMCVolumeCalculation(const InputParameters &parameters)
Definition: OpenMCVolumeCalculation.h:28
virtual void initialize()
Definition: OpenMCVolumeCalculation.h:35
Point _upper_right
Upper right of the box within which to compute OpenMC volumes.
Definition: OpenMCVolumeCalculation.h:80
virtual void execute()
Definition: OpenMCVolumeCalculation.h:37
std::unique_ptr< openmc::VolumeCalculation > _volume_calc
Volume calculation object.
Definition: OpenMCVolumeCalculation.h:83
virtual void initializeVolumeCalculation()
Initialize the volume calculation (not in initialize() because we want to control this from the Probl...
virtual void computeVolumes()
Compute the cell volumes.
Point _lower_left
Lower left of the box within which to compute OpenMC volumes.
Definition: OpenMCVolumeCalculation.h:77
virtual void finalize()
Definition: OpenMCVolumeCalculation.h:36
void cellVolume(const unsigned int &index, Real &vol, Real &std_dev) const
std::map< int, int > _index_to_calc_index
Map from cell index to its volume calculation result.
Definition: OpenMCVolumeCalculation.h:89