fiqus 2025.12.0__py3-none-any.whl → 2026.1.1__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 (52) hide show
  1. fiqus/MainFiQuS.py +4 -8
  2. fiqus/data/DataConductor.py +108 -11
  3. fiqus/data/DataFiQuS.py +2 -1
  4. fiqus/data/DataFiQuSConductorAC_CC.py +345 -0
  5. fiqus/data/DataFiQuSConductorAC_Strand.py +3 -3
  6. fiqus/data/DataFiQuSMultipole.py +363 -165
  7. fiqus/data/DataModelCommon.py +30 -15
  8. fiqus/data/DataMultipole.py +33 -10
  9. fiqus/data/DataWindingsCCT.py +37 -37
  10. fiqus/data/RegionsModelFiQuS.py +1 -1
  11. fiqus/geom_generators/GeometryConductorAC_CC.py +1906 -0
  12. fiqus/geom_generators/GeometryMultipole.py +751 -54
  13. fiqus/getdp_runners/RunGetdpConductorAC_CC.py +123 -0
  14. fiqus/getdp_runners/RunGetdpMultipole.py +181 -31
  15. fiqus/mains/MainConductorAC_CC.py +148 -0
  16. fiqus/mains/MainMultipole.py +109 -17
  17. fiqus/mesh_generators/MeshCCT.py +209 -209
  18. fiqus/mesh_generators/MeshConductorAC_CC.py +1305 -0
  19. fiqus/mesh_generators/MeshMultipole.py +938 -263
  20. fiqus/parsers/ParserCOND.py +2 -1
  21. fiqus/parsers/ParserDAT.py +16 -16
  22. fiqus/parsers/ParserGetDPOnSection.py +212 -212
  23. fiqus/parsers/ParserGetDPTimeTable.py +134 -134
  24. fiqus/parsers/ParserMSH.py +53 -53
  25. fiqus/parsers/ParserRES.py +142 -142
  26. fiqus/plotters/PlotPythonCCT.py +133 -133
  27. fiqus/plotters/PlotPythonMultipole.py +18 -18
  28. fiqus/post_processors/PostProcessAC_CC.py +65 -0
  29. fiqus/post_processors/PostProcessMultipole.py +16 -6
  30. fiqus/pre_processors/PreProcessCCT.py +175 -175
  31. fiqus/pro_assemblers/ProAssembler.py +3 -3
  32. fiqus/pro_material_functions/ironBHcurves.pro +246 -246
  33. fiqus/pro_templates/combined/CAC_CC_template.pro +542 -0
  34. fiqus/pro_templates/combined/CC_Module.pro +1213 -0
  35. fiqus/pro_templates/combined/Multipole_template.pro +2738 -1338
  36. fiqus/pro_templates/combined/TSA_materials.pro +102 -2
  37. fiqus/pro_templates/combined/materials.pro +54 -3
  38. fiqus/utils/Utils.py +18 -25
  39. fiqus/utils/update_data_settings.py +1 -1
  40. {fiqus-2025.12.0.dist-info → fiqus-2026.1.1.dist-info}/METADATA +81 -77
  41. {fiqus-2025.12.0.dist-info → fiqus-2026.1.1.dist-info}/RECORD +52 -44
  42. {fiqus-2025.12.0.dist-info → fiqus-2026.1.1.dist-info}/WHEEL +1 -1
  43. tests/test_geometry_generators.py +47 -30
  44. tests/test_mesh_generators.py +69 -30
  45. tests/test_solvers.py +67 -29
  46. tests/utils/fiqus_test_classes.py +396 -147
  47. tests/utils/generate_reference_files_ConductorAC.py +57 -57
  48. tests/utils/helpers.py +76 -1
  49. /fiqus/pro_templates/combined/{ConductorACRutherford_template.pro → CAC_Rutherford_template.pro} +0 -0
  50. /fiqus/pro_templates/combined/{ConductorAC_template.pro → CAC_Strand_template.pro} +0 -0
  51. {fiqus-2025.12.0.dist-info → fiqus-2026.1.1.dist-info/licenses}/LICENSE.txt +0 -0
  52. {fiqus-2025.12.0.dist-info → fiqus-2026.1.1.dist-info}/top_level.txt +0 -0
@@ -104,32 +104,84 @@ class MultipoleSolveBoundaryConditionsThermal(BaseModel):
104
104
  "The keys are chosen names for each boundary condition.",
105
105
  )
106
106
 
