Skip to content

Commit c6d9a99

Browse files
authored
Merge pull request #91 from fusion-energy/develop
Fixing tests and making use of dagmc-bounding-box package
2 parents 48a74ba + aeb5f1d commit c6d9a99

29 files changed

+488
-441
lines changed

.circleci/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ jobs:
1515
command: |
1616
python setup.py install
1717
18+
- run:
19+
name: install packages required for testing
20+
command: |
21+
pip install -r requirements-test.txt
22+
1823
- run:
1924
name: run test_neutronics_utils
2025
command:

.github/workflows/ci_with_install.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ jobs:
2323
run: |
2424
python setup.py install
2525
26+
- name: install packages required for testing
27+
run: |
28+
pip install -r requirements-test.txt
29+
2630
- name: run tests
2731
run: |
2832
pytest tests/test_neutronics_utils.py -v --cov=openmc_dagmc_wrapper --cov-append --cov-report term --cov-report xml

Dockerfile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ RUN pip install --upgrade numpy cython && \
109109

110110

111111
# Clone and install Double-Down
112-
RUN git clone --shallow-submodules --single-branch --branch main --depth 1 https://github.com/pshriwise/double-down.git && \
112+
RUN git clone --shallow-submodules --single-branch --branch v1.0.0 --depth 1 https://github.com/pshriwise/double-down.git && \
113113
cd double-down && \
114114
mkdir build && \
115115
cd build && \
@@ -125,7 +125,11 @@ RUN mkdir DAGMC && \
125125
cd DAGMC && \
126126
# change to version 3.2.1 when released
127127
# git clone --single-branch --branch 3.2.1 --depth 1 https://github.com/svalinn/DAGMC.git && \
128-
git clone --shallow-submodules --single-branch --branch develop --depth 1 https://github.com/svalinn/DAGMC.git && \
128+
git clone --single-branch --branch develop https://github.com/svalinn/DAGMC.git && \
129+
cd DAGMC && \
130+
# this commit is from this PR https://github.com/svalinn/DAGMC/pull/786
131+
git checkout fbd0cdbad100a0fd8d80de42321e69d09fdd67f4 && \
132+
cd .. && \
129133
mkdir build && \
130134
cd build && \
131135
cmake ../DAGMC -DBUILD_TALLY=ON \
@@ -140,7 +144,11 @@ RUN mkdir DAGMC && \
140144

141145
# Clone and install OpenMC with DAGMC
142146
# TODO clone a specific release when the next release containing (PR 1825) is avaialble.
143-
RUN git clone --shallow-submodules --recurse-submodules --single-branch --branch develop --depth 1 https://github.com/openmc-dev/openmc.git /opt/openmc && \
147+
RUN cd /opt && \
148+
git clone --single-branch --branch develop https://github.com/openmc-dev/openmc.git && \
149+
cd openmc && \
150+
# this commit is from this PR https://github.com/openmc-dev/openmc/pull/1900
151+
git checkout 0157dc219ff8dca814859b3140c6cef1e78cdee1 && \
144152
cd /opt/openmc && \
145153
mkdir build && \
146154
cd build && \

README.md

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -20,33 +20,26 @@
2020

2121
# OpenMC DAGMC Wrapper
2222

