Difference between revisions of "Multi-physics interface"

From Serpent Wiki
Jump to: navigation, search
(User defined functional dependence (type 3))
(User defined functional dependence (type 3))
Line 159: Line 159:
  
 
== User defined functional dependence (type 3) ==
 
== User defined functional dependence (type 3) ==
[[File:IFC_2_axial_density.png|thumb|250px|Coolant density of a pin cell geometry has been modified using the regular mesh based interface (darker color indicates lower density).]]
+
[[File:IFC_3_axial_density.png|thumb|250px|Coolant density of a pin cell geometry has been modified using the user defined functional dependence with a sine wave based density distribution (darker color indicates lower density).]]
  
 
The user defined functional dependence interface allows the user to pass a number of arbitrary input parameters to Serpent, that are passed to subroutine userdf.c, along with local coordinates. The subroutine can be modified to include any kind of functional distribution. The interface file has almost no error tolerance, so be sure that all required values are entered and in the correct order.
 
The user defined functional dependence interface allows the user to pass a number of arbitrary input parameters to Serpent, that are passed to subroutine userdf.c, along with local coordinates. The subroutine can be modified to include any kind of functional distribution. The interface file has almost no error tolerance, so be sure that all required values are entered and in the correct order.

Revision as of 14:49, 24 February 2016

The multi-physics interface is a set of routines, as well as input/output formats intended for easily bringing in detailed temperature and density fields to Serpent and at the same time automatically producing power distributions to be used in coupled codes.

List of multi-physics interface filetypes

Type Name Notes
1 Point-average For interpolation of point-wise data
2 Regular mesh For data on a regular cartesian or hexagonal mesh
3 Functional dependence User defined functional dependence can be defined on source code level
4 Tetrahedral mesh type Use interface type 7 instead.
5 Fuel behavior interface (piecewise constant) For coupling with fuel performance/behavior codes with 1.5 dimensional (z,r) coordinate system.
6 Fuel behavior interface (radial interpolation) For coupling with fuel performance/behavior codes with 1.5 dimensional (z,r) coordinate system.
7 Unstructured mesh Based on OpenFOAM file format.

Usage instructions

The interface is linked to the main input file with the command

ifc FILE

where FILE is the path to the interface definition file. The descriptions for the interface definition files of the different interface types are given below. Multiple interfaces can be linked to a single input e.g. for bringing in temperature/density data for multiple materials.

Point-average interface (type 1)

Coolant density of a pin cell geometry has been modified using the point-average interface (darker color indicates lower density).

The point-average interface is a way to bring in temperatures and densities for a single material in a number of discrete points in the geometry. During neutron transport Serpent will calculate the temperature and density in an interaction point as an average of the values of nearby interface points.

The input syntax for the interface file is

TYPE MAT OUT
OUTFILE NZ ZMIN ZMAX NR
DIM RAD EXP
NP
X1 Y1 Z1 DENS1 T1
X2 Y2 Z2 DENS2 T2
...

The first line contains three parameters:

TYPE  : the interface type (1 for point-average inteface)
MAT  : the name of the material that the data is given for.
OUT  : the output flag (1/0). If the flag is not set, the second line is omitted.

If the output flag is set, the second line contains parameters for the fission power output. If the output flag is not set the second line is emitted. The parameters for the output are:

OUTFILE  : determines the file name to which the output is printed
NZ  : is the number of axial bins for pin-wise power distributions
ZMIN  : is the minimum axial coordinate of the power distribution.
ZMAX  : is the maximum axial coordinate of the power distribution.
NR  : gives the number of radial bins in the power distribution. The radial bins are of equal volume.

The third line contains:

DIM  : The dimension of the distribution (1 = z-dependence only, 2 = x- and y-dependence, 3 = x-, y- and z-dependence).
RAD  : The exclusion radius, beyond which the points are not included in the average.
EXP  : The exponent for the averaging process.

If the exclusion radius RAD is too small, some parts of the region may not be properly covered. If the radius is large, more CPU time is required for calculating the average. Setting the exponent EXP to 1 means that the average is based on distance, EXP = 2 means square distance, and so on.

The fourth line gives the number of points NP to be given and the remaining lines give the data in each of the points: If DIM = 1, only Zi is given, if DIM = 2, only Xi and Yi are given). Parameter DENSi is the material density at the point (negative values for mass density, positive values for atomic density) and Ti is the temperature.

