Objects, functions and methods
PyDrag is manipulating different objects, each containing different kinds of informations :
Library object : contains all the available informations for the chosen nuclear data library. The user does not need to directly interact with it, as the library type, the isotopes contained inside, and the nuclear data are automatically extracted with PyDrag ;
Mixture object : contains mixture’s informations, such as temperature, linear expansion coefficient, compositions. These objects are pre-defined in PyDrag, and it is important to keep their name for the calculation ;
Grid object : contains the description of the assembly grids ;
Materials object : contains all the data related to mixtures. Among others, it includes library, grids and every existing mixtures (as sub-classes) ;
Geometry object : describes the assembly geometry, such as the pin layout, the different dimensions, and the mixtures overlay of each pin ;
Power object : it is used to automatically computes the assembly power density (specifically used for evolution calculations) ;
PyDrag is calling the “calculation.py” module in order to perform different actions on data (such as thermal expansion, dilutions, etc.) and make evolution calculations. Is it also calling the SAPHYB generation process in order to perform paralellized Saphyb calculations.
The next chapters detail the different objects handled by PyDrag, and describe the existing methods. The method’s (current) limitations are clearly defined.
Warning
Each comment encapsulated in a warning box refers to an approximation used for non-regression purpose. Those mistakes will be removed later.
Note
You may access additional informations about every single method by using the ‘help’ Python method (exemple: help(pydrag.GEO)) or by looking directly in the commented source code.
Note
Every functions/methods which are using C2M procedures have one agrument in common: ‘c2m_path’. It gives the path (absolute or relative) where the C2M procedures are stored.
“calculation.py” module
Functions
get_power_density()
Recover the assembly power density. If a non-zero density is already set in “Power” object, is it used. If not, the density is calculated.
Arguments:
mat : materials object
geom : geometry object
powerDens : power object
get_water_density()
Get the water density from pre-tabulated DRAGON data, by using pressure and temperature stored in the water mixture object.
Arguments:
tmod : water temperature (in °C)
pressure : water pressure (in bar)
c2m_path
destination : path to the directory where the C2M procedures have to be copied and executed
Note
This method uses the c2m procedure “GetWaterDens.c2m”.
count_pin()
Count the number of pins in assembly, according to their position (center, side and corner). It takes into the account the symmetry axis.
Arguments:
mat : materials object
geom : geometry object
flag : fuel type flag. This flag can either be equal to “UO2” or “MOX”. In fact, pins position differ from UO2 fuel (depending of spatial position) and MOX fuel (depending of fuel enrichement)
get_bu_list()
Get the pre-defined evolution burnup step. These values depend of the fuel type used (presence of Gd or not).
Arguments:
fueltype : fuel type (either ‘UO2’, ‘MOX’ or ‘UO2+Gd’)
Tihange_model()
Process the calculation of relative elongation coefficient. The material temperature is taken into account. The coefficient calculation routine comes from the publication “Qualification du système NEPTUNE” (by H.PANEK) at p.153.
Arguments:
mat : materials object
temperature : hot temperature of the chosen materials (in °F)
Note
This function is used when there is no defined thermal expansion coefficient, for each material.
PIN_model()
Process the calculation of distance dilatation.
Arguments:
cold_value : cold distance (in cm)
alpha : linear dilatation coefficient
temperature : hot temperature (in °C)
Note
This function is used when a non-zero thermal expansion coefficient is defined, for each material.
gap_dilution()
Process the gap dilution for each pin in geometry. The gaps are identified when PyDrag sees a “void” mixture in the cell, and will dilute this empty space with the closest clad.
Arguments:
ThermalExpans : thermal expansion type (True or False)
mat : materials object
geom : geometry object
Note
If the ThermalExpans argument is set to “True”, PyDrag will automatically check, for each materials, if there a linear dilatation coefficient has been declared in the main input. If not, then this coefficient is approximate based on the public Tihange thermal expansion coefficients.
Note
In reality, the gap is made of helium, rather than void. However, this approximation is kept and considered as having a low impact on calculations.
grid_dilution()
Process the dilution of the assembly grids into the water. It uses the “Grids” object data and water mixture data. Different dilution models are available:
“Tihange”: reference model for Tihange assembly. This model is based on the process described in the paper “Qualification du système NEPTUNE” (by H.PANEK), by using a unique temperature.
“Tihange_dev”: updated model for Tihange assembly grid dilution. Based on the same source than previous model, and making it temperature-dependant. More explanation in the “warning” box. This model uses the cold volumic frations description of the grids.
“TOT”: generic grid dilution process. This model uses the massic/volumic description of the grids.
“NULL”: no grid dilution.
Arguments:
mat : materials object
geom : geometry object
TypeDil : grid dilution type. Possible values for TypeDil are:
‘Tihange’, which is the reference grid dilution process for Tihange assemblies (dilutions are calculated independently of temperature)
‘Tihange_dev’, which is a process based on ‘Tihange’ one, upgraded in order to take into account the temperature-dependencies, based on the cold volumic fraction description of the grids
‘TOT’, which is the generic grid dilution process for non-Tihange assemblies, based on massic/volumic fractions grid description
‘NULL’, which implies no grid dilution
Warning
As previously mentionned, the “Tihange_dev” model is using the cold volumic fractions of each grid materials (in the different considered area to be diluted in) and the moderator temperature. These data allows PyDrag to compute the different hot assembly volumes in order to get the hot volumic frations (which leads to the dilution ratio in the different areas). It allows to take into account the moderator temperature, in opposition with the ‘Tihange’ model (which is always using a moderator temperature of 286°C). Keep in mind that the ‘Tihange’ model is based of official public documentation, but it implies a problem for branching calculations, as those diltion values are used for every temperature calculation points. As a side note, the “Tihange_dev” routine reproduces the results obtained in the reference document for the given temperatures.
thermal_expans()
Process the thermal expansion calculation for every distances and densities. The thermal expansion either uses the user-defined linear elongation coefficients or computes them (based on pre-defined values and adapting them with temperatures).
Arguments:
mat : materials object
geom : geometry object
verify_data()
Verify the content of the different PyDrag objects that may cause PyDrag calculation failures.
Arguments:
mat : materials object
geom : geometry object
init_data()
Initialize some calculation informations, based on the user-defined data in input. This functions :
adds some moderator in the surrounding area of each pin (in order to make rectangular cells) ;
creates the circular rings for the fuel pins ;
computes the average clad temperature ;
processes the thermal expansion, gap dilutions and grid dilution ;
regroups every identical clads for the different pins ;
creates the circular rings for AIC/B4C/Hafnium for control rods ;
saves the mixtures/pins used for the assembly (in order to not modelize unused pre-defined mixtures) ;
gives a generic name for each identical pins of the plan ;
identifies the isotopes that should be self-shielded ;
Arguments:
mat : materials object
geom : geometry object
ThermalExpans : thermal expansion type (True or False)
TypeDil : grid dilution type. Can either be equal to ‘Tihange’,’Tihange_dev’,’TOT’ or ‘NULL’. For more info, see the grid_dilution() sub-chapter
Warning
The AIC aborber does not contain any ring for 15x15 pins assembly, but do for 17x17 pins assembly cases.
Warning
The silicium isotopes are ignored for the description of the Pyrex absoring rods (even if they are used to compute the isotopic concentrations and densities).
get_SS_IDs()
Get the INRS number of self-shielded isotopes (INRS is the index of resonant region associated with each isotope). These IDs come from the DRAGON user guide.
Arguments:
fueltype : fuel type. Can either be equal to ‘UO2’, ‘MOX’ or ‘Gd’.
LIB()
Process the LIB: module call, by desribing every used mixtures. There are two leakage model that can be used (“APOL” and “OLDW”).
Arguments:
mat : materials object
geom : geometry object
CTRA : leakage model. Can be either equal to ‘APOL’ (for APOLLO2 type transport correction based on linearly anistropic within-group scattering cross sections) or ‘OLDW’ (for WIMS type transport correction based on the P1 scattering cross sections)
Note
The self-shielding method is automatically adapted to the number of energy groups in the library : subgroup self-shielding with physical probability tables (“SUBG”) if there are less than 295 groups mathematical probability (“PT”) tables otherwise
GEO()
Process the GEO: module call, in order to describe to assembly and to associate each geometrical areas to a mixture.
Arguments:
mat : materials object
geom : geometry object
USS()
Process the USS: module call, in order to create/update self-shielded library. The USS: calls are performed for every self-shielding burnup steps (that are pre-defined).
Arguments:
mat : materials object
geom : geometry object
istep : iteration number (used to initialize / update the microlib)
discr_isot_list : list of self-shielded isotopes to be declared in each mix. This list is set by default in PyDrag, and takes into account the following isotopes (if they are present in the mixtures) : U238,Ag107,Ag109,In115,Zr90,Zr91,Zr92,Zr94,Zr96,Hf174,Hf176,Hf177,Hf178,Hf179,Hf180,Gd154,Gd155,Gd156,Gd157,Gd158,Gd160.
FLU()
Process the ASM: and FLU: modules call.
Arguments:
mat : materials object
geom : geometry object
istep : iteration number
leak_model : leakage model. There are three different available leakage models : ‘APOL’ (APOLLO-equivalent leakage model), ‘CASM’ (CASMO-equivalent leakage model) or ‘NLKG’ (no leakage model)
mode : calculation mode (‘evo’ for depletion calculation or ‘bib’ for saphyb generation)
T0()
Process the T0 calculation, wihch initialize every LCM objects (by calling init_data(), LIB(), GEO(), USS() and FLU()) .
Arguments:
mat : materials object
geom : geometry object
ThermalExpans : thermal expansion type. Can either be equal to True or False. More informations about it at the Gap dilution sub-chapter
TypeDil : grid dilutuion type. Can either be equal to ‘Tihange’, ‘Tihange_dev’, ‘TOT’ or ‘NULL’. More informations at the grid dilution sub-chapter
leak_model : leakage model. Can either be equal to ‘APOL’, ‘CASM’ or ‘NLKG’. More informations at the FLU sub-chapter
rand_ID : random ID (used for multiple simultaneous C2M procedure calls, such as parallel calculations)
EVO()
Perform the EVO: module call between two time (in days) / burnup (in MWd/t or GWd/t) steps.
Arguments:
mat : materials object
geom : geometry object
powerDens : power object
beg_step : beginning depletion step
end_step : ending depletion step
unit : unit used for depletion steps (‘day’, ‘MWd/t’ or ‘GWd/t’)
Deplete()
Perform the evolution calculation for the given burnup step list, grid dilution type and leakage model.
Note
It is possible to make a depletion calculation for a burnup step list equals to [0], in order to make a T0 calculation.
Arguments:
mat : materials object
geom : geometry object
powerDens : power object
ThermalExpans : thermal expansion type. Can either be equal to True or False. More informations about it at the Gap dilution sub-chapter
TypeDil : grid dilutuion type. Can either be equal to ‘Tihange’, ‘Tihange_dev’, ‘TOT’ or ‘NULL’. More informations at the grid dilution sub-chapter
leak_model : leakage model. Can either be equal to ‘APOL’, ‘CASM’ or ‘NLKG’. More informations at the FLU sub-chapter
burnup_list : depletion burnup list (steps given in MWd/t). If this list is empty, burnup steps are automatically recovered from the get_bu_list function. The reference steps depend of the fuel type : 52 burnup steps from 0 to 72 GWd/t for UO2/MOX assembly or 329 steps from 0-72 GWd/t for UO2+Gd assembly.
results : flag used to return the k-inf list. Can either be set to True or False. This flag is used for non-regression purpose.
rand_ID : random ID (used for multiple simultaneous C2M procedure calls, such as parallel calculations)
“Library” object
Description
This class contains all the informations related to the chosen nuclear data library. It is created when calling the “Material” class, such as:
materials = pydrag.Materials(NuclearData = 'https://github.com/IRSN/PyNjoy2016/releases/download/JEFF-3.x/drglibJEFF-3.1.1')
The “Library” class is able to identify internet adress (as long as it starts by “http”) in order to download any library file. For now, PyDrag can only download libraries from a Git repository. It is also possible to give the absolute path to this library (if it is located locally) or a symbolic link. In any case, PyDrag will create a new symbolic link named “MyLib”. Moreover, PyDrag can handle different types of library, as long as they match the DRAGON formats APLIB2, APXSM or DRAGLIB.
Methods
get_lib_type()
Get the library type, using the c2m procedure “GetLibType.c2m”. It calls the LIB module while specifying a library type, looping through the three handlable types : “DRAGON”, “APLIB2” and “APXSM”. If none of those type is right (or if the library is not readable), the calculation will stop.
get_isotope_list()
Recover the list of all the avaiable non-self-shielded isotopes’ names in the chosen library.
get_energy_group()
Recover the energy group number considered in the chosen library, using the c2m procedures “GetEnergyGr.c2m” and “GetNRG.c2m”. This information is used in order to define the self-shielding routine called at the USS module call
Note
The “GetNRG” procedure is calling LIB: module. To work well, PyDrag at least needs to know one isotope from the library. In consequence, this function can not be called before “get_isotope_list()”.
get_isotope_name()
Check for any correspondance between a “user-defined” isotope’s name and the library isotopes’ names. For instance, it allows to link the user-defined isotope “Fe56” with its codename in the library (which can be “FE56_3” or anything else, depending on the library).
Arguments:
isot_name : user-defined isotope’s name to be checked
get_SS_isotope_list()
Recover the list of every available self-shielded isotopes in the chosen library.
Note
This method is a bit different from the others. In fact, it is impossible (for now) to directly recover this list of names in a c2m procedure, as DRAGON only displays it in an output file (or in the terminal). This methods calls another dedicated python script (called “get_SS_isot.py”) in order to execute the c2m procedure “GetSSIsot.c2m” and recovers the informations from the terminal.
It is mandatory to make a LIB: module call to get these informations : consequently, the name of at least one isotope from the library is required. This method can not be called before the “get_isotope_list()”.
get_real_isot_name()
Check for any correspondance between a “user-defined” isotope’s name and the library isotopes’ names. This function is used for specific isotopes (such as Mo95), for non-regression purpose.
Arguments:
isot : isotope name
get_molar_mass()
Recover the molar masses of every available isotopes in chosen library. A correction is made in order to recover the right isotopic molar masses. In fact, the available libraries do not contain any direct mentions to the molar masses, and store the isotopic average weight ratio (AWR, which are the ratio of each isotope mass divided by the neutron mass). Moreover, as the isotopic neutron masses are not stored, the natural carbon mass (known, and set to 12.011 according to the natural carbon NIST value) is used with the stored carbone AWR. The ratio of those two factors gives the corrective factor, applied on every AWRs.
Arguments:
correction : flag used to apply a corrective factor on library molar masses (equals to the NIST natural carbon molar mass). This flag can either be equal to True or False.
“Mix” object
Description
The “Mix” objects are used to define the mixtures used for the calculation. By default, PyDrag is creating a list of pre-defined elements (based on common isotopic abundances), later used to create mixtures. The pre-defined mixtures have a fixed name, making them easier to handle by the code and directly callable in the input. However, it is possible for the user to create their own mixtures, duplicating existing mixtures, and such.
Methods
__init__():
Initialize the object and create a new mixture.
Arguments:
name: name of the generated mixture. If the name already exists, the new object will replace the old one.
mat_ID: ID attributed to the new mixture (and used later for the mixtures description to LIB module). This argument is not necessary, as it can be automatically attributed later.
temperature: temperature of the created mixture (in K). This argument is not necessary, and is set to ‘None’ by default.
density: density of the created mixture (in g/cm3). This argument is not necessary, and is set to 0.0 g/cm3 by default.
self_shielding: flag (that can either be True or Fralse) that specifies whether the self-shielding is activated for this mixture. Default value is False.
composition: dictionnary describing the composition of the mixture (in massic proportions). Exemple: {‘FeNat’:0.1,’CrNat’:0.99}
info()
Displays general informations about the mixture class.
set_density()
Set the mixture’s density.
Arguments:
density : mixture density (in g/cm3)
set_temperature()
Set the mixture’s temperature. The temperature is converted and stored as °C.
Arguments:
temperature : mixture temperature. This argument can be a float, an integer, or a list described as [temperature value, temperature unit]. If it is a list, PyDrag will automatically identified the unit and the value.
unit : temperature unit (‘C’, ‘F’ or ‘K’)
Note
The temperature value-unit couple can also be given as a list. For exemple, from the call SS304.set_temperature([600, ‘F’]), PyDrag will automatically identifies the temperature value (600) and the unit (°F).
set_enrichment()
Set the isotopic enrichment/ratio (works for one isotope/element at a time).
Arguments:
isotope : isotope name
ratio : isotopic ratio (in absolute unit)
Note
This method is only used to define fuel mixtures.
set_pressure()
Set the mixture’s pressure. The pressure is converted and stored as bar.
Arguments:
pressure : mixture pressure
unit : pressure unit (‘bar’, ‘psi’ or ‘Pa’)
Note
This methods is only used to set moderator’s pressure. The pressure value-unit couple can be given as a single list, such as for exemple water.set_pressure([155, ‘bar’]).
set_compo()
Set the mixture’s composition. This methods can take as many isotopes/elements as needed in one call.
Arguments:
composition : material composition
set_boron()
Set the mixture’s boron concentration (in pcm).
Arguments:
boron : boron concentration (in ppm)
Note
This methods is only used to set moderator’s boron concentration.
set_fraction()
Set the mixture’s MOX fraction in the different assembly areas (corner, side and center pins).
Arguments:
frac : MOX fraction (in %)
Note
This methods is only used for MOX-type fuels.
set_thermal_coef()
Set the mixture’s linear expansion coefficient. By default, this coefficient is always set to 0. If the user defines its own coefficients, they will be used accordingly. However, if there is no coefficient (or if some are missing), PyDrag automatically check for pre-defined expansion coefficients (as a function of the mixture’s temperature).
Arguments:
coef : linear thermal expansion coefficient
“Grids” object
Description
This class describes the assembly grids. PyDrag identifies the grids in two different categories : “Crate” ones (default grid) and “Sleeve” ones. This model comes from the BEAVRS grids representation. Those two different grid types represent (in the same order) the grids that will be diluted in the assembly moderator, and the grids to be diluted in the surrounding water gap. It is possible to describe the grids by giving different types of information, described in the following sub-chapter.
Methods
set_fraction()
Set the cold volumic fraction of chosen material in different moderator areas (“tube”, “fuel” and “gap” areas).
Arguments:
frac : cold volumic fraction of chosen material (in %)
material : mixture composing the grid (usually equals to one of the pre-defined mixture’s name such as ‘Zr4’ or ‘SS304’)
area : area to be diluted with chosen material (‘tube’, ‘fuel’ or ‘gap’)
Note
This method is specifically designed for Tihange-1 assembly description, where there is no data about grid mass/volume.
set_mass()
Set the chosen material’s total mass in the grids.
Arguments:
mass : cold total mass of chosen material (in g)
material : material composing the grid (usually equal to one of the pre-defined mixture’s name such as ‘Zr4’ or ‘SS304’)
area : considered area in which the gris is diluted (‘Crate’ or ‘Sleeve’)
set_volume()
Set the chosen material’s total volume in the grids.
Arguments:
volume : cold total volume of chosen material (in cm3)
material : material composing the grid (usually equal to pre-defined mixture’s name such as ‘Zr4’ or ‘SS304’)
area : considered area in which the grid is diluted (‘Crate’ or ‘Sleeve’)
“Material” object
Description
This class contains all the inforations about every “Mix” object and “Library” object. These data are used to compute every isotopic concentrations, in order to define the used mixtures in assembly (through a LIB: module call to DRAGON). The user can modify each mix by interacting with each mixture’s specific object, or can interact directly with the “Material” class (with the different methods).
Methods
set_natural_abundance()
Set the isotopic abundances of the chosen natural element.
Arguments:
element : name of the element
abundance : elemental abundance (in absolute unit)
set_molar_mass()
Set the molar mass of the chosen natural element.
Arguments:
elem : element name
M : element molarm mass (in g/mol)
set_compounds()
Pre-define a list of chemical compounds.
Note
The pre-defined compounds are B2O3, SiO2, Al2O3, Na2O, Gd2O3 and H2O.
add_compounds()
Add a user-defined chemical compound.
Arguments:
names : list of user-defined chemical compounds to be added
add_element()
Add a user-defined natural element.
Arguments:
name : name of the generated element
isotopes : list of isotopes composing the element
proportions : list of isotopic proportions in element
A call exemple : add_element(‘ClNat’,[‘Cl35’,’Cl36’,’Cl37’],[0.7574,1E-13,0.2424])
Note
This method can be used to update the isotopic abundances of an existing element.
set_tfuel()
Set the fuel temperature. PyDrag will automatically identifies the fuel mixtures within every existing mixtures.
Arguments:
temperature : fuel temperature
unit : temperature unit (‘C’, ‘K’, ‘F’)
Note
This method modifies the temperature of ‘UO2’, ‘MOX’ and ‘Gd’ mixtures.
duplicate_mix()
Duplicate the chosen mixture.
Arguments:
name : name of the mix that has to be duplicated
new_name : name of the duplicated mix
SS_flag : self-shielded flag. Can either be True or False, and is used to specifies if the duplicated mixture has to be self-shielded or not.
Note
By default, the new mixture will be named after a combination of the original name and a digit.
Note
It is recommanded to use this methode in order to create different MOX fuels, as it follows :
Duplicate the existing “UO2” mixture (and name it “MOX”)
Duplicate the “MOX” fuel into as many mixtures as wanted. The identified MOX fuel names are “MOX_low”, “MOX_medium” and “MOX_high”, used to represent fuels with different plutonium enrichements.
Manually set the isotopic enrichments (see “Mix” object).
set_natural_elements()
Pre-define a list of natural elements compositions. Each element is named after its chemical symbol, then followed by the locution “Nat”. For exemple :
Element name |
Name in PyDrag |
---|---|
iron |
FeNat |
chrome |
CrNat |
sulfur |
SNat |
Warning
The isotope Gd152 is not taken into account in the natural gadolinium composition (and replaced by Gd154). Moreover, the natural aliminium composition is different when using an APXSM-formatted nuclear data library.
load_composition()
Load all the defined natural elements and mixtures’ compositions into the object. This method follows these steps :
Recover the isotopes’ molar masses from the library
Check for any missing isotopes by listing all the pre-defined ones. If an isotope is missing in the library, it is replaced by the N+2 isotope.
Compute the natural elements’ molar masses (or recover these molar masses if they do exist in the library)
Compute the atomic densities of each mixtures
Warning
The silicium molar mass is equal the Si28 molar mass. The molybdenum molar mass is equel to the Mo95 molar mass.
Note
This method is used to update the mixtures/elements every time the user modifies the default caracteristics.
make_default_mix()
Pre-define the default mixtures’ compositions.
Note
Default mixtures’ name are :
Common name |
Pydrag mixture name |
---|---|
Stainless Steel 304 |
SS304 |
Inconel |
Inconel |
Zircaloy-4 |
Zr4 |
Ag-In-Cd |
AIC |
Air |
Air |
UO2+Gd fuel |
Gd |
MOX fuel |
MOX |
UO2 fuel |
UO2 |
B4C |
B4C |
Water |
water |
Pyrex |
Pyrex |
Void |
void |
M5 |
M5 |
Hafnium |
Hf |
make_common_mix()
Compute the isotopic concetrations of the mixtures that are not made of U238. It includes all the “structure” materials, the “moderators”, and the “absorbers”.
Warning
The molar mass of water is set to 18.01528 in the case of non-APLIB2 libraries.
add_grids()
Create different moderators to be used in different areas of the assembly. It is representing the diltued assembly grids. The created moderators are called “MODE” (for central fuel cells), “MODEL” (for lateral fuel cells), “MODEC” (for corner fuel cells) and “MODETE” (for tube cells).
Note
The moderators compositions are calculated based on the grid description given in the “Grids” object and the “water” mixture.
make_mix()
Generate every mixtures’ isotopic concentration based on all the given informations (default and user-defined).
Note
It is not necessary to declare the proportion of U238 in fuel mixtures, as it is automatically calculated based on the other declared ratio.
add_combinated_mix()
Create a used-defined combinated mixture, which is a material described through other existing mixtures. It differs from other mixtures as it is desribed in DRAGON with the “COMB” keyword at the LIB: call.
Arguments:
name : name of the mix
composition : massic proportions of each mix composing the new mixture
temperature : mixture temperature. By default, this temperature is considered as given in K.
density : mixture density (in g/cm3)
make_fuel_mix()
Compute the isotopic concetrations of the mixtures containing U238.
“Geometry” object
Description
This class describes the assembly geometry to be modelized. It is mainly represented by a list of lists, containing the assiociation of pin’s dimensions and the different materials’ names inside each described areas. A pin is represented as a rectangular cell composed of centered circular regions. An assembly can be fully represented, or using 4th symmetry or 8th symmetry. For now, it is mandatory to describe it by its “South East” side (for 4th symmetry) or “East South-East” side (for 8th symmetry), as PyDrag has pre-defined symmetry axis for the GEO: module call.
Methods
Geometry __init__()
Initialize the Geomtry object.
Arguments:
PinLayout: assembly pin layout. It is given as a list of list, for exemple
PinLayout = [[I, F, F, B, F, F, B, F, F],
[F, F, F, F, F, F, F, F],
[F, F, F, F, F, F, F],
[T, F, F, B, F, F],
[F, F, F, F, F],
[B, F, F, F],
[F, F, F],
[F, F],
[F]]
PinPitch: pin pitch (in cm by default)
AssemblyPitch: assembly pitch (in cm by default)
Activeheight: fuel active height (in cm by default). This value is set to 0 by default (as it is not required for 0-power assembly calculations)
symmetry: assembly symmetry type. Can either be equal to ‘1/8’,’1/4’ or ‘1/1’
unit: distance unit used for every given distances in this object. Default value is ‘cm’, but it can also be equal to ‘inch’. PyDrag will automatically convert distances in centimeter.
set_mesh()
Set the pin’s mesh for each pin type, based on the type of moderator used in the cell.
make_rings()
Create a list of rings for the chosen material.
Arguments:
material : ring material
radius : radius value. By default, it is given in cm, but it can also be given in inch if the user specified the right distance unit in the Geometry __init__ method
Note
This functions is used for the spatial discretization of fuel (and absorber) rings.
set_pin_type()
Create a copy of the assembly plan attributes and replace every identical pins by a generic name (in order to make them easier to identify during GEO module call and spatial discretization step).
get_position()
Identify the position (corner/side/center) of each pin of the plan. This method helps to identify which kind of moderator will be used for the pins.
“Power” object
Description
This class contains some data required to compute the assembly power density (this calculation is done with a function from calculation.py, as it requires some informations about fuels).
Methods
Power __init__()
Initialize the power object.
Arguments:
nbAssemblies : total number of assemblies in the core
corePower : core power (in MWth)
density : power density (in MW/t)
set_power_density()
Set the power density of assembly. By default, the value is set to 0, which leads to an automatic estimation of the density in calculation.py (at the get_power_density() function).
Arguments:
density : power density (in MW/t)
“saphyb.py” module
This PyDrag module uses the ‘multiprocessing’ built-in Python library, in order to make parallel calculations over multiple CPUs. The Saphyb branches are splitted over multiple independant jobs, and processed with a single function (named ‘CaseMatrix).
Functions
CaseMatrix()
Generate a saphyb file with given branches.
branching description with the water densities and/or temperatures, fuel temperatures, boron concentrations, burnup steps and control rod types to be used
args from the Deplete function
number of CPU(s) to be used
Arguments:
mat : materials object
geom : geometry object
powerDens : power object
output : path and name of the generated Saphyb file. By default, the file is called ‘default.sap’ and is located in the libraries/ folder of PyDrag repository.
particularization : type of particularized isotopes list. It can either be equal to ‘LNR’ (default value, 10+1 isotopes), ‘EDF’ (35+1 isotopes), ‘SIM’ (61+1 isotopes) or ‘ALL’
OptMatrix : optimized branching matrix protocol. Can either be equal to True or False
water_density : list of water densities branches (in g/cm3)
water_temperature : list of water temperatures branches. It can be given as a list of float (assuming that it is given in °C). However, every single temperature steps can also be given as a list itself (such as [[150, ‘C’],[230, ‘F’]] for exemple). PyDrag will automatically identifies the temperature values and the chosen units, in order to convert every value into °C
fuel_temperature : list of fuel temperatures branches. It can be given as a list of float (assuming that it is given in °C). However, every single temperature steps can also be given as a list itself (such as [[286, ‘C’],[600, ‘K’]] for exemple). PyDrag will automatically identifies the temperature values and the chosen units, in order to convert every value into °C
boron_concentration : list of boron concentrations branches (in ppm)
burnup_CaseMatrix : list of burnup branches (in MWd/t)
barr_ID : list of control rods branches. The control rods’ names are given by the user.
ThermalExpans : thermal expansion flag, that can be set to True of False. This flag enables thermal expansion correction for nominal evolution calculation. More informations at the gap dilution sub-chapter
TypeDil : grid dilution type used during nominal evolution calculation. Can either be equal to ‘Tihange’,’Tihange_dev,’TOT’ or ‘NULL’. More informations at the grid dilution function
leak_model : leakage model used during nominal evolution calculation. Can either be equal to ‘APOL’, ‘CASM’ or ‘NLKG’. More informations at the FLU function
burnup_list_Evo : nominal depletion calculation burnup steps (in MWd/t). If this list is empty, PyDrag will recover the default burnup step list from the burnup list edition function
cpu : number of CPU available for calculation (default value is 1)
node : number of nodes available for calculation (default value is 1). This argument is not used in the current developpement state of PyDrag. Multi-node calculation is set, but it needs some format improvements before being published.
optimized_pool : enable the PyDrag calculation pool optimisation. Can either be True or False (if False, PyDrag will use the automatic pool sorting system of ‘multiprocessing’ module, which is highly not recommanded)
Note
The arguments from Deplete function are not required if the user already performed a depletion calculation. If not, an evolution calculation is automatically performed before the saphyb generation.
MakeParallelSaphyb()
This function is used in the multiprocessing routine, producing small saphyb file for every single calculation points.
Arguments:
mat : materials object
geom : geometry object
powerDens : power object
output_list : path and name of the generated Saphyb files
particularisation : type of particularized isotopes list (‘LNR’, ‘EDF’, ‘SIM’ or ‘ALL’). More information at CaseMatrix() function
dmod_list : list of water densities calculation points (in g/cm3)
tfuel_list : list of fuel temperatures calculation points (in °C)
cbor_list : list of boron concentrations calculation points (in ppm)
burnup_list : list of burnup calculation points (in MWd/t)
barrtype_list : list of control rods calculation points
cpu_name : name of the used cpu (used to keep track of the parallel processes state)
GetParticularisedIsotopes()
Return the list of the particularized isotopes to be stored in the Saphyb. The isotopes’ names are stored in human-readable format.
Arguments:
library : nuclear data library object
part_type : particularisation type (‘XEN’,’LNR’, ‘EDF’, ‘SIM’ or ‘ALL’).
Note
The ‘XEN’ option is only including Xe135/I135, as it has been explained in “Handbook of nuclear engeineering” by D.KNOTT and A.YAMAMOTO (p.1201) that it is not relevant to particularized Sm149 without Np239 as they have opposite effect on reactivity (and Np239 is not tracked). It is supposed to be more performant than the ‘LNR’ option, with similar results.
heavy : flag used to recover the heavy isotopes from particularised ones. Can either be set to True or False.
UpdateLIB()
Update the microlib with the calculation point informations (new moderator composition, fuel temperature, etc.).
Arguments:
mat : materials object
bu_step : calculation burnup step number
SPH()
Performe the superhomogeneisation (SPH) equivalence over the chosen calculation point parameters.
Arguments:
mat : materials object
geom : geometry object
barrtype : control rod type
SaveDir : name of the Saphyb LCM object directory
particularisation : particularised isotopes type (‘LNR’, ‘EDF’, ‘SIM’ or ‘ALL’).
SAP()
Memory-locateed Saphyb initialization/update.
Arguments:
mat : materials object
powerDens : power object
cbor : calculation point boron concentration (in ppm)
dmod : calculation point water density (in g/cm3)
tfuel : calculation point fuel temperature (in °C)
bu_step : calculation point burnup step (in MWd/t)
barrtype : calculation point control rod type. The integer used to identify control rod will be used later during DONJON core calculations.
particularisation : particularised isotopes type
itr : calculation point number
sap_name : name of the generated saphyb file
Concat()
Concatenate every single saphyb point into the final saphyb file.
Arguments:
mat : materials object
mode : chosen saphyb files storage mode (‘memory’ for memory-located LCM objects or ‘local’ for saved file)
“Toolbox.py” library
This PyDrag module is a collection of utility functions, used all along the PyDrag process.
Functions
chuking()
Divide a list in to a chosen number of chunks.
Arguments:
lst : list to be chunked
n : number of chunks
Duplicate()
Duplicate any memory-located object. This function uses the C2M procedure called “Duplicate.c2m”. It allows to create an identical object, in a different memory adress.
Arguments:
LCM_obj : LCM object to be duplicated
OpenFile()
Create a memory-located object from an ASCII file.
Arguments:
ASCII_path : path to the ASCII file
MakeFile()
Crate a XSM/ASCII/BIN file from a memory-located object.
Arguments:
lcm_obj : LCM object to be stored as a XSM/ASCII file
file_path : path to the generated file
Clear_Index()
Clean the chosen directory from any PyGan calculation artifacts.