Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop combine #659

Merged
merged 135 commits into from
Jan 18, 2021
Merged
Show file tree
Hide file tree
Changes from 123 commits
Commits
Show all changes
135 commits
Select commit Hold shift + click to select a range
0f12035
refactored tallies
shimwell Dec 20, 2020
d3f78bb
using score correcty in tallies
shimwell Dec 20, 2020
2f44d80
Automated autopep8 fixes
Dec 20, 2020
4aa6de7
added 3d meshes and test sp exists
shimwell Dec 20, 2020
af09f7c
Merge branch 'adding_3d_mesh_tally' of github.com:ukaea/paramak into …
shimwell Dec 20, 2020
cc1b6e2
Automated autopep8 fixes
Dec 20, 2020
a72790f
added mesh_3d to args
shimwell Dec 20, 2020
5dec40b
Merge branch 'adding_3d_mesh_tally' of github.com:ukaea/paramak into …
shimwell Dec 20, 2020
2996952
added tests to check tally type
shimwell Dec 20, 2020
806faaf
added tritium production to tests
shimwell Dec 21, 2020
fb5c43e
replaced valueerror with typeerror
shimwell Dec 21, 2020
73ccf2c
adding write vtk
shimwell Dec 22, 2020
7f9b4b4
mkaing vtk file for 3d meshes and testing for typeerror
shimwell Dec 22, 2020
0182153
Automated autopep8 fixes
Dec 22, 2020
6c12e11
changed error type
shimwell Dec 22, 2020
8027bd8
Merge branch 'adding_3d_mesh_tally' of github.com:ukaea/paramak into …
shimwell Dec 22, 2020
36125ae
added vtk output for 3d mesh tallies
shimwell Dec 23, 2020
820fdcb
improvments from code inspector
shimwell Dec 23, 2020
5d26481
changed error type to TypeError
shimwell Dec 23, 2020
c201336
Merge branch 'develop' into adding_3d_mesh_tally
shimwell Dec 24, 2020
73029b0
changed method of finding TBR tally
shimwell Dec 26, 2020
deb9cd3
added TBR for each materialto tallies
shimwell Dec 26, 2020
68fc268
Merge branch 'adding_3d_mesh_tally' of github.com:ukaea/paramak into …
shimwell Dec 29, 2020
31df8a4
Automated autopep8 fixes
Dec 29, 2020
1a771c3
changing varible name for code inspector
shimwell Dec 29, 2020
7d09ece
:whale: switched to new dependances image
shimwell Dec 29, 2020
d8d1cb3
Merge branch 'adding_3d_mesh_tally' of github.com:ukaea/paramak into …
shimwell Dec 29, 2020
955f576
corected varible name for statepoint file
shimwell Dec 29, 2020
1664c12
added type hinting to class args
shimwell Dec 30, 2020
1a38d28
added type hinting to some function args
shimwell Dec 30, 2020
6028cf5
added type hint package
shimwell Dec 30, 2020
3331d8a
adding vtk to ignored files
shimwell Dec 30, 2020
792e261
removing types from doc string as they are in type hinting
shimwell Dec 30, 2020
a707bc7
Automated autopep8 fixes
Dec 30, 2020
c57fc38
moved trelis script
shimwell Dec 31, 2020
9c0bb6d
added shutil copy to create the trelis script
shimwell Dec 31, 2020
8501c9e
updated docs to remove the references to the trelis script
shimwell Dec 31, 2020
771e24f
Automated autopep8 fixes
Dec 31, 2020
8b067fe
method=None now skips geometry creation
shimwell Jan 2, 2021
151d54e
Merge pull request #655 from ukaea/simulate_optionally_rebuilds_model
shimwell Jan 2, 2021
800fac1
started adding type hinting
billingsley-john Jan 4, 2021
0c00666
Automated autopep8 fixes
Jan 4, 2021
7df272a
added missing type hint
billingsley-john Jan 4, 2021
045c4e5
Merge branch 'update_type_hinting' of https://github.com/ukaea/parama…
billingsley-john Jan 4, 2021
d53278c
fixed typo
billingsley-john Jan 4, 2021
e2c5ec7
fixed typo
billingsley-john Jan 4, 2021
a02e242
added missing import
billingsley-john Jan 4, 2021
5b36690
reverted to old docs for one variable until solution found
billingsley-john Jan 4, 2021
5b351a6
added missing import
billingsley-john Jan 4, 2021
22fa996
Automated autopep8 fixes
Jan 4, 2021
ba7d5c6
reordered imports for best practice
billingsley-john Jan 5, 2021
fd32abf
sorted imports
billingsley-john Jan 5, 2021
65a0a2c
Merge pull request #656 from ukaea/update_type_hinting
billingsley-john Jan 5, 2021
168f102
changed pypi basge
shimwell Jan 5, 2021
287b345
corrected file path checking
shimwell Jan 5, 2021
b1577ac
:whale: corrected dockerfile name
shimwell Jan 6, 2021
b11c6f8
Merge branch 'develop_combine' into adding_3d_mesh_tally
shimwell Jan 6, 2021
ffbadc4
Merge pull request #645 from ukaea/adding_3d_mesh_tally
shimwell Jan 6, 2021
86db75d
Merge pull request #658 from ukaea/docker_build_fix
shimwell Jan 6, 2021
472b31a
Merge pull request #649 from ukaea/move_trelis_script_automatically
shimwell Jan 6, 2021
8990ed5
Merge pull request #648 from ukaea/adding_type_hinting
shimwell Jan 6, 2021
1f213eb
removed second pymoab install
shimwell Jan 6, 2021
8bb9b4e
Merge pull request #661 from ukaea/improved_dockerfile
shimwell Jan 6, 2021
093c0ef
added missing ;
shimwell Jan 7, 2021
40d2f6c
moved cuttering shape to midpoint
shimwell Jan 7, 2021
44dd13a
putting cutting intercept back to 50
shimwell Jan 7, 2021
1d18a35
:whale: made more similar to openmc dockerfile
shimwell Jan 8, 2021
7c4ec7b
updated indentation and pymoab install
shimwell Jan 8, 2021
31d6a5a
adds the option for surface_reflectivity
shimwell Jan 9, 2021
ed28bf8
added surface_reflectivity test
shimwell Jan 9, 2021
a90ff7b
accepts imported stp files as shapes
shimwell Jan 10, 2021
3e69d03
Automated autopep8 fixes
Jan 10, 2021
69a6e3f
added docstrings and types to new function
shimwell Jan 10, 2021
e8094db
added tests for neutron photon spectra
shimwell Jan 11, 2021
824b8ff
Automated autopep8 fixes
Jan 11, 2021
0132613
added example for particle spectra plots
shimwell Jan 11, 2021
984346b
Merge branch 'spectra_tally' of github.com:ukaea/paramak into spectra…
shimwell Jan 11, 2021
ff3c6cd
Automated autopep8 fixes
Jan 11, 2021
b621522
suggestiosn from code inspector
shimwell Jan 11, 2021
2cfd300
Merge pull request #673 from ukaea/spectra_tally
shimwell Jan 11, 2021
8d191b4
Merge pull request #670 from ukaea/adding_reflectivity_option
shimwell Jan 11, 2021
4eeca1f
suggestions form code inspector
shimwell Jan 11, 2021
e033c61
Merge pull request #674 from ukaea/adding_reflectivity_option
shimwell Jan 11, 2021
b8f7c3d
Automated autopep8 fixes
Jan 11, 2021
57062f4
fixed typo missing :
shimwell Jan 11, 2021
22d2eb9
fixed tpyo errors missing arg
shimwell Jan 11, 2021
18204e5
fixed html links
shimwell Jan 11, 2021
a740943
added ability to process output file without simulating
shimwell Jan 12, 2021
1ba19b2
obtaining mesh shape from meshfilter
shimwell Jan 12, 2021
63db479
reduce duplicate code using 2d mesh png writting function
shimwell Jan 12, 2021
0c3cb84
reduce duplicate code using 2d mesh png writting function
shimwell Jan 12, 2021
381629e
moved get neutronics results to utils
shimwell Jan 12, 2021
c4d44a9
added tests for custom output filename
shimwell Jan 12, 2021
97aa89b
added tests for custom output filename and fixed tests
shimwell Jan 12, 2021
040adb4
Automated autopep8 fixes
Jan 12, 2021
90832e1
added more type hinting
shimwell Jan 12, 2021
d1aca77
added more type hints
shimwell Jan 13, 2021
3bed34f
fixed merge conflict
shimwell Jan 13, 2021
23b9255
Automated autopep8 fixes
Jan 13, 2021
834ea04
code inspector suggestions
shimwell Jan 13, 2021
37435e5
Merge branch 'develop_combine' of github.com:ukaea/paramak into devel…
shimwell Jan 13, 2021
5532a63
changed moveTo() to center()
billingsley-john Jan 13, 2021
6ebe26b
updated layout
billingsley-john Jan 13, 2021
4398e15
updated to use center() instead of moveTo()
billingsley-john Jan 13, 2021
5a3b636
fixed arc construction
billingsley-john Jan 13, 2021
33e0568
Merge pull request #675 from ukaea/fix_sweep
billingsley-john Jan 13, 2021
8ab8bd6
Merge branch 'develop' into develop_combine
shimwell Jan 13, 2021
042a792
using pymoab setup.py
shimwell Jan 13, 2021
4cc6d16
code inspector suggestions
shimwell Jan 13, 2021
cbf54fe
Merge branch 'develop' into develop_combine
shimwell Jan 14, 2021
6af2c60
Code review suggestions from Remi
shimwell Jan 14, 2021
9fc225b
add openmc as optional import
shimwell Jan 14, 2021
451c870
added tests for export stp in cm
shimwell Jan 14, 2021
8ec0fcf
testing the name of the gyard
shimwell Jan 14, 2021
c72a951
Automated autopep8 fixes
Jan 14, 2021
3db8f1e
moved openmc import to functions
shimwell Jan 14, 2021
fcff298
moved ppp route to NotImplementedError
shimwell Jan 14, 2021
d592315
added extra type tests
shimwell Jan 14, 2021
d27d9b2
Automated autopep8 fixes
Jan 14, 2021
830c5c3
added more type tests
shimwell Jan 14, 2021
81dac9e
Merge branch 'develop_combine' of github.com:ukaea/paramak into devel…
shimwell Jan 14, 2021
8d5d493
added test to check method = None works
shimwell Jan 14, 2021
e9bfdee
added new test
billingsley-john Jan 15, 2021
73c646d
converted nested tests into single unit tests
shimwell Jan 15, 2021
c45ce20
updated tests to ensure assertions are tested correctly
billingsley-john Jan 15, 2021
9299e01
Automated autopep8 fixes
Jan 15, 2021
c4d7037
Merge pull request #681 from ukaea/fix_assertRaises_tests
billingsley-john Jan 15, 2021
67d93de
pullrequest.com suggestions
shimwell Jan 15, 2021
7e3b0af
pullrequest.com suggestions
shimwell Jan 15, 2021
1cfab27
Automated autopep8 fixes
Jan 15, 2021
dfb7b9e
corrected arg name tolerance not tol
shimwell Jan 16, 2021
7b32d40
Merge branch 'develop_combine' of github.com:ukaea/paramak into devel…
shimwell Jan 16, 2021
a9208fe
corrected arg name tolerance not tol
shimwell Jan 16, 2021
485018a
changed error types
shimwell Jan 16, 2021
e975e64
corrected error type
shimwell Jan 16, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,14 @@ coverage.xml
# neutronics simulation files
*.h5
*.out
*.vtk