23-
The openmc-dagmc-wrapper python package allows convenient access to a series of standard neutronics simulations and post using OpenMC and DAGMC.
24-
25-
The intended use case is to take DAGMC compatible h5m files generated by
26-
[cad_to_h5m](https://github.com/fusion-energy/cad_to_h5m) with CAD file inputs
27-
from the [Paramak](https://github.com/fusion-energy/paramak) as demonstrated in
28-
the [neutronics_workflow](https://github.com/fusion-energy/neutronics_workflow). However the package can also be used with h5m files generated in other ways.
29-
30-
Standard simulations tallies are facilitated:
31-
- Volume / cell tallies
32-
- Regular 2D mesh tallies
33-
- Regular 3D mesh tallies
34-
- Unstructured mesh tally (on road map)
35-
36-
Neutronics responses can be obtained:
37-
- Tritium Breeding Ratio (TBR)
38-
- Heating (photon and neutron)
39-
- Effective dose (photon and neutron)
40-
- Any supported reaction from the [standard OpenMC reactions](https://docs.openmc.org/en/latest/usersguide/tallies.html#scores)
41-
42-
A standard collection of materials are available by making use of the
43-
[neutronics_material_maker](https://github.com/fusion-energy/neutronics_material_maker) package.
44-
45-
OpenMC sources definitions are used for the particle sources.
46-
47-
Post processing of the OpenMC output files are also carried out to automatically
48-
provide: JSON text files, PNG images, VTK files for convenient access to the
49-
results.
23+
24+
The openmc-dagmc-wrapper python package extends OpenMC base classes and adds
25+
convenience features aimed as easing the use of OpenMC with DAGMC for
26+
fixed-source simulations.
27+
28+
The openmc-dagmc-wrapper is built around the assumption that a DAGMC geometry
29+
in the form of a h5m is used as the simulation geometry. This allows several
30+
aspects of openmc simulations to be simplified and automated.
31+
32+
Additional convenience is available when making tallies as standard tally types
33+
are added which automated the application of openmc.Filters and openmc.scores
34+
for standard tallies such as neutron spectra, effective dose, heating, TBR and
35+
others.
36+
37+
Further simplifications are access by using additional packages from the
38+
[fusion-neutronics-workflow](https://github.com/fusion-energy/fusion_neutronics_workflow)
39+
40+
If you are looking for an easy neutronics interface for performing simulations
41+
of fusion reactors this package was built for you.
42+
5043

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

docs/source/conf.py

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
# If your documentation needs a minimal Sphinx version, state it here.
3737
#
38-
needs_sphinx = '3.5.4'
38+
needs_sphinx = "3.5.4"
3939

4040
# Add any Sphinx extension module names here, as strings. They can be
4141
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
@@ -136,11 +136,13 @@
136136
# (source start file, target name, title,
137137
# author, documentclass [howto, manual, or own class]).
138138
latex_documents = [
139-
(master_doc,
140-
"OpenMC-DAGMC-Wrapper.tex",
141-
"OpenMC-DAGMC-Wrapper Documentation",
142-
"OpenMC-DAGMC-Wrapper contributors",
143-
"manual"),
139+
(
140+
master_doc,
141+
"OpenMC-DAGMC-Wrapper.tex",
142+
"OpenMC-DAGMC-Wrapper Documentation",
143+
"OpenMC-DAGMC-Wrapper contributors",
144+
"manual",
145+
),
144146
]
145147

146148

@@ -149,11 +151,14 @@
149151
# One entry per manual page. List of tuples
150152
# (source start file, name, description, authors, manual section).
151153
man_pages = [
152-
(master_doc,
153-
"OpenMC-DAGMC-Wrapper",
154-
"OpenMC-DAGMC-Wrapper Documentation",
155-
[author],
156-
1)]
154+
(
155+
master_doc,
156+
"OpenMC-DAGMC-Wrapper",
157+
"OpenMC-DAGMC-Wrapper Documentation",
158+
[author],
159+
1,
160+
)
161+
]
157162

158163

159164
# -- Options for Texinfo output ----------------------------------------------
@@ -194,4 +199,4 @@
194199

195200
# -- Extension configuration -------------------------------------------------
196201

197-
html_favicon = 'favicon.ico'
202+
html_favicon = "favicon.ico"

docs/source/example_neutronics_simulations.rst

Lines changed: 0 additions & 51 deletions
This file was deleted.

docs/source/fusion_settings.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
FusionSettings()
3+
----------------
4+
5+
.. automodule:: openmc_dagmc_wrapper.FusionSettings
6+
:members:
7+
:show-inheritance:

docs/source/geometry.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
Geometry()
3+
----------
4+
5+
.. automodule:: openmc_dagmc_wrapper.Geometry
6+
:members:
7+
:show-inheritance:

docs/source/index.rst

Lines changed: 23 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,32 @@
11
openmc-dagmc-wrapper
22
====================
33

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

7-
.. toctree::
8-
:maxdepth: 1
9-
10-
install
11-
example_neutronics_simulations
12-
neutronics_model
13-
tests
14-
15-
History
16-
-------
17-
18-
The package was originally conceived by Jonathan Shimwell to help automate
19-
neutronics simulations of fusion reactors in a reproducible manner.
20-
21-
The source code is distributed with a permissive open-source
22-
license (MIT) and is available from the GitHub repository
23-
`https://github.com/fusion-energy/openmc-dagmc-wrapper <https://github.com/fusion-energy/openmc-dagmc-wrapper>`_
8+
The openmc-dagmc-wrapper is built around the assumption that a DAGMC geometry
9+
in the form of a h5m is used as the simulation geometry. This allows several
10+
aspects of openmc simulations to be simplified and automated.
2411

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

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

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

36-
To create a model it is also necessary to define the source and the materials
37-
used.
38-
39-
The Paramak accepts native OpenMC materials and also Neutronics Material Maker
40-
materials. Further details on the Neutronics Material Maker is avaialbe via online
41-
`documentation <https://neutronics-material-maker.readthedocs.io/en/latest/>`_
42-
and the `source code repository <https://github.com/fusion-energy/neutronics_material_maker>`_
43-
.
44-
45-
The `OpenMC workshop <https://github.com/fusion-energy/neutronics_workshop>`_
46-
also has some tasks that make use of this package. The workshop also
47-
demonstrates methods of creating the CAD geometry and h5m files from CAD
48-
geometry.
49-
50-
The `OpenMC workflow <https://github.com/fusion-energy/neutronics_workflow>`_
51-
demonstrates the use of this package along side others in a complete neutronics
52-
tool chain.
53-
54-
`CAD-to-h5m <https://github.com/fusion-energy/cad_to_h5m>`_ makes use of the
55-
`Cubit API <https://coreform.com/products/coreform-cubit/>`_ to convert CAD
56-
files (stp or sat format) into `DAGMC <https://svalinn.github.io/DAGMC/>`_
57-
compatible h5m files for use in DAGMC enabled neutronics codes.
23+
.. toctree::
24+
:maxdepth: 2
5825

59-
For magnetic confinement fusion simulations you might want to use the parametric-plasma-source
60-
`Git repository <https://github.com/open-radiation-sources/parametric-plasma-source>`_
26+
install
27+
geometry
28+
materials
29+
fusion_settings
30+
tally
31+
tests
32+
license

docs/source/install.rst

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,29 @@
22
Installation
33
============
44

5-
6-
Install
7-
-------
8-
95
To use the OpenMC-DAGMC-Wrapper package you will need the Python, MOAB, DAGMC
106
and OpenMC installed.
117

8+
9+
To complete the software stack OpenMC, DAGMC and MOAB will also need installing.
10+
We don't have simple instructions for these packages yet but one option is to
11+
duplicate the stages in the `Dockerfile https://github.com/fusion-energy/neutronics_workflow/blob/main/Dockerfile>`_
12+
or to make use of the `install scripts <https://github.com/fusion-energy/neutronics_workflow/blob/main/install_scripts/`_
13+
14+
15+
Pip install
16+
-----------
17+
18+
Then install the OpenMC-DAGMC-Wrapper package using Pip.
19+
20+
.. code-block:: python
21+
22+
pip install openmc-dagmc-wrapper
23+
24+
25+
Conda install
26+
-------------
27+
1228
The recommended method is to install Python 3 using Anaconda or Miniconda
1329

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

0 commit comments

Comments
 (0)