femagtools 1.8.10__py3-none-any.whl → 1.8.12__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/fsl.py +6 -9
- femagtools/isa7.py +20 -16
- femagtools/leakinduc.py +0 -31
- femagtools/machine/afpm.py +4 -0
- femagtools/machine/effloss.py +29 -14
- femagtools/machine/pm.py +106 -68
- femagtools/parstudy.py +18 -9
- femagtools/plot/bch.py +26 -10
- femagtools/shortcircuit.py +47 -49
- femagtools/templates/plots.mako +0 -1
- femagtools/templates/psi-torq-rem.mako +112 -0
- femagtools/templates/psi-torq-rot.mako +7 -0
- femagtools/windings.py +42 -24
- {femagtools-1.8.10.dist-info → femagtools-1.8.12.dist-info}/METADATA +1 -1
- {femagtools-1.8.10.dist-info → femagtools-1.8.12.dist-info}/RECORD +22 -21
- {femagtools-1.8.10.dist-info → femagtools-1.8.12.dist-info}/WHEEL +1 -1
- tests/test_fsl.py +2 -2
- tests/test_nc.py +1 -1
- {femagtools-1.8.10.dist-info → femagtools-1.8.12.dist-info}/LICENSE +0 -0
- {femagtools-1.8.10.dist-info → femagtools-1.8.12.dist-info}/entry_points.txt +0 -0
- {femagtools-1.8.10.dist-info → femagtools-1.8.12.dist-info}/top_level.txt +0 -0
femagtools/__init__.py
CHANGED
femagtools/fsl.py
CHANGED
@@ -765,18 +765,15 @@ class Builder:
|
|
765
765
|
if pfefunc:
|
766
766
|
sim['loss_funct'] = pfefunc
|
767
767
|
'''
|
768
|
+
if sim.get('plots') and sim.get('calculationMode', '') != 'psi-torq-rem':
|
769
|
+
plots = self.__render(sim, 'plots')
|
770
|
+
else:
|
771
|
+
plots = []
|
768
772
|
|
769
|
-
|
770
|
-
'ld_lq_fast',
|
771
|
-
'pm_sym_loss',
|
772
|
-
'torq_calc',
|
773
|
-
'psd_psq_fast'):
|
774
|
-
return felosses + fslcalc
|
775
|
-
|
776
|
-
return felosses + fslcalc + self.__render(sim, 'plots')
|
773
|
+
return felosses + fslcalc + plots
|
777
774
|
|
778
775
|
def create_shortcircuit(self, model):
|
779
|
-
return self.__render(model, 'shortcircuit')
|
776
|
+
return self.__render(model, 'shortcircuit') + self.__render(model, 'plots')
|
780
777
|
|
781
778
|
def create_airgap_induc(self):
|
782
779
|
return self.__render(dict(), 'airgapinduc')
|
femagtools/isa7.py
CHANGED
@@ -1294,13 +1294,12 @@ class Isa7(object):
|
|
1294
1294
|
scale_factor = poles/poles_sim
|
1295
1295
|
return scale_factor
|
1296
1296
|
|
1297
|
-
def get_magnet_data(self, ibeta=
|
1297
|
+
def get_magnet_data(self, ibeta=None, icur=0) -> list:
|
1298
1298
|
'''Extract magnet data from nc file
|
1299
1299
|
|
1300
1300
|
Args:
|
1301
1301
|
nc: nc object
|
1302
|
-
|
1303
|
-
|
1302
|
+
ibeta: loadcase (default: None)
|
1304
1303
|
Returns:
|
1305
1304
|
pm_data: list of magnet data
|
1306
1305
|
'''
|
@@ -1350,12 +1349,6 @@ class Isa7(object):
|
|
1350
1349
|
ecp = [e.center for e in se.elements]
|
1351
1350
|
geometry = se.get_rect_geom()
|
1352
1351
|
|
1353
|
-
bxy = []
|
1354
|
-
for e in se.elements:
|
1355
|
-
theta = np.arctan2(float(e.center[1]),
|
1356
|
-
float(e.center[0]))
|
1357
|
-
fd = self.flux_density(e, icur, ibeta)
|
1358
|
-
bxy.append(Trot(-theta).dot((fd['bx'], fd['by'])))
|
1359
1352
|
#= np.moveaxis(bxy, 1, 0)
|
1360
1353
|
pd = dict(name='pm_data_se' + str(se.key),
|
1361
1354
|
hm=geometry['h'],
|
@@ -1367,16 +1360,28 @@ class Isa7(object):
|
|
1367
1360
|
mur=mur,
|
1368
1361
|
loadcase=ibeta,
|
1369
1362
|
numpoles=poles,
|
1370
|
-
bl=transform_flux_density(geometry['alpha'],
|
1371
|
-
np.array(bxy)),
|
1372
1363
|
elcp=transform_coord(geometry, ecp),
|
1373
1364
|
area=se.area(),
|
1374
1365
|
spel_key=se.key)
|
1366
|
+
if ibeta != None:
|
1367
|
+
pd.update({'bl': self.get_magnet_flux_density(se, icur, ibeta)})
|
1375
1368
|
pd.update(pos)
|
1376
1369
|
|
1377
1370
|
pm_data.append(pd)
|
1378
1371
|
return pm_data
|
1379
1372
|
|
1373
|
+
def get_magnet_flux_density(self, se, icur, ibeta) -> list:
|
1374
|
+
"""returns the flux density Bx, By of all elements
|
1375
|
+
of this super element transformed to the main axis (alpha)
|
1376
|
+
Note: get_rect_geom must be called previously.
|
1377
|
+
"""
|
1378
|
+
bxy = []
|
1379
|
+
for e in se.elements:
|
1380
|
+
theta = np.arctan2(float(e.center[1]),
|
1381
|
+
float(e.center[0]))
|
1382
|
+
fd = self.flux_density(e, icur, ibeta)
|
1383
|
+
bxy.append(Trot(-theta).dot((fd['bx'], fd['by'])))
|
1384
|
+
return transform_flux_density(se.alpha, np.array(bxy))
|
1380
1385
|
|
1381
1386
|
class Point(object):
|
1382
1387
|
def __init__(self, x, y):
|
@@ -1662,12 +1667,11 @@ class SuperElement(BaseEntity):
|
|
1662
1667
|
# angle of main axis
|
1663
1668
|
i = np.argmax(dc)
|
1664
1669
|
c = np.vstack((c, c[0]))
|
1665
|
-
alpha = np.arctan2(c[i+1, 1]-c[i, 1], c[i+1, 0]-c[i, 0])
|
1666
|
-
if alpha < 0:
|
1667
|
-
|
1670
|
+
self.alpha = np.arctan2(c[i+1, 1]-c[i, 1], c[i+1, 0]-c[i, 0])
|
1671
|
+
#if alpha < 0:
|
1672
|
+
# alpha += np.pi
|
1668
1673
|
return {'w': w, 'h': h, 'cxy': cxy,
|
1669
|
-
'area': area, 'alpha': alpha}
|
1670
|
-
|
1674
|
+
'area': area, 'alpha': self.alpha}
|
1671
1675
|
|
1672
1676
|
class SubRegion(BaseEntity):
|
1673
1677
|
def __init__(self, key, sr_type, color, name, nturns, curdir, wb_key,
|
femagtools/leakinduc.py
CHANGED
@@ -22,37 +22,6 @@ def end_wdg_leak_ind_hairpin_wires(): #TODO
|
|
22
22
|
return L_ew
|
23
23
|
|
24
24
|
|
25
|
-
#def slot_leakage_inductance_round_wires(p, q, w1, num_par_wdgs, layers):
|
26
|
-
# '''returns slot leakage inductance per phase'''
|
27
|
-
# mue0 = 4*np.pi*1e-7
|
28
|
-
# if layers == 1:
|
29
|
-
# lambda_slot = 0 # tbc
|
30
|
-
# if layers == 2:
|
31
|
-
# t1 = b2/bs
|
32
|
-
# t2 = b1/b2
|
33
|
-
# t12 = b1/b2
|
34
|
-
# kt1 = (4*t1**2 - t1**4 - 4*np.log(t1) -3)/(4*(1 - t1)*(1 - t1**2)**2) if t1 != 1 else 0
|
35
|
-
# kt2 = (4*t2**2 - t2**4 - 4*np.log(t2) - 3)/(4*(1 - t2)*(1 - t2**2)**2) if t2 != 1 else 0
|
36
|
-
# kt12 = (t12**2 - 2*np.log(t12) - 1)/(2*(1 - t12)*(1 - t12**2)) if t12 != 1 else 0
|
37
|
-
# const = 0.1424 + 0.5*np.arcsin(np.sqrt(1 - (bo/b1)**2)) + ho/bo
|
38
|
-
# lambda_t = h2/b2*kt2 + const
|
39
|
-
# lambda_b = h3/bs*kt1 + h2/(b2-b1)*np.log(b2/b1) + const if b2 != b1 else h3/bs*kt1 + const
|
40
|
-
# lambda_tb = h2/b2*kt12 + const
|
41
|
-
# lambda_slot = lambda_t + lambda_b + lambda_tb
|
42
|
-
# L_slot = mue0*2/(p*q)*(w1/num_par_wdgs)**2*lambda_slot
|
43
|
-
# return L_slot
|
44
|
-
|
45
|
-
|
46
|
-
def slot_leak_ind_fea(): #TODO
|
47
|
-
'''returns slot and tooth tip leakage inductance'''
|
48
|
-
# make a single slot model with detailed windings
|
49
|
-
# run current through windings
|
50
|
-
# L_slot = flux / current
|
51
|
-
# scale to get values per phase
|
52
|
-
L_slot = 0
|
53
|
-
return L_slot
|
54
|
-
|
55
|
-
|
56
25
|
def harm_leak_ind(E_fft, order_fft, freq, Ia): # needs to be validated
|
57
26
|
'''returns harmonic leakage inductance per phase'''
|
58
27
|
L_harm = []
|
femagtools/machine/afpm.py
CHANGED
@@ -56,6 +56,10 @@ def jsonify(v):
|
|
56
56
|
|
57
57
|
|
58
58
|
def get_magdata(task):
|
59
|
+
"""result func used in parstudy
|
60
|
+
extracts the magnet data from the NC/ISA7 for
|
61
|
+
subsequent magnet loss calc
|
62
|
+
"""
|
59
63
|
basedir = Path(task.directory)
|
60
64
|
bchfile_list = sorted(basedir.glob(
|
61
65
|
'*_[0-9][0-9][0-9].B*CH'))
|
femagtools/machine/effloss.py
CHANGED
@@ -222,10 +222,7 @@ def efficiency_losses_map(eecpars, u1, T, temp, n, npoints=(60, 40),
|
|
222
222
|
m = create_from_eecpars(xtemp, eecpars)
|
223
223
|
else: # must be an instance of Machine
|
224
224
|
m = eecpars
|
225
|
-
if
|
226
|
-
r = {'T': T, 'n': n}
|
227
|
-
rb = {'T': [], 'n': []}
|
228
|
-
else: # calculate speed,torque characteristics
|
225
|
+
if np.isscalar(T): # calculate speed,torque characteristics
|
229
226
|
nmax = n
|
230
227
|
nsamples = npoints[0]
|
231
228
|
rb = {}
|
@@ -249,15 +246,33 @@ def efficiency_losses_map(eecpars, u1, T, temp, n, npoints=(60, 40),
|
|
249
246
|
with_mtpv=with_mtpv, with_mtpa=with_mtpa,
|
250
247
|
with_pmconst=with_pmconst, with_tmech=with_tmech,
|
251
248
|
**kwargs) # braking mode
|
252
|
-
|
253
|
-
|
254
|
-
|
249
|
+
if kwargs.get('mesh_func', 0):
|
250
|
+
ntmesh = kwargs['mesh_func'](r['n_type'], r['n'], r['T'],
|
251
|
+
rb['n'], rb['T'], npoints)
|
252
|
+
else:
|
253
|
+
ntmesh = _generate_mesh(r['n'], r['T'],
|
255
254
|
rb['n'], rb['T'], npoints)
|
256
255
|
else:
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
256
|
+
nt = []
|
257
|
+
iq, id = m.iqd_torque(T[-1])
|
258
|
+
i1max = betai1(iq, id)[1]
|
259
|
+
logger.info("%s %s", n, T)
|
260
|
+
for nx in n:
|
261
|
+
w1 = 2*np.pi*nx*m.p
|
262
|
+
iq, id, tq = m.iqd_imax_umax(i1max, w1, u1, T[-1],
|
263
|
+
with_tmech=with_tmech,
|
264
|
+
with_mtpa=with_mtpa)
|
265
|
+
if np.isclose(tq, T[-1]):
|
266
|
+
tq = T[-1]
|
267
|
+
for Tx in T:
|
268
|
+
if Tx <= tq:
|
269
|
+
nt.append((nx, Tx))
|
270
|
+
if not nt:
|
271
|
+
raise ValueError("Speed, Torque Mesh is empty")
|
272
|
+
nsamples = len(n)
|
273
|
+
ntmesh = np.array(nt).T
|
274
|
+
|
275
|
+
logger.info("total speed,torque samples %s", ntmesh.shape)
|
261
276
|
if isinstance(m, (PmRelMachine, SynchronousMachine)):
|
262
277
|
if num_proc > 1:
|
263
278
|
iqd = iqd_tmech_umax_multi(num_proc, ntmesh, m, u1, with_mtpa,
|
@@ -328,7 +343,7 @@ def efficiency_losses_map(eecpars, u1, T, temp, n, npoints=(60, 40),
|
|
328
343
|
plcu2 = m.iqd_plcu2(*iqd)
|
329
344
|
tfric = m.tfric
|
330
345
|
try:
|
331
|
-
plcu1_dc = m.iqd_plcu1(iqd[0], iqd[1],
|
346
|
+
plcu1_dc = m.iqd_plcu1(iqd[0], iqd[1],
|
332
347
|
np.array([0.0 for i in f1])).tolist()
|
333
348
|
plcu1_ac = [i-j for i, j in zip(plcu1.tolist(), plcu1_dc)]
|
334
349
|
except:
|
@@ -397,6 +412,6 @@ def efficiency_losses_map(eecpars, u1, T, temp, n, npoints=(60, 40),
|
|
397
412
|
plcu1=plcu1.tolist(),
|
398
413
|
plcu2=plcu2.tolist(),
|
399
414
|
plfric=plfric.tolist(),
|
400
|
-
losses=ploss.tolist(),
|
401
|
-
plcu1_dc=plcu1_dc,
|
415
|
+
losses=ploss.tolist(),
|
416
|
+
plcu1_dc=plcu1_dc,
|
402
417
|
plcu1_ac=plcu1_ac)
|
femagtools/machine/pm.py
CHANGED
@@ -315,25 +315,51 @@ class PmRelMachine(object):
|
|
315
315
|
lambda w1: la.norm(self.uqd(w1, iq, id))-u*np.sqrt(2),
|
316
316
|
w10)[0]
|
317
317
|
|
318
|
-
def w1_imax_umax(self, i1max, u1max):
|
318
|
+
def w1_imax_umax(self, i1max, u1max, with_mtpa=True, with_tmech=True):
|
319
319
|
"""return frequency w1 and torque at voltage u1max and current i1max
|
320
320
|
|
321
321
|
Keyword arguments:
|
322
322
|
u1max -- the maximum voltage (Vrms)
|
323
|
-
i1max -- the maximum current (Arms)
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
n0,
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
323
|
+
i1max -- the maximum current (Arms)
|
324
|
+
with_mtpa -- use minimum current
|
325
|
+
with_tmech -- use mech torque
|
326
|
+
"""
|
327
|
+
if with_mtpa:
|
328
|
+
iq, id, T = self.mtpa(i1max)
|
329
|
+
n0 = u1max/np.linalg.norm(self.psi(iq, id))/2/2/np.pi/self.p
|
330
|
+
if with_tmech:
|
331
|
+
sign = -1 if i1max > 0 else 1
|
332
|
+
res = so.minimize(
|
333
|
+
lambda n: sign*self.mtpa_tmech(i1max, n)[2],
|
334
|
+
n0,
|
335
|
+
constraints={
|
336
|
+
'type': 'eq',
|
337
|
+
'fun': lambda n:
|
338
|
+
np.sqrt(2)*u1max - np.linalg.norm(
|
339
|
+
self.uqd(2*np.pi*n*self.p,
|
335
340
|
*self.mtpa_tmech(i1max, n)[:2]))})
|
336
|
-
|
341
|
+
return 2*np.pi*res.x[0]*self.p, self.mtpa_tmech(i1max, res.x[0])[2]
|
342
|
+
return so.fsolve(lambda x: np.linalg.norm(
|
343
|
+
self.uqd(x, iq, id)) - u1max*np.sqrt(2),
|
344
|
+
2*np.pi*self.p*n0), T
|
345
|
+
|
346
|
+
iq, id = iqd(0, i1max)
|
347
|
+
n0 = u1max/np.linalg.norm(self.psi(iq, id))/2/2/np.pi/self.p
|
348
|
+
if with_tmech:
|
349
|
+
sign = -1 if i1max > 0 else 1
|
350
|
+
res = so.minimize(
|
351
|
+
lambda n: sign*self.tmech_iqd(iq, id, n),
|
352
|
+
n0,
|
353
|
+
constraints={
|
354
|
+
'type': 'eq',
|
355
|
+
'fun': lambda n:
|
356
|
+
np.sqrt(2)*u1max - np.linalg.norm(
|
357
|
+
self.uqd(2*np.pi*n*self.p, iq, id))})
|
358
|
+
return 2*np.pi*res.x[0]*self.p, self.tmech_iqd(iq, id, res.x[0])
|
359
|
+
|
360
|
+
return so.fsolve(lambda x: np.linalg.norm(
|
361
|
+
self.uqd(x, iq, id)) - u1max*np.sqrt(2),
|
362
|
+
2*np.pi*self.p*n0), self.torque_iqd(iq, id)
|
337
363
|
|
338
364
|
def w1_u(self, u, iq, id):
|
339
365
|
"""return frequency w1 at given voltage u and id, iq current
|
@@ -497,16 +523,17 @@ class PmRelMachine(object):
|
|
497
523
|
logger.debug("field weakening mode %.2f kW @ %.0f rpm %.1f Nm; "
|
498
524
|
"u1=%.0f V; plfric=%.2f W",
|
499
525
|
P/1000, n*60, T, u1max, self.pfric(n))
|
500
|
-
iq, id = self.iqd_torque_imax_umax(T, n, u1max,
|
526
|
+
iq, id = self.iqd_torque_imax_umax(T, n, u1max,
|
527
|
+
with_tmech=with_tmech, with_mtpa=with_mtpa)[:2]
|
501
528
|
|
502
529
|
if with_tmech:
|
503
530
|
tcon = {'type': 'eq',
|
504
531
|
'fun': lambda iqd:
|
505
|
-
self.tmech_iqd(*iqd, n)
|
532
|
+
T - self.tmech_iqd(*iqd, n)}
|
506
533
|
else:
|
507
534
|
tcon = {'type': 'eq',
|
508
535
|
'fun': lambda iqd:
|
509
|
-
self.torque_iqd(*iqd)
|
536
|
+
T - self.torque_iqd(*iqd)}
|
510
537
|
|
511
538
|
res = so.minimize(lambda iqd: np.linalg.norm(iqd), (iq, id),
|
512
539
|
method='SLSQP',
|
@@ -522,7 +549,7 @@ class PmRelMachine(object):
|
|
522
549
|
log(res.x)
|
523
550
|
if i1 > abs(i1max):
|
524
551
|
return self.iqd_imax_umax(i1max, w1, u1max, T,
|
525
|
-
with_mtpv=False,
|
552
|
+
with_mtpv=False, with_mtpa=with_mtpa,
|
526
553
|
with_tmech=with_tmech)
|
527
554
|
if with_tmech:
|
528
555
|
return *res.x, self.tmech_iqd(*res.x, n)
|
@@ -538,7 +565,7 @@ class PmRelMachine(object):
|
|
538
565
|
log((iq, id, tq))
|
539
566
|
return iq, id, tq
|
540
567
|
|
541
|
-
def iqd_torque_imax_umax(self, torque, n, u1max, with_tmech=False, log=0):
|
568
|
+
def iqd_torque_imax_umax(self, torque, n, u1max, with_tmech=False, with_mtpa=True, log=0):
|
542
569
|
"""return d-q current and torque at stator frequency w1,
|
543
570
|
max voltage and current"""
|
544
571
|
if with_tmech:
|
@@ -553,29 +580,33 @@ class PmRelMachine(object):
|
|
553
580
|
return (iq, id, torque)
|
554
581
|
# Field weaking range
|
555
582
|
imax = betai1(iq, id)[1]
|
556
|
-
iq, id, tq = self.iqd_imax_umax(imax, w1, u1max, torque,
|
583
|
+
iq, id, tq = self.iqd_imax_umax(imax, w1, u1max, torque, with_mtpa=with_mtpa,
|
557
584
|
with_mtpv=False, with_tmech=with_tmech)
|
558
585
|
if log:
|
559
586
|
log((iq, id, tq))
|
560
587
|
return iq, id, tq
|
561
588
|
|
562
|
-
def iqd_imax_umax(self, i1max, w1, u1max, torque, with_mtpv=True, with_tmech=True):
|
589
|
+
def iqd_imax_umax(self, i1max, w1, u1max, torque, with_mtpv=True, with_tmech=True, with_mtpa=True):
|
563
590
|
"""return d-q current and shaft torque at stator frequency and max voltage
|
564
591
|
and max current (for motor operation if maxtorque else generator operation)"""
|
565
|
-
|
566
592
|
if torque > 0:
|
593
|
+
sign=-1
|
567
594
|
# -pi/2 --> 0
|
568
595
|
b0, b1 = max(-np.pi/2, self.betarange[0]), 0
|
569
596
|
if max(self.betarange) < b1:
|
570
597
|
raise ValueError(
|
571
598
|
f"invalid betarange for maxtorque>0: {self.betarange}")
|
572
599
|
else:
|
600
|
+
sign=1
|
573
601
|
# -pi/2 --> -pi
|
574
602
|
b0, b1 = -np.pi/2, max(-np.pi, self.betarange[0])
|
575
603
|
if min(self.betarange) > b0:
|
576
604
|
raise ValueError(
|
577
605
|
f"invalid betarange for maxtorque<0: {self.betarange}")
|
578
|
-
|
606
|
+
if with_mtpa:
|
607
|
+
iq, id, _ = self.mtpa(i1max)
|
608
|
+
else:
|
609
|
+
iq, id = iqd(0, i1max)
|
579
610
|
deps = 1e-6
|
580
611
|
kmax = 100
|
581
612
|
|
@@ -678,7 +709,6 @@ class PmRelMachine(object):
|
|
678
709
|
i1max - betai1(*iqd)[1]})
|
679
710
|
res = so.minimize(lambda iqd: sign*self.torque_iqd(*iqd), i0,
|
680
711
|
method='SLSQP', constraints=constraints)
|
681
|
-
#logger.info("mtpv %s", res)
|
682
712
|
if res['success']:
|
683
713
|
return res.x[0], res.x[1], sign*res.fun
|
684
714
|
raise ValueError(f"mtpv w1={w1} u1={u1} i0 {i0} iqd0 {iqd0} maxtorque={maxtorque} res: {res['message']}")
|
@@ -703,7 +733,6 @@ class PmRelMachine(object):
|
|
703
733
|
res = so.minimize(lambda iqd: sign*self.tmech_iqd(*iqd, n), i0,
|
704
734
|
method='SLSQP',
|
705
735
|
constraints=constraints)
|
706
|
-
#logger.info("mtpv_torque %s", res)
|
707
736
|
if res['success']:
|
708
737
|
return res.x[0], res.x[1], sign*res.fun
|
709
738
|
#logger.warning("w1=%.1f u1=%.1f maxtorque=%s %s: %s", w1, u1, maxtorque, res.x, res.message)
|
@@ -758,11 +787,9 @@ class PmRelMachine(object):
|
|
758
787
|
returns list of speed limit for each interval
|
759
788
|
calculates with friction and windage losses if with_tmech=True
|
760
789
|
"""
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
iq, id, T = self.mtpa(i1max)
|
765
|
-
w1type = self.w1_umax(u1max, iq, id)
|
790
|
+
w1type, T = self.w1_imax_umax(i1max, u1max,
|
791
|
+
with_tmech=with_tmech,
|
792
|
+
with_mtpa=with_mtpa)
|
766
793
|
Pmax = w1type/self.p*T
|
767
794
|
# check max speed:
|
768
795
|
sp = speedmax
|
@@ -776,7 +803,7 @@ class PmRelMachine(object):
|
|
776
803
|
else:
|
777
804
|
iq, id, tq = self.iqd_imax_umax(
|
778
805
|
i1max, w1max, u1max,
|
779
|
-
T, with_mtpv=False,
|
806
|
+
T, with_mtpv=False, with_mtpa=with_mtpa,
|
780
807
|
with_tmech=with_tmech)
|
781
808
|
break
|
782
809
|
except ValueError:
|
@@ -804,7 +831,8 @@ class PmRelMachine(object):
|
|
804
831
|
with_mtpa, with_tmech)[:2]
|
805
832
|
else:
|
806
833
|
iq, id = self.iqd_imax_umax(i1max, wx, u1max,
|
807
|
-
T,
|
834
|
+
T, with_mtpa=with_mtpa,
|
835
|
+
with_mtpv=False)[:2]
|
808
836
|
i1 = betai1(iq, id)[1]
|
809
837
|
try:
|
810
838
|
if with_tmech:
|
@@ -957,42 +985,53 @@ class PmRelMachine(object):
|
|
957
985
|
r = dict(id=[], iq=[], uq=[], ud=[], u1=[], i1=[], T=[],
|
958
986
|
beta=[], gamma=[], phi=[], cosphi=[], pmech=[], n=[], type_op=[])
|
959
987
|
|
988
|
+
i1max = 0
|
960
989
|
if kwargs.get('i1max', 0):
|
961
|
-
|
990
|
+
i1max = kwargs['i1max']
|
991
|
+
w1, Tf = self.w1_imax_umax(i1max, u1max,
|
992
|
+
with_mtpa=with_mtpa,
|
993
|
+
with_tmech=with_tmech)
|
994
|
+
if with_mtpa:
|
995
|
+
iq, id, T = self.mtpa(i1max)
|
996
|
+
else:
|
997
|
+
iq, id = iqd(0, i1max)
|
962
998
|
|
963
999
|
if np.isscalar(T):
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
if
|
970
|
-
|
971
|
-
|
972
|
-
T
|
1000
|
+
if i1max == 0:
|
1001
|
+
tmax = self.torquemax(self.i1range[1])
|
1002
|
+
tmin = 0
|
1003
|
+
if self.betarange[0] < -np.pi/2:
|
1004
|
+
tmin = -self.torquemin(self.i1range[1])
|
1005
|
+
if tmin > T or T > tmax:
|
1006
|
+
if with_torque_corr:
|
1007
|
+
Torig = T
|
1008
|
+
if T > 0:
|
1009
|
+
T = np.floor(tmax)
|
1010
|
+
else:
|
1011
|
+
T = np.ceil(tmin)
|
1012
|
+
logger.warning("corrected torque: %f -> %f Nm",
|
1013
|
+
Torig, T)
|
973
1014
|
else:
|
974
|
-
|
975
|
-
|
976
|
-
|
1015
|
+
raise ValueError(
|
1016
|
+
f"torque {T} Nm out of range ({tmin:.1f}, {tmax:.1f} Nm)")
|
1017
|
+
|
1018
|
+
if with_mtpa:
|
1019
|
+
iq, id = self.iqd_torque(T)
|
1020
|
+
i1max = betai1(iq, id)[1]
|
1021
|
+
if T < 0:
|
1022
|
+
i1max = -i1max
|
977
1023
|
else:
|
978
|
-
|
979
|
-
|
1024
|
+
i1max = self.i1_torque(T, 0)
|
1025
|
+
iq, id = iqd(0, i1max)
|
980
1026
|
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
iq, id = iqd(0, i1max)
|
1027
|
+
if with_tmech:
|
1028
|
+
w1, Tf = self.w1_imax_umax(i1max, u1max, with_mtpa=with_mtpa,
|
1029
|
+
with_tmech=with_tmech)
|
1030
|
+
else:
|
1031
|
+
iq, id = self.iqd_torque(T)
|
1032
|
+
Tf = T
|
1033
|
+
w1 = self.w1_umax(u1max, iq, id)
|
989
1034
|
|
990
|
-
if with_tmech:
|
991
|
-
w1, Tf = self.w1_imax_umax(i1max, u1max)
|
992
|
-
else:
|
993
|
-
iq, id = self.iqd_torque(T)
|
994
|
-
Tf = T
|
995
|
-
w1 = self.w1_umax(u1max, iq, id)
|
996
1035
|
assert w1>0, f"Invalid values u1 {u1max}, T {T}, iq: {iq} id: {id}"
|
997
1036
|
n1 = w1/2/np.pi/self.p
|
998
1037
|
r['n_type'] = n1
|
@@ -1030,11 +1069,7 @@ class PmRelMachine(object):
|
|
1030
1069
|
logger.info("sample intervals %s", nstab)
|
1031
1070
|
for nx in np.linspace(0, n1, nstab[0]):
|
1032
1071
|
if with_tmech:
|
1033
|
-
|
1034
|
-
with_mtpa or nx == n1)[:2]
|
1035
|
-
else:
|
1036
|
-
iq, id = self.iqd_torque(Tf, (iq, id),
|
1037
|
-
with_mtpa or nx == n1)[:2]
|
1072
|
+
T = self.tmech_iqd(iq, id, nx)
|
1038
1073
|
r['id'].append(id)
|
1039
1074
|
r['iq'].append(iq)
|
1040
1075
|
r['n'].append(nx)
|
@@ -1042,6 +1077,7 @@ class PmRelMachine(object):
|
|
1042
1077
|
|
1043
1078
|
r['type_op'] = list(betai1(iq, id))
|
1044
1079
|
Pmax = 2*np.pi*n1*Tf
|
1080
|
+
tq = Tf
|
1045
1081
|
for ns, nu, iv in zip(nstab[1:], speedrange[2:], interv):
|
1046
1082
|
# find id, iq, torque in fieldweakening range
|
1047
1083
|
if ns > 0:
|
@@ -1062,8 +1098,9 @@ class PmRelMachine(object):
|
|
1062
1098
|
else:
|
1063
1099
|
iq, id, tq = self.iqd_imax_umax(
|
1064
1100
|
i1max, w1, u1max,
|
1065
|
-
|
1066
|
-
with_mtpv=with_mtpv
|
1101
|
+
tq, with_tmech=with_tmech,
|
1102
|
+
with_mtpv=with_mtpv,
|
1103
|
+
with_mtpa=with_mtpa)
|
1067
1104
|
else:
|
1068
1105
|
if with_tmech:
|
1069
1106
|
iq, id, tq = self.mtpv_tmech(w1, u1max,
|
@@ -1452,6 +1489,7 @@ class PmRelMachinePsidq(PmRelMachine):
|
|
1452
1489
|
if k in pfe}
|
1453
1490
|
except KeyError as e:
|
1454
1491
|
logger.warning("loss map missing: %s", e)
|
1492
|
+
|
1455
1493
|
pass
|
1456
1494
|
|
1457
1495
|
def psi(self, iq, id):
|
femagtools/parstudy.py
CHANGED
@@ -179,15 +179,21 @@ class ParameterStudy(object):
|
|
179
179
|
extra_result_files = []
|
180
180
|
if simulation.get('airgap_induc', False):
|
181
181
|
extra_result_files.append('bag.dat')
|
182
|
-
|
183
|
-
|
182
|
+
try:
|
183
|
+
simulation['arm_length'] = model.lfe
|
184
|
+
simulation['lfe'] = model.lfe
|
185
|
+
except AttributeError:
|
186
|
+
pass
|
184
187
|
simulation['move_action'] = model.move_action
|
185
188
|
simulation['phi_start'] = 0.0
|
186
189
|
try:
|
187
190
|
simulation['range_phi'] = 720/model.get('poles')
|
188
191
|
except AttributeError: # if dxf or pure fsl model
|
189
192
|
simulation['range_phi'] = 0.0
|
190
|
-
|
193
|
+
try:
|
194
|
+
simulation.update(model.winding)
|
195
|
+
except AttributeError:
|
196
|
+
pass
|
191
197
|
fea = femagtools.model.FeaModel(simulation)
|
192
198
|
|
193
199
|
prob = femagtools.moproblem.FemagMoProblem(decision_vars,
|
@@ -206,11 +212,11 @@ class ParameterStudy(object):
|
|
206
212
|
except:
|
207
213
|
pass
|
208
214
|
for k in ('num_slots', 'num_slots_gen'):
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
215
|
+
try:
|
216
|
+
if k not in machine['stator']:
|
217
|
+
machine['stator'][k] = model.stator[k]
|
218
|
+
except KeyError:
|
219
|
+
pass
|
214
220
|
job = engine.create_job(self.femag.workdir)
|
215
221
|
if self.femag.cmd:
|
216
222
|
engine.cmd = [self.femag.cmd]
|
@@ -226,7 +232,10 @@ class ParameterStudy(object):
|
|
226
232
|
fea.poc.pole_pitch = 2*360/model.get('poles')
|
227
233
|
fea.pocfilename = fea.poc.filename()
|
228
234
|
if not hasattr(fea, 'pocfilename'):
|
229
|
-
|
235
|
+
try:
|
236
|
+
fea.pocfilename = f"{model.name}_{model.get('poles')}p.poc"
|
237
|
+
except AttributeError:
|
238
|
+
logger.warning("Missing number of poles")
|
230
239
|
elapsedTime = 0
|
231
240
|
self.bchmapper_data = [] # clear bch data
|
232
241
|
# split x value (par_range) array in handy chunks:
|
femagtools/plot/bch.py
CHANGED
@@ -527,20 +527,36 @@ def demagnetization(demag, ax=0):
|
|
527
527
|
i1 = [scale*x for x in demag['i1']]
|
528
528
|
ax.plot(i1, demag['rr'], 'o', color='C0')
|
529
529
|
ax.plot(i1, demag['rr'], color='C0')
|
530
|
-
rrmin = 0.6
|
530
|
+
rrmin = min(0.6, np.min(demag['rr']))
|
531
|
+
|
532
|
+
Imax = scale*abs(demag['i1max'])
|
533
|
+
demaglabels = [f'Imax = {Imax:.1f} {unit}']
|
531
534
|
if demag.get('i1c', 0):
|
532
535
|
Icrit = scale*demag['i1c']
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
536
|
+
ax.plot([Icrit, Icrit], [rrmin, 1], 'r:')
|
537
|
+
ax.text(Icrit, rrmin+0.15, 'Icrit', fontfamily='monospace',
|
538
|
+
rotation=90, size='large', ha='right', va='bottom')
|
539
|
+
demaglabels.append(f'Icrit = {Icrit:.1f} {unit}')
|
540
|
+
|
541
|
+
ax.plot([Imax, Imax], [rrmin, 1], 'g:')
|
542
|
+
ax.text(Imax, rrmin+0.05, 'Imax', fontfamily='monospace',
|
543
|
+
rotation=90, size='large', ha='right', va='bottom')
|
544
|
+
|
545
|
+
Hk = demag['Hk']
|
546
|
+
Tmag = demag['Tmag']
|
547
|
+
demaglabels += [f'Hk = {Hk:.1f} kA/m',
|
548
|
+
f'Tmag = {Tmag:.1f} °C']
|
549
|
+
|
550
|
+
ax.text(0, rrmin+0.05,
|
551
|
+
'\n'.join(demaglabels),
|
552
|
+
fontfamily='monospace',
|
553
|
+
ha='left', va='bottom', size='large',
|
542
554
|
bbox={'facecolor': 'white',
|
543
555
|
'edgecolor': 'white'})
|
556
|
+
|
557
|
+
#ax.annotate('Imax', xy=(Imax, demag['rr_i1max']), ha='center', va='bottom',
|
558
|
+
# xytext=(Imax, demag['rr_i1max']-0.1), rotation=90,
|
559
|
+
# arrowprops=dict(facecolor='green', edgecolor='green', shrink=0.05))
|
544
560
|
ax.set_ylim([rrmin, 1.01])
|
545
561
|
ax.set_ylabel('Rel. Remanence')
|
546
562
|
ax.set_xlabel(f'Phase Current / {unit}')
|
femagtools/shortcircuit.py
CHANGED
@@ -106,16 +106,19 @@ def shortcircuit(femag, machine, bch, simulation, engine=0):
|
|
106
106
|
encoding='latin1', errors='ignore'))
|
107
107
|
bchsc.scData['demag'] = bchsc.demag
|
108
108
|
if simulation.get('sim_demagn', 0):
|
109
|
-
|
109
|
+
dd = {'displ': [d['displ']
|
110
110
|
for d in bchsc.demag if 'displ' in d],
|
111
111
|
'H_max': [d['H_max']
|
112
112
|
for d in bchsc.demag if 'H_max' in d],
|
113
113
|
'H_av': [d['H_av']
|
114
114
|
for d in bchsc.demag if 'H_av' in d]}
|
115
|
-
|
115
|
+
i1max = bchsc.scData['iks']
|
116
|
+
if dd['displ']:
|
117
|
+
phi = dd['displ'][0]/180*np.pi
|
116
118
|
bchsc.scData['demag'] = demag(
|
117
|
-
femag, machine, simulation,
|
118
|
-
|
119
|
+
femag, machine, simulation,
|
120
|
+
i1max, phi, engine)
|
121
|
+
bchsc.scData['demag'].update(dd)
|
119
122
|
scdata = bchsc.scData
|
120
123
|
#for w in bch.flux:
|
121
124
|
# try:
|
@@ -129,13 +132,13 @@ def shortcircuit(femag, machine, bch, simulation, engine=0):
|
|
129
132
|
if simulation.get('sc_type', 3) == 2:
|
130
133
|
if 'i1max' not in simulation:
|
131
134
|
# just a wild guess
|
132
|
-
simulation['i1max'] =
|
135
|
+
simulation['i1max'] = 5*bch.machine['i1']
|
133
136
|
logger.info("2phase short circuit simulation i1max = %.0f",
|
134
137
|
simulation['i1max'])
|
135
138
|
scdata = shortcircuit_2phase(femag, machine, simulation, engine)
|
136
139
|
|
137
140
|
else:
|
138
|
-
logger.warning("Empty shortcircuit results for type %
|
141
|
+
logger.warning("Empty shortcircuit results for type %s",
|
139
142
|
simulation.get('sc_type', 'unknown'))
|
140
143
|
# must reset calcmode
|
141
144
|
if calcmode:
|
@@ -161,12 +164,13 @@ def shortcircuit_2phase(femag, machine, simulation, engine=0):
|
|
161
164
|
num_cur_steps = 4
|
162
165
|
i1 = np.linspace(0, i1max, num_cur_steps)
|
163
166
|
i1vec = np.concat((-i1[::-1], i1[1:]))
|
164
|
-
num_par_wdgs = machine['winding'].get('num_par_wdgs', 1)
|
165
167
|
flux_sim = {
|
166
168
|
'calculationMode': 'psi-torq-rot',
|
167
169
|
'i1max': i1max,
|
168
170
|
'curvec': [],
|
169
|
-
'
|
171
|
+
'magntemp': simulation['magn_temp'],
|
172
|
+
'fc_radius': simulation['fc_radius'],
|
173
|
+
'num_par_wdgs': simulation['num_par_wdgs']}
|
170
174
|
|
171
175
|
if engine:
|
172
176
|
parstudy = _parstudy_list(femag, sc_result_func)
|
@@ -304,6 +308,11 @@ def shortcircuit_2phase(femag, machine, simulation, engine=0):
|
|
304
308
|
logger.info("Torque %.1f %.1f %.1f (dphi %.4f)",
|
305
309
|
tp[1], tv[1], tc[1], dphi)
|
306
310
|
|
311
|
+
# rotor position at maximum current:
|
312
|
+
trot = min(iav[0], iap[0])
|
313
|
+
phi = wm*trot + phi0
|
314
|
+
logger.info("phi %.1f")
|
315
|
+
|
307
316
|
scData = {
|
308
317
|
'ia': ia.tolist(),
|
309
318
|
'ib': (-ia).tolist(),
|
@@ -316,63 +325,52 @@ def shortcircuit_2phase(femag, machine, simulation, engine=0):
|
|
316
325
|
'iks': iap[1] if iap[1] > abs(iav[1]) else iav[1],
|
317
326
|
'tks': tp[1] if tp[1] > abs(tv[1]) else tv[1]
|
318
327
|
}
|
319
|
-
scData['peakWindingCurrents'] = [scData['iks'],
|
320
|
-
-scData['iks'], 0]
|
328
|
+
scData['peakWindingCurrents'] = [float(scData['iks']),
|
329
|
+
-float(scData['iks']), 0]
|
321
330
|
if simulation.get('sim_demagn', 0):
|
322
|
-
|
331
|
+
i1max = iap[1] if iap[1] > abs(iav[1]) else iav[1]
|
332
|
+
scData['demag'] = demag(femag, machine, simulation,
|
333
|
+
i1max, phi, engine)
|
323
334
|
return scData
|
324
335
|
|
325
|
-
def
|
326
|
-
basedir = pathlib.Path(task.directory)
|
327
|
-
i1rr = []
|
328
|
-
for f in sorted(basedir.glob('psi-torq-rem-rot-*.dat')):
|
329
|
-
ptr = np.loadtxt(f)
|
330
|
-
i1rr.append((np.max(ptr.T[1:4]), np.min(ptr.T[-1])))
|
331
|
-
return i1rr
|
332
|
-
|
333
|
-
def demag(femag, machine, simulation, engine=0):
|
336
|
+
def demag(femag, machine, simulation, i1max, phi, engine=0):
|
334
337
|
"""demag simulation using psi-torq-rem-rot"""
|
335
338
|
logger.info("Demagnetization processing")
|
336
|
-
|
337
|
-
i1min = simulation.get('i1min', i1max/4)
|
339
|
+
i1min = simulation.get('i1min', abs(i1max/3))
|
338
340
|
num_steps = 7
|
339
|
-
b = (i1min-i1max)/np.log(i1min/i1max)
|
340
|
-
a = i1max/b
|
341
|
-
|
342
|
-
|
343
|
-
|
341
|
+
b = (i1min-abs(i1max))/np.log(i1min/abs(i1max))
|
342
|
+
a = abs(i1max)/b
|
343
|
+
xtab = np.linspace(i1min/abs(i1max),
|
344
|
+
1+2*(1-i1min/abs(i1max))/(num_steps-1), num_steps+2)
|
345
|
+
i1tab = b*(a+np.log(xtab))
|
344
346
|
|
345
347
|
if simulation.get('sc_type', 3) == 3:
|
346
348
|
curvec = [[-a/2, a, -a/2] for a in i1tab]
|
347
349
|
else:
|
348
|
-
|
350
|
+
if i1max > 0:
|
351
|
+
curvec = [[a, -a, 0] for a in i1tab]
|
352
|
+
else:
|
353
|
+
curvec = [[-a, a, 0] for a in i1tab]
|
349
354
|
simulation.update({
|
350
|
-
'calculationMode': 'psi-torq-rem
|
355
|
+
'calculationMode': 'psi-torq-rem',
|
356
|
+
'phi': phi,
|
357
|
+
'magntemp': simulation['Tmag'],
|
351
358
|
'curvec': curvec})
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
}
|
358
|
-
results = parstudy(parvardef, machine, simulation, engine)
|
359
|
-
i1rr = np.vstack(
|
360
|
-
((0, 1),
|
361
|
-
np.array(results['f']).reshape((-1, 2))))
|
362
|
-
else:
|
363
|
-
class Task:
|
364
|
-
def __init__(self, workdir):
|
365
|
-
self.directory = workdir
|
366
|
-
_ = femag(machine, simulation)
|
367
|
-
i1rr = np.vstack(
|
368
|
-
[(0, 1), dm_result_func(Task(femag.workdir))])
|
369
|
-
i1, rr = np.array(i1rr).T
|
359
|
+
_ = femag(machine, simulation)
|
360
|
+
|
361
|
+
ptr = np.loadtxt(femag.workdir / "psi-torq-rem.dat")
|
362
|
+
i1 = np.concat(([0], np.max(ptr[:,1:4], axis=1)))
|
363
|
+
rr = np.concat(([1], ptr[:,-1]))
|
370
364
|
dmag = {'Hk': simulation['Hk'],
|
371
365
|
'Tmag': simulation['Tmag'],
|
372
366
|
'i1': i1.tolist(),
|
367
|
+
'i1max': float(np.abs(i1max)),
|
373
368
|
'rr': rr.tolist()}
|
374
369
|
# critical current
|
375
370
|
if np.min(rr) < 0.99:
|
376
|
-
k = np.where(rr
|
377
|
-
dmag['i1c'] = i1[k]
|
371
|
+
k = np.where(np.diff(dmag['rr'])<-1e-3)[0][0]+1
|
372
|
+
dmag['i1c'] = float(i1[k])
|
373
|
+
if abs(i1max) < i1[-1]:
|
374
|
+
rrf = make_interp_spline(i1, rr)
|
375
|
+
dmag['rr_i1max'] = float(rrf(abs(i1max)))
|
378
376
|
return dmag
|
femagtools/templates/plots.mako
CHANGED
@@ -0,0 +1,112 @@
|
|
1
|
+
-- calculate flux linkages, torque, and rel remanence (magstatic mode)
|
2
|
+
--
|
3
|
+
-- model:
|
4
|
+
-- Hk (kA/m) knee point field strength
|
5
|
+
-- curvec (A) phase current amplitude samples (list of [ía, ib, ic])
|
6
|
+
-- num_par_wdgs (number of parallel winding groups, default 1)
|
7
|
+
-- fc_radius (m) radius of airgap center
|
8
|
+
--
|
9
|
+
-- creates file psi-torq-rem.dat in current directory with columns:
|
10
|
+
-- displ curr1 curr2 curr3 psi1 psi2 psi3 torq rrem
|
11
|
+
|
12
|
+
<%include file="magnet-data.mako"/>
|
13
|
+
|
14
|
+
function dmg(ek, Br, alfam, murm, Bd, Bq, Hd, Hq, alfahm, Hk)
|
15
|
+
if Hd < Hk then
|
16
|
+
muem = murm*4*math.pi*1e-7
|
17
|
+
Brn = Bd - Hk*1e3*muem
|
18
|
+
if Br < 1e-5 then
|
19
|
+
Brn = 1e-5
|
20
|
+
end
|
21
|
+
return Brn, alfam, 1
|
22
|
+
end
|
23
|
+
return Br, alfam, 1
|
24
|
+
end
|
25
|
+
|
26
|
+
function calc_flux_torq_rem(curvec)
|
27
|
+
for k=1,3 do
|
28
|
+
def_curr_wdg(k, curvec[k]/a, 0)
|
29
|
+
end
|
30
|
+
|
31
|
+
dRR = 0
|
32
|
+
RR = 0
|
33
|
+
maxit=m.num_nonl_it
|
34
|
+
maxcop=m.error_perm -- err_perm in %
|
35
|
+
permode='restore'
|
36
|
+
repeat
|
37
|
+
calc_field_single({
|
38
|
+
maxit=maxit, maxcop=maxcop, -- err_perm in %
|
39
|
+
permode=permode})
|
40
|
+
if(maxit > 1) then
|
41
|
+
maxit = 1
|
42
|
+
permode='actual'
|
43
|
+
maxcop = 0.05
|
44
|
+
end
|
45
|
+
stat, RR, dRR = calc_demag(5, Hk)
|
46
|
+
--printf("%g %g", RR, dRR)
|
47
|
+
until math.abs(dRR) < 1e-5
|
48
|
+
|
49
|
+
psi = {}
|
50
|
+
for k=1,3 do
|
51
|
+
psir, psii = flux_winding_wk(k)
|
52
|
+
psi[k] = {ksym*psir/a*m.arm_length, ksym*psii/a*m.arm_length}
|
53
|
+
end
|
54
|
+
|
55
|
+
fr, ft, tq, fx, fy = force_torque()
|
56
|
+
|
57
|
+
return psi, tq, RR
|
58
|
+
end
|
59
|
+
%if model.get('fc_radius', 0):
|
60
|
+
if m.fc_radius == nil then
|
61
|
+
m.fc_radius = ${model['fc_radius']*1e3}
|
62
|
+
end
|
63
|
+
%endif
|
64
|
+
%if type(model.get('curvec')[0]) is list:
|
65
|
+
curvec = {${','.join(['{'+','.join([str(x) for x in y])+'}' for y in model['curvec']])}} -- A
|
66
|
+
%else:
|
67
|
+
curvec = {{${','.join([str(x) for x in model['curvec']])}}} -- A
|
68
|
+
%endif
|
69
|
+
a=${model.get('num_par_wdgs', 1)} -- parallel branches
|
70
|
+
|
71
|
+
ksym = m.num_poles/m.npols_gen
|
72
|
+
|
73
|
+
-- HcB = Brem*tempcoefbr*(magn_temp-20)+1)/muerel/12.565e-7
|
74
|
+
-- Hcmin = HcJ*tempcoefhc*(magn_temp-20.0)+1)/HcB*1e2 -- limit of demagnetization in
|
75
|
+
Hk = ${model.get('Hk', -999)}
|
76
|
+
|
77
|
+
phi = ${model.get('phi', 0)}*180/math.pi
|
78
|
+
-- initialize rotate
|
79
|
+
rotate({
|
80
|
+
airgap = m.fc_radius, -- air gap radius
|
81
|
+
region = "inside", -- region to rotate
|
82
|
+
mode = "save" -- save initial model state
|
83
|
+
})
|
84
|
+
|
85
|
+
file_psi = io.open("psi-torq-rem.dat","w")
|
86
|
+
for i=1, #curvec do
|
87
|
+
print(string.format(" current: %d/%d %g, %g, %g\n",
|
88
|
+
i, #curvec, curvec[i][1], curvec[i][2], curvec[i][3]))
|
89
|
+
|
90
|
+
rotate({angle=phi, mode="absolute"})
|
91
|
+
psi, tq, rr = calc_flux_torq_rem(curvec[i])
|
92
|
+
|
93
|
+
file_psi:write(string.format("%g ", phi))
|
94
|
+
for k=1, 3 do
|
95
|
+
file_psi:write(string.format("%g ", curvec[i][k]))
|
96
|
+
end
|
97
|
+
for k=1, 3 do
|
98
|
+
file_psi:write(string.format("%g ", psi[k][1]))
|
99
|
+
end
|
100
|
+
file_psi:write(string.format("%g ", tq))
|
101
|
+
file_psi:write(string.format("%g ", rr))
|
102
|
+
file_psi:write("\n")
|
103
|
+
|
104
|
+
% if model.get('plots', []):
|
105
|
+
if i == #curvec-2 then
|
106
|
+
<%include file="plots.mako"/>
|
107
|
+
end
|
108
|
+
% endif
|
109
|
+
end
|
110
|
+
|
111
|
+
rotate({mode = "reset"}) -- restore the initial state (discard any changes)
|
112
|
+
file_psi:close()
|
@@ -7,6 +7,8 @@
|
|
7
7
|
-- creates file psi-torq-rot.dat in current directory with columns:
|
8
8
|
-- displ curr1 curr2 curr3 psi1 psi2 psi3 torq
|
9
9
|
--
|
10
|
+
<%include file="magnet-data.mako"/>
|
11
|
+
|
10
12
|
function gcd(a, b)
|
11
13
|
return b==0 and a or gcd(b,a%b)
|
12
14
|
end
|
@@ -69,6 +71,11 @@ dphi = 360//gcd(Q1, p)/nrot
|
|
69
71
|
print(string.format(" rotation steps: %d current steps: %d\n", nrot, #curvec))
|
70
72
|
|
71
73
|
phi = 0
|
74
|
+
%if model.get('fc_radius', 0):
|
75
|
+
if m.fc_radius == nil then
|
76
|
+
m.fc_radius = ${model['fc_radius']*1e3}
|
77
|
+
end
|
78
|
+
%endif
|
72
79
|
-- initialize rotate
|
73
80
|
rotate({
|
74
81
|
airgap = m.fc_radius, -- air gap radius
|
femagtools/windings.py
CHANGED
@@ -70,46 +70,64 @@ def end_wdg_length_round_wires(layers, Rp, Rb, r_wire, h, coil_span, Q, bore_dia
|
|
70
70
|
l_ew = 2*h + l + z + (Rb + r_wire)*(np.pi - 2)
|
71
71
|
return l_ew, h, Rp, Rb
|
72
72
|
|
73
|
-
def end_wdg_hairpin_check(alpha, h, dmin, l_h, wire_w, tooth_wmin):
|
73
|
+
def end_wdg_hairpin_check(alpha, h, dmin, l_h, wire_w, tooth_wmin, h_conn):
|
74
74
|
alpha = alpha*np.pi/180 # ensure alpha is in radians
|
75
|
+
dmin_new = 0
|
76
|
+
alpha_new = 0
|
77
|
+
h_new = 0
|
78
|
+
|
79
|
+
if dmin < 0.0015:
|
80
|
+
dmin = 0.0015
|
81
|
+
if h_conn < 0.005:
|
82
|
+
h_conn = 0.005
|
83
|
+
|
75
84
|
if alpha == 0 and h == 0: # end wdg parameters not set
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
+
alpha_new = np.arcsin((dmin + wire_w)/(tooth_wmin + wire_w))
|
86
|
+
h_new = np.tan(alpha_new)*l_h/2
|
87
|
+
|
88
|
+
elif h > 0: # imposed end wdg height
|
89
|
+
alpha_new = np.arctan(h/l_h)
|
90
|
+
dmin_new = np.sin(alpha_new)*(tooth_wmin + wire_w) - wire_w
|
91
|
+
if dmin_new < dmin: # imposed end wdg height is not feasible - calculate min end wdg parameters
|
92
|
+
dmin_new = dmin
|
93
|
+
alpha_new = np.arcsin((dmin_new + wire_w)/(tooth_wmin + wire_w))
|
94
|
+
h_new = np.tan(alpha_new)*l_h/2
|
95
|
+
|
85
96
|
elif alpha > 0: # imposed end wdg angle
|
86
|
-
|
87
|
-
if
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
97
|
+
dmin_new = np.sin(alpha)*(tooth_wmin + wire_w) - wire_w
|
98
|
+
if dmin_new < dmin: # imposed end wdg angle is not feasible - calculate min end wdg parameters
|
99
|
+
dmin_new = dmin
|
100
|
+
alpha_new = np.arcsin((dmin_new + wire_w)/(tooth_wmin + wire_w))
|
101
|
+
h_new = np.tan(alpha_new)*l_h/2
|
102
|
+
|
103
|
+
if dmin_new > dmin:
|
104
|
+
dmin = dmin_new
|
105
|
+
if alpha_new > alpha:
|
106
|
+
alpha = alpha_new
|
107
|
+
if h_new > h:
|
108
|
+
h = h_new
|
109
|
+
|
110
|
+
return h, alpha, dmin, h_conn
|
92
111
|
|
93
112
|
def end_wdg_length_hairpins(wire_h, wire_w, wire_th, wire_gap,
|
94
|
-
layers, coil_pitch, Q, bore_diam,
|
113
|
+
layers, coil_pitch, Q, bore_diam, slot_w, slot_h,
|
95
114
|
h_bent=0, h_welded=0, h_conn=0.005, alpha_bent=0, alpha_welded=0, dmin=0.0015): # needs to be validated
|
96
115
|
'''return end wdg length of single pin for bent and welded side, average end wdg length,
|
97
116
|
bent and welded side end wdg heights, bending angles and min distances between pins'''
|
98
117
|
|
99
118
|
R_avg = bore_diam/2 + wire_th + layers/2*(wire_h + wire_gap) + wire_h/2
|
100
|
-
l_h = R_avg
|
119
|
+
l_h = R_avg*coil_pitch/Q*2*np.pi
|
101
120
|
tooth_wmin = (bore_diam + 2*wire_th)*np.pi/Q - slot_w
|
102
121
|
|
103
|
-
h_bent, alpha_bent, dmin = end_wdg_hairpin_check(alpha_bent, h_bent, dmin, l_h, wire_w, tooth_wmin)
|
104
|
-
|
122
|
+
h_bent, alpha_bent, dmin, h_conn = end_wdg_hairpin_check(alpha_bent, h_bent, dmin, l_h, wire_w, tooth_wmin, h_conn)
|
105
123
|
h_welded = h_welded - h_conn if h_welded - h_conn > 0 else 0
|
106
|
-
h_welded, alpha_welded, dmin = end_wdg_hairpin_check(alpha_welded, h_welded, dmin, l_h, wire_w, tooth_wmin)
|
124
|
+
h_welded, alpha_welded, dmin, h_conn = end_wdg_hairpin_check(alpha_welded, h_welded, dmin, l_h, wire_w, tooth_wmin, h_conn)
|
107
125
|
|
108
|
-
l_bent = 2*(0.
|
109
|
-
l_welded = 2*(0.
|
126
|
+
l_bent = 2*(0.003 + wire_w/2*alpha_bent + wire_w*(np.pi/2 - alpha_bent) + np.sqrt((l_h/2)**2 + h_bent**2))
|
127
|
+
l_welded = 2*(0.003 + wire_w/2*alpha_bent + wire_w*(np.pi/2 - alpha_bent) + np.sqrt((l_h/2)**2 + h_welded**2)) + h_conn
|
110
128
|
l_ew = (l_bent + l_welded)/2
|
111
129
|
h_welded = h_welded + h_conn
|
112
|
-
return l_bent, l_welded, l_ew, h_bent, h_welded, alpha_bent*180/np.pi, alpha_welded*180/np.pi, dmin
|
130
|
+
return l_bent, l_welded, l_ew, h_bent, h_welded, h_conn, alpha_bent*180/np.pi, alpha_welded*180/np.pi, dmin
|
113
131
|
|
114
132
|
|
115
133
|
class Winding(object):
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: femagtools
|
3
|
-
Version: 1.8.
|
3
|
+
Version: 1.8.12
|
4
4
|
Summary: Python API for FEMAG
|
5
5
|
Author-email: Ronald Tanner <tar@semafor.ch>, Dapu Zhang <dzhang@gtisoft.com>, Beat Holm <hob@semafor.ch>, Günther Amsler <amg@semafor.ch>, Nicolas Mauchle <mau@semafor.ch>
|
6
6
|
License: Copyright (c) 2016-2023, Semafor Informatik & Energie AG, Basel
|
@@ -1,4 +1,4 @@
|
|
1
|
-
femagtools/__init__.py,sha256=
|
1
|
+
femagtools/__init__.py,sha256=wRK12H26MLJW_1cDk2ngqCP1fJGYZOWzt-2ugf0c9ao,1601
|
2
2
|
femagtools/airgap.py,sha256=hELJXe52yUw82JwZ1tGUXUtRhMG2_WSUBVeGkTZSAM8,1900
|
3
3
|
femagtools/amazon.py,sha256=O1ICuv21XDAJi1qK1Sigs2TdS6hDZP19OzvmE2t76wU,12069
|
4
4
|
femagtools/amela.py,sha256=2q-Xsj6i6nQ3iKheBR1vQ4FulJfF1i-L8w3a3U8GYWo,4362
|
@@ -17,17 +17,17 @@ femagtools/ecloss.py,sha256=nES8mtXNFitmxDvKL5o39hZl6qu-HfR6kUh9eBA9zxQ,34660
|
|
17
17
|
femagtools/erg.py,sha256=IXKq76P9qLt_ssNOP78v8Qizk3J2Zg80yaKDSjzwoJE,1224
|
18
18
|
femagtools/femag.py,sha256=ScrZ9gbWQIy4eIhF0Wmi41lSFm7-WRtiLcJOvkITcHo,44864
|
19
19
|
femagtools/forcedens.py,sha256=7NNv75Vg9vQ_fy8W4kM2rlSO970zaSmeurhPmdAxsOU,8485
|
20
|
-
femagtools/fsl.py,sha256=
|
20
|
+
femagtools/fsl.py,sha256=J1V1Kr-PZpWbLegYMAvgfUabj1WZOji_-JR9mlf23gg,37043
|
21
21
|
femagtools/getset.py,sha256=yJ6Em35DeWK7WNZW0qjjS5s7LUkVh5mbgxF59HHm5FM,3017
|
22
22
|
femagtools/gmsh.py,sha256=IKhNiviIBji4cMxAhxaYXNqBRMNAPSKsBGdnGyxkyQw,3903
|
23
23
|
femagtools/google.py,sha256=ugRyHY1zBjHR4aNfbA7GeF-ZU_NgleuVTZaWpi_XLT4,17144
|
24
24
|
femagtools/grid.py,sha256=s7LfKKLm2H4-cza2kSEANq6vwxq10Su3TJl3kHShHRA,1561
|
25
25
|
femagtools/heat_source_network.py,sha256=dz3nTK084SR2fyy1167wlpBlGrzv54OqCCGKPNWqpsU,16836
|
26
26
|
femagtools/hxy.py,sha256=PkiZ_-CRhtvtpkmLAP8iMtwvzh7CjKGGcAbOhFb4Nls,6275
|
27
|
-
femagtools/isa7.py,sha256=
|
27
|
+
femagtools/isa7.py,sha256=HqTQmbOLmLi75ytXpkryeYiXqUChi07mBUNYYj9xOjk,66365
|
28
28
|
femagtools/jhb.py,sha256=stJxkmzHpfUIBVcFw7jWbV5KN9_EFqzOCgacyhUqWvM,1779
|
29
29
|
femagtools/job.py,sha256=sIRVXsyoupfRXqGsWyOHMetcKlWIyggxfVURjM8aD54,11322
|
30
|
-
femagtools/leakinduc.py,sha256=
|
30
|
+
femagtools/leakinduc.py,sha256=4IGZaV8S1ZG6L3hgZsCXqMsMNRH4F88l9EsvUjSXDSE,999
|
31
31
|
femagtools/losscoeffs.py,sha256=7B29VdEsmv8HSP749X3QBb_E-XN6Z9dvNleKiRLWaMI,7721
|
32
32
|
femagtools/magnet.py,sha256=Nuk060bT4Wa3lX74HdefqTTtUxLaERDSBYTTpbi6KP4,1093
|
33
33
|
femagtools/mcv.py,sha256=nVemXwRPHkvlz7IIwnUONfQglnOcTnp3CsPwU1eG3OI,48604
|
@@ -40,16 +40,16 @@ femagtools/nc.py,sha256=sKfFaeT8hPVUCb1axPIwfUVxuUsnrHygdfqiHv7G_YA,15216
|
|
40
40
|
femagtools/netlist.py,sha256=CSCl8setLZ_L8DCnNWaNA3-wLe1yo-fmzARZoVvYfaA,2052
|
41
41
|
femagtools/ntib.py,sha256=76g1ZO3Fq_kN-HTMBvaKvJmMMlJMyEPFeNAcJPq3w7Y,3099
|
42
42
|
femagtools/opt.py,sha256=wBU0yh3hZlNti_zfIvtKcPg1EJrnE3I1BqmVxLGWixU,8753
|
43
|
-
femagtools/parstudy.py,sha256=
|
43
|
+
femagtools/parstudy.py,sha256=kYUUX7wGggt5FEkH2jChl_BhAmKqBACCFYF_LN5mHeA,20045
|
44
44
|
femagtools/poc.py,sha256=yPWmpi8Q2g7NmpAi2YV5ezyo0VUj67EK0tcX2wikerw,7207
|
45
45
|
femagtools/semi_fea.py,sha256=WZtYKrzhDruETyuEW2kpiNp9OaA7Hheq3qJiAIYtsjg,3475
|
46
|
-
femagtools/shortcircuit.py,sha256=
|
46
|
+
femagtools/shortcircuit.py,sha256=B1gfxItKLv2qDgdHQkDWaSAAHsNwXdDD7Hu8mysIekY,14001
|
47
47
|
femagtools/tks.py,sha256=mDi45S5go9-jwALh6rS9RWPoOFBORZm0-XL4ECjSf_8,7531
|
48
48
|
femagtools/ts.py,sha256=x9aCMVASjdBZuyI2pJGMyi1dveGFd_pWQ20cZ-l_moc,47216
|
49
49
|
femagtools/utils.py,sha256=dJkQ5xsoVMzSEB5-2hEiwe2of9mLmsDo8nkrnSN-gPE,1643
|
50
50
|
femagtools/vbf.py,sha256=9XGfhftmD9carU8ByQ5DwqoR4daq5mJ39eMqruwml0Q,2444
|
51
51
|
femagtools/vtu.py,sha256=Sf83dHIfCKY2km-MIUHKKoj-JKN4PDX7kkPLZXyIYY4,10723
|
52
|
-
femagtools/windings.py,sha256=
|
52
|
+
femagtools/windings.py,sha256=p7BkIbi8mMc_CmWqAjOZNKz1-GlQb4kON4rWhvlARf8,27498
|
53
53
|
femagtools/zmq.py,sha256=HY8U7dxXkgE48151nvLcnLPa8OFBZcZTrB2XcjBc0Y4,9413
|
54
54
|
femagtools/dxfsl/__init__.py,sha256=MywcCdpKPKs4qJBJJgeDsikJFJ2P48dbTuNk303f5pM,76
|
55
55
|
femagtools/dxfsl/area.py,sha256=CpTMRBF8_AJmJMkkn-LgRv27U5xJ5Ohhd2ppRvESPNU,69757
|
@@ -71,10 +71,10 @@ femagtools/dxfsl/shape.py,sha256=uQqbgXIA2_KP2XRdhCfVfGWjcjwzhJ5t9RhiqR9R98c,616
|
|
71
71
|
femagtools/dxfsl/svgparser.py,sha256=RY2TU9MK6gOaNmI6w6RNqcw7H9YGmK-NUwvdylKBcsE,3763
|
72
72
|
femagtools/dxfsl/symmetry.py,sha256=dXfZVIqT49nbMirY5YVaRPi8kNB8reaiq-eIbhw1Z54,43936
|
73
73
|
femagtools/machine/__init__.py,sha256=B7yeRZzf29NWCWy8C8iJFdTr9bszAoMRcVEpblhCeg4,7256
|
74
|
-
femagtools/machine/afpm.py,sha256=
|
75
|
-
femagtools/machine/effloss.py,sha256=
|
74
|
+
femagtools/machine/afpm.py,sha256=ZkYk-acfmwV2ebhU8BUE6dKYkDrCR8UKp1plxEdZ4v8,40223
|
75
|
+
femagtools/machine/effloss.py,sha256=6mPm4Y_3lVXc1hOyCgTfRkGK3IAeC8gSxNnbSPL7or8,15508
|
76
76
|
femagtools/machine/im.py,sha256=isMSoCnIk4Hj47MwBNP5PW7a2rI-7N35A9zHGOSl43s,38111
|
77
|
-
femagtools/machine/pm.py,sha256=
|
77
|
+
femagtools/machine/pm.py,sha256=PTzQDIjHzKSoO2WT1jYH5cvCUCdAkmlmCfd2N35EbIs,69967
|
78
78
|
femagtools/machine/sizing.py,sha256=6IUSdp6HNGHlSaWMy0mjzLGxp3UtxFLfdzQ_4MYx7TI,30069
|
79
79
|
femagtools/machine/sm.py,sha256=SLaSuGJ8zXIFq6uBR2iu4uLXyWJZjA3iHAaTC8Jm-gw,39117
|
80
80
|
femagtools/machine/utils.py,sha256=25QNxP8lp31W7kB-gcIA1Vd_9UcYlxrahqZ-k3ALU_s,20985
|
@@ -86,7 +86,7 @@ femagtools/moo/test/AlgorithmTest.py,sha256=KzR1og4bu6NOE61DDKjEMTQdsysmho4LCYmJ
|
|
86
86
|
femagtools/moo/test/PopulationTest.py,sha256=lG9NeWo0xrslfQRa4tgy1Nj23VJMFIlg_vQ9KUBYnRA,5529
|
87
87
|
femagtools/moo/test/ProblemTest.py,sha256=r5XEfY4LPscDb35TxxPd0lbP3nUmL6_G6vrRo1I3RSg,505
|
88
88
|
femagtools/plot/__init__.py,sha256=LFrHy_9L6FxJqhYND2z1534s3ebPXkfXVagFeNA1wWk,978
|
89
|
-
femagtools/plot/bch.py,sha256=
|
89
|
+
femagtools/plot/bch.py,sha256=c2zSrtUyQWeKoxcJPGsuNvQ59veyXlvD-Fu4UBdmAyU,34078
|
90
90
|
femagtools/plot/char.py,sha256=xv4cNOTorK-fy7eUFhmyR-013TFI2A2999xXKgL2AnA,12469
|
91
91
|
femagtools/plot/fieldlines.py,sha256=_7ykKhnQLeS4fz34pnzovH1gIhcUSKJ3gl1GUgWYix8,1137
|
92
92
|
femagtools/plot/fluxdens.py,sha256=NlexRJ3f_8CgKoWrV82ZIsAXPrLhwj98uOe8_fUks7A,1082
|
@@ -144,14 +144,15 @@ femagtools/templates/noloadflux-rot.mako,sha256=BiAtTL0mj8ukbRiPKKyH80PpzugGIJKZ
|
|
144
144
|
femagtools/templates/noloadflux.mako,sha256=vYUpZRLOAixNoBbB-Nc-Y9niPYsSUEPvBCOjw26uFdg,4661
|
145
145
|
femagtools/templates/noloadfluxdc.mako,sha256=n3M4gNxf4Q-i7B8ft69Ism9lquRqh-pf4ET4KYwdQb0,3146
|
146
146
|
femagtools/templates/open.mako,sha256=Zl5yvdwT5BflJIPVmReggzSrTQhepbef62EoCuw_mQg,344
|
147
|
-
femagtools/templates/plots.mako,sha256=
|
147
|
+
femagtools/templates/plots.mako,sha256=2Cy4ArHE_FG6nHPJefZR3BTp9ZQD5oykYhsrzCWLyBk,621
|
148
148
|
femagtools/templates/pm_sym_f_cur.mako,sha256=Tk4ImaSN1vPfybzersJd5AmLHnqJjWHigCeBn_Cr40U,1558
|
149
149
|
femagtools/templates/pm_sym_fast.mako,sha256=wD_bwszJ5svPOL1AtWThbkuMyxi-wRAPpP3AMlJGwPM,2450
|
150
150
|
femagtools/templates/pm_sym_loss.mako,sha256=FNAvi_gmTXsGylrpi7lLKPoOOcNCV1mG6rc8gnXQ8u0,1098
|
151
151
|
femagtools/templates/prepare_thermal.mako,sha256=V3W6BGW7gjY8Lg2qzvGDi8rxx3JvPzrWoABDvHKyq54,9539
|
152
152
|
femagtools/templates/psd_psq_fast.mako,sha256=IOZx04JhVleAAbBOPWk9gEwDyT28z0zkF9tyEBteRPU,1428
|
153
153
|
femagtools/templates/psi-torq-rem-rot.mako,sha256=A1KOsYNSJhIJfumF-egnU-HUfNMPeX-XSPL_WsoE1Cw,3579
|
154
|
-
femagtools/templates/psi-torq-
|
154
|
+
femagtools/templates/psi-torq-rem.mako,sha256=N9AcWV0_c2jvZCr-LOW6QqDC7QIbZ-cVZ2fQ_Jw61KA,3099
|
155
|
+
femagtools/templates/psi-torq-rot.mako,sha256=_iT-IbgeC28wQzMVfi7uIN0cfp5pZ6d1mpLsoQrMx2c,2646
|
155
156
|
femagtools/templates/ring.mako,sha256=Cuc_FuCPWZM-g3TxHqzTdjknYEJSUgP-y64gp8pekDI,643
|
156
157
|
femagtools/templates/rot_hsm.mako,sha256=eh50TbpWNUALK9_7wOOJ7KPewHos7JExAfMACbPlXYc,973
|
157
158
|
femagtools/templates/rotorAsyn.mako,sha256=r_gce0oic24nPdI7BmERM1sokXpC5vvm8Sm0TIPb2zI,2280
|
@@ -184,7 +185,7 @@ tests/test_effloss.py,sha256=-kJJNgS5c6saHXjNuhAe5GdWfr9mEYpPo8fE8OtjsNA,1142
|
|
184
185
|
tests/test_erg.py,sha256=kRVzpXa6JDdbxTss18HUWKny9Dx8IMx9uGTrbQCnHwg,523
|
185
186
|
tests/test_femag.py,sha256=l7-av3eitLm7bwTuunEmVeTspi82ifPrlz7f1boGdVI,1934
|
186
187
|
tests/test_forcedens.py,sha256=Yzl3SAmJNkZN9dA3aLxRvwY8fKsw077Fl0iJm6zJ5Sk,536
|
187
|
-
tests/test_fsl.py,sha256=
|
188
|
+
tests/test_fsl.py,sha256=pjgqRo5fhrKYWg-bWjPm_O6-kwVyr-ZK-oOFUgYtyso,16623
|
188
189
|
tests/test_heat_source_network.py,sha256=TC-Gl4iy9jnMGfsY_24XjwlP-SDxP345JKVT8xRwsFo,690
|
189
190
|
tests/test_hxy.py,sha256=pVb6ZfDhBy5-DXa3gh7RQmLFG8p5cSYB8gdGLC8kjAk,640
|
190
191
|
tests/test_im.py,sha256=55wfCoA8_PuogI_RsC3AjUQCpR84T-HddtHuU1NxfPc,662
|
@@ -199,7 +200,7 @@ tests/test_mcv.py,sha256=Vv51WU3WU0AkgcSpyujMdJ2KvSdLNsks5HGtY0pWMOY,4749
|
|
199
200
|
tests/test_mcvreader.py,sha256=3cgq22b_iaWLrs4WWOUNHqJREnv0YoFivNpAb4teEJs,2118
|
200
201
|
tests/test_me.py,sha256=En00OrOhZclBO4u74q5Os0FgVP4TGFLzz99LF0QHXHA,196
|
201
202
|
tests/test_model.py,sha256=kYjjFgZPIex3foX3skiOdD5MCcmA2JP7oDDuE9txv_U,2698
|
202
|
-
tests/test_nc.py,sha256=
|
203
|
+
tests/test_nc.py,sha256=Qhd8SppnWULcEiGphhhn4K_8PfhV7Wh17NAC63R_-N0,4630
|
203
204
|
tests/test_parident.py,sha256=zwj-f-Q_s5dBr_fEvzd5iZqNVIcLwkoi_FF2_FNTiaw,1393
|
204
205
|
tests/test_parstudy.py,sha256=wk7WfYQrx5dtv6MnmWCfNAEInvRKsbVXYEUIIR9zLbQ,3200
|
205
206
|
tests/test_pocfile.py,sha256=eiMLBRQxDnHIGiqku6EXcQ3fb7wGIxhXmb20iyLlPRU,5816
|
@@ -220,9 +221,9 @@ tests/moo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
220
221
|
tests/moo/test_algorithm.py,sha256=Em8sFm2vzPmuIzRrBBnUQLU_TYuJHSf-kEeozw0XeX4,2563
|
221
222
|
tests/moo/test_population.py,sha256=FvX9LRCxQx0_E2GxHQ5vKwOYFBQiNbT6Lmv5GmNWjTQ,5471
|
222
223
|
tests/moo/test_problem.py,sha256=ALeP4u7g-dFhfwWL8vxivdrrYzVKPjHMCAXzzgyNZbs,467
|
223
|
-
femagtools-1.8.
|
224
|
-
femagtools-1.8.
|
225
|
-
femagtools-1.8.
|
226
|
-
femagtools-1.8.
|
227
|
-
femagtools-1.8.
|
228
|
-
femagtools-1.8.
|
224
|
+
femagtools-1.8.12.dist-info/LICENSE,sha256=NaQe4uvkszQPJmiRPHecfk-Ab9VSRXo8xQLGNVHTeFo,1362
|
225
|
+
femagtools-1.8.12.dist-info/METADATA,sha256=Y7Cxd_Wdj5H25nX8oaFX9ZWBxCvupQPDWKZTnJc-nGM,6191
|
226
|
+
femagtools-1.8.12.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
|
227
|
+
femagtools-1.8.12.dist-info/entry_points.txt,sha256=jrvOkZPiN44u1sASeu271VRaVIv5V-uRpN0_N5U_R8c,248
|
228
|
+
femagtools-1.8.12.dist-info/top_level.txt,sha256=Ri4YWtU8MZTzNje9IKyXhTakNbsrCynuWdon4Yq94Dc,17
|
229
|
+
femagtools-1.8.12.dist-info/RECORD,,
|
tests/test_fsl.py
CHANGED
@@ -319,11 +319,11 @@ class FslBuilderTest(unittest.TestCase):
|
|
319
319
|
|
320
320
|
feapars['calculationMode'] = "pm_sym_fast"
|
321
321
|
fsl = self.builder.create_analysis(feapars)
|
322
|
-
self.assertEqual(len(fsl),
|
322
|
+
self.assertEqual(len(fsl), 34)
|
323
323
|
|
324
324
|
feapars['calculationMode'] = "mult_cal_fast"
|
325
325
|
fsl = self.builder.create_analysis(feapars)
|
326
|
-
self.assertEqual(len(fsl),
|
326
|
+
self.assertEqual(len(fsl), 32)
|
327
327
|
|
328
328
|
feapars['calculationMode'] = "torq_calc"
|
329
329
|
fsl = self.builder.create_analysis(feapars)
|
tests/test_nc.py
CHANGED
@@ -100,7 +100,7 @@ def test_geom(pm):
|
|
100
100
|
assert g['h'] == pytest.approx(0.00308, abs=1e-5)
|
101
101
|
assert g['cxy'] == pytest.approx((0.02317, 0.007528), abs=1e-5)
|
102
102
|
assert g['area'] == pytest.approx(3.45e-05, abs=1e-6)
|
103
|
-
assert g['alpha'] == pytest.approx(1.
|
103
|
+
assert g['alpha'] == pytest.approx(-1.2566371, abs=1e-3)
|
104
104
|
|
105
105
|
def test_calc_iron_loss(pm):
|
106
106
|
import numpy as np
|
File without changes
|
File without changes
|
File without changes
|