107
+ class MultipoleSolveTransient_parent(BaseModel):
108
+ """
109
+ Level 4: Class for FiQuS Multipole
110
+ """
111
+ initial_time: Optional[float] = Field(
112
+ default=0.,
113
+ description="It specifies the initial time of the simulation.",
114
+ )
115
+ final_time: Optional[float] = Field(
116
+ default=0.0,
117
+ description="It specifies the final time of the simulation.",
118
+ )
119
+ initial_time_step: Optional[float] = Field(
120
+ default=1E-10,
121
+ description="It specifies the initial time step used at the beginning of the transient simulation.",
122
+ )
123
+ min_time_step: Optional[float] = Field(
124
+ default=1E-12,
125
+ description="It specifies the minimum possible value of the time step.",
126
+ )
127
+ max_time_step: Optional[float] = Field(
128
+ default=10,
129
+ description="It specifies the maximum possible value of the time step.",
130
+ )
131
+ breakpoints: Optional[List[float]] = Field(
132
+ default=[],
133
+ description="It forces the transient simulation to hit the time instants contained in this list.",
134
+ )
135
+ integration_method: Optional[Union[None, Literal[
136
+ "Euler", "Gear_2", "Gear_3", "Gear_4", "Gear_5", "Gear_6"
137
+ ]]] = Field(
138
+ default="Euler",
139
+ title="Integration Method",
140
+ description="It specifies the type of integration method to be used.",
141
+ )
142
+ rel_tol_time: Optional[float] = Field(
143
+ default=1E-4,
144
+ description="It specifies the relative tolerance.",
145
+ )
146
+ abs_tol_time: Optional[float] = Field(
147
+ default=1e-4,
148
+ description="It specifies the absolute tolerance.",
149
+ )
150
+ norm_type: Optional[Literal["L1Norm", "MeanL1Norm", "L2Norm", "MeanL2Norm", "LinfNorm"]] = Field(
151
+ default='LinfNorm',
152
+ description="It specifies the type of norm to be calculated for convergence assessment.",
153
+ )
107
154
 
108
- # class MultipoleSolveTransientElectromagnetics(BaseModel):
109
- # """
110
- # Level 4: Class for FiQuS Multipole
111
- # """
112
- # time_stepping: Optional[Literal["adaptive", "fixed"]] = Field(
113
- # default="adaptive",
114
- # description="It specifies the type of time stepping.",
115
- # )
116
- # initial_time: Optional[float] = Field(
117
- # default=0.,
118
- # description="It specifies the initial time of the simulation.",
119
- # )
120
- # final_time: Optional[float] = Field(
121
- # default=None,
122
- # description="It specifies the final time of the simulation.",
123
- # )
124
- # fixed: MultipoleSolveTimeParametersFixed = Field(
125
- # default=MultipoleSolveTimeParametersFixed(),
126
- # description="This dictionary contains the information about the time parameters of the fixed time stepping.",
127
- # )
128
- # adaptive: MultipoleSolveTimeParametersAdaptive = Field(
129
- # default=MultipoleSolveTimeParametersAdaptive(),
130
- # description="This dictionary contains the information about the time parameters of the adaptive time stepping.",
131
- # )
155
+ class MultipoleSolveTransientElectromagnetics(MultipoleSolveTransient_parent):
156
+ """
157
+ Level 4: Class for FiQuS Multipole
158
+ """
159
+ T_sim: Optional[float] = Field(
160
+ default=1.9,
161
+ description="It specifies the temperature used to calculate the resistivity of the superconductor during the transient sim.",
162
+ )
132
163
 
164
+ class MultipleSolveCollarHeCooling(BaseModel):
165
+ enabled: Optional[bool] = Field(
166
+ default=False,
167
+ description="It determines whether the helium cooling is enabled or not (adiabatic conditions).",
168
+ )
169
+ which: Optional[Union[Literal['all'], List]] = Field(
170
+ default='all',
171
+ description="It specifies the boundaries where the collar cooling is applied. If 'all', it applies to all boundaries. If a list, it applies to the specified boundaries numbered counter-clockwise."
172
+ )
173
+ heat_transfer_coefficient: Optional[Union[float, str]] = Field(
174
+ default= 'CFUN_hHe_T_THe',
175
+ description="It specifies the value or name of the function of the constant heat transfer coefficient.",
176
+ )
177
+ ref_temperature: Optional[float] = Field(
178
+ default = 0.0,
179
+ description="It specifies the reference temperature for the collar cooling. If not specified, it takes the value of the initial temperature.",
180
+ )
181
+ move_cooling_holes: Optional[Union[str, int, List[List[float]]]] = Field(
182
+ default=None,
183
+ description= "It specifies if and how cooling holes are to be moved. Either choose '1' or '2' for predefined positions or a list [[dx,dy], [dx2,dy2]].. to shift each hole manually"
184
+ )
133
185
 
134
186
  class MultipoleSolveHeCooling(BaseModel):
135
187
  """
@@ -149,6 +201,7 @@ class MultipoleSolveHeCooling(BaseModel):
149
201
  description="It specifies the value or name of the function of the constant heat transfer coefficient.",
150
202
  )
151
203
 
204
+
152
205
  class MultipoleSolveNonLinearSolver(BaseModel):
153
206
  """
154
207
  Level 4: Class for FiQuS Multipole
@@ -173,36 +226,6 @@ class MultipoleSolveNonLinearSolver(BaseModel):
173
226
  default='LinfNorm',
174
227
  description="It specifies the type of norm to be calculated for convergence assessment.",
175
228
  )
176
-
177
-
178
- class MultipoleSolveTransientThermal(BaseModel):
179
- """
180
- Level 4: Class for FiQuS Multipole
181
- """
182
- initial_time: Optional[float] = Field(
183
- default=0.,
184
- description="It specifies the initial time of the simulation.",
185
- )
186
- final_time: Optional[float] = Field(
187
- default=None,
188
- description="It specifies the final time of the simulation.",
189
- )
190
- initial_time_step: Optional[float] = Field(
191
- default=1E-10,
192
- description="It specifies the initial time step used at the beginning of the transient simulation.",
193
- )
194
- min_time_step: Optional[float] = Field(
195
- default=1E-12,
196
- description="It specifies the minimum possible value of the time step.",
197
- )
198
- max_time_step: Optional[float] = Field(
199
- default=10,
200
- description="It specifies the maximum possible value of the time step.",
201
- )
202
- breakpoints: Optional[List[float]] = Field(
203
- default=[],
204
- description="It forces the transient simulation to hit the time instants contained in this list.",
205
- )
206
229
  integration_method: Union[None, Literal[
207
230
  "Euler", "Gear_2", "Gear_3", "Gear_4", "Gear_5", "Gear_6"
208
231
  ]] = Field(
@@ -210,23 +233,40 @@ class MultipoleSolveTransientThermal(BaseModel):
210
233
  title="Integration Method",
211
234
  description="It specifies the type of integration method to be used.",
212
235
  )