Regular mesh based interface (type 2)

Coolant density of a pin cell geometry has been modified using the regular mesh based interface (darker color indicates lower density).

The regular mesh based interface is a way to bring in temperatures and densities on a regular cartesian or hexagonal mesh. The format has a wide variety of uses such as bringing in information from nodal codes, channel/subchannel codes etc.

The input syntax for the interface file is

TYPE MAT OUT
OUTFILE NZ ZMIN ZMAX NR
MESHTYPE
NX XMIN XMAX NY YMIN YMAX NZ ZMIN ZMAX [Cartesian mesh]
X0 Y0 PITCH ZMIN ZMAX NX NY NZ [Hexagonal mesh]
DENS1 T1
DENS2 T2
...

The first line contains three parameters:

TYPE  : the interface type (1 for point-average inteface)
MAT  : the name of the material that the data is given for.
OUT  : the output flag (1/0). If the flag is not set, the second line is omitted.

If the output flag is set, the second line contains parameters for the fission power output. If the output flag is not set the second line is emitted. The parameters for the output are:

OUTFILE  : determines the file name to which the output is printed
NZ  : is the number of axial bins for pin-wise power distributions
ZMIN  : is the minimum axial coordinate of the power distribution.
ZMAX  : is the maximum axial coordinate of the power distribution.
NR  : gives the number of radial bins in the power distribution. The radial bins are of equal volume.

The third line contains basic information about the regular mesh: MESHTYPE is an integer indicating the type of the mesh (1 = cartesian, 4 = x-type hexagonal, 5 = y-type hexagonal). The format of the next line depends on the mesh type:

  • For the cartesian mesh the next line consists of three triplets of values indicating the number of bins as well as the minimum and maximum coordinates in each of the coordinate directions.
  • For the hexagonal mesh the next line contains 8 values: The coordinates for mesh centerpoint, mesh pitch, the axial limits of the mesh and the number of nodes in each of the coordinate directions.

Finally NX*NY*NZ pairs of values indicating the density and temperature in each of the cells follow. The ordering of the cells is such that the x-index increases first, then the y-index and finally the z-index.

User defined functional dependence (type 3)

Coolant density of a pin cell geometry has been modified using the user defined functional dependence with a sine wave based density distribution (darker color indicates lower density).

The user defined functional dependence interface allows the user to pass a number of arbitrary input parameters to Serpent, that are passed to subroutine userdf.c, along with local coordinates. The subroutine can be modified to include any kind of functional distribution. The interface file has almost no error tolerance, so be sure that all required values are entered and in the correct order.

The input syntax for the interface file is

TYPE MAT OUT
OUTFILE NZ ZMIN ZMAX NR
NP
P1
P2
...

The first line contains three parameters:

TYPE  : the interface type (1 for point-average inteface)
MAT  : the name of the material that the data is given for.
OUT  : the output flag (1/0). If the flag is not set, the second line is omitted.

If the output flag is set, the second line contains parameters for the fission power output. If the output flag is not set the second line is emitted. The parameters for the output are:

OUTFILE  : determines the file name to which the output is printed
NZ  : is the number of axial bins for pin-wise power distributions
ZMIN  : is the minimum axial coordinate of the power distribution.
ZMAX  : is the maximum axial coordinate of the power distribution.
NR  : gives the number of radial bins in the power distribution. The radial bins are of equal volume.

After the output parameters, the number of parameters to be read from the file NP is indicated followed by NP arbitrary parameters (integers or floating point numbers).

Tetrahedral mesh interface (type 4)

The tetrahedral mesh interface has been replaced with the OpenFOAM-based interface format, which offers the same functionality with some additional benefits.

Fuel behavior interface (types 5 and 6)

TYPE OUTFILE NPIN

Parameter <type> is set to 5 or 6 for fuel behavior interface. Type 5 indicates a temperature step profile in the radial direction whereas type 6 corresponds to interpolation of temperatures in the radial direction between the radial nodes. <outfile> is the filename where output is written and <npin> is the number of fuel pins described in this interface.

After this header line come <npin> fuel pin descriptions.

Fuel pin description

First the pin name for which the temperatures are applied is given

<pinuni>

this should correspond to the name in the pin-definition. After that come the output meshings for power and flux in axial, angular and radial directions

