-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e5e6ee8
commit 5e89fec
Showing
7 changed files
with
99 additions
and
257 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
from pathlib import Path | ||
|
||
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, 30.0, 60.0, 90.0] | ||
poloidal_angles = [0.0, 120.0, 240.0, 360.0] | ||
wall_s = 1.08 | ||
|
||
empty_radial_build_dict = {} | ||
# Construct in-vessel components | ||
stellarator.construct_invessel_build( | ||
toroidal_angles, | ||
poloidal_angles, | ||
wall_s, | ||
empty_radial_build_dict, | ||
split_chamber=False | ||
) | ||
# Export in-vessel component files | ||
stellarator.export_invessel_build( | ||
export_cad_to_dagmc=False, | ||
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 | ||
) | ||
|
||
strengths = stellarator.source_mesh.strengths | ||
|
||
filepath = Path(export_dir) / 'strengths.txt' | ||
|
||
file = open(filepath, 'w') | ||
for tet in strengths: | ||
file.write(f'{tet}\n') | ||
|
||
# Export DAGMC neutronics H5M file | ||
stellarator.export_dagmc( | ||
skip_imprint=False, | ||
legacy_faceting=True, | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import parastell.nwl_utils as nwl | ||
|
||
|
||
# Define simulation parameters | ||
dagmc_geom = 'first_wall.h5m' | ||
source_mesh = 'SourceMesh.h5m' | ||
tor_ext = 90.0 | ||
ss_file = 'strengths.txt' | ||
num_parts = 100000 | ||
|
||
nwl.nwl_transport(dagmc_geom, source_mesh, tor_ext, ss_file, num_parts) | ||
|
||
# Define first wall geometry and plotting parameters | ||
source_file = 'surface_source.h5' | ||
ss_file = 'strengths.txt' | ||
plas_eq = 'plas_eq.nc' | ||
tor_ext = 90.0 | ||
pol_ext = 360.0 | ||
wall_s = 1.08 | ||
|
||
nwl.nwl_plot(source_file, ss_file, plas_eq, tor_ext, pol_ext, wall_s) |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.