fiqus 2024.6.0__py3-none-any.whl → 2024.12.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 (69) hide show
  1. fiqus/MainFiQuS.py +290 -134
  2. fiqus/data/DataConductor.py +301 -301
  3. fiqus/data/DataFiQuS.py +128 -84
  4. fiqus/data/DataFiQuSCCT.py +150 -150
  5. fiqus/data/DataFiQuSConductor.py +84 -84
  6. fiqus/data/DataFiQuSConductorAC_Strand.py +565 -565
  7. fiqus/data/DataFiQuSMultipole.py +716 -42
  8. fiqus/data/DataFiQuSPancake3D.py +737 -278
  9. fiqus/data/DataMultipole.py +180 -15
  10. fiqus/data/DataRoxieParser.py +90 -51
  11. fiqus/data/DataSettings.py +121 -0
  12. fiqus/data/DataWindingsCCT.py +37 -37
  13. fiqus/data/RegionsModelFiQuS.py +18 -6
  14. fiqus/geom_generators/GeometryCCT.py +905 -905
  15. fiqus/geom_generators/GeometryConductorAC_Strand.py +1391 -1391
  16. fiqus/geom_generators/GeometryMultipole.py +1827 -227
  17. fiqus/geom_generators/GeometryPancake3D.py +316 -117
  18. fiqus/geom_generators/GeometryPancake3DUtils.py +549 -0
  19. fiqus/getdp_runners/RunGetdpCCT.py +4 -4
  20. fiqus/getdp_runners/RunGetdpConductorAC_Strand.py +201 -201
  21. fiqus/getdp_runners/RunGetdpMultipole.py +115 -42
  22. fiqus/getdp_runners/RunGetdpPancake3D.py +28 -6
  23. fiqus/mains/MainCCT.py +2 -2
  24. fiqus/mains/MainConductorAC_Strand.py +132 -132
  25. fiqus/mains/MainMultipole.py +113 -62
  26. fiqus/mains/MainPancake3D.py +63 -23
  27. fiqus/mesh_generators/MeshCCT.py +209 -209
  28. fiqus/mesh_generators/MeshConductorAC_Strand.py +656 -656
  29. fiqus/mesh_generators/MeshMultipole.py +1243 -181
  30. fiqus/mesh_generators/MeshPancake3D.py +275 -192
  31. fiqus/parsers/ParserCOND.py +825 -0
  32. fiqus/parsers/ParserDAT.py +16 -16
  33. fiqus/parsers/ParserGetDPOnSection.py +212 -212
  34. fiqus/parsers/ParserGetDPTimeTable.py +134 -134
  35. fiqus/parsers/ParserMSH.py +53 -53
  36. fiqus/parsers/ParserPOS.py +214 -214
  37. fiqus/parsers/ParserRES.py +142 -142
  38. fiqus/plotters/PlotPythonCCT.py +133 -133
  39. fiqus/plotters/PlotPythonConductorAC.py +855 -840
  40. fiqus/plotters/PlotPythonMultipole.py +18 -18
  41. fiqus/post_processors/PostProcessCCT.py +440 -440
  42. fiqus/post_processors/PostProcessConductorAC.py +49 -49
  43. fiqus/post_processors/PostProcessMultipole.py +353 -229
  44. fiqus/post_processors/PostProcessPancake3D.py +8 -13
  45. fiqus/pre_processors/PreProcessCCT.py +175 -175
  46. fiqus/pro_assemblers/ProAssembler.py +14 -6
  47. fiqus/pro_material_functions/ironBHcurves.pro +246 -246
  48. fiqus/pro_templates/combined/CCT_template.pro +274 -274
  49. fiqus/pro_templates/combined/ConductorAC_template.pro +1025 -1025
  50. fiqus/pro_templates/combined/Multipole_template.pro +1694 -126
  51. fiqus/pro_templates/combined/Pancake3D_template.pro +2294 -1103
  52. fiqus/pro_templates/combined/TSA_materials.pro +162 -0
  53. fiqus/pro_templates/combined/materials.pro +36 -18
  54. fiqus/utils/Utils.py +508 -110
  55. fiqus/utils/update_data_settings.py +33 -0
  56. fiqus-2024.12.0.dist-info/METADATA +130 -0
  57. fiqus-2024.12.0.dist-info/RECORD +84 -0
  58. {fiqus-2024.6.0.dist-info → fiqus-2024.12.0.dist-info}/WHEEL +1 -1
  59. tests/test_FiQuS.py +1 -1
  60. tests/test_geometry_generators.py +101 -2
  61. tests/test_mesh_generators.py +154 -1
  62. tests/test_solvers.py +115 -21
  63. tests/utils/fiqus_test_classes.py +85 -21
  64. tests/utils/generate_reference_files_ConductorAC.py +57 -57
  65. tests/utils/generate_reference_files_Pancake3D.py +4 -5
  66. tests/utils/helpers.py +97 -97
  67. fiqus-2024.6.0.dist-info/METADATA +0 -103
  68. fiqus-2024.6.0.dist-info/RECORD +0 -79
  69. {fiqus-2024.6.0.dist-info → fiqus-2024.12.0.dist-info}/top_level.txt +0 -0
