https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
CSG::PinUniverseEngUnit Class Reference

PinUniverseEngUnit is a CSGUniverseEngUnit that represents a 2D pin universe (concentric cylinders surrounded by an outer region) using basic engineering-scale attrbutes, including ring radii and fill material names for each radial region of the pin structure. More...

#include <PinUniverseEngUnit.h>

Inheritance diagram for CSG::PinUniverseEngUnit:
[legend]

Public Member Functions

 PinUniverseEngUnit (const std::string &name, const std::vector< Real > &ring_radii, const std::vector< std::string > &fill_mats)
 Constructor for PinUniverseEngUnit.
 
std::unordered_map< std::string, AttributeVariantgetAttributes () const override
 Return the pin engineering unit attributes for this object.
 
const std::string & getName () const override
 
bool isEngUnit () const override
 
bool operator== (const CSGUniverseEngUnit &other) const
 
bool operator== (const CSGUniverse &other) const
 
bool operator== (const CSGEngUnit &other) const
 
bool operator!= (const CSGUniverseEngUnit &other) const
 
bool operator!= (const CSGUniverse &other) const
 
bool operator!= (const CSGEngUnit &other) const
 
const std::vector< std::pair< TransformationType, std::tuple< Real, Real, Real > > > & getTransformations () const override
 
std::vector< std::pair< std::string, std::tuple< Real, Real, Real > > > getTransformationsAsStrings () const override
 
const CSGCellgetCell (const std::string &name)
 
bool hasCell (const std::string &name) const
 
const std::vector< std::reference_wrapper< const CSGCell > > & getAllCells () const
 
bool isRoot () const
 
const std::string getBehavior () const
 
const std::string getUnitType () const
 

Static Public Member Functions

static bool isValidTransformationValue (TransformationType type, const std::tuple< Real, Real, Real > &values)
 
static std::string getTransformationTypeString (TransformationType type)
 

Protected Member Functions

std::unique_ptr< CSGUniverseEngUnitclone () const override
 Return a deep copy of this unit.
 
void expandUnit () override
 Represent the pin cell as a single universe that contains cells that define each region of the pin cell structure.
 
const CSGUniversegetExpandedUniverse () const
 
void removeCell (const std::string &name)
 
void removeAllCells ()
 
void setName (const std::string &name)
 
void addTransformation (TransformationType type, const std::tuple< Real, Real, Real > &values)
 
Point applyReverseTransformsToPoint (Point p) const
 
CSGBasegetBase ()
 
std::unique_ptr< CSGBasereleaseBase ()
 
void addCell (const CSGCell &)=delete
 
void addCell (const CSGCell &)=delete
 
 FRIEND_TEST (CSGUniverseTest, testGetCell)
 
 FRIEND_TEST (CSGUniverseTest, testAddCell)
 
 FRIEND_TEST (CSGUniverseTest, testRemoveCell)
 
 FRIEND_TEST (CSGUniverseTest, testRemoveAllCells)
 
 FRIEND_TEST (CSGUniverseTest, testSetName)
 
 FRIEND_TEST (CSGUniverseTest, testUniverseEquality)
 
 FRIEND_TEST (CSGSurfaceTest, testHalfspaceWithTransform)
 
 FRIEND_TEST (CSGSurfaceTest, testHalfspaceWithNullTransform)
 
 FRIEND_TEST (CSGEngUnitTest, testEngUnitEqual)
 
 FRIEND_TEST (CSGUniverseTest, testGetCell)
 
 FRIEND_TEST (CSGUniverseTest, testAddCell)
 
 FRIEND_TEST (CSGUniverseTest, testRemoveCell)
 
 FRIEND_TEST (CSGUniverseTest, testRemoveAllCells)
 
 FRIEND_TEST (CSGUniverseTest, testSetName)
 
 FRIEND_TEST (CSGUniverseTest, testUniverseEquality)
 
 FRIEND_TEST (CSGSurfaceTest, testHalfspaceWithTransform)
 
 FRIEND_TEST (CSGSurfaceTest, testHalfspaceWithNullTransform)
 
 FRIEND_TEST (CSGEngUnitTest, testEngUnitEqual)
 

Protected Attributes

std::string _name
 
std::vector< std::reference_wrapper< const CSGCell > > _cells
 
bool _is_root
 
std::vector< std::pair< TransformationType, std::tuple< Real, Real, Real > > > _transformations
 
std::unique_ptr< CSGBase_internal_base
 
MooseEnum _behavior
 

Private Attributes

const std::vector< Real > _ring_radii
 List of ring radii of pin cell.
 
std::vector< std::string > _fill_mats
 Region IDs of pin cell.
 

Detailed Description

PinUniverseEngUnit is a CSGUniverseEngUnit that represents a 2D pin universe (concentric cylinders surrounded by an outer region) using basic engineering-scale attrbutes, including ring radii and fill material names for each radial region of the pin structure.

Implements:

Definition at line 29 of file PinUniverseEngUnit.h.

Constructor & Destructor Documentation

◆ PinUniverseEngUnit()

CSG::PinUniverseEngUnit::PinUniverseEngUnit ( const std::string &  name,
const std::vector< Real > &  ring_radii,
const std::vector< std::string > &  fill_mats 
)

Constructor for PinUniverseEngUnit.