# 2D and 3D images of the model
*.svg
*.png
*.vtk
*.jpg
*.xcf

# sphinx built documetation
docs/build/
Expand Down
49 changes: 25 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ RUN if [ "$include_neutronics" = "true" ] ; \
mkdir build ; \
cd build ; \
cmake .. -DCMAKE_INSTALL_PREFIX=.. \
-DEMBREE_ISPC_SUPPORT=OFF ; \
-DEMBREE_ISPC_SUPPORT=OFF ; \
make -j"$compile_cores" ; \
make -j"$compile_cores" install ; \
fi
Expand All @@ -119,19 +119,20 @@ RUN if [ "$include_neutronics" = "true" ] ; \
git clone --single-branch --branch develop https://bitbucket.org/fathomteam/moab/ ; \
cd build ; \
cmake ../moab -DENABLE_HDF5=ON \
-DENABLE_NETCDF=ON \
-DBUILD_SHARED_LIBS=OFF \
-DENABLE_FORTRAN=OFF \
-DCMAKE_INSTALL_PREFIX=/MOAB ; \
-DENABLE_NETCDF=ON \
-DENABLE_FORTRAN=OFF \
-DENABLE_BLASLAPACK=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_INSTALL_PREFIX=/MOAB ; \
make -j"$compile_cores" ; \
make -j"$compile_cores" install ; \
rm -rf * ; \
cmake ../moab -DBUILD_SHARED_LIBS=ON \
-DENABLE_HDF5=ON \
-DENABLE_PYMOAB=ON \
-DENABLE_BLASLAPACK=OFF \
-DENABLE_FORTRAN=OFF \
-DCMAKE_INSTALL_PREFIX=/MOAB ; \
cmake ../moab -DENABLE_HDF5=ON \
-DENABLE_PYMOAB=ON \
-DENABLE_FORTRAN=OFF \
-DBUILD_SHARED_LIBS=ON \
-DENABLE_BLASLAPACK=OFF \
-DCMAKE_INSTALL_PREFIX=/MOAB ; \
make -j"$compile_cores" ; \
make -j"$compile_cores" install ; \
cd pymoab ; \
Expand All @@ -146,10 +147,9 @@ RUN if [ "$include_neutronics" = "true" ] ; \
cd double-down ; \
mkdir build ; \
cd build ; \
cmake .. -DCMAKE_INSTALL_PREFIX=.. \
-DMOAB_DIR=/MOAB \
-DEMBREE_DIR=/embree/lib/cmake/embree-3.12.1 \
-DEMBREE_ROOT=/embree/lib/cmake/embree-3.12.1 ; \
cmake .. -DMOAB_DIR=/MOAB \
-DCMAKE_INSTALL_PREFIX=.. \
-DEMBREE_DIR=/embree/lib/cmake/embree-3.12.1 ; \
make -j"$compile_cores" ; \
make -j"$compile_cores" install ; \
fi
Expand All @@ -162,10 +162,10 @@ RUN if [ "$include_neutronics" = "true" ] ; \
mkdir build ; \
cd build ; \
cmake ../dagmc -DBUILD_TALLY=ON \
-DCMAKE_INSTALL_PREFIX=/dagmc/ \
-DMOAB_DIR=/MOAB \
-DBUILD_STATIC_LIBS=OFF \
-DBUILD_STATIC_EXE=OFF ; \
-DMOAB_DIR=/MOAB \
-DBUILD_STATIC_EXE=OFF \
-DBUILD_STATIC_LIBS=OFF \
-DCMAKE_INSTALL_PREFIX=/dagmc/ ; \
make -j"$compile_cores" install ; \
rm -rf /DAGMC/dagmc /DAGMC/build ; \
fi
Expand All @@ -176,9 +176,10 @@ RUN if [ "$include_neutronics" = "true" ] ; \
cd /opt/openmc ; \
mkdir build ; \
cd build ; \
cmake -Doptimize=on -Ddagmc=ON \
-DDAGMC_DIR=/DAGMC/ \
-DHDF5_PREFER_PARALLEL=on .. ; \
cmake -Doptimize=on \
-Ddagmc=ON \
-DDAGMC_DIR=/DAGMC/ \
-DHDF5_PREFER_PARALLEL=on .. ; \
make -j"$compile_cores" ; \
make -j"$compile_cores" install ; \
cd .. ; \
Expand All @@ -191,9 +192,9 @@ ENV OPENMC_CROSS_SECTIONS=/root/nndc_hdf5/cross_sections.xml
# Copies over the Paramak code from the local repository

