Skip to main content

A package for ANT-MOC data manipulation.

Project description

ANT-MOC Data

A package for ANT-MOC data manipulation.

Prerequisites

  • Python >= 3.6
  • baseopt
  • numpy
  • h5py

Install

$ pip install antmocdata

License

MIT

ANT-MOC MGXS

Tools for checking, manipulating, and generating MGXS files for ANT-MOC.

Examples

Check the directory examples/mgxs for examples on how to use antmocmgxs.

Each of the sample scripts accepts command line arguments.

./examples/mgxs/h5/fix_materials.py --help
./examples/mgxs/xml/fix_materials_in_xml.py --help

HDF5 Data Layout

There are two layouts of material data in an H5 file. Materials are treated as data groups in both of the layouts.

In addition to materials, the H5 file must contain a top-level attribute named '# groups' for the number of energy groups.

Layout: named

This is the default cross-section data layout for ANT-MOC.

Cross-section arrays are stored in H5 datasets individually. In this layout, a group for a material consists of several datasets:

  • absorption
  • fission
  • nu-fission
  • transport, or total
  • chi
  • scatter matrix, or nu-scatter matrix, or consistent scatter matrix

For example, a simple cross-section file could have the following hierarchy

attribute  "# groups"
group      /
group      /material/MOX-8.7%
dataset    /material/MOX-8.7%/chi
dataset    /material/MOX-8.7%/fission
dataset    /material/MOX-8.7%/nu-fission
dataset    /material/MOX-8.7%/scatter matrix
dataset    /material/MOX-8.7%/total
group      /material/UO2
dataset    /material/UO2/chi
dataset    /material/UO2/fission
dataset    /material/UO2/nu-fission
dataset    /material/UO2/scatter matrix
dataset    /material/UO2/total

The scatter matrix is usually a flattened n-by-n matrix, where n is the number of energy groups. Elements in the scatter dataset respect the source-major order, which is much like the row-major order.

For example, a scatter matrix with 2 energy groups has 4 elements, which are stored as

1->1
1->2
2->1
2->2

The number before symbol -> is the source group, and the number after the symbol is the destination group.

Layout: compact/compressed

TODO

Common Modules

  • material: class Material representing cross-sections. A material object could be written to an HDF5 file as a dataset.
  • materialxml: representation for the XML material definition, which is used to handle materials.xml.
  • manip: data manipulation utilities.
  • options: representation of command line options.

Type A

Package antmocmgxs.type_a defines a generator which accepts two files to create an mgxs input for antmoc:

  • infilecross: cross-sections in plain text.
  • materials.xml: material definitions in XML, including nuclear densities.

Modules

  • material: definition of MaterialTypeA, which is a sub-class of Material.
  • nuclides: representations of nuclides and nuclide sets, which are basically defined in a plain text file called "infilecross".
  • infilecross: functions for parsing an "infilecross" file. The file must be well-formed.
  • generate: functions for mgxs generation.
  • options: definition of OptionsTypeA, which is a sub-class of Options.

File Formats

materials.xml

This is an XML file consisting of material definitions.

<?xml version="1.0" encoding="utf-8"?>
<MATERIAL>
    <material name="1" set="1" density="0.0E+00" temperature="523.15K" label="Some material">
        <nuclide id="1102301" radio="1.6098e-2"/>
        <nuclide id="601201"  radio="7.3771e-5"/>
    </material>
</MATERIAL>
  • material: definition of a material object.
  • material.name: material name which will be written into the H5 file (string).
  • material.set: nuclide set ID for MGXS calculations (int, defaults to name).
  • material.label: a short description.
  • nuclide: nuclide information for MGXS calculations.
  • nuclide.id: nuclide ID containing its atomic number and mass (int).
  • nuclide.radio: density used by MGXS calculations (float).
infilecross

This is a plain text file consisting of nuclide set definitions.

$SOMESTRING 1  7SETs 1SET
   2  30   6   5   0   0
  0.57564402E+00  0.29341474E+00  0.12731624E+00 ...
  ...
  2511102302   0   3   6SODIUM-23
  ...
  4311402802   0   3   6SILICON-28
  ...
$SOMESTRING 1  7SETs SET2
  ...

Type B

TODO

Modules

File Formats

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

antmocdata-0.1.0.tar.gz (36.4 kB view details)

Uploaded Source

Built Distribution

antmocdata-0.1.0-py3-none-any.whl (25.2 kB view details)

Uploaded Python 3

File details

Details for the file antmocdata-0.1.0.tar.gz.

File metadata

  • Download URL: antmocdata-0.1.0.tar.gz
  • Upload date:
  • Size: 36.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for antmocdata-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9533fe0a27496fb2600aadd67b654d54898f2481df3dd9cdd7f69a306df9cc19
MD5 6888cf5bb1ab50edc5019d77a6981271
BLAKE2b-256 85d22a8ffe82c54043d7eda8541e1a1d9f8acc46e1ac21b86e427924ab318f54

See more details on using hashes here.

File details

Details for the file antmocdata-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: antmocdata-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 25.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for antmocdata-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ee14df83922498864d95d016bf39fb67e8991ab51ebec0fe24df250e3fb8bcf5
MD5 ec66416e711d868a8270614748fb0cdb
BLAKE2b-256 a35bdbb35ee3340529923345d5f14af144c89d95a5a7beda98859843f64c7e46

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page