/gopr
/out,ckslot,out
cmsel,,s_coil
*set,ckcur
*if,arg3,eq,0,then
arg3=1
*endif
*get,_rout,active,,rout
*if,_rout,ne,31,then
fini
/post1
*endif
_arg4=arg4
_err=0
*get,_targ4,parm,_arg4,type
*if,_targ4,ne,3,then
*get,_twind,parm,windloc,type
*if,_twind,eq,3,then
arg4='r_coil'
*else
arg4='s_coil'
*endif
*endif
cm,ce,elem
esel,none
cmsel,,%arg4%
*get,_ec_4,elem,,count
cmsel,,ce
*if,_ec_4,le,0,then
_err=1
/nerr
/out
*msg,error,arg4
The specified component for the coil region ( %c ) does not&
have any elements
/out,ckslot,out,,append
/nerr,0,1e5
*endif
*if,_err,eq,1,:end
esel,all
*get,_elmx,elem,,num,max
cmsel,,%arg4%
*set,_mskv
*dim,_mskv,,_elmx
*set,_rele
*dim,_rele,,_elmx
*vget,_mskv(1),elem,1,esel
*voper,_mskv(1),_mskv(1),gt,0
*vmask,_mskv(1)
*vget,_rele(1),elem,1,attr,real
*vmask,_mskv(1)
*vscfun,_rlmn,min,_rele(1)
*vmask,_mskv(1)
*vscfun,_rlmx,max,_rele(1)
*if,arg1,le,0,then
arg1=_rlmn
*endif
*if,arg2,le,0,then
arg2=_rlmx
*endif
cmsel,,%arg4%
cmsel,r,rotor
*get,_ec_4,elem,,count
*if,_ec_4,gt,0,then
_cncon=nconr
*else
_cncon=ncons
*endif
cmsel,,%arg4%
nckslot=nint((arg2-arg1+1)/arg3+.1)
*dim,ckcur,,nckslot,3
_islot=0
etab,,volu
etab,js,smisc,1
smult,current,js,volu
*do,islot,arg1,arg2,arg3
/gopr
*msg,info,islot
ISLOT: %i
cmsel,,%arg4%
esel,r,real,,islot
ssum
*get,current,ssum,,item,current
_islot=_islot+1
*if,_cncon,eq,1,then
_cslot=nint((islot-_rlmn+1)/_cncon)
*else
_cslot=(islot-(_rlmn-2))/_cncon
_cslot=nint(_cslot-.1)
*endif
*msg,info,islot
ISLOT: %i
ckcur(_islot,1)=islot
ckcur(_islot,2)=current
ckcur(_islot,3)=_cslot
*enddo
islot=
cmsel,,%arg4%
nsle
*if,_mg1,eq,0,then
/auto
/pnum,real,1
/num
eplo
/num,1
*endif
*stat,ckcur
*get,_mnu,active,,menu
/nopr
/out,ckslot,sum
*msg,info
*msg,info
*msg,info
___SUMMARY OF CURRENTS IN THE SLOTS______<
*msg,info
____ Slot____Real_____Current_______
*msg,info
_____No._____No.______(Amp-turns)___
*vwrite,ckcur(1,3),ckcur(1,1),ckcur(1,2)
(3x,f7.0,f8.0,f12.1)
*msg,info
*msg,info
The current density is retained in the element item JS
*msg,info
which can be plotted by <PLOTCURR>
/out,_data
*if,_nomsg,eq,0,then
*if,_mg1,eq,0,then
*uili,ckslot,sum
*else
*list,ckslot,sum
*endif
*else
/out,ckslot,sum,,append
*msg,info,cycle
Cycle number:_____ %i
*list,ckslot,sum
*endif
:end
/gopr
/out