femagtools 1.7.8__py3-none-any.whl → 1.8.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.
- femagtools/__init__.py +1 -1
- femagtools/amela.py +2 -2
- femagtools/dxfsl/area.py +142 -9
- femagtools/dxfsl/conv.py +2 -9
- femagtools/dxfsl/converter.py +33 -9
- femagtools/dxfsl/fslrenderer.py +13 -12
- femagtools/dxfsl/geom.py +39 -6
- femagtools/dxfsl/journal.py +2 -2
- femagtools/dxfsl/machine.py +14 -13
- femagtools/dxfsl/shape.py +3 -0
- femagtools/dxfsl/svgparser.py +31 -4
- femagtools/ecloss.py +381 -2
- femagtools/femag.py +55 -0
- femagtools/fsl.py +74 -47
- femagtools/isa7.py +41 -0
- femagtools/job.py +2 -2
- femagtools/machine/afpm.py +5 -1
- femagtools/machine/pm.py +1 -1
- femagtools/machine/sm.py +14 -0
- femagtools/machine/utils.py +4 -3
- femagtools/mcv.py +128 -124
- femagtools/me.py +13 -13
- femagtools/model.py +14 -1
- femagtools/moo/population.py +9 -7
- femagtools/nc.py +12 -0
- femagtools/plot/__init__.py +1 -1
- femagtools/plot/fieldlines.py +1 -1
- femagtools/plot/mcv.py +18 -0
- femagtools/plot/nc.py +22 -5
- femagtools/plot/wdg.py +40 -7
- femagtools/svgfsl/converter.py +6 -0
- femagtools/templates/gen_hairpin_winding.mako +36 -45
- femagtools/templates/gen_winding.mako +7 -0
- femagtools/templates/magnetIron.mako +30 -46
- femagtools/templates/magnetIron2.mako +39 -0
- femagtools/templates/magnetIron3.mako +39 -0
- femagtools/templates/magnetIron4.mako +39 -0
- femagtools/templates/magnetIron5.mako +39 -0
- femagtools/templates/magnetIronV.mako +34 -54
- femagtools/templates/magnetSector.mako +32 -47
- femagtools/templates/mesh-airgap.mako +12 -6
- femagtools/templates/prepare_thermal.mako +354 -0
- femagtools/templates/statorRotor3.mako +3 -22
- femagtools/windings.py +92 -59
- {femagtools-1.7.8.dist-info → femagtools-1.8.0.dist-info}/METADATA +20 -18
- {femagtools-1.7.8.dist-info → femagtools-1.8.0.dist-info}/RECORD +53 -53
- {femagtools-1.7.8.dist-info → femagtools-1.8.0.dist-info}/WHEEL +1 -1
- tests/test_fsl.py +1 -1
- tests/test_mcv.py +106 -1
- tests/test_windings.py +18 -2
- tests/test_mcvwriter.py +0 -96
- {femagtools-1.7.8.dist-info → femagtools-1.8.0.dist-info}/LICENSE +0 -0
- {femagtools-1.7.8.dist-info → femagtools-1.8.0.dist-info}/entry_points.txt +0 -0
- {femagtools-1.7.8.dist-info → femagtools-1.8.0.dist-info}/top_level.txt +0 -0
@@ -68,55 +68,40 @@ for i = 0, m.npols_gen-1 do
|
|
68
68
|
end
|
69
69
|
end
|
70
70
|
%endif
|
71
|
-
%if model.get('thcond', 0) and model.get('thcap', 0):
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
71
|
+
%if model.get('thcond', 0) and model.get('thcap', 0) and model.get('density', 0):
|
72
|
+
if m.shaft_rad == nil then
|
73
|
+
m.shaft_rad = m.condshaft_r
|
74
|
+
end
|
75
|
+
if m.shaft_rad > dy2/2 then
|
76
|
+
m.shaft_rad = dy2/2
|
77
|
+
end
|
78
|
+
beta = math.pi/m.num_poles
|
79
|
+
rotor_thcond = ${model['thcond']}
|
80
|
+
rotor_thcap = ${model['thcap']}
|
81
|
+
rotor_density = ${model.get('density')}
|
78
82
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
83
|
+
%if model.get('thcond_shaft', 0) and model.get('thcap_shaft', 0):
|
84
|
+
if m.shaft_rad < m.yoke_rad then
|
85
|
+
shaft_thcond = ${model['thcond_shaft']}
|
86
|
+
shaft_thcap = ${model['thcap_shaft']}
|
87
|
+
shaft_density = ${model['spmaweight_shaft']*1e3}
|
88
|
+
r_shaft = (m.shaft_rad + m.yoke_rad)/2
|
89
|
+
x0_shaft, y0_shaft = pd2c(r_shaft, beta/2)
|
86
90
|
end
|
91
|
+
%endif
|
92
|
+
if x0_shaft == nil then
|
93
|
+
-- add air layer (inside) for heat transfer
|
94
|
+
h = 3.8
|
95
|
+
beta = 360*m.npols_gen/m.num_poles
|
87
96
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
end
|
98
|
-
end
|
99
|
-
if srkey == 0 then
|
100
|
-
elkeys = get_spel_data("elkeys", sekeys[i])
|
101
|
-
Ex, Ey = get_elem_data("xycp", elkeys[1])
|
102
|
-
r, phi = c2pr(Ex, Ey)
|
103
|
-
if r < m.rotor_rad then -- rotor only
|
104
|
-
def_mat_therm(Ex,Ey,'skyblue',1.12,thcond,thcap,1)
|
105
|
-
end
|
106
|
-
end
|
97
|
+
x0, y0 = pd2c(m.shaft_rad, m.zeroangl)
|
98
|
+
x1, y1 = pd2c(m.shaft_rad-h, m.zeroangl)
|
99
|
+
x2, y2 = pd2c(m.shaft_rad-h, beta+m.zeroangl)
|
100
|
+
x3, y3 = pd2c(m.shaft_rad, beta+m.zeroangl)
|
101
|
+
nc_line(x0, y0, x1, y1, 0)
|
102
|
+
nc_circle(x1, y1, x2, y2, 0)
|
103
|
+
nc_line(x2, y2, x3, y3, 0)
|
104
|
+
x0, y0 = pd2c(m.shaft_rad-h/2, beta/2+m.zeroangl)
|
105
|
+
create_mesh_se(x0, y0)
|
107
106
|
end
|
108
|
-
--[[
|
109
|
-
-- add air layer (inside) for heat transfer
|
110
|
-
h = 3.8
|
111
|
-
beta = 360*m.npols_gen/m.num_poles
|
112
|
-
x0, y0 = pd2c(dy2/2, m.zeroangl)
|
113
|
-
x1, y1 = pd2c(dy2/2-h, m.zeroangl)
|
114
|
-
x2, y2 = pd2c(dy2/2-h, beta+m.zeroangl)
|
115
|
-
x3, y3 = pd2c(dy2/2, beta+m.zeroangl)
|
116
|
-
nc_line(x0, y0, x1, y1, 0)
|
117
|
-
nc_circle(x1, y1, x2, y2, 0)
|
118
|
-
nc_line(x2, y2, x3, y3, 0)
|
119
|
-
x0, y0 = pd2c(dy2/2-h/2, beta/2+m.zeroangl)
|
120
|
-
create_mesh_se(x0, y0)
|
121
|
-
--]]
|
122
107
|
%endif
|
@@ -34,20 +34,26 @@ if not airgap_created then
|
|
34
34
|
if inner_da_start == nil then
|
35
35
|
inner_da_start = da2/2
|
36
36
|
end
|
37
|
-
|
37
|
+
x1, y1 = pr2c(inner_da_start, 0.0)
|
38
|
+
nc_line(x1, y1, r1, 0.0, 0.0)
|
38
39
|
|
39
40
|
if outer_da_start == nil then
|
40
41
|
outer_da_start = da1/2
|
41
42
|
end
|
42
|
-
|
43
|
+
x2, y2 = pr2c(outer_da_start, 0.0)
|
44
|
+
nc_line(r2, 0.0, x2, y2, 0.0)
|
43
45
|
|
44
46
|
if m.tot_num_slot > m.num_sl_gen then
|
45
|
-
|
46
|
-
|
47
|
-
nc_line(
|
47
|
+
x3, y3 = pr2c(inner_da_end, alfa)
|
48
|
+
x4, y4 = pr2c(r1, alfa)
|
49
|
+
nc_line(x3, y3, x4, y4, 0, 0)
|
50
|
+
|
51
|
+
x3, y3 = pr2c(outer_da_end, alfa)
|
52
|
+
x4, y4 = pr2c(r2, alfa)
|
53
|
+
nc_line(x3, y3, x4, y4, 0, 0)
|
48
54
|
end
|
49
55
|
|
50
|
-
x0, y0 = pr2c(
|
56
|
+
x0, y0 = pr2c(r1-ag/6, alfa/2)
|
51
57
|
create_mesh_se(x0, y0)
|
52
58
|
x0, y0 = pr2c(r2+ag/6, alfa/2)
|
53
59
|
create_mesh_se(x0, y0)
|
@@ -0,0 +1,354 @@
|
|
1
|
+
-- prepare thermal model
|
2
|
+
|
3
|
+
save_model('cont')
|
4
|
+
state_of_problem("therm_static")
|
5
|
+
function get_xy(elkey)
|
6
|
+
-- get element xy
|
7
|
+
local x, y
|
8
|
+
x, y = get_elem_data ( "xycp", elkey)
|
9
|
+
return x, y
|
10
|
+
end
|
11
|
+
|
12
|
+
function get_perm(elkey)
|
13
|
+
-- get element permeability
|
14
|
+
local x, y
|
15
|
+
x, y = get_elem_data ( "perm", elkey)
|
16
|
+
return x, y
|
17
|
+
end
|
18
|
+
|
19
|
+
function get_mag(elkey)
|
20
|
+
-- get element rem
|
21
|
+
local x, y
|
22
|
+
x, y = get_elem_data ("mag", elkey)
|
23
|
+
return x, y
|
24
|
+
end
|
25
|
+
|
26
|
+
function color_spel(spel_key, color)
|
27
|
+
local el
|
28
|
+
el = get_spel_data('elkeys', spel_key)
|
29
|
+
for i = 1, #el do
|
30
|
+
draw_elem(el[i], color, 0)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
get_spel_keys("spel_keys") -- Get all superelements of the model
|
35
|
+
|
36
|
+
copper_spel = {} -- red, 1
|
37
|
+
stator_lam_spel = {} -- darkblue, 9
|
38
|
+
rotor_lam_spel = {} -- darkblue, 9
|
39
|
+
shaft_spel = {} ---- lightgrey, 16
|
40
|
+
magnet_spel = {} -- black, 8
|
41
|
+
outer_air = {} -- darkred, 10
|
42
|
+
inner_air = {} -- lightgrey, 16
|
43
|
+
rotor_air = {}
|
44
|
+
stator_air = {} -- black, 8
|
45
|
+
airgap = {} -- white, 8
|
46
|
+
magnet_pocket_spel = {} -- red, 1
|
47
|
+
non_uniform_airgap = {} -- white, 8
|
48
|
+
slot_opening = {}
|
49
|
+
slot_sreg_exist = 0
|
50
|
+
-- search all components
|
51
|
+
for i =1, #spel_keys do
|
52
|
+
-- loop over all spel keys
|
53
|
+
is_winding = get_spel_data("condtyp", spel_keys[i])
|
54
|
+
els = get_spel_data('elkeys', spel_keys[i])
|
55
|
+
mag1, mag2 = get_mag(els[1])
|
56
|
+
perm1, perm2 = get_perm(els[1])
|
57
|
+
xc, yc = get_xy(els[1])
|
58
|
+
rc, pc = c2pd(xc, yc)
|
59
|
+
|
60
|
+
if (is_winding == 0) then
|
61
|
+
mctype = get_spel_data("mcvtyp", spel_keys[i])
|
62
|
+
if (mctype == 0) then -- no curve
|
63
|
+
-- check if it is air or magnet
|
64
|
+
if math.abs(mag1) > 0 or math.abs(mag2) > 0 then
|
65
|
+
-- is magnet
|
66
|
+
table.insert(magnet_spel, spel_keys[i])
|
67
|
+
def_mat_therm(xc, yc,'red', magn_density, magn_thcond, magn_thcap, 1)
|
68
|
+
color_spel(spel_keys[i], 8) -- black magnet
|
69
|
+
else
|
70
|
+
-- is air
|
71
|
+
if rc > dy1/2 then
|
72
|
+
-- outer air
|
73
|
+
table.insert(outer_air, spel_keys[i])
|
74
|
+
%if model.get('htc_outer', 0):
|
75
|
+
def_heat_transfer(xc,yc,yellow,${model['htc_outer']}, 1.0)
|
76
|
+
%endif
|
77
|
+
color_spel(spel_keys[i], 10)
|
78
|
+
|
79
|
+
elseif rc > dy2/2 and rc < da2/2 then
|
80
|
+
-- rotor air
|
81
|
+
-- check is magnet pocket/air pocket/non_uniform airgap
|
82
|
+
table.insert(rotor_air, spel_keys[i])
|
83
|
+
--def_mat_therm(xc, yc, 'yellow', 1.12,0.026,1007, 1)
|
84
|
+
--color_spel(spel_keys[i], 3) -- yellow air
|
85
|
+
|
86
|
+
elseif rc > da1/2 and rc < dy1/2 then
|
87
|
+
-- stator air
|
88
|
+
table.insert(stator_air, spel_keys[i])
|
89
|
+
def_mat_therm(xc, yc, 'yellow', 1.19,0.15,1007, 1)
|
90
|
+
color_spel(spel_keys[i], 8)
|
91
|
+
key_exist_sl = get_sreg_key(xc, yc)
|
92
|
+
if key_exist_sl <= 0 and slot_sreg_exist == 0 then
|
93
|
+
def_new_sreg(xc, yc, 'Slot', 'yellow')
|
94
|
+
slot_sreg_exist = 1
|
95
|
+
else
|
96
|
+
add_to_sreg(xc, yc, 'Slot')
|
97
|
+
end
|
98
|
+
elseif rc > da2/2 and rc < da1/2 then
|
99
|
+
table.insert(airgap, spel_keys[i])
|
100
|
+
def_mat_therm(xc, yc, 'yellow', 1.19,0.15,1007, 1)
|
101
|
+
add_to_sreg(xc, yc, 'Slot')
|
102
|
+
color_spel(spel_keys[i], 7) -- white air
|
103
|
+
|
104
|
+
-- elseif rc > dy2/2 then
|
105
|
+
-- airgap
|
106
|
+
-- table.insert(airgap, spel_keys[i])
|
107
|
+
-- color_spel(spel_keys[i], 3) -- yellow air
|
108
|
+
-- def_mat_therm(xc, yc, 'yellow', 1.19,0.15,1007, 1)
|
109
|
+
|
110
|
+
elseif rc < dy2/2 then
|
111
|
+
-- check if shaft or inner air
|
112
|
+
if x0_shaft ~= nil and x0_shaft ~= 0.0 then
|
113
|
+
table.insert(shaft_spel, spel_keys[i])
|
114
|
+
def_mat_therm(xc, yc, 'lightgrey', shaft_density, shaft_thcond, shaft_thcap, 1)
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
else
|
119
|
+
-- check if it is stator / rotor
|
120
|
+
if rc > m.fc_radius then
|
121
|
+
color_spel(spel_keys[i], 9) -- magenta stator
|
122
|
+
table.insert(stator_lam_spel, spel_keys[i])
|
123
|
+
def_mat_therm(xc, yc, 'darkblue', stator_density, stator_thcond, stator_thcap, 1)
|
124
|
+
else
|
125
|
+
color_spel(spel_keys[i], 9) -- violet rotor
|
126
|
+
table.insert(rotor_lam_spel, spel_keys[i])
|
127
|
+
def_mat_therm(xc, yc, 'darkblue', rotor_density, rotor_thcond, rotor_thcap, 1)
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
else
|
132
|
+
table.insert(copper_spel, spel_keys[i])
|
133
|
+
def_mat_therm(xc, yc, 'green', conductor_density, conductor_thcond, conductor_thcap, 1)
|
134
|
+
color_spel(spel_keys[i], 1) --
|
135
|
+
|
136
|
+
end
|
137
|
+
|
138
|
+
end
|
139
|
+
|
140
|
+
function is_exist(arr, val)
|
141
|
+
local i
|
142
|
+
if #arr == 0 then
|
143
|
+
return false
|
144
|
+
end
|
145
|
+
for i = 1, #arr do
|
146
|
+
if arr[i] == val then
|
147
|
+
return true
|
148
|
+
end
|
149
|
+
end
|
150
|
+
return false
|
151
|
+
end
|
152
|
+
-- identify magnet air pocket
|
153
|
+
|
154
|
+
for i = 1, #magnet_spel do
|
155
|
+
bkeys = get_spel_data ( "bndkeys", magnet_spel[i])
|
156
|
+
for j = 1, #bkeys do
|
157
|
+
elks = get_node_data ( "elkeys", bkeys[j] )
|
158
|
+
for k = 1, #elks do
|
159
|
+
p1, p2 = get_elem_data("perm", elks[k])
|
160
|
+
sek = get_elem_data("sekey", elks[k])
|
161
|
+
if p1 == 1.0 then
|
162
|
+
if (not is_exist(magnet_pocket_spel, sek)) and (not is_exist(airgap, sek)) then
|
163
|
+
table.insert(magnet_pocket_spel, sek)
|
164
|
+
els = get_spel_data('elkeys', sek)
|
165
|
+
xc, yc = get_xy(els[1])
|
166
|
+
def_mat_therm(xc, yc, 'red', 1.12,0.026,1007, 1)
|
167
|
+
--table.remove(rotor_air, sek)
|
168
|
+
color_spel(sek, 1)
|
169
|
+
end
|
170
|
+
end
|
171
|
+
end
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
for i = 1, #rotor_air do
|
178
|
+
if rotor_air[i] ~= nil then
|
179
|
+
bkeys = get_spel_data ( "bndkeys", rotor_air[i])
|
180
|
+
for j = 1, #bkeys do
|
181
|
+
x, y = get_node_data ( "xy", bkeys[j] )
|
182
|
+
r, phi = c2pd(x, y)
|
183
|
+
if math.abs(r - da2/2) < 1e-5 then
|
184
|
+
if not is_exist(non_uniform_airgap,rotor_air[i]) then
|
185
|
+
table.insert(non_uniform_airgap, rotor_air[i])
|
186
|
+
els = get_spel_data('elkeys', rotor_air[i])
|
187
|
+
xc, yc = get_xy(els[1])
|
188
|
+
def_mat_therm(xc, yc, 'yellow', 1.19,1.15,1007, 1)
|
189
|
+
add_to_sreg(xc, yc, 'Slot')
|
190
|
+
color_spel(rotor_air[i], 7)
|
191
|
+
end
|
192
|
+
end
|
193
|
+
end
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
for i = 1, #rotor_air do
|
198
|
+
if rotor_air[i] ~= nil then
|
199
|
+
if is_exist(non_uniform_airgap, rotor_air[i]) then
|
200
|
+
rotor_air[i] = nil
|
201
|
+
end
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
for i = 1, #rotor_air do
|
206
|
+
if is_exist(magnet_pocket_spel, rotor_air[i]) then
|
207
|
+
rotor_air[i] = nil
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
|
212
|
+
for i = 1, #rotor_air do
|
213
|
+
if rotor_air[i] ~= nil then
|
214
|
+
els = get_spel_data('elkeys', rotor_air[i])
|
215
|
+
xc, yc = get_xy(els[1])
|
216
|
+
def_mat_therm(xc, yc, 'red', 1.12,0.026,1007, 1)
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
220
|
+
|
221
|
+
save_metafile(model..'.ps')
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
---------------------------------------------
|
226
|
+
-- material slot insulation
|
227
|
+
---------------------------------------------
|
228
|
+
|
229
|
+
function get_boundary_node(num_slots)
|
230
|
+
|
231
|
+
local ctr
|
232
|
+
-- get the number of winding
|
233
|
+
get_wdg_keys("wkeys")
|
234
|
+
-- search subregions
|
235
|
+
local srkey_sl = {}
|
236
|
+
ctr = 1
|
237
|
+
for i = 1, #wkeys do
|
238
|
+
tmpksl = get_wdg_data("srkeys", wkeys[i])
|
239
|
+
for j = 1, #tmpksl do
|
240
|
+
srkey_sl[ctr] = tmpksl[j]
|
241
|
+
ctr = ctr + 1
|
242
|
+
end
|
243
|
+
end
|
244
|
+
-- search superelements
|
245
|
+
local sekey_sl = {}
|
246
|
+
ctr = 1
|
247
|
+
for k = 1, #srkey_sl do
|
248
|
+
sl_se = get_sreg_data("sekeys", srkey_sl[k])
|
249
|
+
for kk =1, #sl_se do
|
250
|
+
sl_nd = get_spel_data("bndkeys", sl_se[kk])
|
251
|
+
x, y = get_node_data("xy", sl_nd[1])
|
252
|
+
r, phi = c2pd(x, y)
|
253
|
+
if phi < 360/num_slots then
|
254
|
+
sekey_sl[ctr] = sl_se[kk]
|
255
|
+
ctr = ctr + 1
|
256
|
+
end
|
257
|
+
end
|
258
|
+
end
|
259
|
+
|
260
|
+
local xn = {}
|
261
|
+
local yn = {}
|
262
|
+
local node = {}
|
263
|
+
local bndnodes = {}
|
264
|
+
local bnd_unique = {}
|
265
|
+
|
266
|
+
ctr = 1
|
267
|
+
|
268
|
+
for i = 1, #sekey_sl do
|
269
|
+
bnd = get_spel_data("bndkeys", sekey_sl[i])
|
270
|
+
|
271
|
+
for j = 1, #bnd do
|
272
|
+
bndnodes[ctr] = bnd[j]
|
273
|
+
ctr = ctr + 1
|
274
|
+
if bnd_unique[bnd[j]] == true then
|
275
|
+
bnd_unique[bnd[j]] = false
|
276
|
+
else
|
277
|
+
bnd_unique[bnd[j]] = true
|
278
|
+
end
|
279
|
+
end
|
280
|
+
end
|
281
|
+
|
282
|
+
ctr = 1
|
283
|
+
for j = 1, #bndnodes do
|
284
|
+
x, y = get_node_data("xy", bndnodes[j])
|
285
|
+
|
286
|
+
r, phi = c2pd(x, y)
|
287
|
+
if (phi < 360/num_slots/2 - 0.05) and (bnd_unique[bndnodes[j]] == true) then
|
288
|
+
|
289
|
+
node[ctr] = bndnodes[j]
|
290
|
+
xn[ctr] = x
|
291
|
+
yn[ctr] = y
|
292
|
+
ctr = ctr + 1
|
293
|
+
end
|
294
|
+
end
|
295
|
+
|
296
|
+
|
297
|
+
local indx = {1, math.floor(#node/4), math.floor(#node/2), math.floor(#node/4*3), #node}
|
298
|
+
|
299
|
+
local x_new = {}
|
300
|
+
local y_new = {}
|
301
|
+
|
302
|
+
for i = 1, 10 do
|
303
|
+
x_new[i] = 0
|
304
|
+
y_new[i] = 0
|
305
|
+
end
|
306
|
+
|
307
|
+
for i = 1, #indx do
|
308
|
+
x_new[i] = xn[indx[i]]
|
309
|
+
y_new[i] = yn[indx[i]]
|
310
|
+
r, phi = c2pd(x_new[i], y_new[i])
|
311
|
+
x_new[10 - (i-1)], y_new[10 - (i-1)] = pd2c(r, 360/num_slots - phi)
|
312
|
+
end
|
313
|
+
|
314
|
+
local rn = {}
|
315
|
+
local phin = {}
|
316
|
+
|
317
|
+
for i = 1, #x_new do
|
318
|
+
rn[i], phin[i] = c2pd(x_new[i], y_new[i])
|
319
|
+
end
|
320
|
+
return rn, phin
|
321
|
+
end
|
322
|
+
|
323
|
+
|
324
|
+
rn, phin = get_boundary_node(m.tot_num_slot)
|
325
|
+
thickness = ${model.get('slot_insul', 0.15)}
|
326
|
+
conductivity = ${model.get('slot_insul_cond', 0.31)}
|
327
|
+
|
328
|
+
for i = 1,m.num_sl_gen do
|
329
|
+
x = {}
|
330
|
+
y = {}
|
331
|
+
|
332
|
+
for j = 1, #rn do
|
333
|
+
x[j], y[j] = pd2c(rn[j], phin[j] + (i-1)*360/m.tot_num_slot)
|
334
|
+
point(x[j], y[j],"black","x")
|
335
|
+
end
|
336
|
+
|
337
|
+
def_insulation_by_nodechain(thickness,conductivity,
|
338
|
+
x[1],y[1],
|
339
|
+
x[2],y[2],
|
340
|
+
x[3],y[3],
|
341
|
+
x[4],y[4],
|
342
|
+
x[5],y[5],
|
343
|
+
x[6],y[6],
|
344
|
+
x[7],y[7],
|
345
|
+
x[8],y[8],
|
346
|
+
x[9],y[9],
|
347
|
+
x[10],y[10],
|
348
|
+
x[1], y[1]
|
349
|
+
)
|
350
|
+
|
351
|
+
end
|
352
|
+
save_metafile('insulation.ps')
|
353
|
+
|
354
|
+
state_of_problem("mag_static")
|
@@ -148,26 +148,7 @@ end
|
|
148
148
|
%endif
|
149
149
|
|
150
150
|
%if model.get('thcond', 0) and model.get('thcap', 0):
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
-- Thermal properties: iron in yoke and tooth
|
155
|
-
xst,yst = pd2c(m.inside_diam/2+1,m.zeroangl+0.1) -- stator tooth
|
156
|
-
xsj,ysj = pd2c(m.yoke_diam/2-1,m.zeroangl+0.1) -- stator yoke
|
157
|
-
def_mat_therm(xst,yst,'darkblue',density,thcond,thcap,1)
|
158
|
-
def_mat_therm(xsj,ysj,'darkblue',density,thcond,thcap,1)
|
159
|
-
-- insulation
|
160
|
-
if m.slot_indul > 0 then
|
161
|
-
thickness = 0.25 -- mm
|
162
|
-
thcond = 0.31
|
163
|
-
thcap = 1100
|
164
|
-
xip, yip = pr2c(m.slot_height + m.inside_diam/2-m.slot_indul/2,
|
165
|
-
math.pi/m.tot_num_slot+m.zeroangl/180*math.pi)
|
166
|
-
def_insulation(xip,yip,'darkred',thickness,1340,thcond,thcap)
|
167
|
-
end
|
168
|
-
-- air in slot opening
|
169
|
-
xnl, ynl = pr2c(m.inside_diam/2+m.slot_h1/2, math.pi/m.tot_num_slot+m.zeroangl/180*math.pi)
|
170
|
-
sl_cond = 0.15
|
171
|
-
sl_cap = 1007
|
172
|
-
def_mat_therm(xnl,ynl,'cyan',1.19,sl_cond,sl_cap,1)
|
151
|
+
stator_thcond = ${model.get('thcond', 24)}
|
152
|
+
stator_thcap = ${model.get('thcap', 480)}
|
153
|
+
stator_density = ${model.get('density', 7700)}
|
173
154
|
%endif
|