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

Adding example simulations using regular and unstrucutred meshes #361

Merged
merged 18 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from 16 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
102 changes: 0 additions & 102 deletions examples/example_util_functions.py

This file was deleted.

20 changes: 0 additions & 20 deletions examples/spherical_tokamak_from_plasma_minimal.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from pathlib import Path

from example_util_functions import transport_particles_on_h5m_geometry

import paramak

my_reactor = paramak.spherical_tokamak_from_plasma(
Expand All @@ -21,21 +19,3 @@
rotation_angle=180,
)
my_reactor.save(f"spherical_tokamak_from_plasma_minimal.step")


# from cad_to_dagmc import CadToDagmc
# my_model = CadToDagmc()
# material_tags = [
# "mat1"
# ] * 6
# my_model.add_cadquery_object(cadquery_object=my_reactor, material_tags=material_tags)
# my_model.export_dagmc_h5m_file(min_mesh_size=3.0, max_mesh_size=20.0)

# h5m_filename = "dagmc.h5m"
# flux = transport_particles_on_h5m_geometry(
# h5m_filename=h5m_filename,
# material_tags=material_tags,
# nuclides=["H1"] * len(material_tags),
# cross_sections_xml="tests/cross_sections.xml",
# )
# assert flux > 0.0
16 changes: 0 additions & 16 deletions examples/spherical_tokamak_from_plasma_with_color.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,3 @@
file_path='spherical_tokamak_from_plasma_with_colors.png'
)

# from cad_to_dagmc import CadToDagmc
# my_model = CadToDagmc()
# material_tags = [
# "mat1"
# ] * 6
# my_model.add_cadquery_object(cadquery_object=my_reactor, material_tags=material_tags)
# my_model.export_dagmc_h5m_file(min_mesh_size=3.0, max_mesh_size=20.0)

# h5m_filename = "dagmc.h5m"
# flux = transport_particles_on_h5m_geometry(
# h5m_filename=h5m_filename,
# material_tags=material_tags,
# nuclides=["H1"] * len(material_tags),
# cross_sections_xml="tests/cross_sections.xml",
# )
# assert flux > 0.0
16 changes: 0 additions & 16 deletions examples/spherical_tokamak_from_plasma_with_divertor.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,3 @@
)
my_reactor.save("spherical_tokamak_from_plasma_with_divertor.step")
print("written spherical_tokamak_from_plasma_with_divertor.step")

# from cad_to_dagmc import CadToDagmc
# vis.show(my_reactor)
# my_model = CadToDagmc()
# material_tags = ["mat1"] * 21 # the two divertors split the 3 blanket layers into 9 and the magnets also splt the blanket.
# my_model.add_cadquery_object(cadquery_object=my_reactor, material_tags=material_tags)
# my_model.export_dagmc_h5m_file(min_mesh_size=3.0, max_mesh_size=20.0)

# h5m_filename = "dagmc.h5m"
# flux = transport_particles_on_h5m_geometry(
# h5m_filename=h5m_filename,
# material_tags=material_tags,
# nuclides=["H1"] * len(material_tags),
# cross_sections_xml="tests/cross_sections.xml",
# )
# assert flux > 0.0
16 changes: 0 additions & 16 deletions examples/spherical_tokamak_from_plasma_with_pf_magnets.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,3 @@
extra_cut_shapes=extra_cut_shapes,
)
my_reactor.save(f"spherical_tokamak_from_plasma_with_pf_magnets.step")


# from cad_to_dagmc import CadToDagmc
# my_model = CadToDagmc()
# material_tags = ["mat1"] * 5
# my_model.add_cadquery_object(cadquery_object=my_reactor, material_tags=material_tags)
# my_model.export_dagmc_h5m_file(min_mesh_size=3.0, max_mesh_size=20.0)

# h5m_filename = "dagmc.h5m"
# flux = transport_particles_on_h5m_geometry(
# h5m_filename=h5m_filename,
# material_tags=material_tags,
# nuclides=["H1"] * len(material_tags),
# cross_sections_xml="tests/cross_sections.xml",
# )
# assert flux > 0.0
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,3 @@
extra_cut_shapes=poloidal_field_coils,
)
my_reactor.save(f"spherical_tokamak_from_plasma_with_pf_magnets_and_divertor.step")


# from cad_to_dagmc import CadToDagmc
# my_model = CadToDagmc()
# material_tags = ["mat1"] * 5
# my_model.add_cadquery_object(cadquery_object=my_reactor, material_tags=material_tags)
# my_model.export_dagmc_h5m_file(min_mesh_size=3.0, max_mesh_size=20.0)

# h5m_filename = "dagmc.h5m"
# flux = transport_particles_on_h5m_geometry(
# h5m_filename=h5m_filename,
# material_tags=material_tags,
# nuclides=["H1"] * len(material_tags),
# cross_sections_xml="tests/cross_sections.xml",
# )
# assert flux > 0.0
16 changes: 0 additions & 16 deletions examples/spherical_tokamak_from_plasma_with_tf_magnets.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,3 @@
)

