openmc-dev / openmc

OpenMC Monte Carlo Code
https://docs.openmc.org
Other
764 stars 492 forks source link

Improve documentation on how to use CAD geometries #1123

Closed D-Benjamin closed 5 years ago

D-Benjamin commented 5 years ago
Recently, I do a research with OpenMC, and I need to create a complex geometry that OpenMC can not make it. So I wonder if it is possible to use another tool(such as 'CAD') to create a geometry than input to OpenMC? If it is possible, than how?
Any reply will be appreciated !!
pshriwise commented 5 years ago

OpenMC has recently added the capability to use CAD geometries via the DAGMC toolkit. Geometries are typically created using a CAD/meshing software tool called Trelis, but CAD-based surface mesh geometries from other sources have been used in the past as well. Please let us know if you have any other questions!

nmurali2002 commented 5 years ago

OpenMC has recently added the capability to use CAD geometries via the DAGMC toolkit. Geometries are typically created using a CAD/meshing software tool called Trelis, but CAD-based surface mesh geometries from other sources have been used in the past as well. Please let us know if you have any other questions!

The DAGMC website doesn't have installation instructions for OpenMC - any help? Also, this CAD functionality looks awesome - thank you so much for helping to add that capability!

shimwell commented 5 years ago

I am also keen to use this great feature. It looks like the workflow for this is evolving but there are is some preparation steps that are generic for other DAG codes that you could do in the mean time.

I guess the first stage would be to acquire a copy of Trelis and install the DAGMC plugin.

Then import your CAD models and tag the geometry with groups that identify the different materials. Not sure if OpenMc going to use the same tag names as DAG e.g "mat:steel" ?

I guess that the Trelis tagged geometry will then need to be exported as a h5 file and somehow imported to OpenMc.

D-Benjamin commented 5 years ago

I am also keen to use this great feature. It looks like the workflow for this is evolving but there are is some preparation steps that are generic for other DAG codes that you could do in the mean time.

I guess the first stage would be to acquire a copy of Trelis and install the DAGMC plugin.

Then import your CAD models and tag the geometry with groups that identify the different materials. Not sure if OpenMc going to use the same tag names as DAG e.g "mat:steel" ?

I guess that the Trelis tagged geometry will then need to be exported as a h5 file and somehow imported to OpenMc.

Thanks for your focus on this problem. I believe it will have great help on me. By the way, I wonder if the meshing tools(Such as 'ICEM' or 'Gambit') can take place of the 'Trelis'. Thanks a lot

Best Wishes! D.Benjamin

D-Benjamin commented 5 years ago

OpenMC has recently added the capability to use CAD geometries via the DAGMC toolkit. Geometries are typically created using a CAD/meshing software tool called Trelis, but CAD-based surface mesh geometries from other sources have been used in the past as well. Please let us know if you have any other questions!

The DAGMC website doesn't have installation instructions for OpenMC - any help? Also, this CAD functionality looks awesome - thank you so much for helping to add that capability!

Sorry, I'm a new to OpenMC! I try to simplify the geometry model in my later Master's thesis work since the OpenMC can not make it by itself. And I will not study how to use DAGMC in a short time. But thanks for your focus on this problem, and I hope to get your reply if you can make progress in using DAGMG. keep in touch!!

Best Wishes! D.Benjamin

D-Benjamin commented 5 years ago

OpenMC has recently added the capability to use CAD geometries via the DAGMC toolkit. Geometries are typically created using a CAD/meshing software tool called Trelis, but CAD-based surface mesh geometries from other sources have been used in the past as well. Please let us know if you have any other questions!

Thanks for your focus on this problem. I believe it will have great help on me. By the way, I wonder if the meshing tools(Such as 'ICEM' or 'Gambit') can take place of the 'Trelis'. Thanks a lot

Best Wishes! D.Benjamin

paulromano commented 5 years ago

Glad to see that there's interest in this feature! I've changed the issue title to reflect the fact that we need to add better documentation on the CAD workflow.

shimwell commented 5 years ago

Hi D.Benjamin

I think Trellis has a unique feature of allowing merging and imprinting surfaces.

https://svalinn.github.io/DAGMC/usersguide/trelis_basics.html

I guess that is why is was selected and the plugin was created so that it exports h5 geometry. Just to confuse you Trellis is also called Cubit.

I have not used the other meshing packages but I believe Cubit is free in some cases https://cubit.sandia.gov/public/licensing.html

pshriwise commented 5 years ago

@D-Benjamin I'll add some documentation on how DAGMC can be enabled when building OpenMC very soon, thanks for bringing it to our attention.

@Shimwell is steering you well. The imprinting and merging capabilities in CUBIT/Trelis are important to providing robust surface mesh geometries to the DAGMC kernel. However, we have generated DAGMC models from non-intersecting, non-coincident surface meshes before and are willing to be guides/aides in that process. If either ICEM or Gambit has imprint and/or merge capabilities then this becomes less onerous :)

D-Benjamin commented 5 years ago

@pshriwise Yes, Gambit has merge capabilities, and it is the exclusive mesh tool for CFD software(FLUENT). But Gambit hasn't been updated since Fluent was acquired by ANSYS in a few years ago. I have not used ICEM, and I'm not sure if it has imprint and merge capabilities. I only know it is a widespread mesh tool since Fluent was acquired by ANSYS. However, Gambit has its advantages and still be popular by many CFDer though it will not be updated.

