|
| 1 | +Example of use |
| 2 | +============== |
| 3 | + |
| 4 | +The following is an example of how to use GEOUNED to convert a CAD file to a CSG file |
| 5 | +for use in MCNP. It includes the methodology and rationale behind the process. |
| 6 | + |
| 7 | +.. warning:: It is assumed that GEOUNED has been properly installed as described in the |
| 8 | + `Quick install guide <./quick_install_guide.html>`_. |
| 9 | + |
| 10 | +1. `CAD simplification`_ |
| 11 | +2. `Export as STEP`_ |
| 12 | +3. `Conversion to CSG`_ |
| 13 | +4. `Suspicious solids and debug`_ |
| 14 | +5. `Void check verification`_ |
| 15 | + |
| 16 | +.. _CAD simplification: |
| 17 | + |
| 18 | +CAD simplification |
| 19 | +~~~~~~~~~~~~~~~~~~ |
| 20 | + |
| 21 | +The CAD model of the system should undergo a process of simplification. In this process, |
| 22 | +features that do not affect the radiation transport should be removed. The level of |
| 23 | +detail is usually decreased. Surfaces that are not allowed like splines are substituted |
| 24 | +by simpler surfaces like planes or cylinders. |
| 25 | + |
| 26 | +.. _Export as STEP: |
| 27 | + |
| 28 | +Export as STEP |
| 29 | +~~~~~~~~~~~~~~ |
| 30 | + |
| 31 | +Once the CAD is simplified, it is exported as a STEP file to be used as input by |
| 32 | +GEOUNED. |
| 33 | + |
| 34 | +.. _Conversion to CSG: |
| 35 | + |
| 36 | +Conversion to CSG |
| 37 | +~~~~~~~~~~~~~~~~~ |
| 38 | + |
| 39 | +The below code is run in a Python environment with GEOUNED installed. In the comments |
| 40 | +of the code there is an explanation of the parameters used. |
| 41 | + |
| 42 | +.. code-block:: python |
| 43 | +
|
| 44 | + import geouned |
| 45 | +
|
| 46 | + settings = geouned.Settings( |
| 47 | + debug=True, # This will create a folder with the CAD bodies and their decomposition |
| 48 | + startCell=12001, # The first cell id |
| 49 | + startSurf=12001, # The first surface id |
| 50 | + compSolids=False, # False so the different solids of a component |
| 51 | + # are not combined into a single MCNP cell |
| 52 | + voidGen=True, # Generate the void cells |
| 53 | + ) |
| 54 | +
|
| 55 | + geo = geouned.CadToCsg(settings=settings) |
| 56 | + geo.load_step_file(filename=f"Geometry/model.stp") # Path to the STEP file |
| 57 | + geo.start() |
| 58 | + print("Start exporting") |
| 59 | + geo.export_csg( |
| 60 | + geometryName="My model", # Name of the model to appear in the MCNP file |
| 61 | + outFormat=("mcnp",), # The output format |
| 62 | + UCARD=50, # Makes the model a filler universe with filler id 50 |
| 63 | + volCARD=True, # The volume card is included in the cell definition |
| 64 | + volSDEF=True, # Generate a SDEF card |
| 65 | + ) |
| 66 | + print("Exporting finished") |
| 67 | +
|
| 68 | +.. _Suspicious solids and debug: |
| 69 | + |
| 70 | +Suspicious solids and debug |
| 71 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 72 | + |
| 73 | +Running the above code will generate a debug folder that contains each of the converted |
| 74 | +solids, both the original and the decomposed ones. Those bodies can be opened and |
| 75 | +examined in a CAD software to compare them to the original model. If the decomposed |
| 76 | +model doesn't look right, it is possible to manually decompose a specific solid and |
| 77 | +redo the conversion. |
| 78 | + |
| 79 | +Also, it is possible that a folder called *Suspicious solids* is created. This folder |
| 80 | +contains the same solids as the debug folder but only the ones that have been flagged as |
| 81 | +potentially problematic. This can be useful to quickly identify the problematic solids. |
| 82 | + |
| 83 | +After applying any fix necessary and exporting to STEP, the conversion can be run again. |
| 84 | + |
| 85 | +.. _Void check verification: |
| 86 | + |
| 87 | +Void check verification |
| 88 | +~~~~~~~~~~~~~~~~~~~~~~~ |
| 89 | + |
| 90 | +Once the conversion is finished, it is recommended to stocastically check the volume |
| 91 | +of the solids and to make some plots. |
| 92 | + |
| 93 | +In this example, the *UCARD* was used to make the model a filler universe. For these |
| 94 | +initial checks the *U=50* cards should be commented out as we want to test the |
| 95 | +standalone model. Plots with the MCNP plotter should be done to check that the model |
| 96 | +looks as expected. |
| 97 | + |
| 98 | +Also, a void check simulation should be run. The *volSDEF=True* card automatically |
| 99 | +generated a spherical inward-oriented source with the correct weight to calculate |
| 100 | +volumes stochastically. The tallies for the solid MCNP cells were also automatically |
| 101 | +generated. The user can run the simulation directly and the results of the tallies |
| 102 | +should all be close to 1.0. If a MCNP cell tally shows a result far from 1.0 it would |
| 103 | +mean that the volume of the solid is not correct. |
| 104 | + |
| 105 | +.. warning:: The void check simulation should be run with a high number of particles to |
| 106 | + achieve an acceptable statistical error. An usually number is 1e9 particles. Always |
| 107 | + check that the statistical error of the tallies is below 0.1. |
0 commit comments