-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with dagmc simulation #89
Comments
Thanks for raising the issue and adding so much detail. I wonder if it is possible to include the CAD file in the attached zip file. One thing I would check is the units, often cad produces geometry in mm and openmc/dagmc assume accept units in cm so that might be the issue. I think there is a scaling option on cad-to-dagmc so that is easy to fix. |
Hello, I have a zip file containing the codes as well as the CAD geometry in .step format. For your information, the geometry is based on a square with dimensions of 14x14 meters. It consists of three volumes: the two walls and the floor, all made of different varieties of concrete. Have a good day, |
I loaded the step file and I see the coordinates of the inner square are much bigger than the plotted region the mouse icon shows this area is 1500mm which openmc / dagmc will assume is in cm so it will be 1500cm. perhaps you can scale your gmesh or we can add a scaling argument to the MeshToDagmc class so the mesh would need scaling to put it into the plotted region |
Hello, Indeed, the point you're showing me is at the correct coordinates, at least the ones I intended on the CAD model when I did the model . It's true that when I created the geometry in the CAD software, I used a scale in meters. Perhaps for future modeling, I should use a scale in centimeters to match the base scale used in OpenMC/DAGMC ? Have a nice day. Best regards, |
Hello, I am sorry to bother you again, but despite your advice, I have not been able to solve my problem. I did not find the scaling button on Gmsh. Best regards. |
The values of the coordiates could be divided by a scaling factor |
Hi , I get that but how could I get acess to the step file coordinates? |
As your scripts pass in a gmsh mesh file then I think you might want to scale the mesh. I would recommend looking in the gmsh docs for a suitable function. Perhaps |
Hello, Since the last time, I searched the gmsh library for a function to scale the geometry. Unfortunately, I got a bit lost in the documentation and decided to proceed differently. I found a method that seems to work: I create my CAD geometry in centimeters, with a scale factor of 1/10. When I import the geometry into gmsh, a factor of 10 seems to be applied to the geometry. Since these two factors cancel each other out, I then convert the geometry to .h5m format. I then verify the consistency of the distances with openmc_plot, and with this method, it seems that I achieve the desired importation with the correct dimensions. I'm able to conduct simulations that more closely resemble what I should expect. I have two questions: Is this method, despite being somewhat unconventional but seemingly functional, actually a mirage that I have misinterpreted? I have attached several files within this message: the different basement files at various stages of conversion, the functions to convert to .h5m and display the geometry, and some images. Best regards |
units in CAD can be a bit of a mess, the often (but not always default to mm) sometimes not included in the step file, sometimes they are. Most DAGMC workflows ignore the units in CAD files and just assume the numbers provided are in cm. So I guess what you have is the normal way of going from CAD to neutronics.
I think you want the implicit material option. DAGMC adds a void material to any space not covered by cad geometry. this is called an implicit void. The material assignment can be changed and you can ask DAGMC to use air instead of a void. take a peak at this section of code cad_to_dagmc/src/cad_to_dagmc/core.py Lines 337 to 341 in 5cd38e4
see it has a argument called |
Hi , I've been able to fill with air all the empty space as the png that I attached to this mail. Best regards. |
OneDrive_1_16-07-2024.zip](https://github.com/user-attachments/files/16256217/OneDrive_1_16-07-2024.zip)`
Hello,
I wanted to perform a DAGMC simulation of a geometry as follows:
It is a very simple geometry with two wall thicknesses and a floor, all made of concrete.
Here is how I proceed to convert and simulate the geometry (.step file) created in a CAD software:
First, I use GMSH to create the mesh, and then I use Python:
First function:
convert_file.py
Conversion from .msh to .h5m, applying the different materials to the 3 volumes (WALL1, WALL2, floor).
Second function:
gmsh_sim.py
CAD Geometry Simulation Script
The goal of my import is to have a box surrounding my CAD geometry by about 1 meter on all sides. I also want to fill the box with air, knowing that the concrete materials have already been assigned to the volumes.
I perform my simulation and I do not get anything that resembles what might be expected. There is no attenuation in the flux at the walls.
In my opinion, the function that collects data from the output file tallies.out is correct as I have used it in other simulations and it displayed expected results. I think that the way I coded the geometry import in gmsh_sim.py and the setup of the cells and universes might be incorrect, and this could be the source of the wrong results . Finally , to compare , I added a plot of openmc simulation with an openmc-made geometry wich is similar to the cad model so you can see what I would want to except orignally from the malfunctionnin simulation
Could you please help me?
Have a good day.
Best regards.
The text was updated successfully, but these errors were encountered: