fiqus 2024.7.0__py3-none-any.whl → 2024.12.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 (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 -855
  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.1.dist-info/METADATA +132 -0
  57. fiqus-2024.12.1.dist-info/RECORD +84 -0
  58. {fiqus-2024.7.0.dist-info → fiqus-2024.12.1.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.7.0.dist-info/METADATA +0 -103
  68. fiqus-2024.7.0.dist-info/RECORD +0 -79
  69. {fiqus-2024.7.0.dist-info → fiqus-2024.12.1.dist-info}/top_level.txt +0 -0
fiqus/data/DataFiQuS.py CHANGED
@@ -1,102 +1,105 @@
1
1
  from pydantic import BaseModel, Field
2
- from typing import (Dict, List, Union, Literal, Optional)
3
- from fiqus.data.DataConductor import Conductor
2
+ from typing import Dict, List, Union, Literal, Optional
4
3
  from fiqus.data.DataRoxieParser import RoxieData
5
- from fiqus.data.DataFiQuSMultipole import MPDM
6
4
  from fiqus.data.DataFiQuSCCT import CCTDM
5
+ from fiqus.data.DataFiQuSMultipole import Multipole
7
6
  from fiqus.data.DataFiQuSPancake3D import Pancake3D
7
+ from fiqus.data.DataConductor import Conductor
8
8
  from fiqus.data.DataFiQuSConductorAC_Strand import CACStrand
9
9
 
10
10
 
11
- class MonoFiQuS(BaseModel):
12
- """
13
- Rutherford cable type
14
- """
15
- type: Literal['Mono']
16
- bare_cable_width: Optional[float] = None
17
- bare_cable_height_mean: Optional[float] = None
18
-
19
-
20
- class RibbonFiQuS(BaseModel):
21
- """
22
- Rutherford cable type
23
- """
24
- type: Literal['Ribbon']
25
- bare_cable_width: Optional[float] = None
26
- bare_cable_height_mean: Optional[float] = None
27
-
28
-
29
- class RutherfordFiQuS(BaseModel):
30
- """
31
- Rutherford cable type
32
- """
33
- type: Literal['Rutherford']
34
- bare_cable_width: Optional[float] = None
35
- bare_cable_height_mean: Optional[float] = None
36
-
37
-
38
- class ConductorFiQuS(BaseModel):
39
- """
40
- Class for conductor type
41
- """
42
- cable: Union[RutherfordFiQuS, RibbonFiQuS, MonoFiQuS] = {'type': 'Rutherford'}
43
-
44
-
45
- class GeneralSetting(BaseModel):
46
- """
47
- Class for general information on the case study
48
- """
49
- I_ref: Optional[List[float]] = None
50
-
51
-
52
- class ModelDataSetting(BaseModel):
53
- """
54
- Class for model data
55
- """
56
- general_parameters: GeneralSetting = GeneralSetting()
57
- conductors: Dict[str, ConductorFiQuS] = {}
58
-
59
- #######################################################################################################################
60
-
61
-
62
11
  class FiQuSGeometry(BaseModel):
63
12
  """
64
- Class for Roxie data
13
+ Class for Roxie data
65
14
  """
66
- Roxie_Data: RoxieData = RoxieData()
67
-
68
15
 
69
- class FiQuSSettings(BaseModel):
70
- """
71
- Class for FiQuS model
72
- """
73
- Model_Data_GS: ModelDataSetting = ModelDataSetting()
16
+ Roxie_Data: RoxieData = RoxieData()
74
17
 
75
18
 
76
19
  class RunFiQuS(BaseModel):
77
20
  """
78
- Class for FiQuS run
79
- """
80
- type: Literal["start_from_yaml", "mesh_only", "geometry_only", "geometry_and_mesh", "pre_process_only", "mesh_and_solve_with_post_process_python", "solve_with_post_process_python", "solve_only", "post_process_getdp_only", "post_process_python_only", "post_process", "batch_post_process_python"] = Field(default="start_from_yaml", title="Run Type of FiQuS", description="FiQuS allows you to run the model in different ways. The run type can be specified here. For example, you can just create the geometry and mesh or just solve the model with previous mesh, etc.")
81
- geometry: Optional[Union[str, int]] = Field(default=None, title="Geometry Folder Key", description="This key will be appended to the geometry folder.")
82
- mesh: Optional[Union[str, int]] = Field(default=None, title="Mesh Folder Key", description="This key will be appended to the mesh folder.")
83
- solution: Optional[Union[str, int]] = Field(default=None, title="Solution Folder Key", description="This key will be appended to the solution folder.")
84
- launch_gui: bool = Field(default=True, title="Launch GUI", description="If True, the GUI will be launched after the run.")
85
- overwrite: bool = Field(default=False, title="Overwrite", description="If True, the existing folders will be overwritten, otherwise new folders will be created.")
86
- comments: str = Field(default="", title="Comments", description="Comments for the run. These comments will be saved in the run_log.csv file.")
21
+ Class for FiQuS run
22
+ """
23
+
24
+ type: Literal[
25
+ "start_from_yaml",
26
+ "mesh_only",
27
+ "geometry_only",
28
+ "geometry_and_mesh",
29
+ "pre_process_only",
30
+ "mesh_and_solve_with_post_process_python",
31
+ "solve_with_post_process_python",
32
+ "solve_only",
33
+ "post_process_getdp_only",
34
+ "post_process_python_only",
35
+ "post_process",
36
+ "plot_python",
37
+ "batch_post_process_python",
38
+ ] = Field(
39
+ default="start_from_yaml",
40
+ title="Run Type of FiQuS",
41
+ description="FiQuS allows you to run the model in different ways. The run type can be specified here. For example, you can just create the geometry and mesh or just solve the model with previous mesh, etc.",
42
+ )
43
+ geometry: Optional[Union[str, int]] = Field(
44
+ default=None,
45
+ title="Geometry Folder Key",
46
+ description="This key will be appended to the geometry folder.",
47
+ )
48
+ mesh: Optional[Union[str, int]] = Field(
49
+ default=None,
50
+ title="Mesh Folder Key",
51
+ description="This key will be appended to the mesh folder.",
52
+ )
53
+ solution: Optional[Union[str, int]] = Field(
54
+ default=None,
55
+ title="Solution Folder Key",
56
+ description="This key will be appended to the solution folder.",
57
+ )
58
+ launch_gui: bool = Field(
59
+ default=False,
60
+ title="Launch GUI",
61
+ description="If True, the GUI will be launched after the run.",
62
+ )
63
+ overwrite: bool = Field(
64
+ default=False,
65
+ title="Overwrite",
66
+ description="If True, the existing folders will be overwritten, otherwise new folders will be created. NOTE: This setting has no effect for HTCondor runs.",
67
+ )
68
+ comments: str = Field(
69
+ default="",
70
+ title="Comments",
71
+ description="Comments for the run. These comments will be saved in the run_log.csv file.",
72
+ )
73
+ verbosity_Gmsh: int = Field(
74
+ default=5,
75
+ title="verbosity_Gmsh",
76
+ description="Level of information printed on the terminal and the message console (0: silent except for fatal errors, 1: +errors, 2: +warnings, 3: +direct, 4: +information, 5: +status, 99: +debug)",
77
+ )
78
+ verbosity_GetDP: int = Field(
79
+ default=5,
80
+ title="verbosity_GetDP",
81
+ description="Level of information printed on the terminal and the message console. Higher number prints more, good options are 5 or 6.",
82
+ )
83
+ verbosity_FiQuS: bool = Field(
84
+ default=True,
85
+ title="verbosity_FiQuS",
86
+ description="Level of information printed on the terminal and the message console by FiQuS. Only True of False for now.",
87
+ )
87
88
 
88
89
 
89
90
  class GeneralFiQuS(BaseModel):
90
91
  """
91
- Class for FiQuS general
92
+ Class for FiQuS general
92
93
  """
94
+
93
95
  magnet_name: Optional[str] = None
94
96
 
95
97
 
96
98
  class EnergyExtraction(BaseModel):
97
99
  """
98
- Level 3: Class for FiQuS
100
+ Level 3: Class for FiQuS
99
101
  """
102
+
100
103
  t_trigger: Optional[float] = None
101
104
  R_EE: Optional[float] = None
102
105
  power_R_EE: Optional[float] = None
@@ -106,9 +109,10 @@ class EnergyExtraction(BaseModel):
106
109
 
107
110
  class QuenchHeaters(BaseModel):
108
111
  """
109
- Level 3: Class for FiQuS
112
+ Level 3: Class for FiQuS
110
113
  """
111
- N_strips: Optional[int] = None
114
+
115
+ N_strips: Optional[int] = None # set to 0 to avoid building quench heater thin shells
112
116
  t_trigger: Optional[List[float]] = None
113
117
  U0: Optional[List[float]] = None
114
118
  C: Optional[List[float]] = None
@@ -129,8 +133,9 @@ class QuenchHeaters(BaseModel):
129
133
 
130
134
  class Cliq(BaseModel):
131
135
  """
132
- Level 3: Class for FiQuS
136
+ Level 3: Class for FiQuS
133
137
  """
138
+
134
139
  t_trigger: Optional[float] = None
135
140
  current_direction: Optional[List[int]] = None
136
141
  sym_factor: Optional[int] = None
@@ -144,8 +149,9 @@ class Cliq(BaseModel):
144
149
 
145
150
  class Circuit(BaseModel):
146
151
  """
147
- Level 2: Class for FiQuS
152
+ Level 2: Class for FiQuS
148
153
  """
154
+
149
155
  R_circuit: Optional[float] = None
150
156
  L_circuit: Optional[float] = None
151
157
  R_parallel: Optional[float] = None
@@ -153,31 +159,69 @@ class Circuit(BaseModel):
153
159
 
154
160
  class PowerSupply(BaseModel):
155
161
  """
156
- Level 2: Class for FiQuS
162
+ Level 2: Class for FiQuS
157
163
  """
164
+
158
165
  I_initial: Optional[float] = None
159
166
  t_off: Optional[float] = None
160
- t_control_LUT: List[float] = Field(None, title="Time Values for Current Source", description="This list of time values will be matched with the current values in I_control_LUT, and then these (t, I) points will be connected with straight lines.")
161
- I_control_LUT: List[float] = Field(None, title="Current Values for Current Source" ,description="This list of current values will be matched with the time values in t_control_LUT, and then these (t, I) points will be connected with straight lines.")
167
+ t_control_LUT: Optional[List[float]] = Field(
168
+ default=None,
169
+ title="Time Values for Current Source",
170
+ description="This list of time values will be matched with the current values in I_control_LUT, and then these (t, I) points will be connected with straight lines.",
171
+ )
172
+ I_control_LUT: Optional[List[float]] = Field(
173
+ default=None,
174
+ title="Current Values for Current Source",
175
+ description="This list of current values will be matched with the time values in t_control_LUT, and then these (t, I) points will be connected with straight lines.",
176
+ )
162
177
  R_crowbar: Optional[float] = None
163
178
  Ud_crowbar: Optional[float] = None
164
179
 
165
180
 
166
181
  class QuenchProtection(BaseModel):
167
182
  """
168
- Level 2: Class for FiQuS
183
+ Level 2: Class for FiQuS
169
184
  """
170
- energy_extraction: EnergyExtraction = EnergyExtraction()
185
+
186
+ energy_extraction: EnergyExtraction = EnergyExtraction()
171
187
  quench_heaters: QuenchHeaters = QuenchHeaters()
172
188
  cliq: Cliq = Cliq()
173
189
 
190
+ class QuenchDetection(BaseModel):
191
+ """
192
+ Level 2: Class for FiQuS
193
+ """
194
+
195
+ voltage_thresholds: Optional[List[float]] = Field(
196
+ default=None,
197
+ title="List of quench detection voltage thresholds",
198
+ description="Voltage thresholds for quench detection. The quench detection will be triggered when the voltage exceeds these thresholds continuously for a time larger than the discrimination time.",
199
+ )
200
+
201
+ discrimination_times: Optional[List[float]] = Field(
202
+ default=None,
203
+ title="List of quench detection discrimination times",
204
+ description="Discrimination times for quench detection. The quench detection will be triggered when the voltage exceeds the thresholds continuously for a time larger than these discrimination times.",
205
+ )
206
+
207
+ voltage_tap_pairs: Optional[List[List[int]]] = Field(
208
+ default=None,
209
+ title="List of quench detection voltage tap pairs",
210
+ description="Voltage tap pairs for quench detection. The voltage difference between these pairs will be used for quench detection.",
211
+ )
174
212
 
175
213
  class FDM(BaseModel):
176
214
  """
177
- Class for FiQuS
215
+ Class for FiQuS
178
216
  """
217
+
179
218
  general: GeneralFiQuS = GeneralFiQuS()
180
219
  run: RunFiQuS = RunFiQuS()
181
- magnet: Union[MPDM, CCTDM, Pancake3D, CACStrand] = Field(default=MPDM(), discriminator='type')
220
+ magnet: Union[Multipole, CCTDM, Pancake3D, CACStrand] = Field(
221
+ default=Multipole(), discriminator="type"
222
+ )
223
+ circuit: Circuit = Circuit()
182
224
  power_supply: PowerSupply = PowerSupply()
225
+ quench_protection: QuenchProtection = QuenchProtection()
226
+ quench_detection: QuenchDetection = QuenchDetection()
183
227
  conductors: Dict[Optional[str], Conductor] = {}
@@ -1,150 +1,150 @@
1
- from pydantic import BaseModel
2
- from typing import (List, Literal, Optional)
3
-
4
-
5
- class Winding_gFiQuS(BaseModel): # Geometry related windings _inputs
6
- """
7
- Level 2: Class for FiQuS CCT
8
- """
9
- names: Optional[List[str]] = None # name to use in gmsh and getdp
10
- r_wms: Optional[List[float]] = None # radius of the middle of the winding
11
- n_turnss: Optional[List[float]] = None # number of turns
12
- ndpts: Optional[List[int]] = None # number of divisions of turn, i.e. number of hexagonal elements for each turn
13
- ndpt_ins: Optional[List[int]] = None # number of divisions of terminals in
14
- ndpt_outs: Optional[List[int]] = None # number of divisions of terminals in
15
- lps: Optional[List[float]] = None # layer pitch
16
- alphas: Optional[List[float]] = None # tilt angle
17
- wwws: Optional[List[float]] = None # winding wire widths (assuming rectangular)
18
- wwhs: Optional[List[float]] = None # winding wire heights (assuming rectangular)
19
-
20
-
21
- class Winding_s(BaseModel): # Solution time used windings _inputs (materials and BC)
22
- """
23
- Level 2: Class for FiQuS CCT
24
- """
25
- currents: Optional[List[float]] = None # current in the wire
26
- sigmas: Optional[List[float]] = None # electrical conductivity
27
- mu_rs: Optional[List[float]] = None # relative permeability
28
-
29
-
30
- class FQPL_g(BaseModel): # Geometry related fqpls _inputs
31
- """
32
- Level 2: Class for FiQuS CCT
33
- """
34
- names: List[str] = [] # name to use in gmsh and getdp
35
- fndpls: Optional[List[int]] = None # fqpl number of divisions per length
36
- fwws: Optional[List[float]] = None # fqpl wire widths (assuming rectangular) for theta = 0 this is x dimension
37
- fwhs: Optional[List[float]] = None # fqpl wire heights (assuming rectangular) for theta = 0 this is y dimension
38
- r_ins: Optional[List[float]] = None # radiuses for inner diameter for fqpl (radial (or x direction for theta=0) for placing the fqpl
39
- r_bs: Optional[List[float]] = None # radiuses for bending the fqpl by 180 degrees
40
- n_sbs: Optional[List[int]] = None # number of 'bending segmetns' for the 180 degrees turn
41
- thetas: Optional[List[float]] = None # rotation in deg from x+ axis towards y+ axis about z axis.
42
- z_starts: Optional[List[str]] = None # which air boundary to start at. These is string with either: z_min or z_max key from the Air region.
43
- z_ends: Optional[List[float]] = None # z coordinate of loop end
44
-
45
-
46
- class FQPL_s(BaseModel): # Solution time used fqpls _inputs (materials and BC)
47
- """
48
- Level 2: Class for FiQuS CCT
49
- """
50
- currents: List[float] = [] # current in the wire
51
- sigmas: List[float] = [] # electrical conductivity
52
- mu_rs: List[float] = [] # relative permeability
53
-
54
-
55
- class Former_gFiQuS(BaseModel): # Geometry related formers _inputs
56
- """
57
- Level 2: Class for FiQuS CCT
58
- """
59
- names: Optional[List[str]] = None # name to use in gmsh and getdp
60
- r_ins: Optional[List[float]] = None # inner radius
61
- r_outs: Optional[List[float]] = None # outer radius
62
- z_mins: Optional[List[float]] = None # extend of former in negative z direction
63
- z_maxs: Optional[List[float]] = None # extend of former in positive z direction
64
-
65
-
66
- class Former_s(BaseModel): # Solution time used formers _inputs (materials and BC)
67
- """
68
- Level 2: Class for FiQuS CCT
69
- """
70
- sigmas: Optional[List[float]] = None # electrical conductivity
71
- mu_rs: Optional[List[float]] = None # relative permeability
72
-
73
-
74
- class Air_g(BaseModel): # Geometry related air_region _inputs
75
- """
76
- Level 2: Class for FiQuS CCT
77
- """
78
- name: Optional[str] = None # name to use in gmsh and getdp
79
- sh_type: Optional[str] = None # cylinder or cuboid are possible
80
- ar: Optional[float] = None # if box type is cuboid a is taken as a dimension, if cylinder then r is taken
81
- z_min: Optional[float] = None # extend of air region in negative z direction
82
- z_max: Optional[float] = None # extend of air region in positive z direction
83
-
84
-
85
- class Air_s(BaseModel): # Solution time used air _inputs (materials and BC)
86
- """
87
- Level 2: Class for FiQuS CCT
88
- """
89
- sigma: Optional[float] = None # electrical conductivity
90
- mu_r: Optional[float] = None # relative permeability
91
-
92
-
93
- class GeometryCCTFiQuS(BaseModel):
94
- """
95
- Level 2: Class for FiQuS CCT for FiQuS input
96
- """
97
- windings: Winding_gFiQuS = Winding_gFiQuS()
98
- fqpls: FQPL_g = FQPL_g()
99
- formers: Former_gFiQuS = Former_gFiQuS()
100
- air: Air_g = Air_g()
101
-
102
-
103
- class MeshCCT(BaseModel):
104
- """
105
- Level 2: Class for FiQuS CCT
106
- """
107
- MaxAspectWindings: Optional[float] = None # used in transfinite mesh_generators settings to define mesh_generators size along two longer lines of hex elements of windings
108
- ThresholdSizeMin: Optional[float] = None # sets field control of Threshold SizeMin
109
- ThresholdSizeMax: Optional[float] = None # sets field control of Threshold SizeMax
110
- ThresholdDistMin: Optional[float] = None # sets field control of Threshold DistMin
111
- ThresholdDistMax: Optional[float] = None # sets field control of Threshold DistMax
112
-
113
-
114
- class SolveCCT(BaseModel):
115
- """
116
- Level 2: Class for FiQuS CCT
117
- """
118
- windings: Winding_s = Winding_s() # windings solution time _inputs
119
- fqpls: FQPL_s = FQPL_s() # fqpls solution time _inputs
120
- formers: Former_s = Former_s() # former solution time _inputs
121
- air: Air_s = Air_s() # air solution time _inputs
122
- pro_template: Optional[str] = None # file name of .pro template file
123
- variables: Optional[List[str]] = None # Name of variable to post-process by GetDP, like B for magnetic flux density
124
- volumes: Optional[List[str]] = None # Name of volume to post-process by GetDP, line Winding_1
125
- file_exts: Optional[List[str]] = None # Name of file extensions to post-process by GetDP, like .pos
126
-
127
-
128
- class PostprocCCTFiQuS(BaseModel):
129
- """
130
- Class for FiQuS CCT input file
131
- """
132
- windings_wwns: Optional[List[int]] = None # wires in width direction numbers
133
- windings_whns: Optional[List[int]] = None # wires in height direction numbers
134
- additional_outputs: Optional[List[str]] = None # Name of software specific input files to prepare, like :LEDET3D
135
- winding_order: Optional[List[int]] = None
136
- fqpl_export_trim_tol: Optional[List[float]] = None # this multiplier times winding extend gives 'z' coordinate above(below) which hexes are exported for LEDET, length of this list must match number of fqpls
137
- variables: Optional[List[str]] = None # Name of variable to post-process by python Gmsh API, like B for magnetic flux density
138
- volumes: Optional[List[str]] = None # Name of volume to post-process by python Gmsh API, line Winding_1
139
- file_exts: Optional[List[str]] = None # Name of file extensions o post-process by python Gmsh API, like .pos
140
-
141
-
142
- class CCTDM(BaseModel):
143
- """
144
- Level 1: Class for FiQuS CCT
145
- """
146
- type: Literal['CCT_straight'] = "CCT_straight"
147
- geometry: GeometryCCTFiQuS = GeometryCCTFiQuS()
148
- mesh: MeshCCT = MeshCCT()
149
- solve: SolveCCT = SolveCCT()
150
- postproc: PostprocCCTFiQuS = PostprocCCTFiQuS()
1
+ from pydantic import BaseModel
2
+ from typing import (List, Literal, Optional)
3
+
4
+
5
+ class Winding_gFiQuS(BaseModel): # Geometry related windings _inputs
6
+ """
7
+ Level 2: Class for FiQuS CCT
8
+ """
9
+ names: Optional[List[str]] = None # name to use in gmsh and getdp
10
+ r_wms: Optional[List[float]] = None # radius of the middle of the winding
11
+ n_turnss: Optional[List[float]] = None # number of turns
12
+ ndpts: Optional[List[int]] = None # number of divisions of turn, i.e. number of hexagonal elements for each turn
13
+ ndpt_ins: Optional[List[int]] = None # number of divisions of terminals in
14
+ ndpt_outs: Optional[List[int]] = None # number of divisions of terminals in
15
+ lps: Optional[List[float]] = None # layer pitch
16
+ alphas: Optional[List[float]] = None # tilt angle
17
+ wwws: Optional[List[float]] = None # winding wire widths (assuming rectangular)
18
+ wwhs: Optional[List[float]] = None # winding wire heights (assuming rectangular)
19
+
20
+
21
+ class Winding_s(BaseModel): # Solution time used windings _inputs (materials and BC)
22
+ """
23
+ Level 2: Class for FiQuS CCT
24
+ """
25
+ currents: Optional[List[float]] = None # current in the wire
26
+ sigmas: Optional[List[float]] = None # electrical conductivity
27
+ mu_rs: Optional[List[float]] = None # relative permeability
28
+
29
+
30
+ class FQPL_g(BaseModel): # Geometry related fqpls _inputs
31
+ """
32
+ Level 2: Class for FiQuS CCT
33
+ """
34
+ names: List[str] = [] # name to use in gmsh and getdp
35
+ fndpls: Optional[List[int]] = None # fqpl number of divisions per length
36
+ fwws: Optional[List[float]] = None # fqpl wire widths (assuming rectangular) for theta = 0 this is x dimension
37
+ fwhs: Optional[List[float]] = None # fqpl wire heights (assuming rectangular) for theta = 0 this is y dimension
38
+ r_ins: Optional[List[float]] = None # radiuses for inner diameter for fqpl (radial (or x direction for theta=0) for placing the fqpl
39
+ r_bs: Optional[List[float]] = None # radiuses for bending the fqpl by 180 degrees
40
+ n_sbs: Optional[List[int]] = None # number of 'bending segmetns' for the 180 degrees turn
41
+ thetas: Optional[List[float]] = None # rotation in deg from x+ axis towards y+ axis about z axis.
42
+ z_starts: Optional[List[str]] = None # which air boundary to start at. These is string with either: z_min or z_max key from the Air region.
43
+ z_ends: Optional[List[float]] = None # z coordinate of loop end
44
+
45
+
46
+ class FQPL_s(BaseModel): # Solution time used fqpls _inputs (materials and BC)
47
+ """
48
+ Level 2: Class for FiQuS CCT
49
+ """
50
+ currents: List[float] = [] # current in the wire
51
+ sigmas: List[float] = [] # electrical conductivity
52
+ mu_rs: List[float] = [] # relative permeability
53
+
54
+
55
+ class Former_gFiQuS(BaseModel): # Geometry related formers _inputs
56
+ """
57
+ Level 2: Class for FiQuS CCT
58
+ """
59
+ names: Optional[List[str]] = None # name to use in gmsh and getdp
60
+ r_ins: Optional[List[float]] = None # inner radius
61
+ r_outs: Optional[List[float]] = None # outer radius
62
+ z_mins: Optional[List[float]] = None # extend of former in negative z direction
63
+ z_maxs: Optional[List[float]] = None # extend of former in positive z direction
64
+
65
+
66
+ class Former_s(BaseModel): # Solution time used formers _inputs (materials and BC)
67
+ """
68
+ Level 2: Class for FiQuS CCT
69
+ """
70
+ sigmas: Optional[List[float]] = None # electrical conductivity
71
+ mu_rs: Optional[List[float]] = None # relative permeability
72
+
73
+
74
+ class Air_g(BaseModel): # Geometry related air_region _inputs
75
+ """
76
+ Level 2: Class for FiQuS CCT
77
+ """
78
+ name: Optional[str] = None # name to use in gmsh and getdp
79
+ sh_type: Optional[str] = None # cylinder or cuboid are possible
80
+ ar: Optional[float] = None # if box type is cuboid a is taken as a dimension, if cylinder then r is taken
81
+ z_min: Optional[float] = None # extend of air region in negative z direction
82
+ z_max: Optional[float] = None # extend of air region in positive z direction
83
+
84
+
85
+ class Air_s(BaseModel): # Solution time used air _inputs (materials and BC)
86
+ """
87
+ Level 2: Class for FiQuS CCT
88
+ """
89
+ sigma: Optional[float] = None # electrical conductivity
90
+ mu_r: Optional[float] = None # relative permeability
91
+
92
+
93
+ class GeometryCCTFiQuS(BaseModel):
94
+ """
95
+ Level 2: Class for FiQuS CCT for FiQuS input
96
+ """
97
+ windings: Winding_gFiQuS = Winding_gFiQuS()
98
+ fqpls: FQPL_g = FQPL_g()
99
+ formers: Former_gFiQuS = Former_gFiQuS()
100
+ air: Air_g = Air_g()
101
+
102
+
103
+ class MeshCCT(BaseModel):
104
+ """
105
+ Level 2: Class for FiQuS CCT
106
+ """
107
+ MaxAspectWindings: Optional[float] = None # used in transfinite mesh_generators settings to define mesh_generators size along two longer lines of hex elements of windings
108
+ ThresholdSizeMin: Optional[float] = None # sets field control of Threshold SizeMin
109
+ ThresholdSizeMax: Optional[float] = None # sets field control of Threshold SizeMax
110
+ ThresholdDistMin: Optional[float] = None # sets field control of Threshold DistMin
111
+ ThresholdDistMax: Optional[float] = None # sets field control of Threshold DistMax
112
+
113
+
114
+ class SolveCCT(BaseModel):
115
+ """
116
+ Level 2: Class for FiQuS CCT
117
+ """
118
+ windings: Winding_s = Winding_s() # windings solution time _inputs
119
+ fqpls: FQPL_s = FQPL_s() # fqpls solution time _inputs
120
+ formers: Former_s = Former_s() # former solution time _inputs
121
+ air: Air_s = Air_s() # air solution time _inputs
122
+ pro_template: Optional[str] = None # file name of .pro template file
123
+ variables: Optional[List[str]] = None # Name of variable to post-process by GetDP, like B for magnetic flux density
124
+ volumes: Optional[List[str]] = None # Name of volume to post-process by GetDP, line Winding_1
125
+ file_exts: Optional[List[str]] = None # Name of file extensions to post-process by GetDP, like .pos
126
+
127
+
128
+ class PostprocCCTFiQuS(BaseModel):
129
+ """
130
+ Class for FiQuS CCT input file
131
+ """
132
+ windings_wwns: Optional[List[int]] = None # wires in width direction numbers
133
+ windings_whns: Optional[List[int]] = None # wires in height direction numbers
134
+ additional_outputs: Optional[List[str]] = None # Name of software specific input files to prepare, like :LEDET3D
135
+ winding_order: Optional[List[int]] = None
136
+ fqpl_export_trim_tol: Optional[List[float]] = None # this multiplier times winding extend gives 'z' coordinate above(below) which hexes are exported for LEDET, length of this list must match number of fqpls
137
+ variables: Optional[List[str]] = None # Name of variable to post-process by python Gmsh API, like B for magnetic flux density
138
+ volumes: Optional[List[str]] = None # Name of volume to post-process by python Gmsh API, line Winding_1
139
+ file_exts: Optional[List[str]] = None # Name of file extensions o post-process by python Gmsh API, like .pos
140
+
141
+
142
+ class CCTDM(BaseModel):
143
+ """
144
+ Level 1: Class for FiQuS CCT
145
+ """
146
+ type: Literal['CCT_straight'] = "CCT_straight"
147
+ geometry: GeometryCCTFiQuS = GeometryCCTFiQuS()
148
+ mesh: MeshCCT = MeshCCT()
149
+ solve: SolveCCT = SolveCCT()
150
+ postproc: PostprocCCTFiQuS = PostprocCCTFiQuS()