Annals of Nuclear Energy 115 (2018) 367–376
Contents lists available at ScienceDirect
Annals of Nuclear Energy journal homepage: www.elsevier.com/locate/anucene
Gemma: Development of a two-dimensional neutron transport code with the method of characteristics Guillermo Ibarra Reyes a,⇑, Samuel Vargas Escamilla b, Armando Miguel Gómez Torres b, Edmundo del Valle Gallegos a a b
Escuela Superior de Fsica y Matemáticas, Instituto Politı`cnico Nacional, San Pedro Zacatenco, C.P. 07738 Cd. de Mexico, Mexico Instituto Nacional de Investigaciones Nucleares, Carr. Mexico-Toluca s/n, La Marquesa, C.P. 52750 Ocoyoacac, Edo. de Mexico, Mexico
a r t i c l e
i n f o
Article history: Received 4 October 2017 Received in revised form 23 January 2018 Accepted 25 January 2018
Keywords: Method of characteristics Neutron transport Criticality Gemma code
a b s t r a c t This work describes the development of Gemma code, a next generation neutron transport solver capable of employing accurate solution methods with the ability to incorporating the latest computing techniques and providing a flexible developmental environment. The Gemma code is a 2D method of characteristics solver, which was written completely in the D programming language. In doing so, flexibility is provided on two fronts, for the end user and future developers. Users interact with the code through an input text file where the geometry, materials and calculation parameters are specified with input cards. This approach eliminates the need for leaning any programming language and any errors found are presented clearly. Ó 2018 Elsevier Ltd. All rights reserved.
1. Introduction The AZTLAN Platform (Gomez-Torres et al., 2015) is a Mexican initiative whose primary objective is to develop a comprehensive nuclear analysis software, similar to the vision of the Consortium for the Advanced Simulation of Light Water Reactors (CASL) and the European Platform for Nuclear Reactor Simulation (NURESIM). This initiative is an important first step towards modernizing, improving and incorporating computational methods and codes from previous studies into an integrated national platform. Such that Mexico can develop its own modeling and simulation tools as opposed to using 3rd party software, which has been the norm. Currently the AZTLAN Platform has in house codes that solve the neutron transport equation; however, they rely on precomputed macroscopic neutron cross sections obtained from Serpent (Leppänen, 2013). For a truly independent nuclear analysis toolkit, a lattice code to compute these values must be developed. Crucial to a lattice code is the accurate calculation of the neutron flux distribution throughout the system. This solution is obtained from the Boltzmann steady state neutron transport equation; in which the position, solid angle and energy are discretized. A high resolution distribution of the neutron flux implies modeling ⇑ Corresponding author. E-mail addresses:
[email protected] (G.I. Reyes), samuel.vargas@inin. gob.mx (S.V. Escamilla),
[email protected] (A.M. Gómez Torres). https://doi.org/10.1016/j.anucene.2018.01.043 0306-4549/Ó 2018 Elsevier Ltd. All rights reserved.
the heterogeneous system without simplifications, therefore requiring a greater level of discretization which in turn increases the number of coupled algebraic equations. Historically such detailed calculations were considered computationally prohibitive; however, the advancement of semiconductor manufacturing processes has made such tasks feasible through the use parallel processing. It is worth noting that Serpent (Leppänen, 2013) generates the macroscopic cross sections from a continuous energy spectrum through the Monte Carlo or stochastic method. In the case of a deterministic solution, the use of a multigroup energy spectrum must be accompanied by the self shielding calculations (Knott and Yamamoto, 2010). In the first iteration of the Gemma code and the scope of this paper, focuses on the solution of the neutron transport equation. Implementation of an appropriate self shielding method will be covered in a future work. Given the rare opportunity to develop a neutron transport solver from scratch, a clear vision is required. From a developer’s viewpoint engineering analysis software should be accurate, fast and flexible. Flexible in the sense of being able to adapt to possible or future requirements in the code. Fulfilling such lofty expectations requires having a clear plan of execution and achieving a balance between the solution method, computer hardware and the software development techniques which uses modern development techniques to comply with the general vision.
368
G.I. Reyes et al. / Annals of Nuclear Energy 115 (2018) 367–376
~ ¼ d~ ds X r:
2. Method of characteristics Solving the transport equation within a full reactor core without the need for separate lattice calculations, which generates homogenized few group cross sections, was at one point beyond the limits of available computational resources. In order to circumvent impractical solution times, the neutronic analysis of reactor cores was carried out in two stages; the generation of tabulated neutron cross sections for homogenized regions such as pin cells or fuel assemblies followed by the core calculations. Typically the core calculation solution methods employ the diffusion approximation of the neutron transport equation. The method of characteristics (MOC) (Askew, 1972) is an attractive candidate for incorporating transport theory for full reactor core calculations. Due to the phenomenal increase in computing power in the last decade, MOC is a viable technique and considered practical in terms of computation time due to its highly parallelizable nature. Several lattice level codes have incorporated MOC as a method of solving the multigroup transport equation. Such examples include AEGIS (Yamamoto et al., 2010), APOLLO2 (Sanchez et al., 2010), CASMO-5 (Rhodes et al., 2006), DRAGON5 (Hébert, 2013) and OpenMOC (William et al., 2014). The method of characteristics (MOC) solves the 2D neutron transport equation by discretizing the polar and azimuthal angle space and integrating the integral form of the equation for a particular quadrature set. Such that the integrated multigroup, steady state expression may be expressed as:
~ þ Rt ð~ ~ rWg ~ ~ ~ ~ ~ X r; X g r ÞWg r; X ¼ Q g r; X;
ð1Þ
where g is the energy group corresponding to energy E, ~ r is the posi~ is the angular direction vector, Ug describes the g-th tion vector, X group neutron angular flux distribution, Rtg is the g-th group total macroscopic cross section and Q g represents the g-th group total neutron source. The total neutron source consists of a fission, scattering and external source. In the case of reactor physics, the external source may be neglected such that:
~ ¼ Qg ~ r; X
G Z X g 0 ¼1
þ
4p
~0 ~ Wg0 ~ ~0 X ~0 ; E0 dX Rsg0 !g ~ r; X r; X
Z G vg ð~rÞ X ~0 dX ~0 mRgf 0 ð~rÞ Wg ~r; X 4pk g0 ¼1 4p
ð2Þ
also known as the k-eigenvalue expression. Where Rsg0 !g is the macroscopic scattering cross section from group g 0 to group g; Rgf is the macroscopic fission cross section for group g; m is the average number of neutrons produced per fission, vg is the fraction of neutrons produced from a fission for group g and k represents the multiplication factor or eigenvalue. The characteristic form of the transport equation defines the neutron path and is obtained by integrating the streaming operator ~ rw over a characteristic (a straight line in the X ~ direction) X ~ direction between (Hébert, 2010). For a neutron traveling in the X ~ ~ the positions r 0 and r:
~ ~ r ¼ r~0 þ s X
ð3Þ
where s is the magnitude of the vector ~ r r~0 . For the derivative along the neutron steaming path, consider:
d dx @ dy @ dz @ ¼ þ þ ds ds @x ds @y ds @z with
ð4Þ
ð5Þ
Considering
the
dot
products
of
Eq.
(5),
such
that
^ ¼ dz and substituting into ~ ^i ¼ dx; ds X ~ ^j ¼ dy, and ds X ~k ds X Eq. (4):
d ^ @ ¼X ~ ^i @ þ X ~ ^j @ þ X ~k ~ r: ¼ X ds @x @y @z
ð6Þ
Finally substituting Eqs. (6) into (1):
d ~; X ~ þ Rt r~0 þ s X ~ Wg r~0 þ s X ~; X ~ ¼ Q r~0 þ s X ~; X ~ : Wg r~0 þ s X g g ds ð7Þ The same substitution may be applied to Eq. (2), for brevity this step is skipped. The analytical solution of Eq. (7) requires the integrating factor:
Rs t ~Þds0 R r~ þs0 X e 0 gð 0
ð8Þ
hence:
~; X ~ ¼ Wg r~0 ; X ~ e Wg r~0 þ s X Z
s
þ
Rs
~Þds0 Rtg ðr~0 þs0 X
0
Rs 00 ~ e s0 Rtg ðr~0 þs00 X~Þds ds0 : ~; X Q g r~0 þ s0 X
ð9Þ
0
2.1. Solution method Within the MOC framework the integral over the angular domain in the total neutron source from Eq. (2) is approximated with the discrete ordinates. This approximation represents the discretization of the angular variable with azimuthal and polar angles, such that:
rÞ ¼ /g ð~
Z 4p
~0 dX ~0 r; X Wg ~
M X P X
xm xp Wg;m;p ð~rÞ
ð10Þ
m¼1 p¼1
with
~m;p ~ r ¼ r~0 þ s X
ð11Þ
where the azimuthal and polar angle quadratures are represented by the angles m 2 f1; 2; . . . ; Mg and p 2 f1; 2; . . . ; Pg with weights xm and xp for the azimuthal plane and axial plane, respectively. Characteristics or tracks are traced across the problem system spatial domain, which is divided into arbitrarily sized regions. Such that characteristic k with an azimuthal angle m running along region i creates a spatial discretization or segment of length si;m;k , see Fig. 1. A common assumption within the MOC framework is to consider that the total neutron source Q g as well as the material properties are constant within each region, often termed flat source regions (FSRs). The flat source approximation permits the integral over s from Eq. (9) to be solved analytically for region i as:
Z
s
Q i;g;m;p ð~ r Þe
Rs s0
~m;p Þds00 Rti;g ðr~0 þs00 X
0
ds ¼
Q i;g;m;p
0
Rt;i;g
t 1 eRi;g sk;i;m;p :
ð12Þ
Therefore the outgoing angular flux for each characteristic k or segment passing through each region i can be expressed as: t
in Ri;g;m;p sk;i;m;p Wout þ k;i;g;m;p ¼ Wk;i;g;m;p e
t Q i;g;m;p 1 eRi;g sk;i;m;p : t
Ri;g
ð13Þ
The flat source total source term Q i;g;m;p for FSR i with an area Ai is now defined in terms of an area averaged angular flux, Wi;g;m;p within the FSR:
369
G.I. Reyes et al. / Annals of Nuclear Energy 115 (2018) 367–376
bra to remove terms, which in essence moves operations from inner loops to outer loops. Such a technique is common among the scientific community. In the case of the MOC framework, this approach has been described by Kochunas (2013) and used in the MPACT code (Kochunas et al., 2013). For MOC updating the region scalar flux requires the following operations:
Qi,g si,m,k
outgoing angular flux wout k;i;g;m;p (13) e k;i;g;m;p (15) segment average angular flux w
i
region average angular flux wi;g;m;p (16) region average scalar flux /i;g (18)
k
From these expressions the outer and inner loops are clearly identified. For example, the calculation of /i;g requires wi;g;m;p (outer e k;i;g;m;p (inner loops). and w loop) and consequently wout k;i;g;m;p
Fig. 1. Spatial Discretization of an arbitrary region with constant material properties.
Q i;g;m;p ¼
G X M X P X
~m0 ;p0 X ~m;p wi;g;m0 ;p0 xm0 xp0 Rs;i;g0 !g X
G M X P X vi;g X mRf ;i;g0 xm0 xp0 wi;g0 ;m0 ;p0 : 4pk g0 ¼1 m0 ¼1p0 ¼1
ð14Þ
The region average angular flux Wi;g;m;p term is calculated from the segment-average angular flux:
e k;i;g;m;p ¼ W
R sk;i;m;p 0
Wi;g;m;p ðs0 Þds0
R sk;i;m;p 0
0
ds
out Win Q i;g;m;p k;i;g;m;p Wk;i;g;m;p ¼ þ : t Ri;g sk;i;m;p Rti;g
ð15Þ
Finally the region average angular flux is calculated from the segment average angular fluxes:
X
Wi;g;m;p ¼
e k;i;g;m;p sk;i;m;p dAm;k w X sk;i;m;p dAm;k
k2i
:
ð16Þ
k2i
Another common approximation within the method of characteristics framework is the consideration of an isotropic source. Although higher order scattering derivations have been developed, within this work the simplest approximation is considered. The anisotropy level of the source may be represented by expanding the source as a function of Legendre polynomials (Lewis and Miller, 1984). As an isotropic source, the total source is expressed in terms of scalar flux /i;g :
Q i;g ð~ rÞ ¼
G X
1 4p
Rs0 ;i;g0 !g /i;g0 ð~ rÞ þ
g 0 ¼1
vi;g k
G X g 0 ¼1
mRf ;i;g0 /i;g0 ð~rÞ
!
ð17Þ
where,
/i;g ¼
M X P X
xm xp wi;g;m;p :
as:
Q i;g;m;p out in 1 eRt;i;g sk;i;m;p : Dwk;i;g;m;p ¼ win w ¼ w k;i;g;m;p k;i;g;m;p k;i;g;m;p Rt;i;g ð19Þ
g 0 ¼1m0 ¼1p0 ¼1
þ
Angular flux change along the characteristic can be expressed
ð18Þ
m¼1 p¼1
Expression (18) is an extension of the discrete ordinates approximation, which considers the azimuthal and polar angles over the angular phase space in order to obtain the scalar flux. 2.2. Iterative scheme
When considering isotropic scattering, a reduced source term is rather convenient and defined as:
Q i;g ¼
Q i;g;m;p
Rt;i;g
Q i;g
¼
Rt;i;g
:
ð20Þ
The use of a precomputed reduced source term eliminates a division operation within the innermost loop and eliminates the angle dependence due to the discrete ordinates approximation. Division of the emission density by the total cross section requires the use of a truncated spherical harmonics expansion (Sciannandrone et al., 2016). Thus the angular flux change may then be expressed as:
Dwk;i;g;m;p ¼ win 1 eRt;i;g sk;i;m;p : k;i;g;m;p Q i;g
ð21Þ
Using the new definitions of Q i;g and Dwk;i;g;m;p , the segment average angular flux can be expressed as:
e k;i;g;m;p ¼ Dwk;i;g;m;p þ Q i;g : w Rt;i;g sk;i;m;p
ð22Þ
Accordingly the region average angular flux may be defined as:
P
wi;g;m;p ¼
k2i Dwk;i;g;m;p dAm;k
Rt;i;g
P
k2i sk;i;m;p dAm;k
þ Q i;g :
ð23Þ
A key component of the MOC framework is the solution of the region averaged angular fluxes in (23), which in turn is used to determine the scalar flux for each region. The total area approximation in a FSR is presented in Fig. 2, where dm is the distance between characteristics of the azimuthal angle m. This implies that the integration weights are not chord dependent, therefore reducing the number of calculations required (Sciannandrone et al., 2016). Such that characteristic k of length si;k has an angle of hp with respect to the polar axis when projected onto the azimuthal axis. Therefore the differential area may be expressed as:
dAm;k ¼ dm sin hp
ð24Þ
leading to the FSR volume calculation: The MOC solution method is described the previous subsection. However it is worth noting that being an iterative solution method the equations may be optimized, resulting a reduction in the number of floating point operations. This approach involves using alge-
Vi ¼
X X sk;i;m;p dAm ¼ sk;i;m dm xm k2i
where,
k2i
ð25Þ
370
G.I. Reyes et al. / Annals of Nuclear Energy 115 (2018) 367–376
3.2. Global cyclic tracking Tracks may run along a certain region or the entire system. Gemma uses the latter tracing scheme, also known as global tracking (Roy, 1998). Although the global cycling tracking approach is the most popular, other methods exist (Santandrea et al., 2017). Covering the domain requires azimuthal angles between 0 6 u 6 2p; however through symmetry the angle trajectories need only be traced between 0 6 u 6 p given that complementary angles share the same end points. A set of complementary angles are defined as ðu; uÞ or more precisely ðu; u þ pÞ. Another technique in track generation is the use of cyclic tracking. Cyclic tracks or a perfect reflection provides a straightforward mechanism for treating boundary conditions in which an addition function provides the incoming flux (Kochunas, 2013). With this approach a set of complementary angles are formed, such that tracks wrap around the system geometry as closed cycles.
kn-3 kn-2 kn-1
dm
kn kn+1
kn+2
kn+3
Fig. 2. Area approximation for a FSR.
sk;i;m;p ¼
sk;i;m : sin hp
ð26Þ
The previous expression is the 3D projection of a track segment for the polar angle hp . Substituting the area and volume approximations into (23):
P wi;g;m;p ¼
k2i dm
sin hp Dwk;i;g;m;p þ Q i;g : V i Rt;i;g
ð27Þ
Therefore:
P PM PP /i;g ¼
k2i
m¼1
" ¼ 4p Q i;g þ
p¼1
3.3. Quadrature sets Once the azimuthal angles are adjusted such that a perfect reflection is created, the weights are defined as:
8 1 umþ1 um þ um if m ¼ 0; > < 2p 2 xm ¼ 21p umþ12um þ um 2um1 if 0 < m < M 1; > :1 um um1 2p u m þ if m ¼ M 1: 2 2p
ð29Þ
For modeling polar motion, the Legendre quadrature set is employed.
xm xp dm sin hp Dwk;i;g;m;p V i Rt;i;g
þ
M X P X
xm xp Q i;g
m¼1 p¼1
#
1 X xm xp dm sin hp Dwk;i;g;m;p : V i Rt;i;g k2i
ð28Þ
3. Application method 3.1. Geometric representation The Gemma code uses the constructive solid geometry (Foley et al., 1996) (CSG) methodology to represent arbitrary geometries. CSG allows constructive models to be represented using primitive solids and boolean operators. A universe consists of cells or the combination of primitive surfaces and materials. In the case of the highly repetitive geometries found in nuclear reactors, macro cells are created to easily represent fuel pin cells and lattice arrangements. Codes such as MCNP (MCNP, 2003), Serpent (Leppänen et al., 2015), AEGIS (Yamamoto et al., 2010) and OpenMOC (William et al., 2014) have adopted a similar strategy. A better representation of a lattice fuel cell is the inclusion of the channel. Physically a channel provides an enclosure for the fuel elements. Gemma provides an effortless mechanism for adding additional surfaces to lattice universes. An example of a assembly channel representation is given in Fig. 3a. Whenever a universe is defined, regardless of the card (cell, lattice, or assembly), a tree style structure mapping the surface distribution is generated. Fig. 3b presents the map generated for a fuel lattice assembly. A principle approximation in the method of characteristics is that the scalar flux inside a region is constant. In order to reduce the error associated with this approximation, a greater discretization of the geometric space is required. Gemma provides fine grain control over the creation of regions through the use of the map structure.
3.4. Track segmentation For the track segmentation, the tracks are first traced along the system geometry. Then the track segmentation is carried out in two steps, starting with the intersection points for every surface and finally the intersection points are evaluated for every region within each aforementioned surface. This two step segmentation relies heavily on the tree map structure previously generated. A clear advantage of this approach is a reduced subset of items to sweep or calculate in order to find an intersection. By performing the segmentation on the map structure, this methodology provides a robust mechanism for treating a wide spectrum of geometries. Due to Gemma’s ability to describe a system as a cell or a combination of surfaces and by extension lattices and assemblies. 3.5. Solver routine The primary equations used to solve for the FSR total source and scalar flux within the MOC framework are the following:
Q i;g ¼
1
!
G vi;g X Rs0 ;i;g0 !g /i;g0 ð~ mRf ;i;g0 /i;g0 ð~rÞ rÞ þ
G X
4pRt;i;g g0 ¼1 k g0 ¼1 Dwk;i;g;m;p ¼ win 1 eRt;i;g sk;i;m;p k;i;g;m;p Q i;g /i;g ¼ 4p Q i;g þ
!
1 X xm xp dm sin hp Dwk;i;g;m;p : V i Rt;i;g k2i
ð30Þ ð31Þ ð32Þ
This method of characteristics solution method has been described by Kochunas (2013) and within the OpenMOC code (William et al., 2014). The solution algorithm calculates the eigenvalue keff while updating the eigenvector /i;g using (30)–(32). Being an iterative method, the scalar flux is updated by a transport kernel. This kernel represents an inner and outer iteration scheme. While the inner iteration calculates an approximate scalar flux
371
G.I. Reyes et al. / Annals of Nuclear Energy 115 (2018) 367–376
Fig. 3. 4 4 fuel lattice assembly.
Table 1 Summary of Gemma modules. Module
Class
Description
cell.d expEvaluate.d geometry.d quadrature.d reader.d report.d shapes.d solver.d
Cell ExpEvaluate Map Quadrature InputFile OutputFIle – Solver
track.d trackGenerator. d
Track TrackGenerator
Cell definition Exponential function evaluation table Surface map structure System quadrature information Input file data and parser Output file data structure Geometric intersection library Neutron transport equation solver routine Track data structure Cyclic track distribution
for each region with an assumed constant total source; the outer iteration obtains an updated total source using the scalar flux from the inner iteration. The inner iteration or the transport sweep algorithm involves solving (31) and (32). Within this step, /i;g is calculated for every FSR i and its respective energy group g. Although the track generation and segmentation are discussed in another chapter, consider a 2D system with its corresponding characteristics or tracks along its geometric area. At the system boundary a uniform incoming angular flux is assumed for each track. When starting the eigenvalue calculation, the angular flux is set to some arbitrary value, such as 1, and updated in each inner iteration or transport sweep. Within the transport sweep the angular flux change (31) along each track for each energy group is integrated in order to tally the contribution to the scalar flux within a FSR with an assumed constant total source. Accounting for all the contributions involves a
Table 2 Gemma input file keywords. Card
Usage
Category
surf cell pin
surf cell . . . pin .. . lattice refine assembly . . . groups material . . . . . . . . . . . . .. . . . . quadrature boundary system run tolerance
geometry geometry geometry
lattice refine assembly groups material
quadrature boundary system run tolerance plot
geometry geometry geometry neutronic data neutronic data
simulation simulation simulation simulation simulation simulation
372
G.I. Reyes et al. / Annals of Nuclear Energy 115 (2018) 367–376
Fig. 4. Gemma input file of a 4 4 BWR lattice.
five nested loops over azimuthal angles, tracks for each azimuthal angle, segments within a track, energy groups and polar angles.
4. Aspects of software design 4.1. Choice of programming language The D programming language is a multi-paradigm systems programming language (D.L. Foundation, 2017). D aims to deliver the ease of use associated with interpreted languages such as Python, while providing performance comparable to compiled languages such as C++. The first major update to D was in 2007 with the release of D2 and as of 2012 has been established as the official
version. The official compiler DMD is available under the Boost Software License (Bright, 2017). There exists other compilers for the D language (G. Developers, 2017; Microsoft, 2017; SDC-Developers, 2017), of particular interest is the LLVM based compiler LDC (L. Developers, 2017). In compiler benchmarking, LDC and DMD were proven to be as fast as the C++ compilers (G.U. attractivechaos, 2013) and LDC was faster than clang++ (Benchmarks Round Two, 2013). It is worth noting that the D compilers were also faster than its counterparts of the newer generation of programming languages, Go and Rust, which are all billed as providing memory safe applications. With these traits, D is a strong candidate for any general purpose applications. Another factor that influences a new languages traction is ecosystem support. D provides native support for C code through the application binary interface (ABI) as well as all the C funda-
373
G.I. Reyes et al. / Annals of Nuclear Energy 115 (2018) 367–376 Table 3 LA-13511 k1 result analysis. Number of energy groups
Benchmark Problem
Reference k1
Calculated k1
Difference (PCM)
1
Pua-1-0-IN Pub-1–0-IN Ua-1-0-IN Ub-1-0-IN Uc-1-0-IN Ud-1-0-IN UD2O-1-0-IN Ue-1-0-IN
2.612903 2.290323 2.250000 2.330917 2.256083 2.232667 1.133333 2.180667
2.612903 2.290322 2.250000 2.330917 2.256090 2.232665 1.133333 2.180666
0.000 0.043 0.000 0.000 0.310 0.090 0.000 0.046
2
Pu-2-0-IN U-2-0-IN UAL-2-0-IN URRa-2-0-IN URRb-2-0-IN URRc-2-0-IN URRd-2-0-IN UD2O-2-0-IN
2.683767 2.216349 2.661745 1.631452 1.365821 1.633380 1.034970 1.000221
2.683767 2.216349 2.661744 1.631451 1.365821 1.633379 1.034970 1.000221
0.000 0.000 0.038 0.061 0.000 0.061 0.000 0.000
3
URR-3-0-IN
1.600000
1.600000
0.000
tion process is automated through the use of a Makefile. The input file provides an intuitive and flexible tool for specifying a neutronic system. Greater flexibility of software design comes from D’s multiparadigm approach to development. Gemma adopts the object oriented programming (OOP) developmental approach, where objects contain data or attributes and a set of procedures or methods. The basic building blocks of programs in D are modules or individual source files. Contents of a module may then be called throughout the program through the use of the import keyword. A summary of the modules used in Gemma is presented in Table 1. Version control or a source control management (SCM) tool is also vital in the software development process. SCM tools allow developers to track source code changes, merge changes, fix errors in earlier revisions and rollback in case of mistakes. Gemma uses Mercurial (Mercurial SCM, 2017) for SCM due to its intuitive approach, simple yet powerful functionality and decentralized model. A decentralized model permits operating with a local repository on a computer and a global repository on a server. This approach is considered a more natural workflow by the Gemma developers. 4.3. Input file specifications The problem to be solved is specified by a user through a text input file, which is composed of the geometric system representation, neutronic data for the materials and the simulation parameters. The specification of the aforementioned information is carried out through the use of input cards, see Table 2. Blank spaces are permitted between cards and comments are specified with the % symbol. An example of a sample 4 4 BWR lattice is provided in Fig. 4. After a stable version of Gemma has been released to end users, compile time errors are nonexistent. However execution of the binary file is not error free. Run time errors will arise from incorrect definition or use of cards in the input file generated by the end user. In an effort to provide a better user experience, Gemma adopted a defensive design approach in handling these errors. Such that clear messages identifying the exact problem detected as opposed to jargon related to the program function that encountered the error. Gemma covers over 50 errors associated with incorrect use of the cards, for example not specifying a material will produce the error:
Fig. 5. BWR benchmark regions created in Gemma.
mental and derived types. This support represents seamless access to existing C libraries, several popular bindings current exist (D programming bindings, 2007). Creation of the library bindings involves creating a D interface file or the translation of the C header file. With regards to flexibility of a software project, it can be view as its ability to adapt to possible future changes in a project’s requirements. Key to such environments is the loose coupling of its components and the ease modifying those connection points. Although this sort of flexibility may be created in many languages they are not without their idiosyncrasies (Alexandrescu, 2009). The authors strongly believe that D offers a clean syntax for providing such flexibility. 4.2. Design structure Execution of the Gemma code requires a one time compilation step and all subsequent interactions through command line arguments and an input file. With this approach the end user is not required to learn any aspects of the D language and the compila-
Reading input file. . ... OK. Checking materials. . ... ***ERROR*** Need to specify neutronic data for fuel. Detection of an error results in the program’s termination. 5. Results 5.1. LA-13511 benchmark set The analytical benchmark LA-13511 (Sood et al., 2003) provides a set of problems in where the eigenvalue may be solved, from
Table 4 BWR k1 result analysis for a track spacing of 0.001 cm with k1 ¼ 0:986561. # Azimuthal Angles
keff
Difference (pcm)
8 16 32 64 128 256
0.988346 0.987113 0.986585 0.986502 0.986515 0.986511
+180.93 +55.95 +2.43 5.98 4.66 5.07
374
G.I. Reyes et al. / Annals of Nuclear Energy 115 (2018) 367–376
which 18 problems are selected. The problems contain the identifier: fissile material – energy groups – scattering order - geometry Such that the benchmark problem Pua-1-0-IN represents an infinite geometry (IN) with plutonium type a solved for 1 energy group and isotropic scattering P 0 . The problems selected for testing included different materials for 1, 2 and 3 energy groups. Calculations were performed with a double floating point. The eigenvalue results are presented in Table 3. In every case there was an excellent agreement between the calculated and reference solutions, the few differences are attributed to roundoff errors. Given that the analytical benchmark round off the k1 to 6 digits after the decimal point, while a double real number contains 16 significant digits.
5.2. BWR benchmark Next a 2D BWR type benchmark problem is considered (Hong and Cho, 1998). This problem consists of a 4 4 lattice with reflective boundary conditions. Each fuel pin has a radius of 0.5 cm and encapsulated within a clad with a thickness of 0.1 cm and a pitch of 1.6 cm. The fuel pins consist of 3 wt% UO2 or the burnable poison fuel pins contain 3 wt% UO2 with 3 wt% Gd2O3; whereas, the cladding material is Zircaloy-2 and the moderator is light water. This benchmark problem was modeled in Gemma using two group cross sections obtained from the DRAGON5 code (Hébert, 2013), as explained by Yang and Satvat (2012). In Gemma each pin was modeled as 5 rings divided into 16 sectors, for a total of 1280 regions as represented in Fig. 5. The total flux convergence criteria was set to 1 105 .
Fig. 6. 2D C5G7 benchmark problem configuration.
Table 5 Converged C5G7 eigenvalues at varying angles for a track spacing of 0.01 cm. Angle #
keff
Difference (pcm)
Iterations
Time (min)
4 8 16 32 64 128
1.18536 1.18456 1.18506 1.18633 1.18662 1.18674
100.29 167.71 125.57 18.54 +5.90 +16.01
721 713 713 713 713 713
66.3 133.2 258.8 499.2 961.2 1904.5
375
G.I. Reyes et al. / Annals of Nuclear Energy 115 (2018) 367–376 Table 6 Converged C5G7 eigenvalues at 64 azimuthal angles and varying track spacings. Spacing (cm)
keff
Difference (pcm)
Iterations
Time (min)
0.5 0.1 0.05 0.01
1.18670 1.18666 1.18664 1.18662
12.64 9.27 7.58 5.90
713 713 713 713
22.3 102.1 194.7 961.2
Table 7 Converged C5G7 average and maximum percent at varying angles for a track spacing of 0.01 cm. Angle #
Avg. relative % error
Max relative % error
4 8 16 32 64 128
1.901 0.412 0.451 0.437 0.458 0.461
7.623 1.627 1.738 1.751 1.762 1.791
The number of azimuthal angles was varied from 4 to 256 and 6 polar angles for a track spacing of 0.001 cm, the results of the converged eigenvalue as well as the difference in pcm with respect to the reference value of k1 ¼ 0:986561 are presented in Table 4. As can be observed, the eigenvalue are in excellent agreement with the reference value. It is worth nothing that with 32 azimuthal angles and a track spacing of 0.001 cm, the difference was less than 8 pcm and with 128 the difference of the converged eigenvalue is within 1 pcm. 5.3. C5G7 benchmark The C5G7 benchmark problem (Lewis et al., 2001) with no spatial homogenization is the seven energy group of the C5 mixed oxide (MOX) fuel assembly as previously specified by Cavarec et al. (1994). In the case of the 2D problem, the overall dimensions of the geometry are 64.26 64.26 cm, consisting of UO2 and MOX fuel lattices surrounded by a moderator see Fig. 6. The top and right have a reflective boundary condition and vacuum elsewhere. Fuel lattices consist of 17 17 pin-cells with a pitch of 1.26 cm and fuel-clad mixture pins with a radius of 0.54 cm. The UO2 lattice array contains UO2 fuel while the MOX arrangement is composed of MOX at concentrations of 4.3%, 7.0%, and 8.7%. Within both fuel bundles, guide tubes and a fission chamber is also present with the same radius of 0.54 cm. The resulting converged eigenvalues are presented in Table 5 for different azimuthal angles and 6 polar angles with a track spacing of 0.01 cm and in Table 6 for different spacings at 64 azimuthal angles and 6 polar angles. As well as the difference in PCM with respect to the MCNP5 solution of keff ¼ 1:18655 for each table. All results exhibit an excellent agreement with the reference solution. Calculations were performed on an IntelÒ XeonÒE3.1505M processor. As can be seen from the computation times weak scaling is observed, for example as the number of azimuthal angles doubles so does the time. Regarding the pin powers, an analysis is provided in Table 7, with more than 4 azimuthal angles a maximum relative percent error below 1.8 obtained while an average relative percent error of less than 0.5. 6. Discussion This work focused on the development of a MOC neutron transport solver for 2D steady state eigenvalue calculations. Aside from providing accurate solution, Gemma aims to provide a flexible code
with the potential to incorporate multi-core hardware. With regards to flexibility, it is addressed on two fronts for end users and future developers. Interaction with the Gemma code is carried out through the use of a user generated text input file. This approach carries multiple advantages to end users, including avoiding the need to learn aspects of a programming language and a friendly interface with clearer error detection as opposed to run time errors associated with a compiled language. At the center of the proposed vision for the Gemma lattice code still lies a neutron transport solver. Ideally this solver would need to solve 3D systems, for which the computational burden will be even more demanding. Therefore the Gemma code will need to be fine tuned to incorporate multiprocessing with the aid of multi-core processors and graphical processing units. An inherent disadvantage of the method of characteristics is its slow convergence, this may be alleviated though the use of an acceleration scheme such as coarse mesh finite difference (CMFD). Another key step towards a 3D solver will be extension of the ray tracing technique. A natural approach would be to use the same strategy as proposed in this work for a 2D geometry. However, in Gemma the tracks as well as the segmentation are calculated and stored in memory, thus placing more demand on storage and look up processes. Another approach is the on the fly calculation seem in Monte Carlo codes, which would eliminate the memory storage of tracking data but increase the computational burden. An intuitive approach to ray tracing involves considering the highly repetitive structures. For example in a light water reactor, identical pin-cells share the same segment lengths. With this consideration, only the unique segments will be stored as opposed to all segments for every characteristic. This modular ray tracing method is a must for 3D systems, but can also be incorporated in 2D to reduce the computational and storage requirements. Although this reduction does come with a price, a separate operation to re-create the global tracks is warranted. Therefore a sensibility analysis would also be required to evaluate the effectiveness of the proposed implementation. Acknowledgments The first author was provided financial support for graduate studies by the Consejo Nacional de Ciencia y Tecnologa (CONACYT). This work contributes to the AZTLAN platform or the CONACYT-SENER National Strategic Project No. 212602. References Alexandrescu, A., June 2009. A case for D. < http://www.drdobbs.com/parallel/thecase-for-d/217801225?pgno=4>. Askew, J., 1972. A characteristics formulation of the neutron transport equation in complicated geometries (Tech. rep.). United Kingdom Atomic Energy Authority. Benchmarks Round Two: Parallel Go, Rust, D, Scala and Nimrod, 2013. < https://togototo.wordpress.com/2013/08/23/benchmarks-round-two-parallelgo-rust-d-scala-and-nimrod/> (accessed 20.05.2017). Bright, W., 2017. Switch backend to Boost License #6680 commit. < https:// github.com/dlang/dmd/pull/6680> (accessed 20.05.2017). Cavarec, C., Perron, J., Verwaerde, D., West, J., 1994. Benchmark calculations of power distribution within assemblies (Tech. rep.). Nuclear Energy Agency. D.L. Foundation, 2017. D programming language. < https://dlang.org> (accessed 20.05.2017).
376
G.I. Reyes et al. / Annals of Nuclear Energy 115 (2018) 367–376
D programming bindings, 2017. < https://github.com/D-Programming-Deimos/> (accessed 20.05.2017). Foley, J.D., van Dam, A., Feiner, S.K., Hughes, J.F., 1996. Computer Graphics: Principles and Practice. Addison-Wesley. G. Developers, 2017. GDC D compiler. < https://gdcproject.org> (accessed 20.05.2017). Gomez-Torres, A., Puente Espel, F., del Valle Gallegos, E., François, J., Martı`n-del Campo, C., Espinosa-Paredes, G., 2015. Aztlan: Mexican platform for analysis and design of nuclear reactors. In: Proceedings of ICAPP, pp. 3–6. G.U. attractivechaos, 2013. Programming language benchmarks. < https:// attractivechaos.github.io/plb/> (accessed 20.05.2017). Hébert, A., 2010. Multigroup neutron transport and diffusion computations. In: Cacuci, D. (Ed.), Handbook of Nuclear Engineering, Vol. II Reactor Design. Springer Science & Business Media, pp. 751–911. Hébert, A., 2013. Dragon5: designing computational schemes dedicated to fission nuclear reactors for space. Proc. Nucl. Emerg. Technol. Space, 25–28. Hong, S.G., Cho, N.Z., 1998. CRX: a code for rectangular and hexagonal lattices based on the method of characteristics. Ann. Nucl. Energy 25 (8), 547–565. Knott, D., Yamamoto, A., 2010. Lattice physics computations. In: Cacuci, D. (Ed.), Handbook of Nuclear Engineering, Vol. II Reactor Design. Springer Science +Business Media, pp. 913–1239. Kochunas, B., 2013. A hybrid parallel algorithm for the 3-d method of characteristics solution of the boltzmann transport equation on high performance compute clusters (Ph.D. thesis). University of Michigan. Kochunas, B., Collins, B., Jabaay, D., Downar, T., Martin, W., 2013. Overview of development and design of MPACT: Michigan parallel characteristics transport code (Tech. rep.). American Nuclear Society. L. Developers, 2017. LDC – the LLVM-based D Compiler. < https://github.com/ldcdevelopers/ldc> (accessed 20.05.2017). Leppänen, J., 2013. Serpent–a continuous-energy monte carlo reactor physics burnup calculation code, VTT Technical Research Centre of Finland 4. Leppänen, J., Pusa, M., Viitanen, T., Valtavirta, V., Kaltiaisenaho, T., 2015. The serpent Monte Carlo code: status, development and applications in 2013. Ann. Nucl. Energy 82, 142–150. Lewis, E.E., Miller, W.F., 1984. Computational Methods of Neutron Transport. John Wiley & Sons.
Lewis, E., Smith, M., Tsoulfanidis, N., Palmiotti, G., Taiwo, T., Blomquist, R., 2001. Benchmark specification for Deterministic 2-D/3-D MOX fuel assembly transport calculations without spatial homogenization (C5G7 MOX), NEA/NSC. MCNP, X., 2003. Monte carlo team, mcnp—a general purpose monte carlo n-particle transport code, version 5, Tech. rep., LA-UR-03-1987, Los Alamos National Laboratory, April 2003. The MCNP5 code can be obtained from the Radiation Safety Information Computational Center (RSICC), PO Box 2008, Oak Ridge, TN. 37831–6362 (5). Mercurial SCM, 2017. < https://www.mercurial-scm.org> (accessed 20.05.2017). Microsoft, 2017. D Compiler for.NET. < http://dnet.codeplex.com> (accessed 20.05.2017). Rhodes, J., Smith, K., Lee, D., 2006. CASMO-5 development and applications. In: Proc. ANS Topical Meeting on Reactor Physics (PHYSOR-2006), pp. 10–14. Roy, R., 1998. The cyclic characteristics method. In: Proc. Int. Topical Meeting on the Phys. Nucl. Sci. Technol., Long Island, Oct. 5–8 vol. 1. p. 407. Sanchez, R., Zmijarevic, I., Coste-Delclaux, M., Masiello, E., Santandrea, S., Martinolli, E., Villate, L., Schwartz, N., Guler, N., 2010. Apollo2 year 2010. Nucl. Eng. Technol. 42 (5), 474–499. Santandrea, S., Sciannandrone, D., Sanchez, R., Mao, L., Graziano, L., 2017. A neutron transport characteristics method for 3d axially extruded geometries coupled with a fine group self-shielding environment. Nucl. Sci. Eng., 1–38 Sciannandrone, D., Santandrea, S., Sanchez, R., 2016. Optimized tracking strategies for step MOC calculations in extruded 3D axial geometries. Ann. Nucl. Energy 87, 49–60. SDC-Developers, 2017. The Stupid D Compiler. < http://https://github.com/SDCDevelopers/SDC> (accessed 20.05.2017). Sood, A., Forster, R.A., Parsons, D.K., 2003. Analytical benchmark test set for criticality code verification. Prog. Nucl. Energy 42 (1), 55–106. William, B., Shaner, S., Li, L., Forget, B., Smith, K., 2014. The OpenMOC method of characteristics neutral particle transport code. Ann. Nucl. Energy 68, 43–52. Yamamoto, A., Endo, T., Tabuchi, M., Sugimura, N., Ushio, T., Mori, M., Tatsumi, M., Ohoka, Y., 2010. AEGIS: an advanced lattice physics code for light water reactor analyses. Nucl. Sci. Eng. 42 (5), 500–519. Yang, X., Satvat, N., 2012. MOCUM: a two-dimensional method of characteristics code based on constructive solid geometry and unstructured meshing for general geometries. Ann. Nucl. Energy 46, 20–28.