@@ -1,66 +1,740 @@
1
- from pydantic import BaseModel
2
- from typing import (List, Literal, Optional)
1
+ from pydantic import BaseModel, Field
2
+ from typing import List, Dict, Literal, Union, Optional, Tuple
3
3
 
4
4
 
5
- class Threshold(BaseModel):
5
+ class MultipoleGeoElement(BaseModel):
6
6
  """
7
- Level 2: Class for FiQuS Multipole
7
+ Level 5: Class for FiQuS Multipole
8
8
  """
9
- SizeMin: Optional[float] = None
10
- SizeMax: Optional[float] = None
11
- DistMin: Optional[float] = None
12
- DistMax: Optional[float] = None
9
+ lines: Optional[int] = Field(
10
+ default=3,
11
+ description="It specifies the number of Gaussian points for lines.",
12
+ )
13
+ triangles: Optional[Literal[1, 3, 4, 6, 7, 12, 13, 16]] = Field(
14
+ default=3,
15
+ description="It specifies the number of Gaussian points for triangles.",
16
+ )
17
+ quadrangles: Optional[Literal[1, 3, 4, 7]] = Field(
18
+ default=4,
19
+ description="It specifies the number of Gaussian points for quadrangles.",
20
+ )
13
21
 
14
22
 
15
- class GeometryMultipole(BaseModel):
23
+ class MultipoleSolveConvectionBoundaryCondition(BaseModel):
16
24
  """
17
- Level 2: Class for FiQuS Multipole
25
+ Level 5: Class for FiQuS Multipole
18
26
  """
19
- with_iron_yoke: Optional[bool] = None
27
+ boundaries: Optional[List[str]] = Field(
28
+ default=[],
29
+ description="It specifies the list of boundaries where the condition is applied."
30
+ "Each boundary is identified by a string of the form <half-turn/wedge reference number><side>,"
31
+ "where the accepted sides are i, o, l, h which correspond respectively to inner, outer, lower (angle), higher (angle): e.g., 1o",
32
+ )
33
+ heat_transfer_coefficient: Optional[Union[float, str]] = Field(
34
+ default=None,
35
+ description="It specifies the value or function name of the heat transfer coefficient for this boundary condition.",
36
+ )
20
37
 
21
38
 
22
- class MeshMultipole(BaseModel):
39
+ class MultipoleSolveHeatFluxBoundaryCondition(BaseModel):
23
40
  """
24
- Level 2: Class for FiQuS Multipole
41
+ Level 5: Class for FiQuS Multipole
25
42
  """
26
- default_mesh: Optional[bool] = None
27
- mesh_iron: Threshold = Threshold()
28
- mesh_coil: Threshold = Threshold()
29
- MeshSizeMin: Optional[float] = None # sets gmsh Mesh.MeshSizeMin
30
- MeshSizeMax: Optional[float] = None # sets gmsh Mesh.MeshSizeMax
31
- MeshSizeFromCurvature: Optional[float] = None # sets gmsh Mesh.MeshSizeFromCurvature
32
- Algorithm: Optional[int] = None # sets gmsh Mesh.Algorithm
33
- AngleToleranceFacetOverlap: Optional[float] = None # sets gmsh Mesh.AngleToleranceFacetOverlap
34
- ElementOrder: Optional[int] = None # sets gmsh Mesh.ElementOrder
35
- Optimize: Optional[int] = None # sets gmsh Mesh.Optimize
43
+ boundaries: Optional[List[str]] = Field(
44
+ default=[],
45
+ description="It specifies the list of boundaries where the condition is applied."
46
+ "Each boundary is identified by a string of the form <half-turn/wedge reference number><side>,"
47
+ "where the accepted sides are i, o, l, h which correspond respectively to inner, outer, lower (angle), higher (angle): e.g., 1o",
48
+ )
49
+ const_heat_flux: Optional[float] = Field(
50
+ default=None,
51
+ description="It specifies the value of the heat flux for this boundary condition.",
52
+ )
53
+ # function_heat_flux: Optional[str] = None
36
54
 
