OpenNeoMC:an Open-source Tool for Particle Transport Optimization that Combining OpenMC with NEORL

Related tags

NetworkingOpenNeoMC
Overview

OpenNeoMC:an Open-source Tool for Particle Transport Optimization that Combining OpenMC with NEORL

OpenMC is a community-developed Monte Carlo neutron and photon transport simulation code for particle transport. OpenMC was originally developed by members of the Computational Reactor Physics Group at the Massachusetts Institute of Technology starting in 2011.

NEORL (NeuroEvolution Optimization with Reinforcement Learning) is a set of implementations of hybrid algorithms combining neural networks and evolutionary computation based on a wide range of machine learning and evolutionary intelligence architectures. NEORL aims to solve large-scale optimization problems relevant to operation & optimization research, engineering, business, and other disciplines. NEORL was established in MIT back in 2020 with feedback, validation, and usage of different colleagues.

In OpenNeoMC, we combine these two open-source tools to empower particle transport with state-of-the-art optimization techniques. We firstly provide users with easy ways to install the framework that combines NEORL with OpenMC, and a simple example is available to test the framework. Then we offer two practical engineering optimization applications in nuclear physics. More applications that involve both optimization and nuclear physics will be added in the future. We highly welcome users and researchers in the nuclear area to contribute OpenNeoMC and solve engineering problems in this framework.

Installing OpenNeoMC

Installation on Linux/Mac with conda

Install Conda

Please install conda before proceeding, it will bring you convenience to install anaconda directly, which includes conda and other necessary python packages.

Install OpenMC

conda config --add channels conda-forge
conda search openmc

Create a new virtual environment named openneomc

conda create -n openneomc openmc

Test OpenMC

Follow with the official examples to test the OpenMC

Cross Section Configuration

You may encounter the no cross_sections.xml error when running OpenMC. This is caused by the missing of nuclear data, you could solve it refer to Cross Section Configuration

Download cross section data

Various cross section data are available on the OpenMC official website, from the OpenMC team, LANL, etc. In OpenNeoMC, we use ENDF/B-VII.1 in default. But if you have specific purpose, you can use other data that you need.

After downloading the cross-section data file, configure it as an environmental variable as follows.

Add environmental variables

## Temporary methods
# in python
import os
os.environ['OPENMC_CROSS_SECTIONS'] = '/PATH/cross_sections.xml'
# in shell
export OPENMC_CROSS_SECTIONS=../cross_sections.xml

## Once for all: you can modify the ~/.bashrc to configure environmental variables
# open ~/.bashrc
vim ~/.bashrc
# add the following command in the end 
export OPENMC_CROSS_SECTIONS=/PATH/cross_sections.xml
# update 
source ~/.bashrc

Install NEORL

Install python 3.7 to make sure the stable run of tensorflow-1.14.0

conda install python=3.7 
pip install neorl==1.6

Check the version of sciki-learn, if it is 1.x, downgrade the scikit-learn version to 0.24.2

# check version
python -c 'import sklearn; print(sklearn.__version__)'

# downgrade the sklearn version if necessary
pip install scikit-learn==0.24.2

Check if you have install NEORL successfully by unit test.

neorl

If you see the 'NEORL' logo, then you have prepared the OpenNeoMC framework, congratulations!

Test OpenNeoMC

Let's test OpenNeoMC by the 'pin_cell_test.py' example.

Remember to configure environmental variables as above!

# run 
python pin_cell_test.py

If you see the 'NEORL' logo and the log information of OpenMC, then congratulations!

Installing OpenNeoMC with Docker on Linux/Mac/Windows

Installing OpenNeoMC with docker is highly recommended! In this way, you need not worry about issues like cross-section data and software compatibility, etc. All you need to do are simply pull the image and run it in your own machine with any OS.

Install Docker

Follow the official tutorial to Install docker on your machine: get docker

Install OpenNeoMC

After installing docker, your can easily install use OpenNeoMC framework within only four steps:

# Pull docker images from dock hub  
sudo docker pull 489368492/openneomc

# Check the openmc docker images
sudo docker images

# Run the openmc images to create container named `openneomc`
sudo docker run -tid --shm-size=8G --gpus all --name openneomc -v /LocalWorkingDir/:/workspace/ 489368492/openneomc

# Execute the container
sudo docker exec -it openneomc /bin/bash

Note: in docker run step, the -v flag mounts the current working directory into the container, which is very convenient for users.

Please refer to Docker CLI for docker command-line descriptions.

Other commonly used commands

# Exit the container
exit

# Stop the container
sudo docker stop openneomc

# Start the container
sudo docker start openneomc

# Delete the container
sudo docker rm openneomc

# Delete the image(remove the container first)
sudo docker image rm 489368492/openneomc

Test OpenNeoMC

Let's test OpenNeoMC by the 'pin_cell_test.py' example, which can be found at /home

# cd /home
cd /home

# run 
python pin_cell_test.py

If you see the 'NEORL' logo and the log information of OpenMC, then congratulations!

The program runs around 3 minutes(may vary depending on your CPU), and the results are like:

------------------------ JAYA Summary --------------------------
Best fitness (y) found: 0.0015497217274231812
Best individual (x) found: [2.01355604]
--------------------------------------------------------------
---JAYA Results---
x: [2.01355604]
y: 0.0015497217274231812
JAYA History:
 [0.018311916874464318, 0.0017114252626817539, 0.0017114252626817539, 0.0017114252626817539, 0.0015497217274231812]
