Skip to content

Commit

Permalink
Merge pull request #649 from ukaea/move_trelis_script_automatically
Browse files Browse the repository at this point in the history
Move trelis script automatically
  • Loading branch information
shimwell authored Jan 6, 2021
2 parents 86db75d + 771e24f commit 472b31a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 13 deletions.
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

Option 3. Use of `PyMoab <https://bitbucket.org/fathomteam/moab>`_ 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 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 Down
24 changes: 17 additions & 7 deletions paramak/parametric_neutronics/neutronics_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import json
import math
import os
import pathlib
import shutil
import warnings
from collections import defaultdict
from pathlib import Path
Expand All @@ -26,20 +28,23 @@
class NeutronicsModel():
"""Creates a neuronics model of the provided shape geometry with assigned
materials, source and neutronics tallies. There are three methods
available for producing the imprinted and merged h5m geometry (PyMoab, PPP
or Trelis) and one method of producing non imprinted and non merged
geometry (PyMoab). make_watertight is also used to seal the DAGMC geoemtry.
If using the Trelis option you must have the
make_faceteted_neutronics_model.py in the same directory as your Python
script. Further details on imprinting and merging are available on the
available for producing the the DAGMC h5m file. The PyMoab option is able
to produce non imprinted and non merged geometry so is more suited to
individual components or reactors without touching surfaces. Trelis is
the only method currently able to produce imprinted and merged DAGMC h5m
geometry. PPP is a experimental route that has not been fully demonstrated
yet but is partly intergrated to test this promising new method.
make_watertight is also used to seal the DAGMC geoemtry produced by Trelis.
Further details on imprinting and merging are available on the
DAGMC homepage
https://svalinn.github.io/DAGMC/usersguide/trelis_basics.html
The Parallel-PreProcessor is an open-source tool available
https://github.com/ukaea/parallel-preprocessor and can be used in
conjunction with the OCC_faceter
(https://github.com/makeclean/occ_faceter) to create imprinted and
merged geometry while Trelis (also known as Cubit) is available from
the CoreForm website https://www.coreform.com/
the CoreForm website https://www.coreform.com/ version 17.1 is the version
of Trelis used when testing the Paramak code.
Arguments:
geometry (paramak.Shape, paramak.Rector): The geometry to convert to a
Expand Down Expand Up @@ -334,6 +339,11 @@ def create_neutronics_geometry(self, method=None):
self.geometry.export_stp()
self.geometry.export_neutronics_description()

shutil.copy(
src=pathlib.Path(__file__).parent.absolute() /
'make_faceteted_neutronics_model.py',
dst=pathlib.Path().absolute())

if not Path("make_faceteted_neutronics_model.py").is_file():
raise FileNotFoundError(
"The make_faceteted_neutronics_model.py was \
Expand Down

0 comments on commit 472b31a

Please sign in to comment.