RUN if [ "$include_neutronics" = "true" ] ; \
then pip install neutronics_material_maker ; \
then pip install vtk ; \
pip install parametric_plasma_source ; \
pip install vtk ; \
pip install neutronics_material_maker ; \
fi

COPY requirements.txt requirements.txt
Expand Down
48 changes: 21 additions & 27 deletions DockerfileDependencies
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ RUN if [ "$include_neutronics" = "true" ] ; \
mkdir build ; \
cd build ; \
cmake .. -DCMAKE_INSTALL_PREFIX=.. \
-DEMBREE_ISPC_SUPPORT=OFF ; \
-DEMBREE_ISPC_SUPPORT=OFF ; \
make -j"$compile_cores" ; \
make -j"$compile_cores" install ; \
fi
Expand All @@ -120,24 +120,20 @@ RUN if [ "$include_neutronics" = "true" ] ; \
git clone --single-branch --branch develop https://bitbucket.org/fathomteam/moab/ ; \
cd build ; \
cmake ../moab -DENABLE_HDF5=ON \
-DENABLE_NETCDF=ON \
-DBUILD_SHARED_LIBS=OFF \
-DENABLE_FORTRAN=OFF \
-DCMAKE_INSTALL_PREFIX=/MOAB ; \
-DENABLE_NETCDF=ON \
-DBUILD_SHARED_LIBS=OFF \
-DENABLE_FORTRAN=OFF \
-DENABLE_BLASLAPACK=OFF ; \
make -j"$compile_cores" ; \
make -j"$compile_cores" install ; \
rm -rf * ; \
cmake ../moab -DBUILD_SHARED_LIBS=ON \
-DENABLE_HDF5=ON \
-DENABLE_PYMOAB=ON \
-DENABLE_BLASLAPACK=OFF \
-DENABLE_FORTRAN=OFF \
-DCMAKE_INSTALL_PREFIX=/MOAB ; \
-DENABLE_HDF5=ON \
-DENABLE_PYMOAB=ON \
-DENABLE_FORTRAN=OFF \
-DENABLE_BLASLAPACK=OFF ; \
make -j"$compile_cores" ; \
make -j"$compile_cores" install ; \
cd pymoab ; \
bash install.sh ; \
python setup.py install ; \
fi