213
- rel_tol_time: Optional[float] = Field(
214
- default=1E-4,
236
+
237
+ class MultipoleSolveTransientThermal(MultipoleSolveTransient_parent):
238
+ """
239
+ Level 4: Class for FiQuS Multipole
240
+ """
241
+ stop_temperature: Optional[float] = Field(
242
+ default=300,
243
+ description="If one half turn reaches this temperature, the simulation is stopped.",
244
+ )
245
+
246
+ class MultipoleSolveTransientCoupled(MultipoleSolveTransient_parent):
247
+ """
248
+ Level 4: Class for FiQuS Multipole
249
+ """
250
+ rel_tol_time: Optional[List[float]] = Field(
251
+ default=[1E-4,1E-4],
215
252
  description="It specifies the relative tolerance.",
216
253
  )
217
- abs_tol_time: Optional[float] = Field(
218
- default=1e-4,
254
+ abs_tol_time: Optional[List[float]] = Field(
255
+ default=[1e-4,1e-4],
219
256
  description="It specifies the absolute tolerance.",
220
257
  )
221
- norm_type: Literal["L1Norm", "MeanL1Norm", "L2Norm", "MeanL2Norm", "LinfNorm"] = Field(
222
- default='LinfNorm',
258
+ norm_type: List[Literal["L1Norm", "MeanL1Norm", "L2Norm", "MeanL2Norm", "LinfNorm"]] = Field(
259
+ default=['LinfNorm','LinfNorm'],
223
260
  description="It specifies the type of norm to be calculated for convergence assessment.",
224
261
  )
225
262
  stop_temperature: Optional[float] = Field(
226
263
  default=300,
227
264
  description="If one half turn reaches this temperature, the simulation is stopped.",
228
265
  )
229
-
266
+ seq_NL: Optional[bool] = Field(
267
+ default=True,
268
+ description="The non-linear solver is sequential Mag->Thermal, or its fully coupled.",
269
+ )
230
270
 
231
271
  class MultipoleSolveInsulationBlockToBlock(BaseModel):
232
272
  """
@@ -273,25 +313,38 @@ class MultipoleSolveInsulationExterior(BaseModel):
273
313
  description="It specifies the list of thicknesses of the specified insulation layers. The order must match the one of the materials list.",
274
314
  )
275
315
 
276
-
277
- class MultipoleSolveWedge(BaseModel):
316
+ class MultipoleSolveSpecificMaterial(BaseModel):
278
317
  """
279
318
  Level 3: Class for FiQuS Multipole
280
319
  """
281
320
  material: Optional[str] = Field(
282
321
  default=None,
283
- description="It specifies the material of the wedge regions.",
322
+ description="It specifies the material of the region.",
284
323
  )
285
324
  RRR: Optional[float] = Field(
286
325
  default=None,
287
- description="It specifies the RRR of the wedge regions.",
326
+ description="It specifies the RRR of the region.",
288
327
  )
289
328
  T_ref_RRR_high: Optional[float] = Field(
290
329
  default=None,
291
330
  description="It specifies the reference temperature associated with the RRR.",
292
331
  )
332
+ transient_effects_enabled: Optional[bool] = Field(
333
+ default=False,
334
+ description="It determines whether the transient effects are enabled or not.",
335
+ )
336
+ # rel_magnetic_permeability: Optional[float] = Field(
337
+ # default = 1.0,
338
+ # description = 'It specifies the material relative magnetic permeability against vacuum for EM calculations'
339
+ # )
293
340
 
294
341
 
342
+ class MultipoleSolveInsulationCollar(BaseModel):
343
+ material: Optional[str] = Field(
344
+ default=None,
345
+ description="It specifies the default material of the insulation regions between collar and outer insulation.",
346
+ )
347
+
295
348
  class MultipoleSolveInsulationTSA(BaseModel):
296
349
  """
297
350
  Level 3: Class for FiQuS Multipole
@@ -304,9 +357,22 @@ class MultipoleSolveInsulationTSA(BaseModel):
304
357
  default=MultipoleSolveInsulationExterior(),
305
358
  description="This dictionary contains the information about the materials and thicknesses of the outer insulation regions (exterior boundaries) modeled via thin-shell approximation.",
306
359
  )
360
+ between_collar: Optional[MultipoleSolveInsulationBlockToBlock] = Field(
361
+ default=MultipoleSolveInsulationCollar(),
362
+ description="This dictionary contains the information about the materials and thicknesses of the insulation regions between the collar and the outer insulation regions for thin-shell approximation.",
363
+ )
364
+
365
+ class MultipoleSolve_parent(BaseModel):
366
+ """
367
+ Level 3: Class for FiQuS Multipole
368
+ """
369
+ non_linear_solver: MultipoleSolveNonLinearSolver = Field(
370
+ default=MultipoleSolveNonLinearSolver(),
371
+ description="This dictionary contains the information about the parameters for the non-linear solver.",
372
+ )
307
373
 
308
374
 
309
- class MultipoleSolveThermal(BaseModel):
375
+ class MultipoleSolveThermal(MultipoleSolve_parent):
310
376
  """
311
377
  Level 3: Class for FiQuS Multipole
312
378
  """
@@ -322,14 +388,14 @@ class MultipoleSolveThermal(BaseModel):
322
388
  default=MultipoleSolveHeCooling(),
323
389
  description="This dictionary contains the information about the Robin boundary condition for generic groups of boundaries.",
324
390
  )
391
+ collar_cooling: MultipleSolveCollarHeCooling = Field(
392
+ default=MultipleSolveCollarHeCooling(),
393
+ description="This dictionary contains the information about the cooling for the collar region.",
394
+ )
325
395
  overwrite_boundary_conditions: Optional[MultipoleSolveBoundaryConditionsThermal] = Field(
326
396
  default=MultipoleSolveBoundaryConditionsThermal(),
327
397
  description="This dictionary contains the information about boundary conditions for explicitly specified boundaries.",
328
398
  )
329
- non_linear_solver: MultipoleSolveNonLinearSolver = Field(
330
- default=MultipoleSolveNonLinearSolver(),
331
- description="This dictionary contains the information about the parameters for the non-linear solver.",
332
- )
333
399
  time_stepping: MultipoleSolveTransientThermal = Field(
334
400
  default=MultipoleSolveTransientThermal(),
335
401
  description="This dictionary contains the information about the parameters for the transient solver.",
@@ -347,24 +413,18 @@ class MultipoleSolveThermal(BaseModel):
347
413
  description="It determines whether the initial temperature is enforced as the minimum temperature of the simulation.",
348
414
  )
349
415
 
350
- class MultipoleSolveElectromagnetics(BaseModel):
416
+ class MultipoleSolveElectromagnetics(MultipoleSolve_parent):
351
417
  """
352
418
  Level 3: Class for FiQuS Multipole
353
419
  """
354
- solve_type: Optional[Literal[None, "stationary"]] = Field(
420
+ solve_type: Optional[Literal[None, "stationary","transient"]] = Field(
355
421
  default=None,
356
422
  description="It determines whether the magneto-static problem is solved ('stationary') or not ('null').",
357
423
  )
358
-
359
- non_linear_solver: MultipoleSolveNonLinearSolver = Field(
360
- default=MultipoleSolveNonLinearSolver(),
361
- description="This dictionary contains the information about the parameters for the non-linear solver.",
424
+ time_stepping: Optional[MultipoleSolveTransientElectromagnetics] = Field(
425
+ default=MultipoleSolveTransientElectromagnetics(),
426
+ description="This dictionary contains the information about the parameters for the transient solver.",
362
427
  )
363
- # currently not needed since stationary only, we will be able to reuse it from the thermal solver
364
- # time_stepping_parameters: MultipoleSolveTransientElectromagnetics = Field(
365
- # default=MultipoleSolveTransientElectromagnetics(),
366
- # description="This dictionary contains the information about the parameters for the transient solver.",
367
- # )
368
428
 
369
429
 
370
430
  class MultipoleMeshThinShellApproximationParameters(BaseModel):
@@ -383,7 +443,22 @@ class MultipoleMeshThinShellApproximationParameters(BaseModel):
383
443
  default=1,
384
444
  description="It specifies the number of minimum spacial discretizations across a thin-shell.",
385
445
  )
386
-
446
+ global_size_COL: Optional[float] = Field(
447
+ default=1e-4,
448
+ description="The thickness of the region between ht and collar is divided by this parameter to determine the number of spacial discretizations across the thin-shell.",
449
+ )
450
+ minimum_discretizations_COL: Optional[int] = Field(
451
+ default=1,
452
+ description="It specifies the number of minimum spacial discretizations across a thin-shell.",
453
+ )
454
+ scale_factor_radial: Optional[float] = Field(
455
+ default=-1.0,
456
+ description="Scaling factor for radially directed thin-shells (e.g. halfturns to collar). Set to -1.0 to use default scaling. Wedge scalings are always ignored.",
457
+ )
458
+ scale_factor_azimuthal: Optional[float] = Field(
459
+ default=-1.0,
460
+ description="Scaling factor for azimuthally directed thin-shells (e.g. halfturns to pole). Set to -1.0 to use default scaling. Wedge scalings are always ignored.",
461
+ )
387
462
 
388
463
  class MultipoleMeshThreshold(BaseModel):
389
464
  """
@@ -410,6 +485,15 @@ class MultipoleMeshThreshold(BaseModel):
410
485
  description="It sets gmsh Mesh.MeshDistMax.",
411
486
  )
412
487
 
488
+ class MultipoleMeshThresholdCollar(MultipoleMeshThreshold):
489
+ """
490
+ Level 3: Class for FiQuS Multipole
491
+ """
492
+ Enforce_TSA_mapping: Optional[bool] = Field(
493
+ default=False,
494
+ description="Enfocres matching nodes for the TSA layer. Uses SizeMin to determine the size of the nodes.", # only for the collar layer
495
+ )
496
+
413
497
  class MultipoleMeshTransfinite(BaseModel):
414
498
  """
415
499
  Level 3: Class for FiQuS Multipole
@@ -439,7 +523,7 @@ class MultipoleMeshTransfiniteOrField(BaseModel):
439
523
  description="This dictionary contains the gmsh Field information.",
440
524
  )
441
525
 
442
- class MultipolePostProcThermal(BaseModel):
526
+ class MultipolePostProc_parent(BaseModel):
443
527
  """
444
528
  Level 2: Class for FiQuS Multipole
445
529
  """
@@ -459,15 +543,21 @@ class MultipolePostProcThermal(BaseModel):
459
543
  default=False,
460
544
  description="It determines whether the solution for the .txt file is saved at the end of the simulation or during run time.",
461
545
  )
