fusion-energy / brep_to_h5m

Converts Brep CAD geometry files to h5m geometry files compatible with DAGMC simulations
MIT License
1 stars 2 forks source link

multivolume paramak parts #4

Closed shimwell closed 1 year ago

shimwell commented 2 years ago

The following multi volume paramak reactor only exports the center column and misses the multivolume stl blanket.

import paramak

center_column = paramak.RotateMixedShape(
    points=[
        (50, 600, 'straight'),
        (150, 600, 'spline'),
        (100, 0, 'spline'),
        (150, -600, 'straight'),
        (50, -600, 'straight')
    ],
    name='center_column'
)

blanket = paramak.RotateSplineShape(
    points=[
        (600, 0),
        (600, -20),
        (500, -300),
        (400, -300),
        (400, 0),
        (400, 300),
        (500, 300),
        (600, 20)
    ],
    name='blanket',
    rotation_angle=40,
    azimuth_placement_angle=[0, 45, 90, 135, 180, 225, 270, 315],
)

my_reactor = paramak.Reactor([blanket, center_column])

my_reactor.export_dagmc_h5m()
my_reactor.export_brep('brep_filename.brep')
volumes = gmsh.model.occ.importShapes('brep_filename.brep')
print(volumes)
>>>>volumes [(3, 1), (3, 2), (3, 3), (3, 4), (3, 5), (3, 6), (3, 7), (3, 8), (3, 9)]

volumes_with_tags from a paramak assumes each shape is just one volume

A method of detecting multi volumes should and getting the properties of each volume in the shape should be added to export_dagmc_h5m

shimwell commented 2 years ago

This is now solved but some tests should be added to keep it working

shimwell commented 1 year ago

tests added