result2.save("spherical_tokamak_from_plasma_with_prin_tf_coils.step")

# from example_util_functions import transport_particles_on_h5m_geometry
# from cad_to_dagmc import CadToDagmc
# my_model = CadToDagmc()
# material_tags = ["mat1"] * 7
# my_model.add_cadquery_object(cadquery_object=result, material_tags=material_tags)
# my_model.export_dagmc_h5m_file(min_mesh_size=3.0, max_mesh_size=20.0)

# h5m_filename = "dagmc.h5m"
# flux = transport_particles_on_h5m_geometry(
# h5m_filename=h5m_filename,
# material_tags=material_tags,
# nuclides=["H1"] * len(material_tags),
# cross_sections_xml="tests/cross_sections.xml",
# )
# assert flux > 0.0
16 changes: 0 additions & 16 deletions examples/spherical_tokamak_minimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,3 @@
triangularity=-0.55,
)
my_reactor.save(f"spherical_tokamak_minimal.step")


# from cad_to_dagmc import CadToDagmc
# my_model = CadToDagmc()
# material_tags = ["mat1"] * 6
# my_model.add_cadquery_object(cadquery_object=my_reactor, material_tags=material_tags)
# my_model.export_dagmc_h5m_file(min_mesh_size=3.0, max_mesh_size=20.0)

# h5m_filename = "dagmc.h5m"
# flux = transport_particles_on_h5m_geometry(
# h5m_filename=h5m_filename,
# material_tags=material_tags,
# nuclides=["H1"] * len(material_tags),
# cross_sections_xml="tests/cross_sections.xml",
# )
# assert flux > 0.0
1 change: 1 addition & 0 deletions examples/tokamak_from_plasma_animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import cadquery_png_plugin.plugin
import numpy as np
import cadquery as cq
import os

original_radial_build=[
(paramak.LayerType.GAP, 40),
Expand Down
15 changes: 0 additions & 15 deletions examples/tokamak_from_plasma_minimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,3 @@
)
my_reactor.save(f"tokamak_minimal.step")
print(f"Saved as tokamak_minimal.step")

# from cad_to_dagmc import CadToDagmc
# my_model = CadToDagmc()
# material_tags = ["mat1"] * 6 # as inner and outer layers are one solid there are only 6 solids in model
# my_model.add_cadquery_object(cadquery_object=my_reactor, material_tags=material_tags)
# my_model.export_dagmc_h5m_file(min_mesh_size=3.0, max_mesh_size=20.0)

# h5m_filename = "dagmc.h5m"
# flux = transport_particles_on_h5m_geometry(
# h5m_filename=h5m_filename,
# material_tags=material_tags,
# nuclides=["H1"] * len(material_tags),
# cross_sections_xml="tests/cross_sections.xml",
# )
# assert flux > 0.0
15 changes: 0 additions & 15 deletions examples/tokamak_from_plasma_with_color.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,3 @@
},
file_path='tokamak_from_plasma_with_colors.png'
)

# from cad_to_dagmc import CadToDagmc
# my_model = CadToDagmc()
# material_tags = ["mat1"] * 6 # as inner and outer layers are one solid there are only 6 solids in model
# my_model.add_cadquery_object(cadquery_object=my_reactor, material_tags=material_tags)
# my_model.export_dagmc_h5m_file(min_mesh_size=3.0, max_mesh_size=20.0)

# h5m_filename = "dagmc.h5m"
# flux = transport_particles_on_h5m_geometry(
# h5m_filename=h5m_filename,
# material_tags=material_tags,
# nuclides=["H1"] * len(material_tags),
# cross_sections_xml="tests/cross_sections.xml",
# )
# assert flux > 0.0
15 changes: 0 additions & 15 deletions examples/tokamak_from_plasma_with_divertor.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,4 @@
)
my_reactor.save(f"tokamak_with_divertor.step")
print(f"Saved as tokamak_with_divertor.step")
# vis.show(my_reactor)

# from cad_to_dagmc import CadToDagmc
# my_model = CadToDagmc()
# material_tags = ["mat1"] * 6 # as inner and outer layers are one solid there are only 6 solids in model
# my_model.add_cadquery_object(cadquery_object=my_reactor, material_tags=material_tags)
# my_model.export_dagmc_h5m_file(min_mesh_size=3.0, max_mesh_size=20.0)

# h5m_filename = "dagmc.h5m"
# flux = transport_particles_on_h5m_geometry(
# h5m_filename=h5m_filename,
# material_tags=material_tags,
# nuclides=["H1"] * len(material_tags),
# cross_sections_xml="tests/cross_sections.xml",
# )
# assert flux > 0.0
Loading
Loading