Expand All @@ -148,9 +144,8 @@ RUN if [ "$include_neutronics" = "true" ] ; \
mkdir build ; \
cd build ; \
cmake .. -DCMAKE_INSTALL_PREFIX=.. \
-DMOAB_DIR=/MOAB \
-DEMBREE_DIR=/embree/lib/cmake/embree-3.12.1 \
-DEMBREE_ROOT=/embree/lib/cmake/embree-3.12.1 ; \
-DMOAB_DIR=/usr/local \
-DEMBREE_DIR=/embree/lib/cmake/embree-3.12.1 ; \
make -j"$compile_cores" ; \
make -j"$compile_cores" install ; \
fi
Expand All @@ -163,10 +158,10 @@ RUN if [ "$include_neutronics" = "true" ] ; \
mkdir build ; \
cd build ; \
cmake ../dagmc -DBUILD_TALLY=ON \
-DCMAKE_INSTALL_PREFIX=/dagmc/ \
-DMOAB_DIR=/MOAB \
-DBUILD_STATIC_LIBS=OFF \
-DBUILD_STATIC_EXE=OFF ; \
-DCMAKE_INSTALL_PREFIX=/dagmc/ \
-DMOAB_DIR=/usr/local \
-DBUILD_STATIC_LIBS=OFF \
-DBUILD_STATIC_EXE=OFF ; \
make -j"$compile_cores" install ; \
rm -rf /DAGMC/dagmc /DAGMC/build ; \
fi
Expand All @@ -177,9 +172,10 @@ RUN if [ "$include_neutronics" = "true" ] ; \
cd /opt/openmc ; \
mkdir build ; \
cd build ; \
cmake -Doptimize=on -Ddagmc=ON \
-DDAGMC_DIR=/DAGMC/ \
-DHDF5_PREFER_PARALLEL=on .. ; \
cmake -Doptimize=on \
-Ddagmc=ON \
-DDAGMC_DIR=/DAGMC/ \
-DHDF5_PREFER_PARALLEL=on .. ; \
make -j"$compile_cores" ; \
make -j"$compile_cores" install ; \
cd .. ; \
Expand All @@ -189,12 +185,10 @@ RUN if [ "$include_neutronics" = "true" ] ; \

