Allen CDNE

Computational Design in Nuclear Engineering · Allen

Download the PDF

Computational Design in Nuclear Engineering, second edition, by Kenneth S. Allen, Ph.D., P.E.

Download the PDF

Chapter 2

Chapter 2. Introduction to Computation

As mentioned in the preface, nuclear engineering was at the forefront of most computational methods to solve complex problems. Many graduate courses in radiation interactions and transport require students to write computer programs to calculate Monte Carlo and/or deterministic solutions to the transport problem. In order to write computer codes, students must first develop adequate skills as programmers. This text is not intended for students who will be writing their own neutron transport computational codes. There are several references that provide the level of detail necessary to write neutron transport programs such as Lewis and Miller’s book Computational Methods of Neutron Transport (Lewis and Miller; 1993).

Figure 2.1. There are numerous languages and programs available to the nuclear engineer to solve complex transport problems. The selection of the correct tool for the desired result is important.
Figure 2.1. There are numerous languages and programs available to the nuclear engineer to solve complex transport problems. The selection of the correct tool for the desired result is important.

Although this text is not intended to instruct students on how to write transport codes, it is still necessary to describe the basics of programming and computation to ensure that there is an understanding of the logical operation of how the programs work. As shown in Figure 2.1, there are many language options available to solve computational problems. To this end, the book provides a description of the basic methods of program design and logic. The Julia program is used to demonstrate program logic and write basic scripts. The Julia examples presented could easily be replaced by another programming language such as Matlab®, C++, FORTRAN or Python. The major advantages to using a code like Julia are threefold. First, it is completely open-source and does not require a license or purchase to use. Second, it does not require the user to compile the code. Thirdly, it lends itself to plotting the results with minimal understanding of programming. Additionally, Julia has thousands of built-in functions available to the user as packages that eliminates the need to write many functions. The major disadvantage to Julia is it is an interpreted program. This means there is a requirement to have Julia loaded on the computer so it can interpret the code and it will not operate as a stand-alone program. To this end, it is recommended that students learn a programming language to write scripts to quickly read output files from computer codes and perform iterative adjustments to input files. Simple techniques for writing batch files and using macros in a text editor are presented to help bridge the gap between Julia and independent complied or other interpreted program languages.

  1. Also: Logical Flowcharts; Computer Language Levels; Function Syntax for Operations

    Example 2.1

  2. Example 2.2

  3. Example 2.3

  4. Example 2.4

Computational Design in Nuclear Engineering, second edition, by Kenneth S. Allen, Ph.D., P.E. — the complete book as a 394-page PDF.

Download the PDF