From 53df299b238dc8721637f9a0083ae299b6242ce4 Mon Sep 17 00:00:00 2001 From: Edgar Date: Fri, 8 Nov 2024 14:37:06 -0600 Subject: [PATCH] use native meshing for example nwl script --- Examples/nwl_geom_example.py | 6 +++--- parastell/cubit_io.py | 13 +++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Examples/nwl_geom_example.py b/Examples/nwl_geom_example.py index 0f9b50b..1ba8fdf 100644 --- a/Examples/nwl_geom_example.py +++ b/Examples/nwl_geom_example.py @@ -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 = "" @@ -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) diff --git a/parastell/cubit_io.py b/parastell/cubit_io.py index b0c191b..4a984ad 100644 --- a/parastell/cubit_io.py +++ b/parastell/cubit_io.py @@ -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,