https://github.com/shimwell/neutronics_geomentry_comparision_simulation
The same neutronics geometry made using Constructive Solid Geometry (CSG) and DAGMC faceteted surface mesh at different resolutions to compare simulation results
https://github.com/shimwell/neutronics_geomentry_comparision_simulation
csg dagmc geometry mesh neutronics simulation
Last synced: 6 months ago
JSON representation
The same neutronics geometry made using Constructive Solid Geometry (CSG) and DAGMC faceteted surface mesh at different resolutions to compare simulation results
- Host: GitHub
- URL: https://github.com/shimwell/neutronics_geomentry_comparision_simulation
- Owner: shimwell
- License: mit
- Created: 2022-04-02T10:06:01.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-21T10:40:57.000Z (almost 4 years ago)
- Last Synced: 2024-06-12T17:43:48.152Z (over 1 year ago)
- Topics: csg, dagmc, geometry, mesh, neutronics, simulation
- Language: Python
- Homepage:
- Size: 32.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
This example simulates a simplified model of an inertial confinement fusion reactor using two different neutronics geometries method.
- A CAD model is made and automatically converted to a DAGMC geometry that is then used in OpenMC for a neutronics simulation.
- A Constructive Solid Geometry (CSG) is made made in OpenMC and used for a neutronics simulation directly.
# Prerequisites
This minimal example makes use of Conda to manage and install the packages.
You will need one of these conda distributions to be installed or work within a [Docker image](https://hub.docker.com/r/continuumio/miniconda3)
- [Miniconda](https://docs.conda.io/en/latest/miniconda.html)
- [Anaconda](https://www.anaconda.com/)
- [Miniforge](https://github.com/conda-forge/miniforge)
- [Miniconda](https://docs.conda.io/en/latest/miniconda.html)
# First clone the repository
```bash
git clone https://github.com/shimwell/neutronics_geomentry_comparision_simulation.git
cd neutronics_geomentry_comparision_simulation
```
# Making the DAGMC model for OpenMC and Shift
Make an environment for the model preparation
```
conda env create -f environment_cad.yml
conda activate env_cad
```
Then run the script for making the DAGMC model.
```bash
python scripts/1_create_dagmc_geometry.py
```
Optionally you can inspect the DAGMC file at this stage by converting the h5m file to a vtk file and opening this with [Paraview](https://www.paraview.org/). There should be several h5m made, this example command converts just one of them. The geometries made for Shift should have graveyards while the openmc one won't.
```
mbconvert dagmc_10_openmc.h5m dagmc_10_openmc.vtk
paraview dagmc.vtk
```

# Simulating the model in OpenMC
First make an environment for simulation.
```
conda env create -f environment_neutronics.yml
conda activate env_neutronics
```
Make the DAGMC geometry
```
python scripts 1_create_dagmc_geometry.py
```
Then run the DAGMC simulation which will produce a statepoint file that contains the simulation outputs.
```bash
python python scripts/2_openmc_simulation_with_dagmc_geometry.py
```
Then run the CSG simulation which will produce a statepoint file that contains the simulation outputs.
```bash
python python scripts scripts/3_openmc_simulation_with_csg_geometry.py
```