D-Benjamin commented 5 years ago

@D-Benjamin I'll add some documentation on how DAGMC can be enabled when building OpenMC very soon, thanks for bringing it to our attention.

@pshriwise Hi, pshriwise, Have you finished the documentation on how DAGMC can be enabled when building OpenMC? Recently, I need to create a complex geometry urgently which OpenMC can not make it by itself. Or is there any another way to construct a complex geometry and then simulate by OpenMC? Hope to get your reply soon.

Best Wishes! Benjamin

pshriwise commented 5 years ago

@D-Benjamin I’m overdue on that, aren’t I?! Apologies.

At some point I made the decision to wait until I could implement support for our material-laden geometry workflow, called UWUW, before writing it all up so I could include information on this as well.

In the meantime, what stage are you at in creating this geometry. Do you have a CAD file you’re working with?

D-Benjamin commented 5 years ago

@pshriwise I'd like to create a geometry which is similar to the picture below. OpenMC doesn't have the capability of making complex geometry. Maybe I have to use the method of stacking blocks to complete this work. Anyway, I'm really looking forward to your release of this new capability of OpenMC.

image

D-Benjamin commented 5 years ago

@D-Benjamin I’m overdue on that, aren’t I?! Apologies.

At some point I made the decision to wait until I could implement support for our material-laden geometry workflow, called UWUW, before writing it all up so I could include information on this as well.

In the meantime, what stage are you at in creating this geometry. Do you have a CAD file you’re working with?

@pshriwise Hi pahriwise, I may find a error in the DAGMC documentation when I install the MOAB. the website is "https://svalinn.github.io/DAGMC/install/dependencies.html". After run following commands, there is a error hint: "configure: error: BLAS library not found" on the terminate.

$ ../src/configure --enable-optimize \ --enable-shared \ --disable-debug \ --with-hdf5=$HOME/dagmc_bld/HDF5 \ --prefix=$HOME/dagmc_bld/MOAB

And when I run command "make", there is a hit: "can not find makefile", And then, stop. I'm sure I had followed the source install route. But I tried installing MOAB-4.6.3, it can works. However, the documentation reminder "As of DAGMC version 3.1, MOAB version 5.1.0 or higher is required". So I hope to get your help, I have struggle for it for a long time. My operating system is Ubuntu16.04LTS. Thanks!
pshriwise commented 5 years ago

Hrmmm so MOAB will require either BLAS/ or Eigen3 for its linear algebra needs. Can you check that one of those is installed on your machine?

You can specify which of the two you’d like to use in the configure command using the —with-blas and —with-eigen3, respectively.

Let me know if that helps!

pshriwise commented 5 years ago

@D-Benjamin I hadn’t noticed earlier that you’re on Ubuntu. That should make getting blas/lapack much easier :)

You can make sure they’re installed using the following: sudo apt-get install libblas-dev liblapack-dev

OR

sudo apt-get install libeigen3-dev

If you’d rather use eigen3

D-Benjamin commented 5 years ago

@D-Benjamin I hadn’t noticed earlier that you’re on Ubuntu. That should make getting blas/lapack much easier :)

You can make sure they’re installed using the following: sudo apt-get install libblas-dev liblapack-dev

OR

sudo apt-get install libeigen3-dev

If you’d rather use eigen3

@pshriwise Thank you, pshriwise! I have installed the MOAB successfully by your instruction

pshriwise commented 5 years ago

Excellent! Do keep me updated as to how things are going. There are a lot of instructions for model preparation on the DAGMC site. I’d recommend setting up your module using the UWUW workflow - which will be supported by OpenMC very soon. I’m hoping to submit that capability for review within a week or so.

You can also use the MCNP model prep guide, which is what OpenMC is using currently.

D-Benjamin commented 5 years ago

Excellent! Do keep me updated as to how things are going. There are a lot of instructions for model preparation on the DAGMC site. I’d recommend setting up your module using the UWUW workflow - which will be supported by OpenMC very soon. I’m hoping to submit that capability for review within a week or so.

You can also use the MCNP model prep guide, which is what OpenMC is using currently.

@pshriwise Thanks for your contribution on the OpenMC and thanks for your help in these days! I'll waiting for you to submit it so that I can use this new great feature to make my thesis's work better. Please let me know when it is issued and I'll focus it all the time. Thank you!

pshriwise commented 5 years ago

Hi @D-Benjamin!

I wanted to let you know that documentation for preparation of a DAGMC model in CUBIT/Trelis for OpenMC and use of DAGMC's CAD-based geometry in OpenMC have been added to the DagMC and OpenMC projects.

Please feel free to contact me with any questions you might have along the way. I hope this is helpful to you in your research endeavors!

D-Benjamin commented 5 years ago

Hi, @pshriwise ,

Thanks for your help, and now I'm Installing DAGMC as a dependency of OpenMC according to updated document. But there may be something wrong with it. When I run:

cmake .. -DMOAB_DIR=$HOME/dagmc_bld/MOAB \
           -DBUILD_TALLY=ON \
           -DCMAKE_INSTALL_PATH=$INSTALL_PATH

A error hint will appear:

CMake Error: The source directory "/home/benjamin/dagmc_bld/DAGMC" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

I'm sure that I run it from the build directory(that is "$HOME/dagmc_bld/DAGMC/bld"), which I built as specified on document. Hope to get your reply soon! Thanks!!