-
Notifications
You must be signed in to change notification settings - Fork 18
Create specific turn tf classes #4152
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
Changes from all commits
b1cd311
103a406
cc81af6
7d49ee6
f9b5769
fdf5a09
e5d3d0a
db2b794
0b9a0a9
1283888
d1a31c3
c87417a
b4c4fa8
e40d901
936027f
cefa8f7
dfc83ea
d84fd92
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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -16,6 +16,7 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from process.core.solver.iteration_variables import set_scaled_iteration_variable | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from process.core.solver.objectives import objective_function | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from process.models.tfcoil.base import TFConductorModel | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from process.models.tfcoil.superconducting import SuperconductingTFTurnType | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if TYPE_CHECKING: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from process.core.model import DataStructure | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -296,7 +297,20 @@ def _call_models_once(self, xc: np.ndarray): | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Toroidal field coil superconductor model | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if data_structure.tfcoil_variables.i_tf_sup == TFConductorModel.SUPERCONDUCTING: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.models.sctfcoil.run() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SuperconductingTFTurnType( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| data_structure.superconducting_tf_coil_variables.i_tf_turn_type | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| == SuperconductingTFTurnType.CABLE_IN_CONDUIT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ): | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.models.cicc_sctfcoil.run() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| elif ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SuperconductingTFTurnType( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| data_structure.superconducting_tf_coil_variables.i_tf_turn_type | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| == SuperconductingTFTurnType.CROSS_CONDUCTOR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ): | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.models.croco_sctfcoil.run() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+300
to
+313
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if ( | |
| SuperconductingTFTurnType( | |
| data_structure.superconducting_tf_coil_variables.i_tf_turn_type | |
| ) | |
| == SuperconductingTFTurnType.CABLE_IN_CONDUIT | |
| ): | |
| self.models.cicc_sctfcoil.run() | |
| elif ( | |
| SuperconductingTFTurnType( | |
| data_structure.superconducting_tf_coil_variables.i_tf_turn_type | |
| ) | |
| == SuperconductingTFTurnType.CROSS_CONDUCTOR | |
| ): | |
| self.models.croco_sctfcoil.run() | |
| i_tf_turn_type = ( | |
| data_structure.superconducting_tf_coil_variables.i_tf_turn_type | |
| ) | |
| turn_type = SuperconductingTFTurnType(i_tf_turn_type) | |
| if turn_type == SuperconductingTFTurnType.CABLE_IN_CONDUIT: | |
| self.models.cicc_sctfcoil.run() | |
| elif turn_type == SuperconductingTFTurnType.CROSS_CONDUCTOR: | |
| self.models.croco_sctfcoil.run() | |
| else: | |
| raise ValueError( | |
| f"Unhandled superconducting TF turn type: {i_tf_turn_type!r}" | |
| ) |
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.
I dont know whether this should be organised differently in future eg
self.models.sctfcoil.cicc.run().this if check would then be moved into some sctfcoil object. Right know I'm not going to hold this up but before we add a future cable design we have to reoganise this. I'm not yet sure what that will look like.