Skip to content
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

Understanding of material's volumes assignments #325

Open
gglamzn opened this issue Apr 23, 2024 · 1 comment
Open

Understanding of material's volumes assignments #325

gglamzn opened this issue Apr 23, 2024 · 1 comment

Comments

@gglamzn
Copy link

gglamzn commented Apr 23, 2024

Hi ,
I have done a simple code in order to highlight something I have hard time understanding about CAD geometries and their implementation in OpenMC:

#Code
my_reactor = paramak.FlfSystemCodeReactor(
inner_blanket_radius=100.,
blanket_thickness=70.,
blanket_height=500.,
lower_blanket_thickness=50.,
upper_blanket_thickness=40.,
blanket_vv_gap=20.,
upper_vv_thickness=10.,
vv_thickness=10.,
lower_vv_thickness=10.,
rotation_angle=180,
)

cadquery_object = my_reactor.solid
my_model = CadToDagmc()

Creates a DAGMC h5m file of the geometry with material tags automatically assigned.

my_model.add_cadquery_object(
cadquery_object,
material_tags=["uo2"],
)

#uo2 is on the materials I am defining later on my code.

I get , intentionally , this error:

ValueError: When setting material_tags, the number of material_tags
should be equal to the number of volumes in the CAD geometry.
6 volumes found in the model
and 1 material_tags found.

This is where I am having a hard time. I don't understand how those material tags are working , how they apply to my geometry , how do I know those 6 volumes {for this particular example } define which part of my geometry, are those volumes have to be defined in my CAD software?
Best regards.

@shimwell
Copy link
Member

The number of material tags should be equal to the number of cad volumes in the geometry.

It is difficult to know which material tag corresponds to which volume

the order that the volumes are added to the caquery assembly is the same order as they are exspected to be in for the materials tags

As you have used a reactor then the user does not know the order of the volumes added to the cadquery object without peaking at the source code or exporting the assembly and visually inspecting it.

I hope to make this better and clear in the refactor of the paramak I'm working on

for now this would make your error go way as it makes 6 materials as expected by the code.

cadquery_object,
    material_tags=["mat1", "mat2", "mat3", "mat4", "mat5", "mat6"],
)
```

you could then plot it in openmc to see which material is which

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants