/out,pldcstr,out
_err=0
*if,arg1,le,0,then
arg1=1
*endif
_mx_ph=0
*vscfun,_mx_ph,max,wnd_(1,4)
*if,_mx_ph,le,0,then
/out
/nerr
/nopr
*msg,error
The data (WND_) generated for the specified winding file name does not&
have all the correct data. Winding data should be regenerated. No action
/out,pldcstr,out,,append
_err=1
/gopr
*endif
*if,arg2,le,0,then
arg2=_mx_ph
*endif
*if,arg3,le,0,then
arg3=1
*endif
*if,_n_slot*_nteeth,eq,0,then
/out
/nerr
/nopr
*msg,error
The data generated for the specified winding file name does not&
have all the correct data. Winding data should be regenerated. No action
/out,pldcstr,out,,append
_err=1
/gopr
*endif
*get,_typc10,parm,cwnd_,type
*if,_typc10,ne,4,then
/out
/nerr
/nopr
*msg,error
It does not appear that the Winding data has been generated or it has been&
been deleted. The winding needs to be regenerated. No action
/out,pldcstr,out,,append
_err=1
/gopr
*endif
*if,_typc10,eq,4,then
*get,_zc1000,comp,%cwnd_(1)%,type
*if,_zc1000,ne,2,then
/out
/nerr
/nopr
*msg,error
It appears that the winding was at one time generated, but the element&
component definitions which were generated by <WIND_2D> have been deleted.&
This could have resulted due to regeneration of the stator. The winding needs&
to be regenerated. No action
/out,pldcstr,out,,append
_err=1
*endif
*endif
*if,_err,eq,1,:end
/anno,dele
/ANUM, 1, 1,-0.67249 , 0.90918
/TSPE, 15, 1.000, 1, 0, 0
/TLAB,-0.970, 0.909,Type=1 => IN SLOT
/ANUM, 2, 1,-0.63757 , 0.85913
/TLAB,-0.970, 0.859,Type=2 => OUT SLOT
/ANUM, 3, 1,-0.62000 , 0.80920
/TLAB,-0.970, 0.809,Real = phase number
/ANUM ,0, 1,-0.62009 , 0.75326
/TLAB,-0.970, 0.753,Material=Coil number in file
/title,%mname% phase plot
*if,fac_stk,le,0,then
fac_stk=.5
*endif
*set,get_s
*dim,get_s,,_n_slot
n_i2=0
*do,_i1,arg1,arg2,arg3
n_i2=n_i2+1
get_s(n_i2)=_i1
*enddo
*get,_rout,active,,rout
*if,_rout,ne,17,then
fini
/prep7
*endif
vsel,none
cmsel,,vphase
*get,ncvnt,volu,,count
*if,ncvnt,gt,0,then
aslv
lsla
ksll
vdel,all,,,1
*endif
vsel,none
cm,vphase,elem
csys,1
/num,1
*do,_i1,1,n_i2
_w1=get_s(_i1)
esel,none
*do,_w2,1,_n_slot
/gopr
*if,wnd_(_w2,4),eq,_w1,then
*msg,info,_w1,_w2
_w1,_w2: %i %i
cmsel,,%cwnd_(_w2,1)%
nsle
*get,_thmx,node,,mxloc,y
*get,_thmn,node,,mnloc,y
*if,_thmx*_thmn,lt,0,then
*if,_thmx-_thmn,gt,90,then
local,20,1
cscir,20,1
*get,_thmx,node,,mxloc,y
*get,_thmn,node,,mnloc,y
csys,1
*endif
*endif
*get,_rmax,node,,mxloc,x
*get,_rmin,node,,mnloc,x
_zstk=stkthk*ggeom/2*fac_stk
vsel,none
cylinder,_rmin,_rmax,-_zstk,_zstk,_thmn,_thmx
_m_in=wnd_(_w2,1)
vatt,_w2,_w1,1
cmsel,a,vphase
cm,vphase,volu
cmsel,,%cwnd_(_w2,2)%
nsle
*get,_thmx,node,,mxloc,y
*get,_thmn,node,,mnloc,y
*if,_thmx*_thmn,lt,0,then
*if,_thmx-_thmn,gt,90,then
local,20,1
cscir,20,1
*get,_thmx,node,,mxloc,y
*get,_thmn,node,,mnloc,y
csys,1
*endif
*endif
*get,_rmax,node,,mxloc,x
*get,_rmin,node,,mnloc,x
vsel,none
cylinder,_rmin,_rmax,-_zstk,_zstk,_thmn,_thmx,
_m_out=wnd_(_w2,2)
vatt,_w2,_w1,2
cmsel,a,vphase
cm,vphase,volu
*msg,info
**********************************************
*endif
*enddo
*enddo
cmsel,,vphase
aslv
lsla
ksll
/auto
/pnum,real,1
/pnum,kp
/pnum,line
/pnum,area
/pnum,volu
/num
vplo
/anno,dele
/ANUM, 1, 1,-0.67249 , 0.90918
/TSPE, 15, 1.000, 1, 0, 0
/TLAB,-0.970, 0.909,Type=1 => OUT SLOT
/ANUM, 2, 1,-0.63757 , 0.85913
/TLAB,-0.970, 0.859,Type=2 => IN SLOT
/ANUM, 3, 1,-0.62000 , 0.80920
/TLAB,-0.970, 0.809,Real = phase number
/ANUM ,0, 1,-0.62009 , 0.75326
/TLAB,-0.970, 0.753,Material=coil number in file
/title,%mname% phase plot
cmsel,,vphase
/auto
/pnum,real,1
/num
/type,,2
vplo
*if,_rout,eq,21,then
fini
/solu
*endif
*if,_rout,eq,31,then
fini
/post1
*endif
/eras
:end
/nerr,0,1e5
/out