-
Notifications
You must be signed in to change notification settings - Fork 18
Add blkt type enum
#4212
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
base: main
Are you sure you want to change the base?
Add blkt type enum
#4212
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,6 +58,7 @@ | |
| ) | ||
| from process.data_structure.tfcoil_variables import init_tfcoil_variables | ||
| from process.data_structure.times_variables import init_times_variables | ||
| from process.models.blankets.blanket_library import BlktModelTypes | ||
|
||
| from process.models.stellarator.initialization import st_init | ||
| from process.models.superconductors import ( | ||
| SuperconductorMaterial, | ||
|
|
@@ -1178,7 +1179,7 @@ def check_process(inputs, data): # noqa: ARG001 | |
| # CCFE HCPB Model | ||
|
|
||
| if data_structure.stellarator_variables.istell == 0 and ( | ||
| data_structure.fwbs_variables.i_blanket_type == 1 | ||
| data_structure.fwbs_variables.i_blanket_type == BlktModelTypes.CCFE_HCPB | ||
| ): | ||
| fsum = ( | ||
| data_structure.fwbs_variables.breeder_multiplier | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| from process import data_structure | ||
| from process.core.log import logging_model_handler | ||
| from process.models.blankets.blanket_library import BlktModelTypes | ||
|
||
| from process.models.tfcoil.base import TFConductorModel | ||
| from process.models.tfcoil.superconducting import ( | ||
| SuperconductingTFTurnType, | ||
|
|
@@ -122,11 +123,11 @@ def write(models, _outfile): | |
| # First wall geometry | ||
| models.fw.output() | ||
|
|
||
| if data_structure.fwbs_variables.i_blanket_type == 1: | ||
| if data_structure.fwbs_variables.i_blanket_type == BlktModelTypes.CCFE_HCPB: | ||
| # CCFE HCPB model | ||
| models.ccfe_hcpb.output() | ||
|
|
||
| elif data_structure.fwbs_variables.i_blanket_type == 5: | ||
| elif data_structure.fwbs_variables.i_blanket_type == BlktModelTypes.DCLL: | ||
| # DCLL model | ||
| models.dcll.output() | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,6 +40,13 @@ | |
| # FCI Flow Channel Insert | ||
|
|
||
|
|
||
| class BlktModelTypes(IntEnum): | ||
| """Enum for blanket model types. `i_blanket_type`""" | ||
|
|
||
| CCFE_HCPB = 1 | ||
| DCLL = 5 | ||
|
Comment on lines
+43
to
+47
|
||
|
|
||
|
|
||
| class FWBlktCoolantLoopTypes(IntEnum): | ||
| """Enumeration for first wall and blanket coolant loop types. `i_fw_blkt_shared_coolant`.""" | ||
|
|
||
|
|
@@ -884,7 +891,8 @@ def set_blanket_module_geometry(self): | |
| Error | ||
| If the poloidal segment length is less than three times the minimum liquid breeder pipe width. | ||
| """ | ||
| if fwbs_variables.i_blanket_type == 5: | ||
| i_blanket_type = BlktModelTypes(fwbs_variables.i_blanket_type) | ||
| if i_blanket_type == BlktModelTypes.DCLL: | ||
| # Unless DCLL then we will use BZ | ||
| blanket_library.len_blkt_inboard_coolant_channel_radial = ( | ||
| build_variables.blbuith | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -26,6 +26,7 @@ | |||||||||||||||||||||||||||||||
| tfcoil_variables, | ||||||||||||||||||||||||||||||||
| times_variables, | ||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||
| from process.models.blankets.blanket_library import BlktModelTypes | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
|
Comment on lines
+29
to
30
|
||||||||||||||||||||||||||||||||
| from process.models.blankets.blanket_library import BlktModelTypes | |
| def _get_blkt_model_types(): | |
| from process.models.blankets.blanket_library import BlktModelTypes | |
| return BlktModelTypes | |
| class _BlktModelTypesProxy: | |
| def __getattr__(self, name): | |
| return getattr(_get_blkt_model_types(), name) | |
| BlktModelTypes = _BlktModelTypesProxy() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Importing
BlktModelTypesfromprocess.models.blankets.blanket_librarycouples the core caller to the full blanket library import graph. Consider relocating the enum to a lightweight module (or importing locally) so selecting a blanket model doesn't require importingblanket_library.pyat module import time.