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])

A script to automatically update the github's proxy IP in hosts file.

updateHostsGithub A script to automatically update the github's proxy IP in hosts file. Now only Mac and Linux are supported. (脚本自动更新本地hosts文件,目前仅支持Ma

2 Jul 06, 2022
Real-time text-editor using python tcp socket

Real-time text-editor using python tcp socket This project does not need any external libraries so you don't need to use virtual environments. All you

MatiYo 3 Aug 05, 2022
Simple reverse backdoor utility, that uses sockets to communicate.

reverse_backdoor Simple reverse backdoor utility, that uses sockets to communicate. How to use Run rev_bd_listener.py using command below: $ python3 r

1 Dec 10, 2021
Socket programming is a way of connecting two nodes on a network to communicate with each other

Socket Programming in Python Socket programming is a way of connecting two nodes on a network to communicate with each other. One socket(node) listens

Janak raikhola 1 Jul 05, 2022
This script will make it easier to connect to any wireguard vpn config

wireguard-linux-python-script-vpn This script will make it easier to connect to any wireguard vpn config also u will need your wireguard vpn from your

Jimo 1 Sep 21, 2022
A python shell / chat bot for XMPP and cloud services

XMPP_Shell_Bot A python shell / chat bot for XMPP and cloud services, designed for penetration testers to bypass network filters. To better understand

Abdulkareem Aldeek 1 Jan 09, 2022
EV: IDS Evasion via Packet Manipulation

EV: IDS Evasion via TCP/IP Packet Manipulation 中文文档 Introduction EV is a tool that allows you crafting TCP packets and leveraging some well-known TCP/

256 Dec 08, 2022
A simple DHCP server and client simulation with python

About The Project This is a simple DHCP server and client simulation. I implemented it for computer network course spring 2021 The client can request

shakiba 3 Feb 08, 2022
A powerful framework for decentralized federated learning with user-defined communication topology

Scatterbrained Decentralized Federated Learning Scatterbrained makes it easy to build federated learning systems. In addition to traditional federated

Johns Hopkins Applied Physics Laboratory 7 Sep 26, 2022
The can package provides controller area network support for Python developers

python-can The Controller Area Network is a bus standard designed to allow microcontrollers and devices to communicate with each other. It has priorit

Brian Thorne 904 Dec 29, 2022
Qtas(Quite a Storage)is an experimental distributed storage system developed by Q-team in BJFU Advanced Computer Network sources.

Qtas(Quite a Storage)is a experimental distributed storage system developed by Q-team in BJFU Advanced Computer Network sources.

Jiaming Zhang 3 Jan 12, 2022
A socket script to obtain chinese phones-sequence for any english word

Foreign Pronunciation Generator (English-Chinese) We provide a simple socket script for acquiring Chinese pronunciation of English words (phones in ai

Ephemeroptera 5 Jul 25, 2022
Share clipboards between two devices in a network

Shared Clipboard I felt the need for sharing clipboard texts between virtual machines but I didn't find any reliable solutions for this (I use HyperV)

Teja Swaroop 9 Jun 10, 2022
Tool for quickly gathering information from Shodan.io about the number of IPs which satisfy large number of different queries

TriOp Tool for quickly gathering information from Shodan.io about the number of IPs which satisfy large number of different queries For furt

Jan Kopriva 27 Nov 03, 2022
PcapConverter - A project for generating 15min frames out of a .pcap file containing network traffic

CMB Assignment 02 code + notebooks This is a project for containing code for the

Yannik S 2 Jan 24, 2022
A Python based command line ARP Spoofer utility, which takes input as arguments for the exact target IP and gateway IP for which you wish to Spoof ARP request

A Python based command line ARP Spoofer utility, which takes input as arguments for the exact target IP and gateway IP for which you wish to Spoof ARP request

Abhinandan Khurana 1 Feb 10, 2022
A TrueCharts automatic and bulk update utility

trueupdate A TrueCharts automatic and bulk update utility How to install run pip install trueupdate Please be aware you will need to reinstall after e

TrueCharts 125 Jan 04, 2023
Azure-function-proxy - Basic proxy as an azure function serverless app

azure function proxy (for phishing) here are config files for using *[.]azureweb

17 Nov 09, 2022
This repository contain sample code of gRPC Communication between Python and GoLang

This repository contain sample code of gRPC Communication between Python and GoLang, the Server is running on GoLang while Python is running the client

Abdullahi Muhammad 2 Nov 29, 2021
jarbou3 is rat tool coded in python with C&C which can accept multiple connections from clients

jarbou3 Jarbou3 is rat tool with coded in python with C&C which can accept multi

youhacker55 108 Dec 29, 2022