37
55
 
38
- class SolveMultipoleFiQuS(BaseModel):
56
+ class MultipoleSolveTemperatureBoundaryCondition(BaseModel):
39
57
  """
40
- Level 2: Class for FiQuS Multipole
58
+ Level 5: Class for FiQuS Multipole
41
59
  """
42
- I_initial: Optional[List[float]] = None
43
- pro_template: Optional[str] = None # file name of .pro template file
60
+ boundaries: Optional[List[str]] = Field(
61
+ default=[],
62
+ description="It specifies the list of boundaries where the condition is applied."
63
+ "Each boundary is identified by a string of the form <half-turn/wedge reference number><side>,"
64
+ "where the accepted sides are i, o, l, h which correspond respectively to inner, outer, lower (angle), higher (angle): e.g., 1o",
65
+ )
66
+ const_temperature: Optional[float] = Field(
67
+ default=None,
68
+ description="It specifies the value of the temperature for this boundary condition.",
69
+ )
70
+ # function_temperature: Optional[str] = None
44
71
 
45
72
 
46
- class PostProcMultipole(BaseModel):
73
+ class MultipoleSolveQuenchInitiation(BaseModel):
47
74
  """
48
- Level 2: Class for FiQuS Multipole
75
+ Level 4: Class for FiQuS Multipole
49
76
  """
50
- compare_to_ROXIE: Optional[str] = None
51
- plot_all: Optional[str | bool] = None
52
- variables: Optional[List[str]] = None # Name of variables to post-process, like "b" for magnetic flux density
53
- volumes: Optional[List[str]] = None # Name of domains to post-process, like "powered"
54
- file_exts: Optional[List[str]] = None # Name of file extensions to output to, like "pos"
55
- additional_outputs: Optional[List[str]] = None # Name of software specific input files to prepare, like "LEDET3D"
77
+ turns: Optional[List[int]] = Field(
78
+ default=[],
79
+ description="It specifies the list of reference numbers of half-turns whose critical currents are set to zero.",
80
+ )
81
+ t_trigger: Optional[List[float]] = Field(
82
+ default=[],
83
+ description="It specifies the list of time instants at which the critical current is set to zero.",
84
+ )
56
85
 
57
86
 
58
- class MPDM(BaseModel):
87
+ class MultipoleSolveBoundaryConditionsThermal(BaseModel):
59
88
  """
60
- Level 2: Class for FiQuS Multipole
89
+ Level 4: Class for FiQuS Multipole
61
90
  """
