Skip to content

Commit

Permalink
use native meshing for example nwl script
Browse files Browse the repository at this point in the history
  • Loading branch information
Edgar-21 committed Nov 8, 2024
1 parent e330994 commit 53df299
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Examples/nwl_geom_example.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pathlib import Path
import parastell.parastell as ps
from parastell.cubit_io import tag_surface_legacy
from parastell.cubit_io import tag_surface_native

# Define directory to export all output files to
export_dir = ""
Expand Down Expand Up @@ -46,6 +46,6 @@
file.write(f"{tet}\n")

# Export DAGMC neutronics H5M file
stellarator.build_cubit_model(skip_imprint=True, legacy_faceting=True)
tag_surface_legacy(1, "vacuum")
stellarator.build_cubit_model(skip_imprint=True, legacy_faceting=False)
tag_surface_native(1, "vacuum")
stellarator.export_dagmc(filename="nwl_geom", export_dir=export_dir)
13 changes: 13 additions & 0 deletions parastell/cubit_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,19 @@ def tag_surface_legacy(surface_id, tag):
cubit.cmd(f'group "boundary:{tag}" add surf {surface_id}')


def tag_surface_native(surface_id, tag):
"""Applies a boundary condition to a surface in cubit following the
native coreform syntax
Arguments:
surface_id (int): Surface to tag
tag (str): boundary type
"""
cubit.cmd(f"create sideset {surface_id}")
cubit.cmd(f"sideset {surface_id} name 'boundary:{tag}'")
cubit.cmd(f"sideset {surface_id} add surface {surface_id}")


def export_dagmc_cubit_native(
anisotropic_ratio=100.0,
deviation_angle=5.0,
Expand Down

0 comments on commit 53df299

Please sign in to comment.