forked from svalinn/parastell
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request svalinn#180 from svalinn/os-dagmc-faceting
- Loading branch information
Showing
12 changed files
with
222 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import numpy as np | ||
|
||
import parastell.parastell as ps | ||
|
||
|
||
# Define directory to export all output files to | ||
export_dir = "" | ||
# Define plasma equilibrium VMEC file | ||
vmec_file = "wout_vmec.nc" | ||
|
||
# Instantiate ParaStell build | ||
stellarator = ps.Stellarator(vmec_file) | ||
|
||
# Define build parameters for in-vessel components | ||
toroidal_angles = [0.0, 11.25, 22.5, 33.75, 45.0, 56.25, 67.5, 78.75, 90.0] | ||
poloidal_angles = [0.0, 45.0, 90.0, 135.0, 180.0, 225.0, 270.0, 315.0, 360.0] | ||
wall_s = 1.08 | ||
|
||
# Define a matrix of uniform unit thickness | ||
uniform_unit_thickness = np.ones((len(toroidal_angles), len(poloidal_angles))) | ||
|
||
radial_build_dict = { | ||
"first_wall": {"thickness_matrix": uniform_unit_thickness * 5}, | ||
"breeder": { | ||
"thickness_matrix": ( | ||
[ | ||
[75.0, 75.0, 75.0, 25.0, 25.0, 25.0, 75.0, 75.0, 75.0], | ||
[75.0, 75.0, 75.0, 25.0, 25.0, 75.0, 75.0, 75.0, 75.0], | ||
[75.0, 75.0, 25.0, 25.0, 75.0, 75.0, 75.0, 75.0, 75.0], | ||
[65.0, 25.0, 25.0, 65.0, 75.0, 75.0, 75.0, 75.0, 65.0], | ||
[45.0, 45.0, 75.0, 75.0, 75.0, 75.0, 75.0, 45.0, 45.0], | ||
[65.0, 75.0, 75.0, 75.0, 75.0, 65.0, 25.0, 25.0, 65.0], | ||
[75.0, 75.0, 75.0, 75.0, 75.0, 25.0, 25.0, 75.0, 75.0], | ||
[75.0, 75.0, 75.0, 75.0, 25.0, 25.0, 75.0, 75.0, 75.0], | ||
[75.0, 75.0, 75.0, 25.0, 25.0, 25.0, 75.0, 75.0, 75.0], | ||
] | ||
) | ||
}, | ||
"back_wall": {"thickness_matrix": uniform_unit_thickness * 5}, | ||
"shield": {"thickness_matrix": uniform_unit_thickness * 50}, | ||
"vacuum_vessel": { | ||
"thickness_matrix": uniform_unit_thickness * 10, | ||
"mat_tag": "vac_vessel", | ||
}, | ||
} | ||
# Construct in-vessel components | ||
stellarator.construct_invessel_build( | ||
toroidal_angles, poloidal_angles, wall_s, radial_build_dict | ||
) | ||
# Export in-vessel component files | ||
stellarator.export_invessel_build(export_dir=export_dir) | ||
|
||
# Define build parameters for magnet coils | ||
coils_file = "coils.example" | ||
width = 40.0 | ||
thickness = 50.0 | ||
toroidal_extent = 90.0 | ||
# Construct magnets | ||
stellarator.construct_magnets( | ||
coils_file, width, thickness, toroidal_extent, sample_mod=6 | ||
) | ||
# Export magnet files | ||
stellarator.export_magnets( | ||
step_filename="magnets", | ||
export_mesh=True, | ||
mesh_filename="magnet_mesh", | ||
export_dir=export_dir, | ||
) | ||
|
||
# Define source mesh parameters | ||
mesh_size = (11, 81, 61) | ||
toroidal_extent = 90.0 | ||
# Construct source | ||
stellarator.construct_source_mesh(mesh_size, toroidal_extent) | ||
# Export source file | ||
stellarator.export_source_mesh(filename="source_mesh", export_dir=export_dir) | ||
|
||
# Build Cubit model of Parastell Components | ||
stellarator.build_cad_to_dagmc_model() | ||
|
||
# Export DAGMC neutronics H5M file | ||
stellarator.export_cad_to_dagmc(filename="dagmc", export_dir=export_dir) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.