Parameters
nameunique name of the unit
ring_radiilist of ring radii of cylindrical pin regions, which need to be in ascending order
fill_matsVector of material names that represent the fill of each radial region
Note
The number of fill material names should be one larger than the number of ring radii in the pin. The extra material name represents the material fill that surrounds the region outside of the outermost ring.

Definition at line 17 of file PinUniverseEngUnit.C.

20 : CSGUniverseEngUnit(name), _ring_radii(ring_radii), _fill_mats(fill_mats)
21{
22 unsigned int n_radial = _ring_radii.size();
23
24 if (n_radial == 0)
25 mooseError("Pin universe engineering unit must have at least one ring radius defined");
26
27 // Check radii in ascending order
28 if (n_radial > 1)
29 for (const auto i : make_range(_ring_radii.size() - 1))
30 if (_ring_radii[i] >= _ring_radii[i + 1])
31 mooseError("Pin engineering unit must have ring radii defined in strictly ascending order");
32
33 if (_fill_mats.size() != n_radial + 1)
34 mooseError("Size of region IDs must be one more than the number of radial rings in pin");
35}
void mooseError(Args &&... args)
const std::string name
Definition Setup.h:21
CSGUniverseEngUnit(const std::string &name, bool is_root=false)
const std::vector< Real > _ring_radii
List of ring radii of pin cell.
std::vector< std::string > _fill_mats
Region IDs of pin cell.
if(subdm)
IntRange< T > make_range(T beg, T end)

Member Function Documentation

◆ clone()

std::unique_ptr< CSGUniverseEngUnit > CSG::PinUniverseEngUnit::clone ( ) const
overrideprotectedvirtual

Return a deep copy of this unit.

Returns
unique_ptr to a new PinUniverseEngUnit with identical parameters

Implements CSG::CSGUniverseEngUnit.

Definition at line 44 of file PinUniverseEngUnit.C.

45{
46 return std::make_unique<PinUniverseEngUnit>(_name, _ring_radii, _fill_mats);
47}

◆ expandUnit()

void CSG::PinUniverseEngUnit::expandUnit ( )
overrideprotectedvirtual

Represent the pin cell as a single universe that contains cells that define each region of the pin cell structure.

Implements CSG::CSGUniverseEngUnit.

Definition at line 50 of file PinUniverseEngUnit.C.

51{
52 CSG::CSGRegion inner_region, outer_region, cell_region;
53
54 // Add surfaces and regions for each pin ring
55 // Iterate through all rings and define all corresponding surfaces, regions, and cells
56 for (const auto i : index_range(_fill_mats))
57 {
58 const bool build_ring_surf = i < _ring_radii.size();
59 if (build_ring_surf)
60 {
61 // Add surfaces corresponding to pin rings
62 const auto & radius = _ring_radii[i];
63 const auto surf_name = _name + "_radial_ring_" + std::to_string(i);
64 std::unique_ptr<CSG::CSGSurface> ring_surf_ptr =
65 std::make_unique<CSG::CSGZCylinder>(surf_name, 0, 0, radius);
66 const auto & ring_surf = _internal_base->addSurface(std::move(ring_surf_ptr));
67
68 // Define radial region for each incremental radial ring
69 if (inner_region.getRegionType() == CSG::CSGRegion::RegionType::EMPTY)
70 {
71 // We are in the innermost radial region, the radial region is inner_region
72 inner_region = CSGUtils::getInnerRegion({ring_surf}, Point(0, 0, 0));
73 cell_region = inner_region;
74 }
75 else
76 {
77 // For all other regions, the radial region is the intersection of inner_region and
78 // outer_region
79 outer_region = ~inner_region;
80 inner_region = CSGUtils::getInnerRegion({ring_surf}, Point(0, 0, 0));
81 cell_region = inner_region & outer_region;
82 }
83 }
84 else
85 cell_region = ~inner_region;
86
87 // Define all cells within pin domain
88 auto cell_name = _name + "_cell_radial_" + std::to_string(i);
89 const auto fill_mat = _fill_mats[i];
90 _internal_base->createCell(cell_name, fill_mat, cell_region);
91 }
92}
std::unique_ptr< CSGBase > _internal_base
RegionType getRegionType() const
CSG::CSGRegion getInnerRegion(const std::vector< std::reference_wrapper< const CSG::CSGSurface > > &surfaces, const libMesh::Point &origin)
auto index_range(const T &sizable)
const Real radius

◆ getAttributes()

std::unordered_map< std::string, AttributeVariant > CSG::PinUniverseEngUnit::getAttributes ( ) const
overridevirtual

Return the pin engineering unit attributes for this object.

Returns
map containing: ring_radii (std::vector<Real>) and fill_mats (std::vector<std::string>)

Implements CSG::CSGUniverseEngUnit.

Definition at line 38 of file PinUniverseEngUnit.C.

39{
40 return {{"ring_radii", _ring_radii}, {"fill_mats", _fill_mats}};
41}

Member Data Documentation

◆ _fill_mats

std::vector<std::string> CSG::PinUniverseEngUnit::_fill_mats
private

Region IDs of pin cell.

Definition at line 74 of file PinUniverseEngUnit.h.

Referenced by clone(), expandUnit(), getAttributes(), and PinUniverseEngUnit().

◆ _ring_radii

const std::vector<Real> CSG::PinUniverseEngUnit::_ring_radii
private

List of ring radii of pin cell.

Definition at line 71 of file PinUniverseEngUnit.h.

Referenced by clone(), expandUnit(), getAttributes(), and PinUniverseEngUnit().


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