A monte carlo pin cell spectral code for nuclear engineering applications.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Geometry.h
Go to the documentation of this file.
1 
8 #ifndef GEOMETRY_H_
9 #define GEOMETRY_H_
10 
11 #ifdef __cplusplus
12 #include <sys/stat.h>
13 #include <omp.h>
14 #include <vector>
15 #include "Region.h"
16 #include "Fissioner.h"
17 #include "TallyBank.h"
18 #include "Timer.h"
19 #endif
20 
21 
31 typedef enum spatialTypes {
38 } spatialType;
39 
40 
48 class Geometry {
49 
50 private:
52  const char* _geometry_name;
59 
69  std::vector<BoundedRegion*> _regions;
70 
73  float _fuel_radius;
76  float _pitch;
79 
81  float _dancoff;
83  float _sigma_e;
85  float _beta;
87  float _alpha1;
89  float _alpha2;
90 
92  int _num_prob;
97  float* _prob_ff;
99  float* _prob_mf;
100 
105 
107 
108 public:
109  Geometry(spatialType spatial_type, const char* name=(const char*)"");
110  virtual ~Geometry();
111 
112  const char* getName();
114  int getTotalNumNeutrons();
115  int getNumBatches();
116  int getNumThreads();
118  float getBucklingSquared();
119  float getVolume();
120  float getSourceSamplingRadius();
121 
122  void setName(const char* name);
123  void setSourceSamplingRadius(float radius);
124  void setNeutronsPerBatch(int num_neutrons_per_batch);
125  void setNumBatches(int num_batches);
126  void setNumThreads(int num_threads);
127  void setSpatialType(spatialType spatial_type);
128  void setFuelPinRadius(float radius);
129  void setPinCellPitch(float pitch);
130  void setDancoffFactor(float dancoff);
131  void addRegion(Region* region);
132  void setBucklingSquared(float buckling_squared);
133 
134  bool contains(neutron* neutron);
135  bool contains(float x, float y, float z);
137  Region* findContainingRegion(float x, float y, float z);
140 };
141 
142 
143 #endif /* GEOMETRY_H_ */
float * _prob_mf
Definition: Geometry.h:99
EquivalenceRegion * _moderator
Definition: Geometry.h:67
Represents a neutron in a PINSPEC simulation.
Definition: Neutron.h:27
spatialTypes
The spatial types for the geometry.
Definition: Geometry.h:31
float _pitch
Definition: Geometry.h:76
void setName(const char *name)
Sets the name of the geometry.
Definition: Geometry.cpp:151
void setNumBatches(int num_batches)
Sets the number of batches for this simulation.
Definition: Geometry.cpp:187
Geometry(spatialType spatial_type, const char *name=(const char *)"")
Geomtery constructor.
Definition: Geometry.cpp:9
void setBucklingSquared(float buckling_squared)
Sets the square of the geometric buckling for the geometry.
Definition: Geometry.cpp:170
void initializeSourceNeutron(neutron *neutron)
Initializes a new source neutron within the geometry.
Definition: Geometry.cpp:697
int getNumNeutronsPerBatch()
Returns the number of neutrons per batch for this simulation.
Definition: Geometry.cpp:72
spatialType getSpatialType()
Return the spatial type of Geometry (INFINITE_HOMOGENEOUS, HOMOGENEOUS_EQUIVALENCE or HETEROGENEOUS)...
Definition: Geometry.cpp:109
float getVolume()
Returns the total volume occuppied by the geometry.
Definition: Geometry.cpp:127
The Equivalence Region is a fuel or moderator region treated using the heterogenous-homogeneous equiv...
Definition: Region.h:170
float _beta
Definition: Geometry.h:85
void setNumThreads(int num_threads)
Sets the number of batches for this simulation.
Definition: Geometry.cpp:196
spatialType _spatial_type
Definition: Geometry.h:61
The Fissioner class for fission neutron emission.
int getNumBatches()
Returns the number of batches of neutrons for this simulation.
Definition: Geometry.cpp:90
Definition: Geometry.h:37
void setSpatialType(spatialType spatial_type)
Set the geometry's spatial type (INFINITE_HOMOGENEOUS, HOMOGENEOUS_EQUIVALENCE or HETEROGENEOUS)...
Definition: Geometry.cpp:242
The InfiniteMediumRegion is a homogenized region treated without geometric effects.
Definition: Region.h:145
void initializeProbModFuelRatios()
Initializes a pre-computed array of moderator to first flight collsion probabilities using Carlvik's ...
Definition: Geometry.cpp:628
int _num_threads
Definition: Geometry.h:58
The Timer static class.
float _alpha1
Definition: Geometry.h:87
The region class represents a region in 2D space.
Definition: Region.h:58
void runMonteCarloSimulation()
The primary Monte Carlo kernel for a PINSPEC simulation.
Definition: Geometry.cpp:472
void addRegion(Region *region)
Adds a new region to the geometry.
Definition: Geometry.cpp:273
float _buckling_squared
Definition: Geometry.h:78
const char * getName()
Returns the name of the geometry.
Definition: Geometry.cpp:63
The Geometry represents the highest level entity in which a neutron may reside during a PINSPEC simul...
Definition: Geometry.h:48
int _num_prob
Definition: Geometry.h:92
float _fuel_radius
Definition: Geometry.h:73
std::vector< BoundedRegion * > _regions
Definition: Geometry.h:69
float getBucklingSquared()
Returns the square of the geometric buckling for this geometry.
Definition: Geometry.cpp:118
InfiniteMediumRegion * _infinite_medium
Definition: Geometry.h:63
void findContainingRegion(neutron *neutron)
Finds the region containing a neutron.
Definition: Geometry.cpp:411
int getTotalNumNeutrons()
Returns the total number of neutrons for this simulation.
Definition: Geometry.cpp:81
Definition: Geometry.h:33
bool contains(neutron *neutron)
Determines whether or not the geometry contains this neutron.
Definition: Geometry.cpp:349
float _dancoff
Definition: Geometry.h:81
float _source_sampling_radius
Definition: Geometry.h:104
void setNeutronsPerBatch(int num_neutrons_per_batch)
Sets the number of neutrons per batch for this simulation.
Definition: Geometry.cpp:179
void setSourceSamplingRadius(float radius)
Sets the source sampling radius used for rejection sampling of random fission emission source sites...
Definition: Geometry.cpp:161
float getSourceSamplingRadius()
Returns the source sampling radius used for rejection sampling of random fission emission source site...
Definition: Geometry.cpp:142
int _num_batches
Definition: Geometry.h:56
float _alpha2
Definition: Geometry.h:89
enum spatialTypes spatialType
A spatial type for the geometry.
EquivalenceRegion * _fuel
Definition: Geometry.h:65
void setPinCellPitch(float pitch)
Sets the lattice pin cell pitch.
Definition: Geometry.cpp:214
The TallyBank static class.
The Region class.
int _num_neutrons_per_batch
Definition: Geometry.h:54
int getNumThreads()
Returns the number of parallel threads for this simulation.
Definition: Geometry.cpp:99
void setDancoffFactor(float dancoff)
Sets the dancoff factor and computes the escape cross-section, beta, alpha1 and alpha2 parameters use...
Definition: Geometry.cpp:225
Definition: Geometry.h:35
float * _prob_ff
Definition: Geometry.h:97
virtual ~Geometry()
Destructor lets SWIG delete regions, materials, isotopes and tallies during garbage collection...
Definition: Geometry.cpp:48
const char * _geometry_name
Definition: Geometry.h:52
void setFuelPinRadius(float radius)
Sets the fuel pin radius.
Definition: Geometry.cpp:205
Fissioner * _fissioner
Definition: Geometry.h:102
float _sigma_e
Definition: Geometry.h:83
The Fissioner represents the physics of fission neutron emission.
Definition: Fissioner.h:32
float * _prob_energies
Definition: Geometry.h:95