fiqus 2025.2.0__py3-none-any.whl → 2025.11.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. fiqus/MainFiQuS.py +24 -28
  2. fiqus/data/DataConductor.py +350 -301
  3. fiqus/data/DataFiQuS.py +42 -115
  4. fiqus/data/DataFiQuSCCT.py +150 -150
  5. fiqus/data/DataFiQuSConductor.py +97 -84
  6. fiqus/data/DataFiQuSConductorAC_Strand.py +701 -565
  7. fiqus/data/DataModelCommon.py +439 -0
  8. fiqus/data/DataMultipole.py +0 -13
  9. fiqus/data/DataRoxieParser.py +7 -0
  10. fiqus/data/DataWindingsCCT.py +37 -37
  11. fiqus/data/RegionsModelFiQuS.py +61 -104
  12. fiqus/geom_generators/GeometryCCT.py +904 -905
  13. fiqus/geom_generators/GeometryConductorAC_Strand.py +1863 -1391
  14. fiqus/geom_generators/GeometryMultipole.py +5 -4
  15. fiqus/geom_generators/GeometryPancake3D.py +1 -1
  16. fiqus/getdp_runners/RunGetdpCCT.py +13 -4
  17. fiqus/getdp_runners/RunGetdpConductorAC_Strand.py +341 -201
  18. fiqus/getdp_runners/RunGetdpPancake3D.py +2 -2
  19. fiqus/mains/MainConductorAC_Strand.py +141 -133
  20. fiqus/mains/MainMultipole.py +6 -5
  21. fiqus/mains/MainPancake3D.py +3 -4
  22. fiqus/mesh_generators/MeshCCT.py +209 -209
  23. fiqus/mesh_generators/MeshConductorAC_Strand.py +709 -656
  24. fiqus/mesh_generators/MeshMultipole.py +43 -46
  25. fiqus/parsers/ParserDAT.py +16 -16
  26. fiqus/parsers/ParserGetDPOnSection.py +212 -212
  27. fiqus/parsers/ParserGetDPTimeTable.py +134 -134
  28. fiqus/parsers/ParserMSH.py +53 -53
  29. fiqus/parsers/ParserPOS.py +214 -214
  30. fiqus/parsers/ParserRES.py +142 -142
  31. fiqus/plotters/PlotPythonCCT.py +133 -133
  32. fiqus/plotters/PlotPythonConductorAC.py +1079 -855
  33. fiqus/plotters/PlotPythonMultipole.py +18 -18
  34. fiqus/post_processors/PostProcessCCT.py +444 -440
  35. fiqus/post_processors/PostProcessConductorAC.py +997 -49
  36. fiqus/post_processors/PostProcessMultipole.py +19 -19
  37. fiqus/pre_processors/PreProcessCCT.py +175 -175
  38. fiqus/pro_material_functions/ironBHcurves.pro +246 -246
  39. fiqus/pro_templates/combined/CCT_template.pro +275 -274
  40. fiqus/pro_templates/combined/ConductorAC_template.pro +1474 -1025
  41. fiqus/pro_templates/combined/Multipole_template.pro +5 -5
  42. fiqus/utils/Utils.py +12 -7
  43. {fiqus-2025.2.0.dist-info → fiqus-2025.11.0.dist-info}/METADATA +65 -63
  44. fiqus-2025.11.0.dist-info/RECORD +86 -0
  45. {fiqus-2025.2.0.dist-info → fiqus-2025.11.0.dist-info}/WHEEL +1 -1
  46. tests/test_geometry_generators.py +4 -0
  47. tests/test_mesh_generators.py +5 -0
  48. tests/test_solvers.py +41 -4
  49. tests/utils/fiqus_test_classes.py +15 -6
  50. tests/utils/generate_reference_files_ConductorAC.py +57 -57
  51. tests/utils/helpers.py +97 -97
  52. fiqus-2025.2.0.dist-info/RECORD +0 -85
  53. {fiqus-2025.2.0.dist-info → fiqus-2025.11.0.dist-info}/LICENSE.txt +0 -0
  54. {fiqus-2025.2.0.dist-info → fiqus-2025.11.0.dist-info}/top_level.txt +0 -0