<nz> <zmin> <zmax> <na> <amin> <amax> <nr> <rmin> <rmax>
<nz> <zmin> <zmax> <na> <amin> <amax> <nr> <rmin> <rmax> <Emin> <Emax>

This sets up tallies for power and flux: <nz> axial bins between <zmin> and <zmax>, <na> angular bins between <amin> and <amax> (degrees), and <nr> radial bins (of equal area) between <rmin> and <rmax>. The detector intended for tallying the local fast flux also has energy limits <Emin> and <Emax>.

After these two output lines comes the number of axial temperature profiles that will be given for the first pin

<nz>

Next, the limits of the first axial zone should be given as well as the number of angular subzones for this axial region

<zmin1> <zmax1> <na>

After this, the limits of the first angular zone are given as well as the number of radial nodes to be read for the temperature distribution

<amin1> <amax1> <nr>

Finally, the information at <nr> radial nodes is given for the first angular zone of the first axial zone of the first pin:

<rcold1> <rhot1> <T1>
<rcold2> <rhot2> <T2>
<rcold3> <rhot3> <T3>
...
<rcold_nr> <rhot_nr> <T_nr>

Three values are given for each radial node: <rcold> the radial position of the node in cold (Serpent input) coordinates, <rhot> the radial position of the node in hot (to be used for neutron tracking) coordinates and <T> temperature at this radial node. If <rcold> and <rhot> are equal the geometry is not deformed for the neutron tracking. If the interface type is 5, <T_n> is the temperature used between <rhot_{n-1}> and <rhot_n> giving a step profile. If the interface type is set to 6, linear interpolation is used between the radial nodes.

After the list of <nr> radial nodes, come the limits of the next angular zone (if available) followed by the radial nodes for that zone etc. After all of the angular zones have been defined come the limits for the next axial zone and its first angular zone etc. After all of the axial zones of the first pin have been defined comes the pin-universe for the second pin etc.

Special cases

Axially segmented fuel rods

The pin-definitions in Serpent are essentially one-dimensional, which means that fuel rods that have consist of axial segments have to be defined as a combination of multiple pin-definitions (or without the use of pin-definitions).

The fuel behavior interface can be used for rods consisting of multiple pin-definitions, but all of the pin definitions have to be linked to the interface. Instead of giving the pin-universe name

<pinuni>

in the interface file a negative number indicating the number of pin-definitions to be linked should be given followed by the pin-universe names

<-nuni> <pinuni_1> <pinuni_2> ... <pinuni_nuni>

Consider, for example a fuel rod filled consisting of a lower undoped fuel part, an intermediate segment with gadolinia-doped fuel and an upper undoped fuel part. This kind of a fuel rod can be modeled by creating two pin-definitions

pin p1nogd
fuel   0.60579
void   0.62103
Zirc   0.71501
cool

for the undoped part and

pin p1yesgd
fuelgd 0.60579
void   0.62103
Zirc   0.71501
cool

for the doped part. The three dimensional rod can be created by defining the limiting horizontal surfaces (here surf z1 and surf z2) and filling the pin-definitions into the correct axial levels of a new universe:

cell cp1l p1combined fill p1nogd        -z1
cell cp1m p1combined fill p1yesgd    z1 -z2
cell cp1h p1combined fill p1nogd     z2

Now the universe p1combined can be used for example in a lattice, producing a three dimensional representation of the fuel rod. The interface file associated with this rod would then link both of the pin-definitions to the temperature field:

<type> <output_file> <npin>
-2 p1nogd p1yesgd
<nz> <zmin> <zmax> <na> <amin> <amax> <nr> <rmin> <rmax>
<nz> <zmin> <zmax> <na> <amin> <amax> <nr> <rmin> <rmax> <Emin> <Emax>
...

Non-uniform output binning

The output binning defined by the

<nz> <zmin> <zmax> <na> <amin> <amax> <nr> <rmin> <rmax>

line is normally of equal volume. If an arbitrary binning is to be used instead, a negative value can be given for the number of bins, followed by <nbin> + 1 bin boundaries instead of <binmin> and <binmax>. For example:

<nz> <zmin> <zmax> <na> <amin> <amax> -3 0.0 0.1 0.4 0.5

will define three radial bins, where the first bin is from 0.0 cm to 0.1 cm, the second one from 0.1 cm to 0.4 cm and the third bin from 0.4 cm to 0.5 cm. The practice is the same for each of the directions (axial, angular or radial).

Unstructured mesh based interface (type 7)