ENV OPENMC_CROSS_SECTIONS=/root/nndc_hdf5/cross_sections.xml

# Copies over the Paramak code from the local repository

RUN if [ "$include_neutronics" = "true" ] ; \
then pip install neutronics_material_maker ; \
then pip install vtk ; \
pip install parametric_plasma_source ; \
pip install vtk ; \
pip install neutronics_material_maker ; \
fi

COPY requirements.txt requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![N|Python](https://www.python.org/static/community_logos/python-powered-w-100x40.png)](https://www.python.org)
[![CircleCI](https://circleci.com/gh/ukaea/paramak/tree/main.svg?style=svg)](https://circleci.com/gh/ukaea/paramak/tree/main)
[![codecov](https://codecov.io/gh/ukaea/paramak/branch/main/graph/badge.svg)](https://codecov.io/gh/ukaea/paramak)
[![PyPI version](https://badge.fury.io/py/paramak.svg)](https://badge.fury.io/py/paramak)
[![PyPI](https://img.shields.io/pypi/v/paramak?color=green&label=green&logo=green&logoColor=green)](https://pypi.org/project/paramak/)
[![Documentation Status](https://readthedocs.org/projects/paramak/badge/?version=main)](https://paramak.readthedocs.io/en/main/?badge=main)
[![dockerhub-publish-stable](https://github.com/ukaea/paramak/workflows/dockerhub-publish-stable/badge.svg)](https://github.com/ukaea/paramak/actions?query=workflow%3Adockerhub-publish-stable)
[![DOI](https://zenodo.org/badge/269635577.svg)](https://zenodo.org/badge/latestdoi/269635577)
Expand Down
3 changes: 2 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.coverage",
"sphinx.ext.napoleon"]
"sphinx.ext.napoleon",
"sphinx_autodoc_typehints"]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
Expand Down
3 changes: 1 addition & 2 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ straightforward for developers with Python knowledge.

.. raw:: html

<span style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; height: auto;">
<iframe width="560" height="315" src="https://www.youtube.com/embed/fXboew3U7rw" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</span>


.. toctree::
:maxdepth: 1
Expand Down
22 changes: 16 additions & 6 deletions docs/source/paramak.parametric_neutronics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,24 @@ the material tag names. mbsize -ll dagmc.h5m | grep 'mat:'

The creation of the dagmc.h5m file can be carried out via three routes.

Option 1. Use of the `OCC_Faceter <https://github.com/makeclean/occ_faceter/>`_
and the `PPP <https://github.com/ukaea/parallel-preprocessor>`_
Option 1. Use of `PyMoab <https://bitbucket.org/fathomteam/moab>`_ which is
distributed with MOAB. Thus method can not imprint or merge the surfaces of the
geometry that touch. Therefore this method should only be used for single
components or components that touch on flat surfaces. Curved surfaces converted
via this method can potentially overlap and cause errors with the particle
tracking.

Option 2. Use of `Trelis <https://www.coreform.com/products/trelis/>`_ by
Coreform
Coreform along with the DAGMC
`plugin <https://svalinn.github.io/DAGMC/install/plugin.html>`_ / This method
can support imprinting and merging of shared surfaces between components and is
therefore suitable for converting more complex CAD geometry to the PyMoab
method.

Option 3. Use of `PyMoab <https://bitbucket.org/fathomteam/moab>`_ by
Coreform
Option 3. Use of the `PPP <https://github.com/ukaea/parallel-preprocessor>`_
and `OCC_Faceter <https://github.com/makeclean/occ_faceter/>`_ . This option
has not yet been fully demonstrated but is partly included to test the
promising new method.

To create a model it is also necessary to define the source and the materials
used.
Expand All @@ -34,7 +44,7 @@ Details of the Neutronics Material Maker are available from the
and the `source code repository <https://github.com/ukaea/neutronics_material_maker>`_
. However openmc.Materials can also be used directly.

The [UKAEA openmc workshop](https://github.com/ukaea/openmc_workshop) also has
The `OpenMC workshop <https://github.com/ukaea/openmc_workshop>`_ also has
some Paramak with DAGMC and OpenMC based tasks that might be of interest.

NeutronicsModel()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
"""This example creates a curved center column with a few different sizes.
The shape is then converted into a neutronics geometry and the heat deposited
is simulated for a few different sizes of ceter column"""

import matplotlib.pyplot as plt
import openmc
import paramak


def make_model_and_simulate():
simulation_values = []
for mid_radius in [60, 70, 80]:

# makes the component with a few different size mid radius values
my_shape = paramak.CenterColumnShieldHyperbola(
height=500,
inner_radius=50,
mid_radius=mid_radius,
outer_radius=100,
material_tag='center_column_shield_mat'
)

my_shape.export_stp('my_shape' + str(mid_radius) + '.stp')

# makes the openmc neutron source at x,y,z 0, 0, 0 with isotropic
# diections
source = openmc.Source()
source.space = openmc.stats.Point((0, 0, 0))
source.angle = openmc.stats.Isotropic()

# converts the geometry into a neutronics geometry
my_model = paramak.NeutronicsModel(
geometry=my_shape,
source=source,
materials={'center_column_shield_mat': 'eurofer'},
cell_tallies=['heating', 'TBR'],
mesh_tally_2D=['heating'],
mesh_tally_3D=['heating'],
simulation_batches=10, # should be increased for more accurate result
simulation_particles_per_batch=10 # settings are low to reduce time required
)

# performs an openmc simulation on the model
my_model.simulate(method='pymoab')

# extracts the heat from the results dictionary
heat = my_model.results['center_column_shield_mat_heating']['Watts']['result']

# adds the heat and the mid radius value to a list
simulation_values.append((mid_radius, heat))

# plots the simualtion results vs the mid_radius used for the simulation
plt.plot(
[i[0] for i in simulation_values],
[i[1] for i in simulation_values],
'-p'
)

# adds labels to the graph
plt.title("heating vs thickness")
plt.xlabel("thickness (cm)")
plt.ylabel("heating (watts)")

plt.savefig('heating_vs_thickness.svg')
plt.show()


if __name__ == "__main__":
make_model_and_simulate()
Loading