Giter Club home page Giter Club logo

inertial_fusion_openmc_dagmc_paramak_example's Introduction

This example simulates a simplified model of an inertial confinement fusion reactor.

  • A CAD model is made and automatically converted to a DAGMC geometry that is then used in OpenMC for a neutronics simulation.
  • The neutronics simulation obtains the tritium breeding ratio and a 3D map of tritium production.
  • The simulation outputs are post processed to display the results and produce a VTK file for visualization.

๐Ÿ‘‰ ๐Ÿ“น Link to video tutorial for this repository ๐Ÿ“น

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

First clone the repository

git clone https://github.com/fusion-energy/inertial_fusion_openmc_dagmc_paramak_example
inertial_fusion_openmc_dagmc_paramak_example

Making the DAGMC model

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.

python 1_creation_of_dagmc_geometry.py

Then open the dagmc.html file in an internet browser to view the CAD created

CAD geometry image

Optionally you can inspect the DAGMC file at this stage by converting the h5m file to a vtk file and opening this with Paraview

mbconvert dagmc.h5m dagmc.vtk
paraview dagmc.vtk

DAGMC model image

Simulating the model in OpenMC

First make an environment for simulation.

conda env create -f environment_neutronics.yml
conda activate env_neutronics

Then run the simulation which will produce a statepoint.10.h5 file that contains the simulation outputs

python 2_run_openmc_dagmc_simulation.py

Then run the post processing script that should output the Tritium Breeding Ratio to the terminal and make a VTK showing the neutron interactions resulting in tritium production

python 3_extract_results.py

Open up the VTK file with Paraview and slice the data to see the high tritium breeding region

paraview tritium_production_map.vtk

Mesh Tally result

inertial_fusion_openmc_dagmc_paramak_example's People

Contributors

shimwell avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

inertial_fusion_openmc_dagmc_paramak_example's Issues

Issue with Installing Paramak on linux-aarch64 via Conda

Hi there! Thanks for creating such a wonderful resource. Am running into some problems as I try to install paramak package via conda on a linux-aarch64 system. Despite the package being listed in the fusion-energy channel on Anaconda.org, conda can'r find it for installation.

Environment:

Operating System: Ubuntu Linux 22.04
Architecture: ARM64 (aarch64)
Conda version: 23.10.00
Python version: 3.11.5

Steps to Reproduce:
Run the command conda install -c fusion-energy paramak
Encounter the error showing PackagesNotFoundError

The installation fails with the following error:

failed
Traceback (most recent call last):
  File "/home/parallels/miniconda3/lib/python3.11/site-packages/conda/exception_handler.py", line 17, in __call__
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/parallels/miniconda3/lib/python3.11/site-packages/conda/cli/main.py", line 83, in main_subshell
    exit_code = do_call(args, parser)
                ^^^^^^^^^^^^^^^^^^^^^
  File "/home/parallels/miniconda3/lib/python3.11/site-packages/conda/cli/conda_argparse.py", line 164, in do_call
    result = getattr(module, func_name)(args, parser)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/parallels/miniconda3/lib/python3.11/site-packages/conda/notices/core.py", line 124, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/parallels/miniconda3/lib/python3.11/site-packages/conda/cli/main_install.py", line 26, in execute
    install(args, parser, "install")
  File "/home/parallels/miniconda3/lib/python3.11/site-packages/conda/cli/install.py", line 374, in install
    raise e  # see note in next except block
    ^^^^^^^
  File "/home/parallels/miniconda3/lib/python3.11/site-packages/conda/cli/install.py", line 360, in install
    unlink_link_transaction = solver.solve_for_transaction(
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/parallels/miniconda3/lib/python3.11/site-packages/conda/core/solve.py", line 139, in solve_for_transaction
    unlink_precs, link_precs = self.solve_for_diff(
                               ^^^^^^^^^^^^^^^^^^^^
  File "/home/parallels/miniconda3/lib/python3.11/site-packages/conda/core/solve.py", line 200, in solve_for_diff
    final_precs = self.solve_final_state(
                  ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/parallels/miniconda3/lib/python3.11/site-packages/conda_libmamba_solver/solver.py", line 221, in solve_final_state
    out_state = self._solving_loop(in_state, out_state, index)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/parallels/miniconda3/lib/python3.11/site-packages/conda_libmamba_solver/solver.py", line 308, in _solving_loop
    solved = self._solve_attempt(in_state, out_state, index)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/parallels/miniconda3/lib/python3.11/site-packages/conda_libmamba_solver/solver.py", line 395, in _solve_attempt
    new_conflicts = self._maybe_raise_for_problems(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/parallels/miniconda3/lib/python3.11/site-packages/conda_libmamba_solver/solver.py", line 700, in _maybe_raise_for_problems
    raise exc
conda.exceptions.PackagesNotFoundError: The following packages are not available from current channels:

  - paramak

Current channels:

  - https://conda.anaconda.org/fusion-energy
  - defaults

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

Would love some guidance on this! Thanks so much

why conda env create -f environment_neutronics.yml error

Has anyone ever encountered such a problem, and how to solve it.

Collecting package metadata (repodata.json): failed

>>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

Traceback (most recent call last):
  File "/home/a/anaconda3/lib/python3.10/site-packages/conda/exceptions.py", line 1124, in __call__
    return func(*args, **kwargs)
  File "/home/a/anaconda3/lib/python3.10/site-packages/conda_env/cli/main.py", line 78, in do_call
    exit_code = getattr(module, func_name)(args, parser)
  File "/home/a/anaconda3/lib/python3.10/site-packages/conda/notices/core.py", line 109, in wrapper
    return func(*args, **kwargs)
  File "/home/a/anaconda3/lib/python3.10/site-packages/conda_env/cli/main_create.py", line 154, in execute

conda install issue

might be related to moab/dagmc/openmc conda package but currently the CI is reporting this error when installing the neutronics environment

ValueError: Incompatible component merge:
      - 'mpi_mpich_*'
      - 'mpi_mpich_tempest*'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.