running time:
 155.2281835079193

Reference

OpenMC: https://docs.openmc.org/en/stable

OpenMC image: https://hub.docker.com/r/openmc/openmc

NEORL: https://neorl.readthedocs.io/en/latest/

OpenNeoMC image: https://hub.docker.com/r/489368492/openneomc

Contact

If you have any suggestions or issues, please feel free to contact Xubo Gu([email protected])

Tool to get the top 100 of the fastest nodes in the Tor network. Based on Kirzahk tool.

Tor Network Top 100 IPs Tool to get the top 100 of the fastest nodes in the Tor network. Based on Kirzahk tool. Just execute top100ipstor.py to get th

Juan Manuel 0 Jan 23, 2022
Tool for pretty printing and optimizing Lightning Network channels.

Suez Tool for pretty printing and optimizing Lightning Network channels. Installation Install poetry poetry install poetry run ./suez Channel fee poli

Pavol Rusnak 69 Nov 03, 2022
a safe proxy over tls

TlsProxys 基于TLS协议的http流量代理 安装 ※ 需要python3.7+ linux: python3.9 -m pip install TlsProxys windows: pip install TlsProxys 基本用法 服务器端: $ tpserver [command]

56 Nov 30, 2022
A Project to resolve hostname and receive IP

hostname-resolver A Project to resolve hostname and receive IP Installation git clone https://github.com/ihapiw/hostname-resolver.git Head into the ho

iHapiW 5 Sep 12, 2022
Converts from PC formatted MAC addresses (hardware addresses) to Cisco format or vice-versa

MAC-Converter Converts from PC formatted MAC addresses (hardware addresses) to Cisco format or vice-versa Stores the results to a file in the same dir

Stew Alexander 0 Dec 24, 2022
Openconnect VPN RPi Gateway

Openconnect-VPN-RPi-Gateway See the blog (Chinese) for how to build an Openconne

Zhongze Tang 2 Jan 30, 2022
A great python/java dynamic DNS service for NameSilo, with log, email reminder...

English NameSilo DDNS is a DDNS service for NameSilo domain names for home broadband , it can automatically detect IP changes in home broadband

云牧青 77 Dec 28, 2022
Octodns-cloudflare - Cloudflare DNS provider for octoDNS

CloudflareProvider provider for octoDNS An octoDNS provider that targets Cloudfl

octoDNS 6 May 28, 2022
This application aims to read all wifi passwords and visualizes the complexity in graph formation by taking into account several criteria and help you generate new random passwords.

This application aims to read all wifi passwords and visualizes the complexity in graph formation by taking into account several criteria and help you generate new random passwords.

Njomza Rexhepi 0 May 29, 2022
With the use of this tool, you can change your MAC address

Akshat0404/MAC_CHANGER This tool has to be used on linux kernel. Now o

1 Jan 25, 2022
GitHub action for sspanel automatically checks in to get free traffic quota

SSPanel_Checkin This is a dish chicken script for automatic check-in of sspanel for GitHub action, It is only applicable when there is no verification

FeedCatWithFish 7 Apr 28, 2022
Ov3 - Easy common OpenVPN3 operations

ov3 Easy common OpenVPN3 operations Install ov3 requires Python3 and OpenVPN3 to

Yunus Bora Erciyas 6 Apr 25, 2022
A Python server and client app that tracks player session times and server status

MC Outpost A Python server and client application that tracks player session times and server status About MC Outpost provides a session graph and ser

Grant Scrits 0 Jul 23, 2021
ProxyBroker is an open source tool that asynchronously finds public proxies from multiple sources and concurrently checks them

ProxyBroker is an open source tool that asynchronously finds public proxies from multiple sources and concurrently checks them. Features F

Denis 3.2k Jan 04, 2023
The AKS cluster provisioner provisions AKS clusters :-)

Overview The AKS cluster provisioner provisions AKS clusters :-) It uses the Azure CLI to configure VNet and subnets before creating the cluster itsel

Gigi Sayfan 1 Nov 10, 2021
A Python library to ease the integration with the Beem Africa (SMS, AIRTIME, OTP, 2WAY-SMS, BPAY, USSD)

python-client A Python library to easy the integration with the Beem Africa SMS Gateway Features to be Implemented Airtime OTP SMS Two way SMS USSD Bp

Beem Africa 24 Oct 29, 2022
SocksFlood, a DoS tools that sends attacks using Socks5 & Socks4

Information SocksFlood, a DoS tools that sends attacks using Socks5 and Socks4 Requirements Python 3.10.0 A little bit knowledge of sockets IDE / Code

ArtemisID 0 Dec 03, 2021
Pritunl is a distributed enterprise vpn server built using the OpenVPN protocol.

Pritunl is a distributed enterprise vpn server built using the OpenVPN protocol.

Pritunl 3.8k Jan 03, 2023
A simple chat room using socket and threading for handle multiple connections.

• Socket Chat Room was a little project for socket study. It works with a server handling the incoming connections from the clients. Clients send encoded messages while waiting for others clients mes

Guilherme de Oliveira 2 Mar 03, 2022
IPV4 network calculation project in Python

Curso de Python 3 do Básico ao Avançado Desafio: Calculando redes IPV4 Criar um programa que obtem um numero de IP com o prefixo da mascara de rede. O

Diego Guedes 3 Jan 21, 2022