62
- type: Literal['multipole'] = 'multipole'
63
- geometry: GeometryMultipole = GeometryMultipole()
64
- mesh: MeshMultipole = MeshMultipole()
65
- solve: SolveMultipoleFiQuS = SolveMultipoleFiQuS()
66
- postproc: PostProcMultipole = PostProcMultipole()
91
+ temperature: Optional[Dict[str, MultipoleSolveTemperatureBoundaryCondition]] = Field(
92
+ default={},
93
+ description="This dictionary contains the information about the Dirichlet boundary conditions."
94
+ "The keys are chosen names for each boundary condition.",
95
+ )
96
+ heat_flux: Optional[Dict[str, MultipoleSolveHeatFluxBoundaryCondition]] = Field(
97
+ default={},
98
+ description="This dictionary contains the information about the Neumann boundary conditions."
99
+ "The keys are chosen names for each boundary condition.",
100
+ )
101
+ cooling: Optional[Dict[str, MultipoleSolveConvectionBoundaryCondition]] = Field(
102
+ default={},
103
+ description="This dictionary contains the information about the Robin boundary conditions."
104
+ "The keys are chosen names for each boundary condition.",
105
+ )
106
+
107
+
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
+ # )
132
+
133
+
134
+ class MultipoleSolveHeCooling(BaseModel):
135
+ """
136
+ Level 4: Class for FiQuS Multipole
137
+ """
138
+ enabled: Optional[bool] = Field(
139
+ default=False,
140
+ description="It determines whether the helium cooling is enabled or not (adiabatic conditions).",
141
+ )
142
+ sides: Optional[Literal["external", "inner", "outer", "inner_outer"]] = Field(
143
+ default="outer",
144
+ description="It specifies the general grouping of the boundaries where to apply cooling:"
145
+ "'external': all external boundaries; 'inner': only inner boundaries; 'outer': only outer boundaries; 'inner_outer': inner and outer boundaries.",
146
+ )
147
+ heat_transfer_coefficient: Optional[Union[float, str]] = Field(
148
+ default=0.0,
149
+ description="It specifies the value or name of the function of the constant heat transfer coefficient.",
150
+ )
151
+
152
+ class MultipoleSolveNonLinearSolver(BaseModel):
153
+ """
154
+ Level 4: Class for FiQuS Multipole
155
+ """
156
+ rel_tolerance: Optional[float] = Field(
157
+ default=1E-4,
158
+ description="It specifies the relative tolerance.",
159
+ )
160
+ abs_tolerance: Optional[float] = Field(
161
+ default=0.1,
162
+ description="It specifies the absolute tolerance.",
163
+ )
164
+ relaxation_factor: Optional[float] = Field(
165
+ default=0.7,
166
+ description="It specifies the relaxation factor.",
167
+ )
168
+ max_iterations: Optional[int] = Field(
169
+ default=20,
170
+ description="It specifies the maximum number of iterations if no convergence is reached.",
171
+ )
172
+ norm_type: Literal["L1Norm", "MeanL1Norm", "L2Norm", "MeanL2Norm", "LinfNorm"] = Field(
173
+ default='LinfNorm',
174
+ description="It specifies the type of norm to be calculated for convergence assessment.",
175
+ )
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
+ integration_method: Union[None, Literal[
207
+ "Euler", "Gear_2", "Gear_3", "Gear_4", "Gear_5", "Gear_6"
208
+ ]] = Field(
209
+ default="Euler",
210
+ title="Integration Method",
211
+ description="It specifies the type of integration method to be used.",
212
+ )
213
+ rel_tol_time: Optional[float] = Field(
214
+ default=1E-4,
215
+ description="It specifies the relative tolerance.",
216
+ )
217
+ abs_tol_time: Optional[float] = Field(
218
+ default=1e-4,
219
+ description="It specifies the absolute tolerance.",
220
+ )
221
+ norm_type: Literal["L1Norm", "MeanL1Norm", "L2Norm", "MeanL2Norm", "LinfNorm"] = Field(
222
+ default='LinfNorm',
223
+ description="It specifies the type of norm to be calculated for convergence assessment.",
224
+ )
225
+ stop_temperature: Optional[float] = Field(
226
+ default=300,
227
+ description="If one half turn reaches this temperature, the simulation is stopped.",
228
+ )
229
+
230
+
231
+ class MultipoleSolveInsulationBlockToBlock(BaseModel):
232
+ """
233
+ Level 4: Class for FiQuS Multipole
234
+ It contains the information about the materials and thicknesses of the inner insulation regions (between blocks) modeled via thin-shell approximation.
235
+ """
236
+ material: Optional[str] = Field(
237
+ default=None,
238
+ description="It specifies the default material of the insulation regions between the blocks insulation regions.",
239
+ )
240
+ # the order of blocks should be: [inner, outer] for mid-layer couples or [lower, higher] for mid-pole and mid-winding couples
241
+ blocks_connection_overwrite: List[Tuple[str, str]] = Field(
242
+ default=[],
243
+ description="It specifies the blocks couples adjacent to the insulation region."
244
+ "The blocks must be ordered from inner to outer block for mid-layer insulation regions and from lower to higher angle block for mid-pole and mid-winding insulation regions.",
245
+ )
246
+ materials_overwrite: Optional[List[List[str]]] = Field(
247
+ default=[],
248
+ description="It specifies the list of materials making up the layered insulation region to be placed between the specified blocks."
249
+ "The materials must be ordered from inner to outer layers and lower to higher angle layers.",
250
+ )
251
+ thicknesses_overwrite: Optional[List[List[Optional[float]]]] = Field(
252
+ default=[],
253
+ description="It specifies the list of thicknesses of the specified insulation layers. The order must match the one of the materials list.",
254
+ )
255
+
256
+
257
+ class MultipoleSolveInsulationExterior(BaseModel):
258
+ """
259
+ Level 4: Class for FiQuS Multipole
260
+ It contains the information about the materials and thicknesses of the outer insulation regions (exterior boundaries) modeled via thin-shell approximation.
261
+ """
262
+ blocks: Optional[List[str]] = Field(
263
+ default=[],
264
+ description="It specifies the reference numbers of the blocks adjacent to the exterior insulation regions to modify.",
265
+ )
266
+ materials_append: Optional[List[List[str]]] = Field(
267
+ default=[],
268
+ description="It specifies the list of materials making up the layered insulation region to be appended to the block insulation."
269
+ "The materials must be ordered from the block outward.",
270
+ )
271
+ thicknesses_append: Optional[List[List[float]]] = Field(
272
+ default=[],
273
+ description="It specifies the list of thicknesses of the specified insulation layers. The order must match the one of the materials list.",
274
+ )
275
+
276
+
277
+ class MultipoleSolveWedge(BaseModel):
278
+ """
279
+ Level 3: Class for FiQuS Multipole
280
+ """
281
+ material: Optional[str] = Field(
282
+ default=None,
283
+ description="It specifies the material of the wedge regions.",
284
+ )
285
+ RRR: Optional[float] = Field(
286
+ default=None,
287
+ description="It specifies the RRR of the wedge regions.",
288
+ )
289
+ T_ref_RRR_high: Optional[float] = Field(
290
+ default=None,
291
+ description="It specifies the reference temperature associated with the RRR.",
292
+ )
293
+
294
+
295
+ class MultipoleSolveInsulationTSA(BaseModel):
296
+ """
297
+ Level 3: Class for FiQuS Multipole
298
+ """
299
+ block_to_block: MultipoleSolveInsulationBlockToBlock = Field(
300
+ default=MultipoleSolveInsulationBlockToBlock(),
301
+ description="This dictionary contains the information about the materials and thicknesses of the inner insulation regions (between blocks) modeled via thin-shell approximation.",
302
+ )
303
+ exterior: Optional[MultipoleSolveInsulationExterior] = Field(
304
+ default=MultipoleSolveInsulationExterior(),
305
+ description="This dictionary contains the information about the materials and thicknesses of the outer insulation regions (exterior boundaries) modeled via thin-shell approximation.",
306
+ )
307
+
308
+
309
+ class MultipoleSolveThermal(BaseModel):
310
+ """
311
+ Level 3: Class for FiQuS Multipole
312
+ """
313
+ solve_type: Optional[Literal[None, "transient"]] = Field(
314
+ default=None,
315
+ description="It determines whether the thermal transient problem is solved ('transient') or not ('null').",
316
+ )
317
+ insulation_TSA: Optional[MultipoleSolveInsulationTSA] = Field(
318
+ default=MultipoleSolveInsulationTSA(),
319
+ description="This dictionary contains the information about the materials and thicknesses of the insulation regions modeled via thin-shell approximation.",
320
+ )
321
+ He_cooling: MultipoleSolveHeCooling = Field(
322
+ default=MultipoleSolveHeCooling(),
323
+ description="This dictionary contains the information about the Robin boundary condition for generic groups of boundaries.",
324
+ )
325
+ overwrite_boundary_conditions: Optional[MultipoleSolveBoundaryConditionsThermal] = Field(
326
+ default=MultipoleSolveBoundaryConditionsThermal(),
327
+ description="This dictionary contains the information about boundary conditions for explicitly specified boundaries.",
328
+ )
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
+ time_stepping: MultipoleSolveTransientThermal = Field(
334
+ default=MultipoleSolveTransientThermal(),
335
+ description="This dictionary contains the information about the parameters for the transient solver.",
336
+ )
337
+ jc_degradation_to_zero: Optional[MultipoleSolveQuenchInitiation] = Field(
338
+ default=MultipoleSolveQuenchInitiation(),
339
+ description="This dictionary contains the information about half turns with zero critical current.",
340
+ )
341
+ init_temperature: Optional[float] = Field(
342
+ default=1.9,
343
+ description="It specifies the initial temperature of the simulation.",
344
+ )
345
+ enforce_init_temperature_as_minimum: Optional[bool] = Field(
346
+ default=False,
347
+ description="It determines whether the initial temperature is enforced as the minimum temperature of the simulation.",
348
+ )
349
+
350
+ class MultipoleSolveElectromagnetics(BaseModel):
351
+ """
352
+ Level 3: Class for FiQuS Multipole
353
+ """
354
+ solve_type: Optional[Literal[None, "stationary"]] = Field(
355
+ default=None,
356
+ description="It determines whether the magneto-static problem is solved ('stationary') or not ('null').",
357
+ )
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.",
362
+ )
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
+
369
+
370
+ class MultipoleMeshThinShellApproximationParameters(BaseModel):
371
+ """
372
+ Level 4: Class for FiQuS Multipole
373
+ """
374
+ minimum_discretizations: Optional[int] = Field(
375
+ default=1,
376
+ description="It specifies the number of minimum spacial discretizations across a thin-shell.",
377
+ )
378
+ global_size_QH: Optional[float] = Field(
379
+ default=1e-4,
380
+ description="The thickness of the quench heater region is divided by this parameter to determine the number of spacial discretizations across the thin-shell.",
381
+ )
382
+ minimum_discretizations_QH: Optional[int] = Field(
383
+ default=1,
384
+ description="It specifies the number of minimum spacial discretizations across a thin-shell.",
385
+ )
386
+
387
+
388
+ class MultipoleMeshThreshold(BaseModel):
389
+ """
390
+ Level 3: Class for FiQuS Multipole
391
+ """
392
+ enabled: Optional[bool] = Field(
393
+ default=False,
394
+ description="It determines whether the gmsh Field is enabled or not.",
395
+ )
396
+ SizeMin: Optional[float] = Field(
397
+ default=None,
398
+ description="It sets gmsh Mesh.MeshSizeMin.",
399
+ )
400
+ SizeMax: Optional[float] = Field(
401
+ default=None,
402
+ description="It sets gmsh Mesh.MeshSizeMax.",
403
+ )
404
+ DistMin: Optional[float] = Field(
405
+ default=None,
406
+ description="It sets gmsh Mesh.MeshDistMin.",
407
+ )
408
+ DistMax: Optional[float] = Field(
409
+ default=None,
410
+ description="It sets gmsh Mesh.MeshDistMax.",
411
+ )
412
+
413
+ class MultipoleMeshTransfinite(BaseModel):
414
+ """
415
+ Level 3: Class for FiQuS Multipole
416
+ """
417
+ enabled_for: Literal[None, "curves", "curves_and_surfaces"] = Field(
418
+ default=None,
419
+ description="It determines on what entities the transfinite algorithm is applied.",
420
+ )
421
+ curve_target_size_height: Optional[float] = Field(
422
+ default=1.0,
423
+ description="The height of the region (short side) is divided by this parameter to determine the number of elements to apply via transfinite curves.",
424
+ )
425
+ curve_target_size_width: Optional[float] = Field(
426
+ default=1.0,
427
+ description="The width of the region (long side) is divided by this parameter to determine the number of elements to apply via transfinite curves.",
428
+ )
429
+ class MultipoleMeshTransfiniteOrField(BaseModel):
430
+ """
431
+ Level 3: Class for FiQuS Multipole
432
+ """
433
+ transfinite: MultipoleMeshTransfinite = Field(
434
+ default=MultipoleMeshTransfinite(),
435
+ description="This dictionary contains the mesh information for transfinite curves.",
436
+ )
437
+ field: MultipoleMeshThreshold = Field(
438
+ default=MultipoleMeshThreshold(),
439
+ description="This dictionary contains the gmsh Field information.",
440
+ )
441
+
442
+ class MultipolePostProcThermal(BaseModel):
443
+ """
444
+ Level 2: Class for FiQuS Multipole
445
+ """
446
+ output_time_steps_pos: Optional[Union[bool, int]] = Field(
447
+ default=True,
448
+ description="It determines whether the solution for the .pos file is saved for all time steps (True), none (False), or equidistant time steps (int).",
449
+ )
450
+ output_time_steps_txt: Optional[Union[bool, int]] = Field(
451
+ default=True,
452
+ description="It determines whether the solution for the .txt file is saved for all time steps (True), none (False), or equidistant time steps (int).",
453
+ )
454
+ save_pos_at_the_end: Optional[bool] = Field(
455
+ default=True,
456
+ description="It determines whether the solution for the .pos file is saved at the end of the simulation or during run time.",
457
+ )
458
+ save_txt_at_the_end: Optional[bool] = Field(
459
+ default=False,
460
+ description="It determines whether the solution for the .txt file is saved at the end of the simulation or during run time.",
461
+ )
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
+ )
466
+ plot_all: Optional[Union[bool, None]] = Field(
467
+ default=False,
468
+ description="It determines whether the figures are generated and shown (true), generated only (null), or not generated (false). Useful for tests.",
469
+ )
470
+ variables: Optional[List[Literal["T", "jOverJc", "rho"]]] = Field(
471
+ default=["T"],
472
+ description="It specifies the physical quantity to be output.",
473
+ )
474
+ volumes: Optional[List[
475
+ Literal["omega", "powered", "induced", "iron", "conducting", "insulator"]]] = Field(
476
+ default=["powered"],
477
+ description="It specifies the regions associated with the physical quantity to be output.",
478
+ )
479
+
480
+
481
+ class MultipolePostProcElectromagnetics(BaseModel):
482
+ """
483
+ Level 2: Class for FiQuS Multipole
484
+ """
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
+ compare_to_ROXIE: Optional[str] = Field(
502
+ default=None,
503
+ description="It contains the absolute path to a reference ROXIE map2d file. If provided, comparative plots with respect to the reference are generated.",
504
+ )
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"],
511
+ description="It specifies the physical quantity to be output.",
512
+ )
513
+ volumes: Optional[List[
514
+ Literal["omega", "powered", "induced", "air", "air_far_field", "iron", "conducting", "insulator"]]] = Field(
515
+ default=["powered"],
516
+ description="It specifies the regions associated with the physical quantity to be output.",
517
+ )
518
+
519
+
520
+ class MultipolePostProc(BaseModel):
521
+ """
522
+ Level 2: Class for FiQuS Multipole
523
+ """
524
+ electromagnetics: MultipolePostProcElectromagnetics = Field(
525
+ default=MultipolePostProcElectromagnetics(),
526
+ description="This dictionary contains the post-processing information for the electromagnetic solution.",
527
+ )
528
+ thermal: MultipolePostProcThermal = Field(
529
+ default=MultipolePostProcThermal(),
530
+ description="This dictionary contains the post-processing information for the thermal solution.",
531
+ )
532
+
533
+
534
+ class MultipoleSolve(BaseModel):
535
+ """
536
+ Level 2: Class for FiQuS Multipole
537
+ """
538
+ electromagnetics: MultipoleSolveElectromagnetics = Field(
539
+ default=MultipoleSolveElectromagnetics(),
540
+ description="This dictionary contains the solver information for the electromagnetic solution.",
541
+ )
542
+ thermal: MultipoleSolveThermal = Field(
543
+ default=MultipoleSolveThermal(),
544
+ description="This dictionary contains the solver information for the thermal solution.",
545
+ )
546
+ wedges: MultipoleSolveWedge = Field(
547
+ default=MultipoleSolveWedge(),
548
+ description="This dictionary contains the material information of wedges.",
549
+ )
550
+ noOfMPITasks: Optional[Union[bool, int]] = Field(
551
+ default=False,
552
+ title="No. of tasks for MPI parallel run of GetDP",
553
+ description=(
554
+ "If integer, GetDP will be run in parallel using MPI. This is only valid"
555
+ " if MPI is installed on the system and an MPI-enabled GetDP is used."
556
+ " If False, GetDP will be run in serial without invoking mpiexec."
557
+ ),
558
+ )
559
+
560
+ class MultipoleThermalInsulationMesh(BaseModel):
561
+ """
562
+ Level 3: Class for FiQuS Multipole
563
+ """
564
+ global_size: float = Field(
565
+ default=1e-4,
566
+ description="It specifies the global size of the mesh for the insulation regions. It is enforced as a constant mesh field for surface insulation and by fixing the number of TSA layers for thin-shell approximation.",
567
+ )
568
+ TSA: Optional[MultipoleMeshThinShellApproximationParameters] = Field(
569
+ default=MultipoleMeshThinShellApproximationParameters(),
570
+ description="This dictionary contains the mesh information for thin-shells.",
571
+ )
572
+
573
+ class MultipoleMeshThermal(BaseModel):
574
+ """
575
+ Level 2: Class for FiQuS Multipole
576
+ """
577
+ create: bool = Field(
578
+ default=True,
579
+ description="It determines whether the thermal mesh is built or not.",
580
+ )
581
+ conductors: Optional[MultipoleMeshTransfiniteOrField] = Field(
582
+ default=MultipoleMeshTransfiniteOrField(),
583
+ description="This dictionary contains the mesh information for the conductor regions.",
584
+ )
585
+ wedges: Optional[MultipoleMeshTransfiniteOrField] = Field(
586
+ default=MultipoleMeshTransfiniteOrField(),
587
+ description="This dictionary contains the mesh information for the wedge regions.",
588
+ )
589
+ iron_field: Optional[MultipoleMeshThreshold] = Field(
590
+ default=MultipoleMeshThreshold(),
591
+ description="This dictionary contains the gmsh Field information for the iron yoke region.",
592
+ )
593
+ insulation: Optional[MultipoleThermalInsulationMesh] = Field(
594
+ default=MultipoleThermalInsulationMesh(),
595
+ description="This dictionary contains the mesh information for the insulation regions.",
596
+ )
597
+
598
+ iron_field: Optional[MultipoleMeshThreshold] = Field(
599
+ default=MultipoleMeshThreshold(),
600
+ description="This dictionary contains the gmsh Field information for the iron yoke region.",
601
+ )
602
+
603
+ isothermal_conductors: Optional[bool] = Field(
604
+ default=False,
605
+ description="It determines whether the conductors are considered isothermal or not using getDP constraints.",
606
+ )
607
+ isothermal_wedges: Optional[bool] = Field(
608
+ default=False,
609
+ description="It determines whether the wedges are considered isothermal or not using getDP Link constraints.",
610
+ )
611
+
612
+ class MultipoleMeshElectromagnetics(BaseModel):
613
+ """
614
+ Level 2: Class for FiQuS Multipole
615
+ """
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
+ bore_field: Optional[MultipoleMeshThreshold] = Field(
633
+ default=MultipoleMeshThreshold(),
634
+ description="This dictionary contains the gmsh Field information for the bore region.",
635
+ )
636
+
637
+ class MultipoleMesh(BaseModel):
638
+ """
639
+ Level 2: Class for FiQuS Multipole
640
+ """
641
+ electromagnetics: MultipoleMeshElectromagnetics = Field(
642
+ default=MultipoleMeshElectromagnetics(),
643
+ description="This dictionary contains the mesh information for the electromagnetic solution.",
644
+ )
645
+ thermal: MultipoleMeshThermal = Field(
646
+ default=MultipoleMeshThermal(),
647
+ description="This dictionary contains the mesh information for the thermal solution.",
648
+ )
649
+
650
+
651
+ class MultipoleGeometryThermal(BaseModel):
652
+ """
653
+ Level 2: Class for FiQuS Multipole
654
+ """
655
+ create: bool = Field(
656
+ 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.",
662
+ )
663
+ with_wedges: Optional[bool] = Field(
664
+ default=True,
665
+ description="It determines whether the wedge regions are built or not.",
666
+ )
667
+ use_TSA: Optional[bool] = Field(
668
+ default=False,
669
+ description="It determines whether the insulation regions are explicitly built or modeled via thin-shell approximation.",
670
+ )
671
+ correct_block_coil_tsa_checkered_scheme: Optional[bool] = Field(
672
+ default=False,
673
+ 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
+ )
675
+
676
+ class MultipoleGeometryElectromagnetics(BaseModel):
677
+ """
678
+ Level 2: Class for FiQuS Multipole
679
+ """
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
+ symmetry: Optional[Literal["none", "xy", "x", "y"]] = Field(
693
+ default='none',
694
+ description="It determines the model regions to build according to the specified axis/axes.",
695
+ )
696
+
697
+
698
+ class MultipoleGeometry(BaseModel):
699
+ """
700
+ Level 2: Class for FiQuS Multipole
701
+ """
702
+ geom_file_path: Optional[str] = Field(
703
+ default=None,
704
+ description="It contains the path to a .geom file. If null, the default .geom file produced by steam-sdk BuilderFiQuS will be used.",
705
+ )
706
+ plot_preview: Optional[bool] = Field(
707
+ default=False,
708
+ description="If true, it displays matplotlib figures of the magnet geometry with relevant information (e.g., conductor and block numbers).",
709
+ )
710
+ electromagnetics: MultipoleGeometryElectromagnetics = Field(
711
+ default=MultipoleGeometryElectromagnetics(),
712
+ description="This dictionary contains the geometry information for the electromagnetic solution.",
713
+ )
714
+ thermal: MultipoleGeometryThermal = Field(
715
+ default=MultipoleGeometryThermal(),
716
+ description="This dictionary contains the geometry information for the thermal solution.",
717
+ )
718
+
719
+
720
+ class Multipole(BaseModel):
721
+ """
722
+ Level 1: Class for FiQuS Multipole
723
+ """
724
+ type: Literal["multipole"] = "multipole"
725
+ geometry: MultipoleGeometry = Field(
726
+ default=MultipoleGeometry(),
727
+ description="This dictionary contains the geometry information.",
728
+ )
729
+ mesh: MultipoleMesh = Field(
730
+ default=MultipoleMesh(),
731
+ description="This dictionary contains the mesh information.",
732
+ )
733
+ solve: MultipoleSolve = Field(
734
+ default=MultipoleSolve(),
735
+ description="This dictionary contains the solution information.",
736
+ )
737
+ postproc: MultipolePostProc = Field(
738
+ default=MultipolePostProc(),
739
+ description="This dictionary contains the post-process information.",
740
+ )