MURE
Loading...
Searching...
No Matches
GenericReactorAssembly.hxx
Go to the documentation of this file.
1/*
2 This file is part of MURE,
3 Copyright (C) 2007-2021 MURE developers.
4
5 MURE is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 MURE is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with MURE. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#ifndef _GenericReactorAssembly_HXX
20#define _GenericReactorAssembly_HXX
21
27#include <vector>
28#include <algorithm>
29#include <fstream>
30#include <string>
31
32#include "LatticeCell.hxx"
33#include "PinCell.hxx"
34#include "Material.hxx"
35#include "MCSource.hxx"
36
37class Cell;
38class Material;
39class PinCell;
40
41using namespace std;
42
43
45
69{
70 public:
77 double Pitch,
78 int NRadialZones = 1,
79 int NZLevels = 1,
80 string AssemblyName = "GenericAss"
81 );
85 virtual ~GenericReactorAssembly();
87
88
108 void SetAssemblyDuct(double DuctThickness, Material *DuctMat);
109
122 void SetPlenum(double PlenumThickness, Material *UpperPlenumMat, Material *LowerPlenumMat = nullptr);
123
141 void SetAssemblyShape(Shape_ptr TheOuterShape, Shape_ptr TheRealShape = Shape_ptr(nullptr));
142
164 void AddFuelPin(PinCell *pin, int Ix = 99999, int Iy = 99999, int ZoneNumber = - 1);
165
183 void AddGuideTube(PinCell *pin, int Ix, int Iy, int ZoneNumber = - 1);
184
203 void AddControlRod(PinCell *pin, int Ix, int Iy, int ZoneNumber = - 1);
204
205 bool IsGuideTubes() {return fIsGuideTubes;}
207 bool IsPlenum() {return fIsPlenum;}
208 bool IsDuct(){return fIsDuct;}
212
213 vector < double > GetGuideTubeOuterRadius();
214 vector < double > GetControlRodOuterRadius();
215 vector < PinCell *> GetPinCellOfDifferentShape(string PinType);
217
219
221 {
222 return fRadialZones;
223 }
225 {
226 return fAxialLevels;
227 }
249 void AddRadialZone2Mesh(double Radius, int ZoneNum);
266 void AddRadialZone2Mesh(int Ix, int Iy, int ZoneNum );
267
268 int GetRadialLatticeMeshZone(int x, int y, int z)
269 {
270 return fRadialMeshZone[x][y];
271 }
272
280 vector < Cell *> GetFuelCell(int RadialZoneNumber, int AxialLevelNumber);
281
288 vector < PinCell *> &GetPinCellVector(int RadialZoneNumber, int AxialLevelNumber)
289 {
290 return fPinCellVector[RadialZoneNumber][AxialLevelNumber];
291 }
292
293 vector < vector < vector < int > > > GetGlobalLatticeMesh()
294 {
295 return fMeshLattice;
296 }
298
300
301 int GetGlobalLatticeMeshUniverse(int x, int y, int z);
302 PinCell *GetGlobalLatticeMeshPin(int x, int y, int z);
304 {
305 return fNx;
306 }
308 {
309 return fNy;
310 }
312 {
313 return fIXmin;
314 }
316 {
317 return fIXmax;
318 }
320 {
321 return fIYmin;
322 }
324 {
325 return fIYmax;
326 }
328 {
329 return fIZmin;
330 }
332 {
333 return fIZmax;
334 }
335
337
338
340
341
345 virtual void BuildAssemblyGeometry() = 0;
347 {
348 return fSAssemblyZone;
349 }
351 {
352 return fIsHexagon;
353 }
354
355 double GetPitch()
356 {
357 return fPitch;
358 }
359 double GetWidth()
360 {
361 return fAssemblyWidth;
362 }
363 double GetSide()
364 {
365 return fAssemblySide;
366 }
367 double GetHeight()
368 {
369 return fAssemblyHeight;
370 }
372 {
373 return fAxialLevelHeight;
374 }
376 {
377 return fPlenumThickness;
378 }
380 {
381 return fDuctThickness;
382 }
388 void Translate(
389 double dx,
390 double dy,
391 double dz
392 );
394 {
395 return fPrimitiveCellXCenter;
396 }
398 {
399 return fPrimitiveCellYCenter;
400 }
401
411 void SetBorderPin(PinCell *pin);
412
422
431 void SetSpatialVariable(PinCell *pin, string RadialZoneName, double RadialZoneValue, string ZLevelName, double ZLevelValue);
432
442 void SetNumberOfInstance(int N);
444
449
465 void SetUniverse(int u = - 1);
467 {
468 return fUniverse;
469 }
470
472 {
474 }
476 {
478 }
480 {
482 }
484 {
486 }
490
492
496 virtual void SetSource(
497 int NPS = 5000,
498 int ActivesCycles = 100,
499 int InactivesCycles = 100
500 ) = 0;
501
502
504 {
505 return fAssemblyName;
506 }
508
509
510 protected:
511
517 void Copy(const GenericReactorAssembly &m);
518
520 virtual void CreatePlenum() = 0;
521
523 virtual void CreateDuct() = 0;
524
526 void Init();
527
529 int FindNumInArray(int num, vector < int > Array);
530
533
536
537 void SetGasSpaceData(double GasThickness, double GasPressure, double HeFraMol, double XeFraMol, int Zone);
538
540 void AddPin(PinCell *pin, int Ix, int Iy);
541
547 void ReplaceBorderPins();
548
550 void CheckZoning();
551
553 void PrintData();
554
556 void Closing();
557
560
567 void CountUniversePerRadialZone(int Rzone, vector < int > Universe, vector < int > &Nb_Of_Count);
568
573 vector < int > FindUniversesInRadialZones();
574
576 void FillAssemblyMesh();
577
579 void SetSpatialVariable();
580
582 void SetSpatialVariable(PinCell *pin, int RadialZoneNum, string RadialZoneName, double RadialZoneValue, string ZLevelName, double ZLevelValue);
583
585
586
594
595 double fPitch;
602
603 vector < double > fHexaXplaneNormalVector;
604
606
611
615
623
632
641 bool fIsDuct;
643
650 vector < vector < int > > fRadialMeshZone;
651 vector < double > fVirtualRadiusCircle;
652 vector < int > fVirtualRadiusZone;
653
655
660 int fNx;
661 int fNy;
667
671
672 vector < vector < int > > fRadialMeshLattice;
673 vector < vector < vector < int > > > fMeshLattice;
675
680 vector < PinCell *> fRadialPinCell;
681
682 vector < vector < vector < PinCell *> > > fPinCellVector;
683
687
693
698 vector < ofstream *> fFiles;
699
701 vector < double > fGasThickness;
703 double fHeFraMol;
704 double fXeFraMol;
705
707
708};
709
710#endif
711
712
713
Reference_ptr< Shape > Shape_ptr
Definition MCNPSource.hxx:42
Header file for Monte-Carlo Source abstract class.
Header file for Material class.
Header file for PinCell class.
A Cell is composed from a Shape and a Material.
Definition Cell.hxx:84
This abstract class is used to built a reactor assembly.
Definition GenericReactorAssembly.hxx:69
void CountUniversePerRadialZone(int Rzone, vector< int > Universe, vector< int > &Nb_Of_Count)
Definition GenericReactorAssembly.cxx:663
Cell * fCPlenumDown
Bottom Plenum cell.
Definition GenericReactorAssembly.hxx:627
Material * fLowerPlenumMaterial
Lower Plenum material.
Definition GenericReactorAssembly.hxx:624
int fAxialLevels
The number of axial levels (number of differents cells in z direction)
Definition GenericReactorAssembly.hxx:648
void SetPlenum(double PlenumThickness, Material *UpperPlenumMat, Material *LowerPlenumMat=nullptr)
Definition GenericReactorAssembly.cxx:320
double GetSide()
Definition GenericReactorAssembly.hxx:363
double GetWidth()
Definition GenericReactorAssembly.hxx:359
void Copy(const GenericReactorAssembly &m)
< Copy ReactorMesh object m attributs in this
Definition GenericReactorAssembly.cxx:102
double fAssemblyWidth
The assembly x-side for Brick case or width between 2 opposite planes for Hexagon case.
Definition GenericReactorAssembly.hxx:596
Shape_ptr GetInfiniteAssemblyShape()
Definition GenericReactorAssembly.cxx:1085
vector< int > & GetNumberOfFuelPinsPerZone()
Definition GenericReactorAssembly.hxx:471
double GetAxialLevelHeight()
Definition GenericReactorAssembly.hxx:371
int fUniverse
Assembly universe for filling core lattice.
Definition GenericReactorAssembly.hxx:605
void SetAssemblyDuct(double DuctThickness, Material *DuctMat)
Definition GenericReactorAssembly.cxx:306
void AddFuelPin(PinCell *pin, int Ix=99999, int Iy=99999, int ZoneNumber=- 1)
Definition GenericReactorAssembly.cxx:483
bool IsControlRods()
true if some control rods have been defined
Definition GenericReactorAssembly.hxx:206
Cell * GetUpperCellPlenum()
return the upper cell plenum
Definition GenericReactorAssembly.hxx:209
double fAssemblyHeight
The total assembly height (including plenums)
Definition GenericReactorAssembly.hxx:598
Material * fUpperPlenumMaterial
Upper Plenum material.
Definition GenericReactorAssembly.hxx:625
bool fIsTranslated
whether or not an assembly has been tranlated
Definition GenericReactorAssembly.hxx:610
void FillAssemblyMesh()
Fill the global (R, Z) assembly mesh.
Definition GenericReactorAssembly.cxx:933
string fAssemblyName
name of the assembly for output
Definition GenericReactorAssembly.hxx:600
Cell * fCellDuct
Cell of the Duct.
Definition GenericReactorAssembly.hxx:639
Shape_ptr fBetweenPlenums
space between plenum if fUniverse>0
Definition GenericReactorAssembly.hxx:622
void AddPin(PinCell *pin, int Ix, int Iy)
add a generic pin (Fuel, GuideTube, .. Call by AddFuelPin, ...
Definition GenericReactorAssembly.cxx:407
bool fIsControlRods
whether ControlRod pins have been added
Definition GenericReactorAssembly.hxx:686
double fPrimitiveCellYCenter
Y center of the primitive lattice cell of the mesh.
Definition GenericReactorAssembly.hxx:666
bool fIsGuideTubes
whether GuideTube pins have been added
Definition GenericReactorAssembly.hxx:685
Material * fDuctMaterial
Material of the Duct.
Definition GenericReactorAssembly.hxx:638
double fAxialLevelHeight
The height of each axial level=(fAssemblyHeight-2*fPlenumThickness)/fAxialLevels.
Definition GenericReactorAssembly.hxx:599
Shape_ptr fSOuterShape
Assembly shape (either a Brick or an Hexagon)
Definition GenericReactorAssembly.hxx:592
int fRadialZones
The number of radial zones (number of differents cells in x, y direction)
Definition GenericReactorAssembly.hxx:649
double fDzAssemblyTrans
z assembly translation vector
Definition GenericReactorAssembly.hxx:609
vector< PinCell * > & GetPinCellVector(int RadialZoneNumber, int AxialLevelNumber)
Definition GenericReactorAssembly.hxx:288
int GetGlobalLatticeMeshUniverse(int x, int y, int z)
MC mesh methods.
Definition GenericReactorAssembly.cxx:523
int GetNumberOfRadialZones()
Zoning methods.
Definition GenericReactorAssembly.hxx:220
double GetHeight()
Definition GenericReactorAssembly.hxx:367
void FillRadialZone2MeshFromRadius()
Fill Radial Zone lattice from the assembly lattice mesh.
Definition GenericReactorAssembly.cxx:584
Shape_ptr GetAssemblyShape()
Definition GenericReactorAssembly.hxx:346
Cell * fCPlenumUp
Top Plenum cell.
Definition GenericReactorAssembly.hxx:626
int fNx
size of the x lattice mesh
Definition GenericReactorAssembly.hxx:660
vector< int > & GetNumberOfControlRodsPerZone()
Definition GenericReactorAssembly.hxx:479
Shape_ptr fSAssemblyDuct
Assembly Duct shape.
Definition GenericReactorAssembly.hxx:640
int GetNumberOfControlRodsPerLevel()
number of all Control Rods of a level
Definition GenericReactorAssembly.cxx:763
string GetAssemblyName()
Definition GenericReactorAssembly.hxx:503
double fHeFraMol
Molar fraction of Helium in the gas.
Definition GenericReactorAssembly.hxx:703
void ReplaceBorderPins()
Definition GenericReactorAssembly.cxx:854
void ApplyRadialZone2Mesh()
apply the radial zoning to each pins (if a pin is in 2 zones, it is duplicated to have 2 different pi...
Definition GenericReactorAssembly.cxx:773
double fDuctThickness
Thickness of the Duct.
Definition GenericReactorAssembly.hxx:637
double fPitch
The pitch of channels.
Definition GenericReactorAssembly.hxx:595
vector< int > FindUniversesInRadialZones()
Definition GenericReactorAssembly.cxx:650
PinCell * GetGlobalLatticeMeshPin(int x, int y, int z)
return the PinCell located at (x, y, z) in the global lattice mesh
Definition GenericReactorAssembly.cxx:533
int GetMCXMeshSize()
Definition GenericReactorAssembly.hxx:303
vector< int > & GetNumberOfCoolantPinsPerZone()
Definition GenericReactorAssembly.hxx:483
virtual void CreatePlenum()=0
Creates plenum shapes for the upper and lower plenum.
double GetPitch()
Definition GenericReactorAssembly.hxx:355
bool IsHexagonalAssembly()
Definition GenericReactorAssembly.hxx:350
int GetMCMeshZmin()
Definition GenericReactorAssembly.hxx:327
vector< int > fNumberOfFuelPinsPerZone
Number of fuel pins in each radial zone.
Definition GenericReactorAssembly.hxx:688
Shape_ptr fSPlenumUp
Top Plenum shape.
Definition GenericReactorAssembly.hxx:620
void Translate(double dx, double dy, double dz)
Definition GenericReactorAssembly.cxx:390
bool IsPlenum()
true if plenums have been defined
Definition GenericReactorAssembly.hxx:207
virtual void CreateDuct()=0
Creates Duct shapes.
vector< double > fGasThickness
Thickness of the gas space.
Definition GenericReactorAssembly.hxx:701
vector< PinCell * > fRadialPinCell
pin for the radial mesh
Definition GenericReactorAssembly.hxx:680
double GetPrimitiveCellXCenter()
Definition GenericReactorAssembly.hxx:393
double fYMeshCenter
Definition GenericReactorAssembly.hxx:669
vector< Cell * > GetFuelCell(int RadialZoneNumber, int AxialLevelNumber)
Definition GenericReactorAssembly.cxx:1311
vector< double > fHexaXplaneNormalVector
Normal vector to the right plane of an hexagonal assembly.
Definition GenericReactorAssembly.hxx:603
double fZMeshCenter
Definition GenericReactorAssembly.hxx:670
virtual ~GenericReactorAssembly()
Default destructor.
Definition GenericReactorAssembly.cxx:237
double fDxAssemblyTrans
x assembly translation vector
Definition GenericReactorAssembly.hxx:607
Shape_ptr fSPlenumDown
Bottom Plenum shape.
Definition GenericReactorAssembly.hxx:621
void AddGuideTube(PinCell *pin, int Ix, int Iy, int ZoneNumber=- 1)
Definition GenericReactorAssembly.cxx:458
void SetGasSpaceData(double GasThickness, double GasPressure, double HeFraMol, double XeFraMol, int Zone)
Definition GenericReactorAssembly.cxx:632
vector< ofstream * > fFiles
Output files.
Definition GenericReactorAssembly.hxx:698
double fPlenumThickness
Width of the plenum up and down.
Definition GenericReactorAssembly.hxx:628
bool fIsPlenum
True if lower and upper plenums are defined.
Definition GenericReactorAssembly.hxx:630
Cell * GetLowerCellPlenum()
return the lower cell plenum
Definition GenericReactorAssembly.hxx:210
void SetAssemblyShape(Shape_ptr TheOuterShape, Shape_ptr TheRealShape=Shape_ptr(nullptr))
Definition GenericReactorAssembly.cxx:338
vector< int > & GetNumberOfGuideTubesPerZone()
Definition GenericReactorAssembly.hxx:475
virtual GenericReactorAssembly * Clone()=0
int GetMCMeshXmax()
Definition GenericReactorAssembly.hxx:315
vector< int > fNumberOfGuideTubesPerZone
Number of fuel pins in each radial zone.
Definition GenericReactorAssembly.hxx:689
vector< vector< vector< int > > > GetGlobalLatticeMesh()
Definition GenericReactorAssembly.hxx:293
void SetSpatialVariable()
Fill all Pin's spatial variables.
Definition GenericReactorAssembly.cxx:1093
bool fIsAssemblyShapeDefined
to allow or not the AddXXXpin methods
Definition GenericReactorAssembly.hxx:612
int fIXmax
extremal value of the x lattice mesh
Definition GenericReactorAssembly.hxx:662
bool IsDuct()
true if a asembly duct has been defined
Definition GenericReactorAssembly.hxx:208
int FindNumInArray(int num, vector< int > Array)
Find the position of Num in the vector Array (-1 if not found)
Definition GenericReactorAssembly.cxx:1065
void SetNumberOfInstance(int N)
Definition GenericReactorAssembly.cxx:1346
double fPrimitiveCellXCenter
X center of the primitive lattice cell of the mesh.
Definition GenericReactorAssembly.hxx:665
void CheckZoning()
verify that all the lattice has a zone and that the zone numbers are 0, 1, ..fNRadialZones.
Definition GenericReactorAssembly.cxx:544
double fXeFraMol
Molar fraction of Xenon in the gas.
Definition GenericReactorAssembly.hxx:704
void AddControlRod(PinCell *pin, int Ix, int Iy, int ZoneNumber=- 1)
Definition GenericReactorAssembly.cxx:471
int GetMCMeshXmin()
Definition GenericReactorAssembly.hxx:311
int fIYmin
Definition GenericReactorAssembly.hxx:663
bool fIsGasSpace
Whether gas space is simulated between cladding and fuel pin.
Definition GenericReactorAssembly.hxx:700
int GetNumberOfAxialLevels()
Definition GenericReactorAssembly.hxx:224
void AddRadialZone2Mesh(double Radius, int ZoneNum)
Definition GenericReactorAssembly.cxx:493
int GetMCMeshYmin()
Definition GenericReactorAssembly.hxx:319
int GetMCMeshYmax()
Definition GenericReactorAssembly.hxx:323
Cell * GetDuctCell()
return the Duct cell
Definition GenericReactorAssembly.hxx:211
double fGasPressure
Cold fill gas pressure (Pa)
Definition GenericReactorAssembly.hxx:702
virtual void SetSource(int NPS=5000, int ActivesCycles=100, int InactivesCycles=100)=0
Sets a volumic neutron source.
virtual void BuildAssemblyGeometry()=0
Geometry methods.
void Init()
Initialization of arrays.
Definition GenericReactorAssembly.cxx:249
int fIZmax
extremal value of the z lattice mesh
Definition GenericReactorAssembly.hxx:664
int GetNumberOfGuideTubesPerLevel()
number of all Guide Tubes of a level
Definition GenericReactorAssembly.cxx:752
int fIZmin
Definition GenericReactorAssembly.hxx:664
vector< vector< vector< int > > > fMeshLattice
Complete Assembly mesh (x, y, z)
Definition GenericReactorAssembly.hxx:673
vector< int > fNumberOfControlRodsPerZone
Number of fuel pins in each radial zone.
Definition GenericReactorAssembly.hxx:690
int GetMCYMeshSize()
Definition GenericReactorAssembly.hxx:307
void PrintData()
Print output files.
Definition GenericReactorAssembly.cxx:1020
vector< int > fVirtualRadiusZone
associated zone to the previous vector (0..fRadialZones)
Definition GenericReactorAssembly.hxx:652
double GetDuctThickness()
Definition GenericReactorAssembly.hxx:379
Shape_ptr fSInnerShape
Assembly inner shape (a small brick/hexa if plenum and/or Duct is defined)
Definition GenericReactorAssembly.hxx:593
vector< double > fVirtualRadiusCircle
virtual circle radius to define zones (0..fRadialZones)
Definition GenericReactorAssembly.hxx:651
bool fCanDefinePlenum
Whether or not plenum can be defined.
Definition GenericReactorAssembly.hxx:629
int GetUniverse()
Definition GenericReactorAssembly.hxx:466
Shape_ptr fSAssemblyZone
Assembly shape (could have holes in it)
Definition GenericReactorAssembly.hxx:591
PinCell * fBorderPin
special pin (surrounding material only) to fill assembly border
Definition GenericReactorAssembly.hxx:684
int fIXmin
Definition GenericReactorAssembly.hxx:662
vector< vector< int > > fRadialMeshZone
radial zone mesh fNx*fNy : zone number of a mesh position (same for All Level) PTO ASK NICO*
Definition GenericReactorAssembly.hxx:650
double fAssemblySide
The assembly y-side for Brick case or side for Hexagon case.
Definition GenericReactorAssembly.hxx:597
int fIYmax
extremal value of the y lattice mesh
Definition GenericReactorAssembly.hxx:663
bool IsGuideTubes()
true if some guide tubes have been defined
Definition GenericReactorAssembly.hxx:205
vector< int > fNumberOfCoolantPinsPerZone
Number of fuel pins in each radial zone.
Definition GenericReactorAssembly.hxx:691
int GetMCMeshZmax()
Definition GenericReactorAssembly.hxx:331
double GetPrimitiveCellYCenter()
Definition GenericReactorAssembly.hxx:397
vector< vector< int > > fRadialMeshLattice
radial mesh (only for assembly definition, fNx x fNy)
Definition GenericReactorAssembly.hxx:672
double fDyAssemblyTrans
y assembly translation vector
Definition GenericReactorAssembly.hxx:608
vector< double > GetControlRodOuterRadius()
return the most outer control rod layer radius (outer clad)
Definition GenericReactorAssembly.cxx:1251
void Closing()
Some routines to execute before exiting.
Definition GenericReactorAssembly.cxx:1057
int fNy
size of the y lattice mesh
Definition GenericReactorAssembly.hxx:661
double fXMeshCenter
Definition GenericReactorAssembly.hxx:668
double GetPlenumThickness()
Definition GenericReactorAssembly.hxx:375
void SetUniverse(int u=- 1)
Definition GenericReactorAssembly.cxx:1073
int GetNumberOfFuelPinsPerLevel()
number of all fuel pins of a level (may be an approximation for an hexagons)
Definition GenericReactorAssembly.cxx:742
bool fIsAssemblyGeometryBuilt
whether or not the assembly geometry has been built
Definition GenericReactorAssembly.hxx:613
vector< vector< vector< PinCell * > > > fPinCellVector
full pin vector per radial zone, axial level for each universe type [nr][nz][nu]
Definition GenericReactorAssembly.hxx:682
void CountPinsPerTypePerRadialZone()
Count the number of each pin type per radial zone.
Definition GenericReactorAssembly.cxx:674
void SetBorderPin(PinCell *pin)
Definition GenericReactorAssembly.cxx:847
bool fIsHexagon
Whether the assembly shape is hexagonal or cuboid.
Definition GenericReactorAssembly.hxx:601
bool fIsDuct
true if a duct has been added
Definition GenericReactorAssembly.hxx:641
int GetRadialLatticeMeshZone(int x, int y, int z)
Definition GenericReactorAssembly.hxx:268
vector< double > GetGuideTubeOuterRadius()
return the most outer guide tube layer radius (clad)
Definition GenericReactorAssembly.cxx:1233
vector< PinCell * > GetPinCellOfDifferentShape(string PinType)
return the vector of all pincell of a given type ("Fuel", "GuideTube", ...)
Definition GenericReactorAssembly.cxx:1269
A Material constituing a Cell.
Definition Material.hxx:83
PinCell class allows to create cylindrical cell set included as Matrioshka.
Definition PinCell.hxx:53
the namespace of the Standard C++

MURE Project, documentation generated by Doxygen 1.9.7 - Fri Jan 19 2024