Coverage for fiqus/data/DataFiQuSCCT.py: 100%

85 statements  

« prev     ^ index     » next       coverage.py v6.4.4, created at 2024-05-20 03:24 +0200

1from pydantic import BaseModel 

2from typing import (List, Literal, Optional) 

3 

4 

5class 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 

21class 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 

30class 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 

46class 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 

55class 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 

66class 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 

74class 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 

85class 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 

93class 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 

103class 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 

114class 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 

128class 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 

142class 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()