Skip to content

Create Geometry Input Files

wbinventor edited this page Mar 11, 2012 · 26 revisions

Home

The geometry in OpenMOC is described using constructive solid geometry (CSG), also sometimes referred to as combinatorial geometry. CSG allows a user to create complex objects using Boolean operators on a set of simpler surfaces. In the geometry model, each unique closed volume in defined by its bounding surfaces. In OpenMC, most quadratic surfaces can be modeled and used as bounding surfaces.

Every geometry.xml must have an XML declaration at the beginning of the file and a root element named geometry. Within the root element the user can define any number of cells, surfaces, and lattices. Let us look at the following example:

<?xml version="1.0">
<geometry>
  <!-- This is a comment -->

  <surface>
    <id>1</id>
    <type>circle</type>
    <coeffs>0.0 0.0 5.0</coeffs>
  <surface>

  <cell>
    <id>1</id>
    <universe>0</universe>
    <material>1</material>
    <surfaces>-1</surfaces>
  </cell>
</geometry>

At the beginning of this file is a comment, denoted by a tag starting with <!-- and ending with -->. Comments, as well as any other type of input, may span multiple lines. One convenient feature of the XML input format is that sub-elements of the cell and surface elements can also be equivalently expressed of attributes of the original element, e.g. the geometry file above could be written as:

<?xml version="1.0">
<geometry>  

  <!-- This is a comment -->  

  <surface id="1" type="sphere" coeffs="0.0 0.0 0.0 5.0" boundary="vacuum" />  

  <cell id="1" universe="0" material="1" surfaces="-1" />  

</geometry>

###Surfaces

Each surface element can have the following attributes or sub-elements:

  • id: A unique integer that can be used to identify the surface. Note: all ids must be less than 10,000.

  • type: The type of the surfaces. This can be x-plane, y-plane, plane, or circle.

  • coeffs: The corresponding coefficients for the given type of surface. See below for a list of the coefficients you must specify for a given surface

  • boundary: The boundary condition for the surface. This can be reflective or vacuum, or this attribute can be left empty if no boundary conditions are to be specified for the surface (default is none).

The following quadratic surfaces can be modeled:

  • x-plane: A plane perpendicular to the x-axis, i.e. a surface of the form x - x0 = 0 . The coefficients specified are “x0”.

  • y-plane: A plane perpendicular to the y-axis, i.e. a surface of the form y - y0 = 0. The coefficients specified are “y0”.

  • plane: An arbitrary plane of the form Ax + By = C. The coefficients specified are “A B C”.

  • circle: A circle is a quadratic surface of the form (x - x0)^2 + (y - y0)^2 = R^2. The coefficients specified are “x0 y0 R”.

###Cells Each cell element can have the following attributes or sub-elements:

  • id: A unique integer that can be used to identify the surface. Note: all ids must be less than 10,000.

  • universe: The id of the universe that this cell is contained in. Note: Your global level universe must have "id=0".

  • fill: The id of the universe that fills this cell. Note: if a fill is specified, no material should be given.

  • material: The id of the material that this cell contains. Note: if a material is specified, no fill should be given.

  • surfaces: A list of the ids for surfaces that bound this cell, e.g. if the cell is on the negative side of surface 3 and the positive side of surface 5, the bounding surfaces would be given as “-3 5”.

###Lattices
The lattice can be used to represent repeating structures (e.g. fuel pins in an assembly) or other geometry which naturally fits into a two-dimensional structured mesh. Each cell within the lattice is filled with a specified universe. Every geometry input file to OpenMOC must contain at least one lattice to define the boundaries of the geometry. A lattice accepts the following attributes or sub-elements:

  • id: A unique integer that can be used to identify the lattice. Since lattices are represented as a type of universe within OpenMOC, this id cannot be the same as an id used for a universe containing a cell. Note: all ids must be less than 10,000.

  • dimension: Two integers representing the number of lattice cells in the x- and y- directions, respectively.

  • width: The width of the lattice cell in the x- and y- directions.

  • universes: A list of the universe numbers that fill each cell of the lattice.

##Important Thing to Note
There are a few things to note when writing your input files:

  • Ids must be positive integers

  • Ids for surfaces, cells, and lattices must be smaller than 10,000. Ids larger than this are reserved for internal use by OpenMOC.

  • The global universe must be specified with "id=0".

  • A cell can contain either a material or a fill, but not both

  • Every geometry input file must contain at least one lattice which defines the boundaries of the geometry

  • To test that your input file uses proper xml syntax, please try opening the file using a web browser. If the browser displays an error message, correct your input file before attempting to input it to OpenMOC.

##Sample Input Files
To become more familiar with how the geometry input files for OpenMOC work, please review the "xml-sample" directory which is provided with OpenMOC. This directory contains several input files for geometries of varying size and complexity. In addition, to get a more intuitive feel for how your geometry input file is interpreted by OpenMOC, we recommend that you run OpenMOC with the input files in "xml-sample" using the supported runtime options for plotting the geometry as detailed in Run OpenMOC.

Clone this wiki locally