Skip to content
This repository has been archived by the owner on Aug 15, 2023. It is now read-only.

Commit

Permalink
Merge pull request #91 from fusion-energy/develop
Browse files Browse the repository at this point in the history
Fixing tests and making use of dagmc-bounding-box package
  • Loading branch information
shimwell authored Nov 25, 2021
2 parents 48a74ba + aeb5f1d commit c6d9a99
Show file tree
Hide file tree
Showing 29 changed files with 488 additions and 441 deletions.
5 changes: 5 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ jobs:
command: |
python setup.py install
- run:
name: install packages required for testing
command: |
pip install -r requirements-test.txt
- run:
name: run test_neutronics_utils
command:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci_with_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ jobs:
run: |
python setup.py install
- name: install packages required for testing
run: |
pip install -r requirements-test.txt
- name: run tests
run: |
pytest tests/test_neutronics_utils.py -v --cov=openmc_dagmc_wrapper --cov-append --cov-report term --cov-report xml
Expand Down
14 changes: 11 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ RUN pip install --upgrade numpy cython && \


# Clone and install Double-Down
RUN git clone --shallow-submodules --single-branch --branch main --depth 1 https://github.com/pshriwise/double-down.git && \
RUN git clone --shallow-submodules --single-branch --branch v1.0.0 --depth 1 https://github.com/pshriwise/double-down.git && \
cd double-down && \
mkdir build && \
cd build && \
Expand All @@ -125,7 +125,11 @@ RUN mkdir DAGMC && \
cd DAGMC && \
# change to version 3.2.1 when released
# git clone --single-branch --branch 3.2.1 --depth 1 https://github.com/svalinn/DAGMC.git && \
git clone --shallow-submodules --single-branch --branch develop --depth 1 https://github.com/svalinn/DAGMC.git && \
git clone --single-branch --branch develop https://github.com/svalinn/DAGMC.git && \
cd DAGMC && \
# this commit is from this PR https://github.com/svalinn/DAGMC/pull/786
git checkout fbd0cdbad100a0fd8d80de42321e69d09fdd67f4 && \
cd .. && \
mkdir build && \
cd build && \
cmake ../DAGMC -DBUILD_TALLY=ON \
Expand All @@ -140,7 +144,11 @@ RUN mkdir DAGMC && \

# Clone and install OpenMC with DAGMC
# TODO clone a specific release when the next release containing (PR 1825) is avaialble.
RUN git clone --shallow-submodules --recurse-submodules --single-branch --branch develop --depth 1 https://github.com/openmc-dev/openmc.git /opt/openmc && \
RUN cd /opt && \
git clone --single-branch --branch develop https://github.com/openmc-dev/openmc.git && \
cd openmc && \
# this commit is from this PR https://github.com/openmc-dev/openmc/pull/1900
git checkout 0157dc219ff8dca814859b3140c6cef1e78cdee1 && \
cd /opt/openmc && \
mkdir build && \
cd build && \
Expand Down
47 changes: 20 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,26 @@

# OpenMC DAGMC Wrapper

The openmc-dagmc-wrapper python package allows convenient access to a series of standard neutronics simulations and post using OpenMC and DAGMC.