462
- take_average_conductor_temperature: Optional[bool] = Field(
463
- default=True,
464
- description="It determines whether the output files are based on the average conductor temperature or not (map2d).",
465
- )
546
+
466
547
  plot_all: Optional[Union[bool, None]] = Field(
467
548
  default=False,
468
549
  description="It determines whether the figures are generated and shown (true), generated only (null), or not generated (false). Useful for tests.",
469
550
  )
470
- variables: Optional[List[Literal["T", "jOverJc", "rho"]]] = Field(
551
+
552
+ class MultipolePostProcThermal(MultipolePostProc_parent):
553
+ """
554
+ Level 2: Class for FiQuS Multipole
555
+ """
556
+ take_average_conductor_temperature: Optional[bool] = Field(
557
+ default=True,
558
+ description="It determines whether the output files are based on the average conductor temperature or not (map2d).",
559
+ )
560
+ variables: Optional[List[Literal["T", "jOverJc", "rho", "az_thermal", "ac_loss"]]] = Field(
471
561
  default=["T"],
472
562
  description="It specifies the physical quantity to be output.",
473
563
  )
@@ -478,44 +568,46 @@ class MultipolePostProcThermal(BaseModel):
478
568
  )
479
569
 
480
570
 
481
- class MultipolePostProcElectromagnetics(BaseModel):
571
+ class MultipolePostProcElectromagnetics(MultipolePostProc_parent):
482
572
  """
483
573
  Level 2: Class for FiQuS Multipole
484
574
  """
