Help in running OpenMC on Docker for Windows 11

Greetings!

I followed the instructions for Windows installation using Docker.

However this is unable to get called: openmc.examples nor am I able to run the code given in the documentation for Python API.

I am new to this type of coding (in Docker/Linux environment), please guide me.

Thanks!

Sorry I’ve not tried the Docker in windows 11. I’ve got a tutorial for Windows 10 with a slightly different docker image if that helps.

You would just have to change the name of the docker imaged used to one of these tags Docker

1 Like

Thanks @Shimwell

So, I originally used docker run openmc/openmc:latest and could not run any example, so if I use docker pull openmc/openmc:develop-dagmc instead, will I be able to execute the example here or here ?

Thanks!

@IIP If you want to run notebook file from the terminal, you have to convert it to python script first. Then rename the generated script to be an IPython script by changing the extension to .ipy and run it with ipython

So the steps on the command line all together would be:

jupyter nbconvert pincell.ipynb --to python
mv pincell.py pincell.ipy
ipython pincell.ipy
1 Like

Thanks @Pranto . I have a few more queries:

  1. If I want to write and run code in a Jupyter Notebook (instead of code conversion) or Lab environment, how can I do that ?

  2. For geometry, is there a direct way to import CAD from mainstream software like SolidWorks and Creo, instead of DAGMC ?

Thanks!

  1. First, You have to install jupyter lab inside the container with the command as follows:
docker run -it --name=jupyter_lab openmc/openmc:latest
pip install jupyterlab
git clone https://github.com/openmc-dev/openmc-notebooks.git && exit
docker commit jupyter_lab openmc_notebook
docker run -it --rm -p 8888:8888 openmc_notebook jupyter lab --ip=0.0.0.0 --port=8888 --no-browser --allow-root --notebook-dir=/openmc-notebooks

At this point, an HTTP address will appear in your terminal output, copy this address into your browser, and you’re ready to code!

  1. Nope! But If you’re looking for the alternative of coreform-cubit for import and imprint/merging algorithm, you can try CAD_to_OpenMC python package.
1 Like

Sorry for so many questions (I’m new to this) but what difference is in pulling OpenMC using
docker pull openmc/openmc:latest from any other, such as docker pull openmc/openmc:develop-dagmc-libmesh.

I noticed the ‘develop’ one’s are larger in size and have been pushed recently…

Thanks again.

@Pranto, PowerShell couldn’t run the commands. However, it worked on Command Prompt, but no link was generated…

Please advise.

Thanks.

The different docker images contain OpenMC compiled in different ways. Some include extra programs like Libmesh or DAGMC while the openmc/openmc:latest is a minimal version. If the minimal version has everything you need then I would stick with that.

1 Like

@Shimwell could you advise on this please.

Unfortunately I don’t have Windows but Prantos instructions look good to me.

Here is a quick demonstration of how to build on top of the openmc dockerfile to add jupyter lab, build and run the dockerfile in Linux

Re: For geometry, is there a direct way to import CAD from mainstream software like SolidWorks and Creo, instead of DAGMC ?

Provided that your CAD software can output Brep, STP or STL files then there are a few tools out there for conversion to DAGMC h5m files which can then be run in OpenMC.

We maintain a list of such software here

I’m working on yet another addition to this list and can post here once it is more ready

1 Like

I just released the version 0.1.1 of cad_to_dagmc which can convert CAD files in STP format or CadQuery objects into DAGMC h5m files. It might help convert your CAD geometry @IIP

1 Like

Hello @Shimwell,
There exist some tutorial on the usage of the cad_to_openmc package?

Thanks,
Lorenzo

I’ve not seen a tutorial for the cad_to_openmc package which was created by Erik. Perhaps you can request a tutorial on the github page as I’m not sure if Erik visits the discourse channel


How do I proceed from here?