Difference between revisions of "Tutorial"

From Serpent Wiki
Jump to: navigation, search
(Input)
(Pre-requisite)
Line 3: Line 3:
 
== Pre-requisite ==
 
== Pre-requisite ==
  
Compiled version of Serpent 2
+
Compiled version of Serpent 2.
 +
 
 +
This tutorial assumes that you can run Serpent 2 simply by typing <tt>sss2</tt> in your terminal, i.e. you either have the executable in your <tt>PATH</tt> or have created an alias for the executable. If this is not the case, you'll need to replace the <tt>sss2</tt> run-commands with the full path to your executable.
 +
 
 +
This tutorial assumes that you have defined a default cross section directory file for Serpent using the SERPENT_ACELIB environment variable (see the notes of [[Input syntax manual#set acelib| set acelib]]). If this is not the case, you'll need to give the path to a cross section directory file in the input using [[Input syntax manual#set acelib| set acelib]].
  
 
== Basics of Serpent input ==
 
== Basics of Serpent input ==

Revision as of 11:30, 11 September 2017

This page is the beginning of a hands-on tutorial in Serpent that will walk you through the creation of simple pin-cell and assembly geometry models and the use of those models for some reactor physics simulations.

Pre-requisite

Compiled version of Serpent 2.

This tutorial assumes that you can run Serpent 2 simply by typing sss2 in your terminal, i.e. you either have the executable in your PATH or have created an alias for the executable. If this is not the case, you'll need to replace the sss2 run-commands with the full path to your executable.

This tutorial assumes that you have defined a default cross section directory file for Serpent using the SERPENT_ACELIB environment variable (see the notes of set acelib). If this is not the case, you'll need to give the path to a cross section directory file in the input using set acelib.

Basics of Serpent input

Explain different (typical) parts such as:

  • Material definitions
  • Geometry definitions
  • Run parameters/options

Infinite homogeneous model

Overview

The first model in this tutorial is the simplest geometry model one can imagine: an infinite homogeneous system consisting of a single material. Here the infinite material is 4.0 wt-% enriched uranium with a density of 10.1 g/cm3.

We will use the infinite homogeneous system example for three tasks:

  1. Finding the critical enrichment of an infinite uranium system.
  2. Tallying the neutron energy spectrum in the critical infinite uranium system.
  3. Testing the effect of added neutron moderation on the multiplication factor and energy spectrum of the system.

Input

The input of the model is shown below and consists of only five definitions:

  1. Defining the single material, which is called fuel in this example.
  2. Defining the geometry by
    1. Defining an "infinite" surface, i.e. a surface enclosing all of space. The surface name is s1 in this example.
    2. Defining two geometry cells: One containing the material fuel and the other being defined as an outside cell.
  3. Setting up other run parameters, here simply setting the neutron population that is to be simulated.

Colors in the input correspond to:

  • Comments: These are ignored by Serpent.
  • Control words: A constantly updating list of control words can be found in the Input syntax manual. Everything between two control words that is not a comment is treated as a parameter to the first control word.
  • Name definitions: Name definitions for the various Serpent objects can contain characters and numbers and are used for referencing certain objects in other definitions.
  • Name references: References to named objects defined in the input. Name references can be made even if the name definition has not been made yet as long as the name will be defined later in the input.

Input for 2D pin-cell geometry

% --- Very simple infinite homogeneous geometry for Serpent tutorial

/************************
 * Material definitions *
 ************************/

% --- Fuel material (4.0 wt-% enriched uranium dioxide), density 10.1 g/cm3

mat fuel     -10.1
92235.03c    -0.04 
92238.03c    -0.96

/************************
 * Geometry definitions *
 ************************/

% --- "Surface" at infinity

surf s1 inf

% --- Cell c1 belongs to the base universe 0, contains the material fuel
%     and covers everything inside surface s1

cell c1 0 fuel      -s1

% --- Cell c2 belongs to the base universe 0, is defined as an "outside" cell
%     and covers everything outside surface s1

cell c2 0 outside    s1

/******************
 * Run parameters *
 ******************/

% --- Neutron population: 5000 neutrons per cycle, 100 active / 20 inactive cycles

set pop 5000 100 20

Running the input

Copy and paste the input to a file named infinite on your computer.

Testing and tinkering

2D Pin-cell model

Overview

Basics

Colors in input correspond to:

  • Comments
  • Control words
  • Name definitions
  • Name references

Input for 2D pin-cell geometry

% --- Simple 2D PWR pin-cell geometry for Serpent tutorial

/************************
 * Material definitions *
 ************************/

% --- Fuel material (3.0 wt-% enriched uranium dioxide), density 10.1 g/cm3

mat fuel     -10.1
92235.03c    -0.02644492
92238.03c    -0.85505247
 8016.03c    -0.11850261

% --- Cladding material for fuel rod
%     (100 % Zirconium)

mat clad     -6.55
40000.03c    -1.0

% --- Water at 1.0 g/cm3

mat water    -1.0
 1001.03c     2.0
 8016.03c     1.0

/************************
 * Geometry definitions *
 ************************/

% --- Fuel pin structure

pin p1
fuel    0.4025
clad    0.4750
water

% --- Square surface with 1.0 cm side centered at (x,y) = (0,0)

surf s1 sqc 0.0 0.0 0.5

% --- Cell c1 belongs to the base universe 0, is filled with the pin p1
%     and covers everything inside surface s1

cell c1 0 fill p1   -s1

% --- Cell c2 belongs to the base universe 0, is defined as an "outside" cell
%     and covers everything inside surface s1

cell c2 0 outside    s1

/******************
 * Run parameters *
 ******************/

% --- Neutron population

set pop 5000 100 20

% --- Boundary condition (1 = black, 2 = reflective, 3 = periodic)

set bc 2

% --- Geometry plots

plot 3  200  200
plot 3 1000 1000 0.0 -2.5 2.5 -2.5 2.5

Testing and tinkering

2D Assembly model

Overview

Basics

Testing and tinkering