@@ -1,301 +1,350 @@
1
- from pydantic import BaseModel, Field
2
- from typing import Union, Literal, Optional
3
-
4
- # ------------------- Jc fits ---------------------------#
5
- class ConstantJc(BaseModel):
6
- """
7
- Level 3: Class for setting constant Jc
8
- """
9
-
10
- type: Literal["Constant Jc"]
11
- Jc_constant: Optional[float] = None # [A/m^2]
12
-
13
-
14
- class Ic_A_NbTi(BaseModel):
15
- """
16
- Level 3: Class for setting IcNbTi fit
17
- """
18
-
19
- type: Literal["Ic_A_NbTi"]
20
- Jc_5T_4_2K: Optional[float] = None # [A/m^2]
21
-
22
-
23
- class Bottura(BaseModel):
24
- """
25
- Level 3: Class for setting Bottura fit
26
- """
27
-
28
- type: Literal["Bottura"]
29
- Tc0_Bottura: Optional[float] = None # [K]
30
- Bc20_Bottura: Optional[float] = None # [T]
31
- Jc_ref_Bottura: Optional[float] = None # [A/m^2]
32
- C0_Bottura: Optional[float] = None # [-]
33
- alpha_Bottura: Optional[float] = None # [-]
34
- beta_Bottura: Optional[float] = None # [-]
35
- gamma_Bottura: Optional[float] = None # [-]
36
-
37
-
38
- class CUDI1(BaseModel):
39
- """
40
- Level 3: Class for Nb-Ti fit based on "Fit 1" in CUDI manual
41
- """
42
-
43
- type: Literal["CUDI1"]
44
- Tc0_CUDI1: Optional[float] = None # [K]
45
- Bc20_CUDI1: Optional[float] = None # [T]
46
- C1_CUDI1: Optional[float] = None # [A]
47
- C2_CUDI1: Optional[float] = None # [A/T]
48
-
49
-
50
- class CUDI3(BaseModel):
51
- """
52
- Level 3: Class for Nb-Ti fit based on "Fit 3" in CUDI manual
53
- """
54
-
55
- type: Literal["CUDI3"]
56
- Tc0_CUDI3: Optional[float] = None # [K]
57
- Bc20_CUDI3: Optional[float] = None # [T]
58
- c1_CUDI3: Optional[float] = None # [-]
59
- c2_CUDI3: Optional[float] = None # [-]
60
- c3_CUDI3: Optional[float] = None # [-]
61
- c4_CUDI3: Optional[float] = None # [-]
62
- c5_CUDI3: Optional[float] = None # [-]
63
- c6_CUDI3: Optional[float] = None # [-]
64
-
65
-
66
- class Summers(BaseModel):
67
- """
68
- Level 3: Class for cable Summer's Nb3Sn fit
69
- """
70
-
71
- type: Literal["Summers"]
72
- Tc0_Summers: Optional[float] = None # [K]
73
- Bc20_Summers: Optional[float] = None # [T]
74
- Jc0_Summers: Optional[float] = None # [A*T^0.5/m^2]
75
-
76
-
77
- class Bordini(BaseModel):
78
- """
79
- Level 3: Class for cable Bordini's Nb3Sn fit
80
- """
81
-
82
- type: Literal["Bordini"]
83
- Tc0_Bordini: Optional[float] = None # [K]
84
- Bc20_Bordini: Optional[float] = None # [T]
85
- C0_Bordini: Optional[float] = None # [A*T/m^2]
86
- alpha_Bordini: Optional[float] = None # [-]
87
-
88
-
89
- class BSCCO_2212_LBNL(BaseModel):
90
- """
91
- Level 3: Class for cable Bi-2212 fit developed in LBNL
92
- """
93
-
94
- # only ad-hoc fit [T. Shen, D. Davis, E. Ravaioli with LBNL, Berkeley, CA]
95
- type: Literal["BSCCO_2212_LBNL"]
96
- f_scaling_Jc_BSCCO2212: Optional[float] = None # [-] used for the ad-hoc fit
97
-
98
-
99
- # ------------------- Cable types ---------------------------#
100
- class Mono(BaseModel):
101
- """
102
- Mono cable type: This is basically type of cable consisting of one strand - not really a cable
103
- """
104
-
105
- type: Literal["Mono"]
106
- bare_cable_width: Optional[float] = None
107
- bare_cable_height_low: Optional[float] = None
108
- bare_cable_height_high: Optional[float] = None
109
- bare_cable_height_mean: Optional[float] = None
110
- th_insulation_along_width: Optional[float] = None
111
- th_insulation_along_height: Optional[float] = None
112
- # Fractions given with respect to the insulated conductor
113
- f_superconductor: Optional[float] = None
114
- f_stabilizer: Optional[float] = None # (related to CuFraction in ProteCCT)
115
- f_insulation: Optional[float] = None
116
- f_inner_voids: Optional[float] = None
117
- f_outer_voids: Optional[float] = None
118
- # Available materials depend on the component and on the selected program
119
- material_insulation: Optional[str] = None
120
- material_inner_voids: Optional[str] = None
121
- material_outer_voids: Optional[str] = None
122
-
123
-
124
- class Rutherford(BaseModel):
125
- """
126
- Rutherford cable type: for example LHC MB magnet cable
127
- """
128
-
129
- type: Literal["Rutherford"]
130
- n_strands: Optional[int] = None
131
- n_strand_layers: Optional[int] = None
132
- n_strands_per_layers: Optional[int] = None
133
- bare_cable_width: Optional[float] = None
134
- bare_cable_height_low: Optional[float] = None
135
- bare_cable_height_high: Optional[float] = None
136
- bare_cable_height_mean: Optional[float] = None
137
- th_insulation_along_width: Optional[float] = None
138
- th_insulation_along_height: Optional[float] = None
139
- width_core: Optional[float] = None
140
- height_core: Optional[float] = None
141
- strand_twist_pitch: Optional[float] = None
142
- strand_twist_pitch_angle: Optional[float] = None
143
- Rc: Optional[float] = None
144
- Ra: Optional[float] = None
145
- # Fractions given with respect to the insulated conductor
146
- f_superconductor: Optional[float] = None
147
- f_stabilizer: Optional[float] = None # (related to CuFraction in ProteCCT)
148
- f_insulation: Optional[float] = None
149
- f_inner_voids: Optional[float] = None
150
- f_outer_voids: Optional[float] = None
151
- f_core: Optional[float] = None
152
- # Available materials depend on the component and on the selected program
153
- material_insulation: Optional[str] = None
154
- material_inner_voids: Optional[str] = None
155
- material_outer_voids: Optional[str] = None
156
- material_core: Optional[str] = None
157
-
158
-
159
- class Ribbon(BaseModel):
160
- """
161
- Mono cable type: This is basically type of cable consisting of one strand - not really a cable
162
- """
163
-
164
- type: Literal["Ribbon"]
165
- n_strands: Optional[int] = (
166
- None # This defines the number of "strands" in the ribbon cable, which are physically glued but electrically in series
167
- )
168
- bare_cable_width: Optional[float] = None
169
- bare_cable_height_low: Optional[float] = None
170
- bare_cable_height_high: Optional[float] = None
171
- bare_cable_height_mean: Optional[float] = None
172
- th_insulation_along_width: Optional[float] = (
173
- None # This defines the thickness of the insulation around each strand (DIFFERENT FROM ROXIE CADATA FILE)
174
- )
175
- th_insulation_along_height: Optional[float] = (
176
- None # This defines the thickness of the insulation around each strand (DIFFERENT FROM ROXIE CADATA FILE)
177
- )
178
- # Fractions given with respect to the insulated conductor
179
- f_superconductor: Optional[float] = None
180
- f_stabilizer: Optional[float] = None # (related to CuFraction in ProteCCT)
181
- f_insulation: Optional[float] = None
182
- f_inner_voids: Optional[float] = None
183
- f_outer_voids: Optional[float] = None
184
- f_core: Optional[float] = None
185
- # Available materials depend on the component and on the selected program
186
- material_insulation: Optional[str] = None
187
- material_inner_voids: Optional[str] = None
188
- material_outer_voids: Optional[str] = None
189
- material_core: Optional[str] = None
190
-
191
-
192
- # ------------------- Conductors ---------------------------#
193
-
194
- # class MaterialSuperconductor(BaseModel):
195
- # """
196
- # Level 3: Class for strand superconductor material parameters
197
- # """
198
- # material: Optional[str] = Field(default=None, description="Material of the superconductor. E.g. NbTi, Nb3Sn, etc.")
199
- # n_value: Optional[float] = Field(default=None, description="n value of the superconductor (for power law fit).")
200
- # ec: Optional[float] = Field(default=None, description="Critical electric field of the superconductor.")
201
- # Cv_material: Optional[Union[str, float]] = Field(default=None, description="Material function for specific heat of the superconductor.")
202
-
203
- # class MaterialStabilizer(BaseModel):
204
- # """
205
- # Level 3: Class for strand stabilizer material parameters
206
- # """
207
-
208
- # rho_material: Optional[Union[str, float]] = Field(default=None, description="Material function for resistivity of the stabilizer. Constant resistivity can be given as float.")
209
- # RRR: Optional[float] = Field(default=None, description="Residual resistivity ratio of the stabilizer.")
210
- # T_ref_RRR_high: Optional[float] = Field(default=None, description="Upper reference temperature for RRR measurements.")
211
- # T_ref_RRR_low: Optional[float] = Field(default=None, description="Lower reference temperature for RRR measurements.")
212
- # k_material: Optional[Union[str, float]] = Field(default=None, description="Thermal conductivity of the stabilizer.")
213
- # Cv_material: Optional[Union[str, float]] = Field(default=None, description="Material function for specific heat of the stabilizer.")
214
-
215
-
216
- class Round(BaseModel):
217
- """
218
- Level 2: Class for strand parameters
219
- """
220
-
221
- type: Literal["Round"]
222
- fil_twist_pitch: Optional[float] = None # Strand twist pitch
223
- diameter: Optional[float] = None # ds_inGroup (LEDET), DConductor (BBQ), DStrand (ProteCCT)
224
- diameter_core: Optional[float] = None # dcore_inGroup (LEDET)
225
- diameter_filamentary: Optional[float] = None # dfilamentary_inGroup (LEDET)
226
- filament_diameter: Optional[float] = None # df_inGroup (LEDET)
227
- number_of_filaments: Optional[int] = None # nf_inGroup (LEDET)
228
- f_Rho_effective: Optional[float] = None
229
- Cu_noCu_in_strand: Optional[float] = None
230
-
231
- # -- Superconductor parameters -- #
232
- material_superconductor: Optional[str] = Field(default=None, description="Material of the superconductor. E.g. Nb-Ti, Nb3Sn, etc.")
233
- n_value_superconductor: Optional[float] = Field(default=None, description="n value of the superconductor (for power law fit).")
234
- ec_superconductor: Optional[float] = Field(default=None, description="Critical electric field of the superconductor.")
235
- k_material_superconductor: Optional[Union[str, float]] = Field(default=None, description="Thermal conductivity of the superconductor.")
236
- Cv_material_superconductor: Optional[Union[str, float]] = Field(default=None, description="Material function for specific heat of the superconductor.")
237
- # -- Stabilizer parameters -- #
238
- material_stabilizer: Optional[str] = Field(default=None, description="Material of the stabilizer.")
239
- rho_material_stabilizer: Optional[Union[str, float]] = Field(default=None, description="Material function for resistivity of the stabilizer. Constant resistivity can be given as float.")
240
- RRR: Optional[float] = Field(default=None, description="Residual resistivity ratio of the stabilizer.")
241
- T_ref_RRR_high: Optional[float] = Field(default=None, description="Upper reference temperature for RRR measurements.")
242
- T_ref_RRR_low: Optional[float] = Field(default=None, description="Lower reference temperature for RRR measurements.")
243
- k_material_stabilizer: Optional[Union[str, float]] = Field(default=None, description="Thermal conductivity of the stabilizer.")
244
- Cv_material_stabilizer: Optional[Union[str, float]] = Field(default=None, description="Material function for specific heat of the stabilizer.")
245
-
246
- # superconductor: MaterialSuperconductor = MaterialSuperconductor()
247
- # stabilizer: MaterialStabilizer = MaterialStabilizer()
248
-
249
-
250
- class Rectangular(BaseModel):
251
- """
252
- Level 2: Class for strand parameters
253
- """
254
-
255
- type: Literal["Rectangular"]
256
- bare_width: Optional[float] = None
257
- bare_height: Optional[float] = None
258
- Cu_noCu_in_strand: Optional[float] = None
259
- filament_diameter: Optional[float] = None # df_inGroup (LEDET)
260
- f_Rho_effective: Optional[float] = None
261
- fil_twist_pitch: Optional[float] = None
262
- bare_corner_radius: Optional[float] = None
263
-
264
- # -- Superconductor parameters -- #
265
- material_superconductor: Optional[str] = Field(default=None, description="Material of the superconductor. E.g. NbTi, Nb3Sn, etc.")
266
- n_value_superconductor: Optional[float] = Field(default=None, description="n value of the superconductor (for power law fit).")
267
- ec_superconductor: Optional[float] = Field(default=None, description="Critical electric field of the superconductor.")
268
- k_material_superconductor: Optional[Union[str, float]] = Field(default=None, description="Thermal conductivity of the superconductor.")
269
- Cv_material_superconductor: Optional[Union[str, float]] = Field(default=None, description="Material function for specific heat of the superconductor.")
270
- # -- Stabilizer parameters -- #
271
- material_stabilizer: Optional[str] = Field(default=None, description="Material of the stabilizer.")
272
- rho_material_stabilizer: Optional[Union[str, float]] = Field(default=None, description="Material function for resistivity of the stabilizer. Constant resistivity can be given as float.")
273
- RRR: Optional[float] = Field(default=None, description="Residual resistivity ratio of the stabilizer.")
274
- T_ref_RRR_high: Optional[float] = Field(default=None, description="Upper reference temperature for RRR measurements.")
275
- T_ref_RRR_low: Optional[float] = Field(default=None, description="Lower reference temperature for RRR measurements.")
276
- k_material_stabilizer: Optional[Union[str, float]] = Field(default=None, description="Thermal conductivity of the stabilizer.")
277
- Cv_material_stabilizer: Optional[Union[str, float]] = Field(default=None, description="Material function for specific heat of the stabilizer.")
278
-
279
- # superconductor: MaterialSuperconductor = MaterialSuperconductor()
280
- # stabilizer: MaterialStabilizer = MaterialStabilizer()
281
-
282
-
283
-
284
- # ------------------- Conductors ---------------------------#
285
-
286
-
287
- class Conductor(BaseModel):
288
- """
289
- Level 1: Class for conductor parameters
290
- """
291
-
292
- version: Optional[str] = None
293
- case: Optional[str] = None
294
- state: Optional[str] = None
295
- cable: Union[Rutherford, Mono, Ribbon] = {
296
- "type": "Rutherford"
297
- } # TODO: Busbar, Rope, Roebel, CORC, TSTC, CICC
298
- strand: Union[Round, Rectangular] = {"type": "Round"} # TODO: Tape, WIC
299
- Jc_fit: Union[ConstantJc, Bottura, CUDI1, CUDI3, Summers, Bordini, BSCCO_2212_LBNL, Ic_A_NbTi] = {
300
- "type": "CUDI1"
301
- } # TODO: CUDI other numbers? , Roxie?
1
+ from pydantic import BaseModel, Field
2
+ from typing import Union, Literal, Optional, List
3
+
4
+ # ------------------- Jc fits ---------------------------#
5
+ class ConstantJc(BaseModel):
6
+ """
7
+ Level 3: Class for setting constant Jc
8
+ """
9
+
10
+ type: Literal["Constant Jc"]
11
+ Jc_constant: Optional[float] = None # [A/m^2]
12
+
13
+
14
+ class Ic_A_NbTi(BaseModel):
15
+ """
16
+ Level 3: Class for setting IcNbTi fit
17
+ """
18
+
19
+ type: Literal["Ic_A_NbTi"]
20
+ Jc_5T_4_2K: Optional[float] = None # [A/m^2]
21
+
22
+
23
+ class Bottura(BaseModel):
24
+ """
25
+ Level 3: Class for setting Bottura fit
26
+ """
27
+
28
+ type: Literal["Bottura"]
29
+ Tc0_Bottura: Optional[float] = None # [K]
30
+ Bc20_Bottura: Optional[float] = None # [T]
31
+ Jc_ref_Bottura: Optional[float] = None # [A/m^2]
32
+ C0_Bottura: Optional[float] = None # [-]
33
+ alpha_Bottura: Optional[float] = None # [-]
34
+ beta_Bottura: Optional[float] = None # [-]
35
+ gamma_Bottura: Optional[float] = None # [-]
36
+
37
+
38
+ class CUDI1(BaseModel):
39
+ """
40
+ Level 3: Class for Nb-Ti fit based on "Fit 1" in CUDI manual
41
+ """
42
+
43
+ type: Literal["CUDI1"]
44
+ Tc0_CUDI1: Optional[float] = None # [K]
45
+ Bc20_CUDI1: Optional[float] = None # [T]
46
+ C1_CUDI1: Optional[float] = None # [A]
47
+ C2_CUDI1: Optional[float] = None # [A/T]
48
+
49
+
50
+ class CUDI3(BaseModel):
51
+ """
52
+ Level 3: Class for Nb-Ti fit based on "Fit 3" in CUDI manual
53
+ """
54
+
55
+ type: Literal["CUDI3"]
56
+ Tc0_CUDI3: Optional[float] = None # [K]
57
+ Bc20_CUDI3: Optional[float] = None # [T]
58
+ c1_CUDI3: Optional[float] = None # [-]
59
+ c2_CUDI3: Optional[float] = None # [-]
60
+ c3_CUDI3: Optional[float] = None # [-]
61
+ c4_CUDI3: Optional[float] = None # [-]
62
+ c5_CUDI3: Optional[float] = None # [-]
63
+ c6_CUDI3: Optional[float] = None # [-]
64
+
65
+
66
+ class Summers(BaseModel):
67
+ """
68
+ Level 3: Class for cable Summer's Nb3Sn fit
69
+ """
70
+
71
+ type: Literal["Summers"]
72
+ Tc0_Summers: Optional[float] = None # [K]
73
+ Bc20_Summers: Optional[float] = None # [T]
74
+ Jc0_Summers: Optional[float] = None # [A*T^0.5/m^2]
75
+
76
+
77
+ class Bordini(BaseModel):
78
+ """
79
+ Level 3: Class for cable Bordini's Nb3Sn fit
80
+ """
81
+
82
+ type: Literal["Bordini"]
83
+ Tc0_Bordini: Optional[float] = None # [K]
84
+ Bc20_Bordini: Optional[float] = None # [T]
85
+ C0_Bordini: Optional[float] = None # [A*T/m^2]
86
+ alpha_Bordini: Optional[float] = None # [-]
87
+
88
+
89
+ class Nb3Sn_HFM(BaseModel):
90
+ """
91
+ Level 3: Class for cable HFM Nb3Sn fit
92
+ """
93
+
94
+ type: Literal["Nb3Sn_HFM"]
95
+ Tc0_Nb3Sn_HFM: Optional[float] = None # [K]
96
+ Bc20_Nb3Sn_HFM: Optional[float] = None # [T]
97
+ C0_Nb3Sn_HFM: Optional[float] = None # [A*T/m^2]
98
+ alpha_Nb3Sn_HFM: Optional[float] = None # [-]
99
+ nu_Nb3Sn_HFM: Optional[float] = None # [-]
100
+ p_Nb3Sn_HFM: Optional[float] = None # [-]
101
+ q_Nb3Sn_HFM: Optional[float] = None # [-]
102
+
103
+
104
+ class ProDefined(BaseModel):
105
+ """
106
+ Level 3: Class for cable Bordini's Nb3Sn fit
107
+ """
108
+
109
+ type: Literal["ProDefined"]
110
+ Tc0: Optional[float] = None # [K]
111
+ Bc20: Optional[float] = None # [T]
112
+ C0: Optional[float] = None # [A*T/m^2]
113
+ alpha: Optional[float] = None # [-]
114
+ p: Optional[float] = None # [-]
115
+ q: Optional[float] = None # [-]
116
+ v: Optional[float] = None # [-]
117
+ B0: Optional[float] = None # [-]
118
+
119
+
120
+ class BSCCO_2212_LBNL(BaseModel):
121
+ """
122
+ Level 3: Class for cable Bi-2212 fit developed in LBNL
123
+ """
124
+
125
+ # only ad-hoc fit [T. Shen, D. Davis, E. Ravaioli with LBNL, Berkeley, CA]
126
+ type: Literal["BSCCO_2212_LBNL"]
127
+ f_scaling_Jc_BSCCO2212: Optional[float] = None # [-] used for the ad-hoc fit
128
+
129
+
130
+ # ------------------- Cable types ---------------------------#
131
+ class Mono(BaseModel):
132
+ """
133
+ Mono cable type: This is basically type of cable consisting of one strand - not really a cable
134
+ """
135
+
136
+ type: Literal["Mono"]
137
+ bare_cable_width: Optional[float] = None
138
+ bare_cable_height_low: Optional[float] = None
139
+ bare_cable_height_high: Optional[float] = None
140
+ bare_cable_height_mean: Optional[float] = None
141
+ th_insulation_along_width: Optional[float] = None
142
+ th_insulation_along_height: Optional[float] = None
143
+ # Fractions given with respect to the insulated conductor
144
+ f_superconductor: Optional[float] = None
145
+ f_stabilizer: Optional[float] = None # (related to CuFraction in ProteCCT)
146
+ f_insulation: Optional[float] = None
147
+ f_inner_voids: Optional[float] = None
148
+ f_outer_voids: Optional[float] = None
149
+ # Available materials depend on the component and on the selected program
150
+ material_insulation: Optional[str] = None
151
+ material_inner_voids: Optional[str] = None
152
+ material_outer_voids: Optional[str] = None
153
+
154
+
155
+ class Rutherford(BaseModel):
156
+ """
157
+ Rutherford cable type: for example LHC MB magnet cable
158
+ """
159
+
160
+ type: Literal["Rutherford"]
161
+ n_strands: Optional[int] = None
162
+ n_strand_layers: Optional[int] = None
163
+ n_strands_per_layers: Optional[int] = None
164
+ bare_cable_width: Optional[float] = None
165
+ bare_cable_height_low: Optional[float] = None
166
+ bare_cable_height_high: Optional[float] = None
167
+ bare_cable_height_mean: Optional[float] = None
168
+ th_insulation_along_width: Optional[float] = None
169
+ th_insulation_along_height: Optional[float] = None
170
+ width_core: Optional[float] = None
171
+ height_core: Optional[float] = None
172
+ strand_twist_pitch: Optional[float] = None
173
+ strand_twist_pitch_angle: Optional[float] = None
174
+ Rc: Optional[float] = None
175
+ Ra: Optional[float] = None
176
+ # Fractions given with respect to the insulated conductor
177
+ f_superconductor: Optional[float] = None
178
+ f_stabilizer: Optional[float] = None # (related to CuFraction in ProteCCT)
179
+ f_insulation: Optional[float] = None
180
+ f_inner_voids: Optional[float] = None
181
+ f_outer_voids: Optional[float] = None
182
+ f_core: Optional[float] = None
183
+ # Available materials depend on the component and on the selected program
184
+ material_insulation: Optional[str] = None
185
+ material_inner_voids: Optional[str] = None
186
+ material_outer_voids: Optional[str] = None
187
+ material_core: Optional[str] = None
188
+ gamma_c: Optional[float] = Field(
189
+ default=0.0,
190
+ description="parameter for DISCC cable homogenization"
191
+ )
192
+
193
+
194
+ class Ribbon(BaseModel):
195
+ """
196
+ Mono cable type: This is basically type of cable consisting of one strand - not really a cable
197
+ """
198
+
199
+ type: Literal["Ribbon"]
200
+ n_strands: Optional[int] = (
201
+ None # This defines the number of "strands" in the ribbon cable, which are physically glued but electrically in series
202
+ )
203
+ bare_cable_width: Optional[float] = None
204
+ bare_cable_height_low: Optional[float] = None
205
+ bare_cable_height_high: Optional[float] = None
206
+ bare_cable_height_mean: Optional[float] = None
207
+ th_insulation_along_width: Optional[float] = (
208
+ None # This defines the thickness of the insulation around each strand (DIFFERENT FROM ROXIE CADATA FILE)
209
+ )
210
+ th_insulation_along_height: Optional[float] = (
211
+ None # This defines the thickness of the insulation around each strand (DIFFERENT FROM ROXIE CADATA FILE)
212
+ )
213
+ # Fractions given with respect to the insulated conductor
214
+ f_superconductor: Optional[float] = None
215
+ f_stabilizer: Optional[float] = None # (related to CuFraction in ProteCCT)
216
+ f_insulation: Optional[float] = None
217
+ f_inner_voids: Optional[float] = None
218
+ f_outer_voids: Optional[float] = None
219
+ f_core: Optional[float] = None
220
+ # Available materials depend on the component and on the selected program
221
+ material_insulation: Optional[str] = None
222
+ material_inner_voids: Optional[str] = None
223
+ material_outer_voids: Optional[str] = None
224
+ material_core: Optional[str] = None
225
+
226
+
227
+ # ------------------- Conductors ---------------------------#
228
+
229
+ # class MaterialSuperconductor(BaseModel):
230
+ # """
231
+ # Level 3: Class for strand superconductor material parameters
232
+ # """
233
+ # material: Optional[str] = Field(default=None, description="Material of the superconductor. E.g. NbTi, Nb3Sn, etc.")
234
+ # n_value: Optional[float] = Field(default=None, description="n value of the superconductor (for power law fit).")
235
+ # ec: Optional[float] = Field(default=None, description="Critical electric field of the superconductor.")
236
+ # Cv_material: Optional[Union[str, float]] = Field(default=None, description="Material function for specific heat of the superconductor.")
237
+
238
+ # class MaterialStabilizer(BaseModel):
239
+ # """
240
+ # Level 3: Class for strand stabilizer material parameters
241
+ # """
242
+
243
+ # rho_material: Optional[Union[str, float]] = Field(default=None, description="Material function for resistivity of the stabilizer. Constant resistivity can be given as float.")
244
+ # RRR: Optional[float] = Field(default=None, description="Residual resistivity ratio of the stabilizer.")
245
+ # T_ref_RRR_high: Optional[float] = Field(default=None, description="Upper reference temperature for RRR measurements.")
246
+ # T_ref_RRR_low: Optional[float] = Field(default=None, description="Lower reference temperature for RRR measurements.")
247
+ # k_material: Optional[Union[str, float]] = Field(default=None, description="Thermal conductivity of the stabilizer.")
248
+ # Cv_material: Optional[Union[str, float]] = Field(default=None, description="Material function for specific heat of the stabilizer.")
249
+
250
+
251
+ class Round(BaseModel):
252
+ """
253
+ Level 2: Class for strand parameters
254
+ """
255
+
256
+ type: Literal["Round"]
257
+ fil_twist_pitch: Optional[float] = None # Strand twist pitch
258
+ diameter: Optional[float] = None # ds_inGroup (LEDET), DConductor (BBQ), DStrand (ProteCCT)
259
+ diameter_core: Optional[float] = None # dcore_inGroup (LEDET)
260
+ diameter_filamentary: Optional[float] = None # dfilamentary_inGroup (LEDET)
261
+ filament_diameter: Optional[float] = None # df_inGroup (LEDET)
262
+ filament_hole_diameter: Optional[float] = Field(default=None, description="Specifies round or hexagonal hole diameter inside the filament. If None or 0.0, no hole is created.")
263
+ number_of_filaments: Optional[int] = None # nf_inGroup (LEDET)
264
+ f_Rho_effective: Optional[float] = None
265
+ Cu_noCu_in_strand: Optional[float] = None
266
+
267
+ # -- Superconductor parameters -- #
268
+ material_superconductor: Optional[str] = Field(default=None, description="Material of the superconductor. E.g. Nb-Ti, Nb3Sn, etc.")
269
+ n_value_superconductor: Optional[float] = Field(default=None, description="n value of the superconductor (for power law fit).")
270
+ ec_superconductor: Optional[float] = Field(default=None, description="Critical electric field of the superconductor in V/m.")
271
+ minimum_jc_fraction: Optional[float] = Field(gt=0, le=1, default=None, description="Fraction of Jc(minimum_jc_field, T) to use as minimum Jc for the power law fit to avoid division by zero when Jc(B_local, T) decreases to zero."
272
+ "Typical value would be 0.001 (so the Jc_minimum is 0.1% of Jc(minimum_jc_field, T))"
273
+ "This fraction is only allowed to be greater than 0.0 and less than or equal to 1.0")
274
+ minimum_jc_field: Optional[float] = Field(default=None, description="Magnetic flux density in tesla used for calculation of Jc(minimum_jc_field, T). This gets multiplied by minimum_jc_fraction and used as minimum Jc for the power law")
275
+ k_material_superconductor: Optional[Union[str, float]] = Field(default=None, description="Thermal conductivity of the superconductor.")
276
+ Cv_material_superconductor: Optional[Union[str, float]] = Field(default=None, description="Material function for specific heat of the superconductor.")
277
+ # -- Stabilizer parameters -- #
278
+ material_stabilizer: Optional[str] = Field(default=None, description="Material of the stabilizer.")
279
+ rho_material_stabilizer: Optional[Union[str, float]] = Field(default=None, description="Material function for resistivity of the stabilizer. Constant resistivity can be given as float.")
280
+ rho_material_holes: Optional[Union[str, float]] = Field(default=None, description="Material function for resistivity of the holes in the filaments."
281
+ "Constant resistivity can be given as float, material name as a string or None or 0.0 to use 'air' in the holes.")
282
+ RRR: Optional[Union[float, List[float]]] = Field(default=None, description="Residual resistivity ratio of the stabilizer. If a list of RRR is provided it needs to match in length the number of matrix regions in the geometry (typically 3)")
283
+ T_ref_RRR_high: Optional[float] = Field(default=None, description="Upper reference temperature for RRR measurements.")
284
+ T_ref_RRR_low: Optional[float] = Field(default=None, description="Lower reference temperature for RRR measurements.")
285
+ k_material_stabilizer: Optional[Union[str, float]] = Field(default=None, description="Thermal conductivity of the stabilizer.")
286
+ Cv_material_stabilizer: Optional[Union[str, float]] = Field(default=None, description="Material function for specific heat of the stabilizer.")
287
+
288
+ # superconductor: MaterialSuperconductor = MaterialSuperconductor()
289
+ # stabilizer: MaterialStabilizer = MaterialStabilizer()
290
+
291
+
292
+ class Rectangular(BaseModel):
293
+ """
294
+ Level 2: Class for strand parameters
295
+ """
296
+
297
+ type: Literal["Rectangular"]
298
+ bare_width: Optional[float] = None
299
+ bare_height: Optional[float] = None
300
+ Cu_noCu_in_strand: Optional[float] = None
301
+ filament_diameter: Optional[float] = None # df_inGroup (LEDET)
302
+ f_Rho_effective: Optional[float] = None
303
+ fil_twist_pitch: Optional[float] = None
304
+ bare_corner_radius: Optional[float] = None
305
+
306
+ # -- Superconductor parameters -- #
307
+ material_superconductor: Optional[str] = Field(default=None, description="Material of the superconductor. E.g. NbTi, Nb3Sn, etc.")
308
+ n_value_superconductor: Optional[float] = Field(default=None, description="n value of the superconductor (for power law fit).")
309
+ ec_superconductor: Optional[float] = Field(default=None, description="Critical electric field of the superconductor.")
310
+ minimum_jc_fraction: Optional[float] = Field(gt=0, le=1, default=None, description="Fraction of Jc(minimum_jc_field, T) to use as minimum Jc for the power law"
311
+ " fit to avoid division by zero when Jc(B_local, T) decreases to zero."
312
+ "Typical value would be 0.001 (so the Jc_minimum is 0.1% of Jc(minimum_jc_field, T))"
313
+ "This fraction is only allowed to be greater than 0.0 and less than or equal to 1.0")
314
+ minimum_jc_field: Optional[float] = Field(default=None, description="Magnetic flux density in tesla used for calculation of Jc(minimum_jc_field, T)."
315
+ "This gets multiplied by minimum_jc_fraction and used as minimum Jc for the power law")
316
+ k_material_superconductor: Optional[Union[str, float]] = Field(default=None, description="Thermal conductivity of the superconductor.")
317
+ Cv_material_superconductor: Optional[Union[str, float]] = Field(default=None, description="Material function for specific heat of the superconductor.")
318
+ # -- Stabilizer parameters -- #
319
+ material_stabilizer: Optional[str] = Field(default=None, description="Material of the stabilizer.")
320
+ rho_material_stabilizer: Optional[Union[str, float]] = Field(default=None, description="Material function for resistivity of the stabilizer. Constant resistivity can be given as float.")
321
+ RRR: Optional[Union[float, List[float]]] = Field(default=None, description="Residual resistivity ratio of the stabilizer. If a list of RRR is provided it needs to match in length the number of matrix regions in the geometry (typically 3)")
322
+ T_ref_RRR_high: Optional[float] = Field(default=None, description="Upper reference temperature for RRR measurements.")
323
+ T_ref_RRR_low: Optional[float] = Field(default=None, description="Lower reference temperature for RRR measurements.")
324
+ k_material_stabilizer: Optional[Union[str, float]] = Field(default=None, description="Thermal conductivity of the stabilizer.")
325
+ Cv_material_stabilizer: Optional[Union[str, float]] = Field(default=None, description="Material function for specific heat of the stabilizer.")
326
+ number_of_filaments: Optional[int] = None
327
+
328
+ # superconductor: MaterialSuperconductor = MaterialSuperconductor()
329
+ # stabilizer: MaterialStabilizer = MaterialStabilizer()
330
+
331
+
332
+
333
+ # ------------------- Conductors ---------------------------#
334
+
335
+
336
+ class Conductor(BaseModel):
337
+ """
338
+ Level 1: Class for conductor parameters
339
+ """
340
+
341
+ version: Optional[str] = None
342
+ case: Optional[str] = None
343
+ state: Optional[str] = None
344
+ cable: Union[Rutherford, Mono, Ribbon] = {
345
+ "type": "Rutherford"
346
+ } # TODO: Busbar, Rope, Roebel, CORC, TSTC, CICC
347
+ strand: Union[Round, Rectangular] = {"type": "Round"} # TODO: Tape, WIC
348
+ Jc_fit: Union[ConstantJc, Bottura, CUDI1, CUDI3, Summers, Bordini, Nb3Sn_HFM, BSCCO_2212_LBNL, Ic_A_NbTi, ProDefined] = {
349
+ "type": "CUDI1"
350
+ } # TODO: CUDI other numbers? , Roxie?