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 parastell tool, overhaul text wrapping, allow more generalized text in plot #11

Closed
wants to merge 7 commits into from
Closed
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
84 changes: 84 additions & 0 deletions ExampleRadialBuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
build:
BW:
composition:
HeT410P80: 0.2
MF82H: 0.8
thickness: 2
Coil Pack:
composition:
Cu: 0.1307
HTS TAPE: 0.0622
HeT410P80: 0.0288
SS316L: 0.7435
Solder: 0.0438
description: '[combines winding pack and coil case]'
thickness: 52.5
FW:
composition:
HeT410P80: 0.66
MF82H: 0.34
thickness: 3.8
FW_armor:
thickness: 0.2
HTS:
description: Composition and thickness vary
thickness: 8
LTS:
description: Composition and thickness vary
thickness: 8
Thermal Insulator (Gap):
composition:
Void: 1.0
thickness: 10
breeder:
description: Composition and thickness vary
thickness: 8
gap_1:
composition:
Void: 1.0
thickness: 8
gap_2:
composition:
Void: 1.0
thickness: 2
manifolds:
description: composition varies
thickness: 10
sol:
thickness: 8
vv_back_plate:
composition:
SS316L: 1.0
thickness: 2
vv_fill:
composition:
HeT410P80: 0.4
SS316L: 0.6
thickness: 6
vv_front_plate:
composition:
SS316L: 1.0
thickness: 2
colors:
- '#acc2d9'
- '#56ae57'
- '#b2996e'
- '#a8ff04'
- '#69d84f'
- '#894585'
- '#70b23f'
- '#d4ffff'
- '#65ab7c'
- '#952e8f'
- '#fcfc81'
- '#a5a391'
- '#388004'
- '#4c9085'
- '#5e9b8a'
max_characters: 39
max_thickness: 1000000.0
size:
- 10
- 4
title: Example Radial Build
unit: cm
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,13 @@
Tools for building, manipulating and representing radial build for fusion power systems

[Early vision](https://docs.google.com/presentation/d/1yDzG23BL8KTqxQCjatCVnmPRx0kgijyP6wGbssfKwiQ/edit#slide=id.p)

See examples folders for demonstrations of tools

## plot_radial_build.py
Main plotting functionality, can be called from command line via:

`python plot_radial_build.py ExampleRadialBuild.yml`

`plot_radial_build.py` will write both a png of a plot and a yml file which
can be used to recreate it.
44 changes: 0 additions & 44 deletions example.yaml

This file was deleted.

83 changes: 83 additions & 0 deletions examples/plot_parastell_build_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import numpy as np
import plot_radial_build

num_phi = 80
num_theta = 90

phi_list = np.linspace(0,90,num_phi)
theta_list = np.linspace(0,360,num_theta)
ones = np.ones((len(phi_list),len(theta_list)))

build = {
'phi_list': phi_list,
'theta_list': theta_list,
'wall_s': 1.2,
'radial_build': {
'fw': {
'thickness_matrix': ones*4, #cell 3
'h5m_tag': 'FNSFFW'
},
'breeder': {
'thickness_matrix': ones*50, #cell 4
'h5m_tag':'FNSFDCLL'
},
'BW': {
'thickness_matrix': ones*2, #cell 5
'h5m_tag': 'FNSFBW'
},
'manifolds': {
'thickness_matrix': ones*6, #cell 6
'h5m_tag': 'FNSFHeManifolds'
},
'HTS': {
'thickness_matrix': ones*20, #cell 7
'h5m_tag': 'FNSFIBSR'
},
'Gap_1': {
'thickness_matrix': ones*1, #cell 8
'h5m_tag': 'Vacuum'
},
'vvfrontplate': {
'thickness_matrix': ones*2, #cell 9
'h5m_tag': 'SS316L'
},
'VVFill': {
'thickness_matrix': ones*6, #cell 10
'h5m_tag': 'VVFill'
},
'VVBackPlate': {
'thickness_matrix': ones*2, #cell 11
'h5m_tag': 'SS316L'
},
'Gap_2':{
'thickness_matrix': ones*2, #cell 12
'h5m_tag': 'AirSTP'
},
'LTS':{
'thickness_matrix': ones*23, #cell 13
'h5m_tag': 'LTS'
},
'Thermal_Insulator':{
'thickness_matrix': ones*10, #cell 14
'h5m_tag': 'AirSTP'
},
'coilfrontplate':{
'thickness_matrix': ones*2, #cell 15
'h5m_tag': 'coils'
},
'coils':{
'thickness_matrix': ones*50.5, #cell 16
'h5m_tag':'coils'
}
}
}

radial_build = plot_radial_build.radial_build.from_parastell_build(
build, "Example Parastell Build", phi_list[-1], theta_list[-1])


# create the radial build plot png
radial_build.plot_radial_build()

# save the plot configuration as a yml file
radial_build.write_yml()
58 changes: 58 additions & 0 deletions examples/plot_radial_build_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import plot_radial_build

build_dict = {
# here is a layer with no optional data incluede
"sol": {},

# here is a layer where only thickness is included
"FW_armor": {"thickness": 0.2},

"FW": {'thickness': 3.8, 'composition': {"MF82H": 0.34, "HeT410P80": 0.66}},

# here is a layer where only a description is included
"breeder": {'description': "Composition and thickness vary"},

'BW': {'thickness': 2, 'composition': {"MF82H": 0.80, "HeT410P80": 0.20}},

# here is a layer where thickness and description are included
'manifolds': {'thickness': 10, "description": "composition varies"},

'HTS': {'description': "Composition and thickness vary"},

# here is a layer where only composition is inclued
'gap_1': {'composition': {"Void": 1.0}},

'vv_front_plate': {'thickness': 2, 'composition': {"SS316L": 1.0}},

'vv_fill': {'thickness': 6, 'composition': {"SS316L": 0.6,
"HeT410P80": 0.4}},

'vv_back_plate': {'thickness': 2, 'composition': {"SS316L": 1.0}},

'gap_2': {'thickness': 2, 'composition': {"Void": 1.0}},

'LTS': {'description': "Composition and thickness vary"},

'Thermal Insulator (Gap)': {'thickness': 10,
'composition': {"Void": 1.0}},

# here is a layer with all optional data included
'Coil Pack': {'thickness': 52.5, 'composition': {"SS316L": 0.7435,
"HTS TAPE": 0.0622,
"Cu": 0.1307,
"Solder": 0.0438,
"HeT410P80": 0.0288},
'description': '[combines winding pack and coil case]'}
}

# note that since this is quite a detailed radial build, the default figure
# size was insufficient
radial_build = plot_radial_build.radial_build(build_dict, 'Example Radial Build',
max_characters=39, size=(10, 4))

# create the radial build plot png
radial_build.plot_radial_build()

# save the plot configuration as a yml file
radial_build.write_yml()

Loading