-
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.
Merge pull request #100 from svalinn/oo_NWL
OO NWL
- Loading branch information
Showing
18 changed files
with
389 additions
and
451 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,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) / 'source_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=True, | ||
legacy_faceting=True, | ||
filename='nwl_geom', | ||
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,20 @@ | ||
import parastell.nwl_utils as nwl | ||
|
||
|
||
# Define simulation parameters | ||
dagmc_geom = 'nwl_geom.h5m' | ||
source_mesh = 'source_mesh.h5m' | ||
tor_ext = 90.0 | ||
ss_file = 'source_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' | ||
plas_eq = 'wout_vmec.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.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
|
||
initialized = False | ||
|
||
|
||
def init_cubit(): | ||
"""Initializes Coreform Cubit with the DAGMC plugin. | ||
""" | ||
|
Oops, something went wrong.