The intended use case is to take DAGMC compatible h5m files generated by
[cad_to_h5m](https://github.com/fusion-energy/cad_to_h5m) with CAD file inputs
from the [Paramak](https://github.com/fusion-energy/paramak) as demonstrated in
the [neutronics_workflow](https://github.com/fusion-energy/neutronics_workflow). However the package can also be used with h5m files generated in other ways.

Standard simulations tallies are facilitated:
- Volume / cell tallies
- Regular 2D mesh tallies
- Regular 3D mesh tallies
- Unstructured mesh tally (on road map)

Neutronics responses can be obtained:
- Tritium Breeding Ratio (TBR)
- Heating (photon and neutron)
- Effective dose (photon and neutron)
- Any supported reaction from the [standard OpenMC reactions](https://docs.openmc.org/en/latest/usersguide/tallies.html#scores)

A standard collection of materials are available by making use of the
[neutronics_material_maker](https://github.com/fusion-energy/neutronics_material_maker) package.

OpenMC sources definitions are used for the particle sources.

Post processing of the OpenMC output files are also carried out to automatically
provide: JSON text files, PNG images, VTK files for convenient access to the
results.

The openmc-dagmc-wrapper python package extends OpenMC base classes and adds
convenience features aimed as easing the use of OpenMC with DAGMC for
fixed-source simulations.

The openmc-dagmc-wrapper is built around the assumption that a DAGMC geometry
in the form of a h5m is used as the simulation geometry. This allows several
aspects of openmc simulations to be simplified and automated.

Additional convenience is available when making tallies as standard tally types
are added which automated the application of openmc.Filters and openmc.scores
for standard tallies such as neutron spectra, effective dose, heating, TBR and
others.

Further simplifications are access by using additional packages from the
[fusion-neutronics-workflow](https://github.com/fusion-energy/fusion_neutronics_workflow)

If you are looking for an easy neutronics interface for performing simulations
of fusion reactors this package was built for you.


:point_right: [Documentation](https://openmc-dagmc-wrapper.readthedocs.io)

Expand Down
29 changes: 17 additions & 12 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

# If your documentation needs a minimal Sphinx version, state it here.
#
needs_sphinx = '3.5.4'
needs_sphinx = "3.5.4"

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
Expand Down Expand Up @@ -136,11 +136,13 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc,
"OpenMC-DAGMC-Wrapper.tex",
"OpenMC-DAGMC-Wrapper Documentation",
"OpenMC-DAGMC-Wrapper contributors",
"manual"),
(
master_doc,
"OpenMC-DAGMC-Wrapper.tex",
"OpenMC-DAGMC-Wrapper Documentation",
"OpenMC-DAGMC-Wrapper contributors",
"manual",
),
]


Expand All @@ -149,11 +151,14 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc,
"OpenMC-DAGMC-Wrapper",
"OpenMC-DAGMC-Wrapper Documentation",
[author],
1)]
(
master_doc,
"OpenMC-DAGMC-Wrapper",
"OpenMC-DAGMC-Wrapper Documentation",
[author],
1,
)
]


# -- Options for Texinfo output ----------------------------------------------
Expand Down Expand Up @@ -194,4 +199,4 @@

# -- Extension configuration -------------------------------------------------

html_favicon = 'favicon.ico'
html_favicon = "favicon.ico"
51 changes: 0 additions & 51 deletions docs/source/example_neutronics_simulations.rst

This file was deleted.

7 changes: 7 additions & 0 deletions docs/source/fusion_settings.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

FusionSettings()
----------------

.. automodule:: openmc_dagmc_wrapper.FusionSettings
:members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/source/geometry.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

Geometry()
----------

.. automodule:: openmc_dagmc_wrapper.Geometry
:members:
:show-inheritance:
74 changes: 23 additions & 51 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,60 +1,32 @@
openmc-dagmc-wrapper
====================

The openmc-dagmc-wrapper python package allows convenient access to a series of
standard neutronics simulations and post using OpenMC and DAGMC.
The openmc-dagmc-wrapper python package extends OpenMC base classes and adds
convenience features aimed as easing the use of OpenMC with DAGMC for
fixed-source simulations.

.. toctree::
:maxdepth: 1

install
example_neutronics_simulations
neutronics_model
tests

History
-------

The package was originally conceived by Jonathan Shimwell to help automate
neutronics simulations of fusion reactors in a reproducible manner.

The source code is distributed with a permissive open-source
license (MIT) and is available from the GitHub repository
`https://github.com/fusion-energy/openmc-dagmc-wrapper <https://github.com/fusion-energy/openmc-dagmc-wrapper>`_
The openmc-dagmc-wrapper is built around the assumption that a DAGMC geometry
in the form of a h5m is used as the simulation geometry. This allows several
aspects of openmc simulations to be simplified and automated.

Additional convenience is available when making tallies as standard tally types
are added which automated the application of openmc.Filters and openmc.scores
for standard tallies such as neutron spectra, effective dose, heating, TBR and
others.

Features
--------
Further simplifications are access by using additional packages from the
`fusion-neutronics-workflow <https://github.com/fusion-energy/fusion_neutronics_workflow>`_

In general the openmc-dagmc-wrapper takes a DAGMC geometry in the form of a h5m
file and helps adding tallies, materials and a source term to be easily added to
create a complete neutronics model. The package will also post processes the
results of the neutronics simulation to allow easy access to the outputs.
The simulated results are extracted from the statepoint.h5 file that
OpenMC produces and converted to vtk, png and JSON files depending on the tally.
If you are looking for an easy neutronics interface for performing simulations
of fusion reactors this package was built for you.

To create a model it is also necessary to define the source and the materials
used.

The Paramak accepts native OpenMC materials and also Neutronics Material Maker
materials. Further details on the Neutronics Material Maker is avaialbe via online
`documentation <https://neutronics-material-maker.readthedocs.io/en/latest/>`_
and the `source code repository <https://github.com/fusion-energy/neutronics_material_maker>`_
.

The `OpenMC workshop <https://github.com/fusion-energy/neutronics_workshop>`_
also has some tasks that make use of this package. The workshop also
demonstrates methods of creating the CAD geometry and h5m files from CAD
geometry.

The `OpenMC workflow <https://github.com/fusion-energy/neutronics_workflow>`_
demonstrates the use of this package along side others in a complete neutronics
tool chain.

`CAD-to-h5m <https://github.com/fusion-energy/cad_to_h5m>`_ makes use of the
`Cubit API <https://coreform.com/products/coreform-cubit/>`_ to convert CAD
files (stp or sat format) into `DAGMC <https://svalinn.github.io/DAGMC/>`_
compatible h5m files for use in DAGMC enabled neutronics codes.
.. toctree::
:maxdepth: 2

For magnetic confinement fusion simulations you might want to use the parametric-plasma-source
`Git repository <https://github.com/open-radiation-sources/parametric-plasma-source>`_
install
geometry
materials
fusion_settings
tally
tests
license
30 changes: 20 additions & 10 deletions docs/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,29 @@
Installation
============


Install
-------

To use the OpenMC-DAGMC-Wrapper package you will need the Python, MOAB, DAGMC
and OpenMC installed.


To complete the software stack OpenMC, DAGMC and MOAB will also need installing.
We don't have simple instructions for these packages yet but one option is to
duplicate the stages in the `Dockerfile https://github.com/fusion-energy/neutronics_workflow/blob/main/Dockerfile>`_
or to make use of the `install scripts <https://github.com/fusion-energy/neutronics_workflow/blob/main/install_scripts/`_


Pip install
-----------

Then install the OpenMC-DAGMC-Wrapper package using Pip.

.. code-block:: python
pip install openmc-dagmc-wrapper
Conda install
-------------

The recommended method is to install Python 3 using Anaconda or Miniconda

* `Miniconda <https://docs.conda.io/en/latest/miniconda.html>`_ (preferable to avoid hdf5 conflicts)
Expand Down Expand Up @@ -38,12 +54,6 @@ Then install the OpenMC-DAGMC-Wrapper package using Pip.
pip install openmc-dagmc-wrapper
To complete the software stack OpenMC, DAGMC and MOAB will also need installing.
We don't have simple instructions for these packages yet but one option is to
duplicate the stages in the `Dockerfile https://github.com/fusion-energy/neutronics_workflow/blob/main/Dockerfile>`_
or to make use of the `install scripts <https://github.com/fusion-energy/neutronics_workflow/blob/main/install_scripts/`_


Docker Image Installation
-------------------------

Expand Down
7 changes: 7 additions & 0 deletions docs/source/license.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

License
-------

The source code is distributed with a permissive open-source license (MIT) and
is available from the GitHub repository
`https://github.com/fusion-energy/openmc-dagmc-wrapper <https://github.com/fusion-energy/openmc-dagmc-wrapper>`_
10 changes: 10 additions & 0 deletions docs/source/materials.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

A standard collection of materials are available by making use of the
[neutronics_material_maker](https://github.com/fusion-energy/neutronics_material_maker) package.

Materials()
-----------

.. automodule:: openmc_dagmc_wrapper.Materials
:members:
:show-inheritance:
7 changes: 0 additions & 7 deletions docs/source/neutronics_model.rst

This file was deleted.

Loading

0 comments on commit c6d9a99

Please sign in to comment.