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

Add function for adding boundary conditions in native cubit export #175

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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