485
- output_time_steps_pos: Optional[Union[bool, int]] = Field(
486
- default=True,
487
- description="It determines whether the solution for the .pos file is saved for all time steps (True), none (False), or equidistant time steps (int).",
488
- )
489
- output_time_steps_txt: Optional[Union[bool, int]] = Field(
490
- default=True,
491
- description="It determines whether the solution for the .txt file is saved for all time steps (True), none (False), or equidistant time steps (int).",
492
- )
493
- save_pos_at_the_end: Optional[bool] = Field(
494
- default=True,
495
- description="It determines whether the solution for the .pos file is saved at the end of the simulation or during run time.",
496
- )
497
- save_txt_at_the_end: Optional[bool] = Field(
498
- default=False,
499
- description="It determines whether the solution for the .txt file is saved at the end of the simulation or during run time.",
500
- )
501
575
  compare_to_ROXIE: Optional[str] = Field(
502
576
  default=None,
503
577
  description="It contains the absolute path to a reference ROXIE map2d file. If provided, comparative plots with respect to the reference are generated.",
504
578
  )
505
- plot_all: Optional[Union[bool, None]] = Field(
506
- default=False,
507
- description="It determines whether the figures are generated and shown (true), generated only (null), or not generated (false). Useful for tests.",
508
- )
509
- variables: Optional[List[Literal["a", "az", "b", "h", "js"]]] = Field(
510
- default=["b"],
579
+ variables: Optional[List[Literal["a", "az", "b", "h", "js","jOverJc", "sigma_collar","is"]]] = Field(
580
+ default=[],
511
581
  description="It specifies the physical quantity to be output.",
512
582
  )
513
583
  volumes: Optional[List[
514
584
  Literal["omega", "powered", "induced", "air", "air_far_field", "iron", "conducting", "insulator"]]] = Field(
515
- default=["powered"],
585
+ default=[],
516
586
  description="It specifies the regions associated with the physical quantity to be output.",
517
587
  )
518
588
 
589
+ class CCPostProc(BaseModel):
590
+ variables_I: Optional[List[Literal["I_PC","I_1","I_2","I_cpc","I_crowbar","I_3","I_c_r","I_EE","I_c","I_s","I_C",
591
+ "I_EE_n","I_c_n","I_s_n","I_QH","I_EQ","I_ESC",
592
+ "I_A","I_B","I_C",
593
+ "I_EQ",
594
+ "I_ESC","I_ESC_Diode","I_ESC_C"]]] = Field(
595
+ default=[],
596
+ description="Currents from the circuit that will be exported as csv",
597
+ )
598
+ variables_U: Optional[List[Literal["PS_currentsource","PS_R_1","PS_L_1","PS_C","PS_R_3","PS_L_3","PS_R_2","PS_L_2","PS_R_crowbar","PS_Ud_crowbar","PS_L_crowbar","PS_R_c_r","PS_Ud_c_r","PS_L_c_r",
599
+ "circ_R_circuit",
600
+ "EE_L","EE_V_EE","EE_Ud_snubber","EE_C","EE_R_c","EE_L_c","EE_Ud_switch","EE_R_s","EE_L_s","EE_L_n","EE_V_EE_n","EE_Ud_snubber_n","EE_C_n","EE_R_c_n","EE_L_c_n","EE_Ud_switch_n","EE_R_s_n","EE_L_s_n","EE_R_switch","EE_R_switch_n",
601
+ "CLIQ_R","CLIQ_L","CLIQ_C",
602
+ "ECLIQ_currentsource","ECLIQ_L_leads","ECLIQ_R_leads",
603
+ "ESC_C1","ESC_C2","ESC_R_leads","ESC_R_unit","ESC_L","ESC_L_Diode","ESC_Ud_Diode"]]] = Field(
604
+ default=[],
605
+ description="Voltages from the circuit that will be exported as csv",
606
+ )
607
+ assemble_veusz: Optional[bool] = Field(
608
+ default=False,
609
+ description="It determines whether the post-processing data is assembled in a veusz file.",
610
+ )
519
611
 
520
612
  class MultipolePostProc(BaseModel):
521
613
  """
@@ -529,12 +621,111 @@ class MultipolePostProc(BaseModel):
529
621
  default=MultipolePostProcThermal(),
530
622
  description="This dictionary contains the post-processing information for the thermal solution.",
531
623
  )
624
+ circuit_coupling: CCPostProc = Field(
625
+ default= CCPostProc(),
626
+ description="This dictionary contains the post-processing information for the circuit variables calculated in the solution.",
627
+ )
628
+
629
+ class MultipoleSolveCoilWindingsElectricalOrder(BaseModel):
630
+ """
631
+ Level 2: Class for the order of the electrical pairs
632
+ """
633
+ group_together: Optional[List[List[int]]] = [] # elPairs_GroupTogether
634
+ reversed: Optional[List[int]] = [] # elPairs_RevElOrder
635
+ overwrite_electrical_order: Optional[List[int]] = []
636
+
637
+ class MultipoleSolveCoilWindings(BaseModel):
638
+ """
639
+ Level 1: Class for winding information
640
+ """
641
+ conductor_to_group: Optional[List[int]] = [] # This key assigns to each group a conductor of one of the types defined with Conductor.name
642
+ group_to_coil_section: Optional[List[int]] = [] # This key assigns groups of half-turns to coil sections
643
+ polarities_in_group: Optional[List[int]] = [] # This key assigns the polarity of the current in each group #
644
+ half_turn_length: Optional[List[float]] = []
645
+ electrical_pairs: Optional[MultipoleSolveCoilWindingsElectricalOrder] = MultipoleSolveCoilWindingsElectricalOrder() # Variables used to calculate half-turn electrical order
646
+ # Homogenized Multipole
647
+ class HomogenizedConductorFormulationparametersROHM(BaseModel):
648
+ """
649
+ Level 4: Class for finite element formulation parameters
650
+ """
651
+ enabled: Optional[bool] = Field(
652
+ default=False,
653
+ description='Use ROHM to homogenize the magnetization hysteresis in the cables.'
654
+ )
655
+ parameter_csv_file: Optional[str] = Field(
656
+ default=None,
657
+ description='Name of the csv file containing the ROHM parameters within the inputs folder with expected row structure: [alpha,kappa,chi,gamma,lambda].'
658
+ )
659
+ gather_cell_systems: Optional[bool] = Field(
660
+ default = False,
661
+ description = 'when true, it generates a single system to solve the ROHM cells instead of one system per cell to decrease generation time.'
662
+ )
663
+ weight_scaling: Optional[float] = Field(
664
+ default=1.0,
665
+ description='Downscaling factor (s<1.0) which is applied to all weights except the first, which is scaled up to compensate.'
666
+ )
667
+ tau_scaling: Optional[float] = Field(
668
+ default=1.0,
669
+ description='Scaling factor which is applied uniformly to all coupling time constants.'
670
+ )
532
671
 
672
+ class HomogenizedConductorFormulationparametersROHF(BaseModel):
673
+ """
674
+ Level 4: Class for finite element formulation parameters
675
+ """
676
+ enabled: Optional[bool] = Field(
677
+ default=False,
678
+ description='Use ROHF to homogenize the internal flux hysteresis in the cables.'
679
+ )
680
+ parameter_csv_file: Optional[str] = Field(
681
+ default=None,
682
+ description='Name of the csv file containing the ROHF parameters within the inputs folder with expected row structure: [alpha,kappa,tau].'
683
+ )
684
+ gather_cell_systems: Optional[bool] = Field(
685
+ default = False,
686
+ description = 'when true, it generates a single system to solve the ROHF cells instead of one system per cell to decrease generation time.'
687
+ )
688
+ class HomogenizedConductorRunType(BaseModel):
689
+ """
690
+ Level 4: Class for runtype parameters
691
+ """
692
+ mode: Optional[Literal["ramp","isothermal_ramp","quench"]] = Field(
693
+ default="ramp",
694
+ description= "Type of simulation to run with homogenized conductors (ramp - real cooling conditions, isothermal_ramp - unlimited cooling, quench - non-zero initial conditions)"
695
+ )
696
+ ramp_file: Optional[str] = Field(
697
+ default=None,
698
+ description='Name of the ramp model from which to start the simulation'
699
+ )
700
+ class HomogenizedConductor(BaseModel):
701
+ """
702
+ Level 3: Class for FiQuS Multipole
703
+ """
704
+ enabled: Optional[bool] = Field(
705
+ default=False,
706
+ description="It determines whether the homogenized conductor model is enabled or not."
707
+ )
708
+ run_type: HomogenizedConductorRunType = Field(
709
+ default=HomogenizedConductorRunType(),
710
+ description= "Type of simulation to run with homogenized conductors (ramp - real cooling conditions, isothermal_ramp - unlimited cooling, quench - non-zero initial conditions)"
711
+ )
712
+ rohm: HomogenizedConductorFormulationparametersROHM = Field(
713
+ default=HomogenizedConductorFormulationparametersROHM(),
714
+ description="This dictionary contains the information about the parameters for the ROHM model.",
715
+ )
716
+ rohf: HomogenizedConductorFormulationparametersROHF = Field(
717
+ default=HomogenizedConductorFormulationparametersROHF(),
718
+ description="This dictionary contains the information about the parameters for the ROHF model.",
719
+ )
533
720
 
534
721
  class MultipoleSolve(BaseModel):
535
722
  """
536
723
  Level 2: Class for FiQuS Multipole
537
724
  """
725
+ coil_windings: Optional[MultipoleSolveCoilWindings] = Field(
726
+ default=MultipoleSolveCoilWindings(),
727
+ description="This dictionary contains the information pertaining the number of coils and electrical order necessary to generate the associated electrical circuit"
728
+ )
538
729
  electromagnetics: MultipoleSolveElectromagnetics = Field(
539
730
  default=MultipoleSolveElectromagnetics(),
540
731
  description="This dictionary contains the solver information for the electromagnetic solution.",
@@ -543,10 +734,22 @@ class MultipoleSolve(BaseModel):
543
734
  default=MultipoleSolveThermal(),
544
735
  description="This dictionary contains the solver information for the thermal solution.",
545
736
  )
546
- wedges: MultipoleSolveWedge = Field(
547
- default=MultipoleSolveWedge(),
737
+ wedges: MultipoleSolveSpecificMaterial = Field(
738
+ default=MultipoleSolveSpecificMaterial(),
548
739
  description="This dictionary contains the material information of wedges.",
549
740
  )
741
+ collar: MultipoleSolveSpecificMaterial = Field(
742
+ default=MultipoleSolveSpecificMaterial(),
743
+ description="This dictionary contains the material information of the collar region.",
744
+ )
745
+ iron_yoke: MultipoleSolveSpecificMaterial = Field(
746
+ default=MultipoleSolveSpecificMaterial(),
747
+ description="This dictionary contains the material information of the iron yoke region.",
748
+ )
749
+ poles: MultipoleSolveSpecificMaterial = Field(
750
+ default=MultipoleSolveSpecificMaterial(),
751
+ description="This dictionary contains the material information of the pole region.",
752
+ )
550
753
  noOfMPITasks: Optional[Union[bool, int]] = Field(
551
754
  default=False,
552
755
  title="No. of tasks for MPI parallel run of GetDP",
@@ -556,6 +759,14 @@ class MultipoleSolve(BaseModel):
556
759
  " If False, GetDP will be run in serial without invoking mpiexec."
557
760
  ),
558
761
  )
762
+ time_stepping: Optional[MultipoleSolveTransientCoupled] = Field(
763
+ default=MultipoleSolveTransientCoupled(),
764
+ description="This dictionary contains the information about the parameters for the transient solver.",
765
+ )
766
+ cable_homogenization: Optional[HomogenizedConductor]= Field(
767
+ default=HomogenizedConductor(),
768
+ description="This dictionary contains the information about the homogenized conductor properties.",
769
+ )
559
770
 
560
771
  class MultipoleThermalInsulationMesh(BaseModel):
561
772
  """
@@ -569,14 +780,14 @@ class MultipoleThermalInsulationMesh(BaseModel):
569
780
  default=MultipoleMeshThinShellApproximationParameters(),
570
781
  description="This dictionary contains the mesh information for thin-shells.",
571
782
  )
572
-
573
- class MultipoleMeshThermal(BaseModel):
783
+
784
+ class MultipoleMesh_parent(BaseModel):
574
785
  """
575
786
  Level 2: Class for FiQuS Multipole
576
787
  """
577
788
  create: bool = Field(
578
789
  default=True,
579
- description="It determines whether the thermal mesh is built or not.",
790
+ description="It determines whether the mesh is built or not.",
580
791
  )
581
792
  conductors: Optional[MultipoleMeshTransfiniteOrField] = Field(
582
793
  default=MultipoleMeshTransfiniteOrField(),
@@ -590,16 +801,27 @@ class MultipoleMeshThermal(BaseModel):
590
801
  default=MultipoleMeshThreshold(),
591
802
  description="This dictionary contains the gmsh Field information for the iron yoke region.",
592
803
  )
593
- insulation: Optional[MultipoleThermalInsulationMesh] = Field(
594
- default=MultipoleThermalInsulationMesh(),
595
- description="This dictionary contains the mesh information for the insulation regions.",
804
+ collar: Optional[MultipoleMeshThresholdCollar] = Field(
805
+ default=MultipoleMeshThresholdCollar(),
806
+ description="This dictionary contains the gmsh Field information for the collar region.",
596
807
  )
597
-
598
- iron_field: Optional[MultipoleMeshThreshold] = Field(
808
+ poles: Optional[MultipoleMeshThreshold] = Field(
599
809
  default=MultipoleMeshThreshold(),
600
- description="This dictionary contains the gmsh Field information for the iron yoke region.",
810
+ description="This dictionary contains the mesh information for the poles region.",
601
811
  )
602
812
 
813
+ class MultipoleMeshThermal(MultipoleMesh_parent):
814
+ """
815
+ Level 2: Class for FiQuS Multipole
816
+ """
817
+ reference: Optional[MultipoleMeshThreshold] = Field(
818
+ default=MultipoleMeshThreshold(),
819
+ description="It determines whether the reference mesh is built or not. If True, an additional layer between the insulation and collar is meshed",
820
+ )
821
+ insulation: Optional[MultipoleThermalInsulationMesh] = Field(
822
+ default=MultipoleThermalInsulationMesh(),
823
+ description="This dictionary contains the mesh information for the insulation regions.",
824
+ )
603
825
  isothermal_conductors: Optional[bool] = Field(
604
826
  default=False,
605
827
  description="It determines whether the conductors are considered isothermal or not using getDP constraints.",
@@ -609,26 +831,10 @@ class MultipoleMeshThermal(BaseModel):
609
831
  description="It determines whether the wedges are considered isothermal or not using getDP Link constraints.",
610
832
  )
611
833
 
612
- class MultipoleMeshElectromagnetics(BaseModel):
834
+ class MultipoleMeshElectromagnetics(MultipoleMesh_parent):
613
835
  """
614
836
  Level 2: Class for FiQuS Multipole
615
837
  """
616
- create: bool = Field(
617
- default=True,
618
- description="It determines whether the electromagnetic mesh is built or not.",
619
- )
620
- conductors: Optional[MultipoleMeshTransfiniteOrField] = Field(
621
- default=MultipoleMeshTransfiniteOrField(),
622
- description="This dictionary contains the mesh information for the conductor regions.",
623
- )
624
- wedges: Optional[MultipoleMeshTransfiniteOrField] = Field(
625
- default=MultipoleMeshTransfiniteOrField(),
626
- description="This dictionary contains the mesh information for the wedge regions.",
627
- )
628
- iron_field: Optional[MultipoleMeshThreshold] = Field(
629
- default=MultipoleMeshThreshold(),
630
- description="This dictionary contains the gmsh Field information for the iron yoke region.",
631
- )
632
838
  bore_field: Optional[MultipoleMeshThreshold] = Field(
633
839
  default=MultipoleMeshThreshold(),
634
840
  description="This dictionary contains the gmsh Field information for the bore region.",
@@ -647,23 +853,24 @@ class MultipoleMesh(BaseModel):
647
853
  description="This dictionary contains the mesh information for the thermal solution.",
648
854
  )
649
855
 
650
-
651
- class MultipoleGeometryThermal(BaseModel):
652
- """
653
- Level 2: Class for FiQuS Multipole
654
- """
856
+ class MultipoleGeometry_parent(BaseModel):
655
857
  create: bool = Field(
656
858
  default=True,
657
- description="It determines whether the thermal geometry is built or not.",
658
- )
659
- with_iron_yoke: Optional[bool] = Field(
660
- default=False,
661
- description="It determines whether the iron yoke region is built or not.",
859
+ description="It determines whether the geometry is built or not.",
662
860
  )
663
861
  with_wedges: Optional[bool] = Field(
664
862
  default=True,
665
863
  description="It determines whether the wedge regions are built or not.",
666
864
  )
865
+ areas: Optional[List[Literal["iron_yoke", "collar", "poles"]]] = Field(
866
+ default= [],
867
+ description="List with areas to build."
868
+ )
869
+
870
+ class MultipoleGeometryThermal(MultipoleGeometry_parent):
871
+ """
872
+ Level 2: Class for FiQuS Multipole
873
+ """
667
874
  use_TSA: Optional[bool] = Field(
668
875
  default=False,
669
876
  description="It determines whether the insulation regions are explicitly built or modeled via thin-shell approximation.",
@@ -672,29 +879,20 @@ class MultipoleGeometryThermal(BaseModel):
672
879
  default=False,
673
880
  description="There is a bug in the TSA naming scheme for block coils, this flag activates a simple (not clean) bug fix that will be replaced in a future version.",
674
881
  )
882
+ use_TSA_new: Optional[bool] = Field(
883
+ default=False,
884
+ description="It determines whether the regions between collar and coils are modeled via thin-shell approximation.",
885
+ )
675
886
 
676
- class MultipoleGeometryElectromagnetics(BaseModel):
887
+ class MultipoleGeometryElectromagnetics(MultipoleGeometry_parent):
677
888
  """
678
889
  Level 2: Class for FiQuS Multipole
679
890
  """
680
- create: bool = Field(
681
- default=True,
682
- description="It determines whether the electromagnetic geometry is built or not.",
683
- )
684
- with_iron_yoke: Optional[bool] = Field(
685
- default=True,
686
- description="It determines whether the iron yoke region is built or not.",
687
- )
688
- with_wedges: Optional[bool] = Field(
689
- default=True,
690
- description="It determines whether the wedge regions are built or not.",
691
- )
692
891
  symmetry: Optional[Literal["none", "xy", "x", "y"]] = Field(
693
892
  default='none',
694
893
  description="It determines the model regions to build according to the specified axis/axes.",
695
894
  )
696
895
 
697
-
698
896
  class MultipoleGeometry(BaseModel):
699
897
  """
700
898
  Level 2: Class for FiQuS Multipole
@@ -737,4 +935,4 @@ class Multipole(BaseModel):
737
935
  postproc: MultipolePostProc = Field(
738
936
  default=MultipolePostProc(),
739
937
  description="This dictionary contains the post-process information.",
740
- )
938
+ )