/BATCH rn=0 /filnam,mcforces2%rn% /show,mcforces2%rn%,grp !resume !*if,1,eq,1,:1000 /PREP7 /com /com Input file used to generate higher-order nodal forces on NCSX Modular Coils /com Field Sources: Conventional and Modular Coils /com CS, TF and PFL4/5/6 coils developed as current source primitives. /com New 3x4 TF build incorporated. /com /com MCs are read in from a file (*.cdb) as SOLID5s (developed from Mod_Coils_mesh200.db, circa 03/08/05) /com They already have VOLT, CP and nodal components (n_m1, n_m2, n_m3) defined for AMPS application. /com Their element numbering must be maintained so that EM forces can be returned to original model. /com /com Force files (entitled fxyz_cn%cn%_lc%lcnum%.out) are generated which can be read into higher-order models /com Consistent with this EM analysis, the forces are in Newtons. /com /com /com Run History /com /com 11: TF Only (fields look good) /com 12: /com 13: /com /com Pick a Current Set to analyze /com lcnum=3 ! Load Case Number from Coil Current Array (see i_coils array below) /com /com Define Coil Currents (Amps NOT Amp-turns) /com *dim,i_coils,array,5,12 ! For Each Load Case: (lcnum,M1,M2,M3,PF1,PF2,PF3,PF4,PF5,PF6,TF,Plasma) /com Proposed Worst 4 Cases (from Wayne's TDS_XL_C08R00_C1.xls Spreadsheet) /com LC1: 0.5 T /com LC2: 1.7T Ohmic/t=0.0s /com LC3: 2.0T HighBeta/t=0.0s /com LC4: 320kAOhmic/t=0.206s /com LC5: 2.0T HighBeta/t=0.197s i_coils(1,1)= 1, 2, 3, 4, 5 ! LoadCase# i_coils(1,2)= 0, 38141, 40908, 34200, 38583 ! M1 i_coils(1,3)= 0, 35504, 41561, 32057, 38338 ! M2 i_coils(1,4)= 0, 35453, 40598, 32184, 35315 ! M3 i_coils(1,5)= 0,-25123,-14574, 11354, -7501 ! PF1 i_coils(1,6)= 0,-25123,-14574, 11354, -7501 ! PF2 i_coils(1,7)= 0, -9698, -5468, -11802, -2459 ! PF3 i_coils(1,8)= 0, -7752, -9062, -13936, -8394 ! PF4 i_coils(1,9)= 0, 8284, 1085, 4563, 2671 ! PF5 i_coils(1,10)= 0, -8997, 18, 5068, 7077 ! PF6 i_coils(1,11)= 0, 0, 0,-320775,-209732 ! Plasma i_coils(1,12)= 16200, -3548, -1301, 2191, 4424 ! TF /com /com Misc Parameters /com r0=1.40 ! major radius b0=0.5 ! reference On-Axis toroidal field th_model=120 ! angular extent of model (keep 120) emsym,nint(360/th_model) ! electromagnetic symmetry about Z t=1e-5 ! tiny k=0.0254 ! conversion (inches to meters) cel=0.040 ! characteristic element size pi=acos(-1) ! pi *afun,deg ! use degrees in trig functions /vup,1,z /pnum,mat,1 /num,1 /com /com PF & TF Conductor Dimensions /com dr_pfcon=0.787*k ! Conductor build in radius dz_pfcon=0.787*k ! Conductor build in height ri_pfcon=0.354/2*k ! inside radius of cooling channel hole a_pfcon=dr_pfcon*dz_pfcon-pi*ri_pfcon**2 ! conductor metal area dr_tfcon=0.966*k ! Conductor build in thickness dz_tfcon=0.709*k ! Conductor build in height dri_tfcon=0.312*k ! inside thickness of cooling channel dzi_tfcon=0.312*k ! inside height of cooling channel a_tfcon=dr_tfcon*dz_tfcon-dri_tfcon*dzi_tfcon ! conductor metal area /com /com OF & TF Insulation Dimensions /com t_pftw=0.049*k ! turn wrap insulation thk t_pfpan=0.000*k ! pancake insulation thk (can be 0.0) t_pflay=(0.030+0.0)*k ! layer insulation thk (can be 0.0) t_pfgw=0.12*k ! module over-wrap thickness t_tftw=0.049*k ! turn wrap insulation thk t_tfpan=0.0*k ! pancake insulation thk (can be 0.0) t_tflay=0.0*k ! layer insulation thk (can be 0.0) t_tfgw1=0.125*k ! TF ground-wrap thickness (near wedges) t_tfgw2=0.375*k ! TF ground-wrap thickness (away from wedges) /com /com TF Turn-Count /com n_tflay=3 ! number of radial layers in each TF coil n_tfpan=4 ! number of pancakes in each TF coil /com /com PF Turn-Count /com nr1=4 $nz1=18 ! PF1 turn-count nr2=4 $nz2=18 ! PF2 turn-count nr3=4 $nz3=18 ! PF3 turn-count nr4=8 $nz4=10 ! PF4 turn-count nr5=4 $nz5=6 ! PF5 turn-count nr6=2 $nz6=7 ! PF6 turn-count nr7=1 $nz7=1 ! Plasma turn-count /com /com Modular Coil Turn-Count /com tpmc1=10 ! turns per half-MC1 (+/-10 deg) winding pack, 4 in-hand tpmc2=10 ! turns per half-MC2 (+/-30 deg) winding pack, 4 in-hand tpmc3=9 ! turns per half-MC3 (+/-50 deg) winding pack, 4 in-hand /com /com Reference TF coil current from given B0 /com n_tf=18 ! total number of tf coils in TF system i_tf=5e6*b0*r0/n_tf ! total current per tf coil i_con=i_tf/(n_tflay*n_tfpan)! TF conductor current /com /com PF Unit Cell and TF WP dimensions /com n_pf=7 ! number of PF coil sets including plasma dr_pfcell=dr_pfcon+2*t_pftw+1*t_pflay ! radial build of PF conductor dz_pfcell=dz_pfcon+2*t_pftw+1*t_pfpan ! vertical build of PF conductor dr_tfwp=n_tflay*(dr_tfcon+2*t_tftw)+(n_tflay-1)*t_tflay ! radial build of TF WP dz_tfwp=n_tfpan*(dz_tfcon+2*t_tftw)+(n_tfpan-1)*t_tfpan ! toroidal build of TF WP dr_tfiwp1=dr_tfwp+2*t_tfgw1 ! radial build of ground-wrapped WP dz_tfiwp1=dz_tfwp+2*t_tfgw1 ! toroidal build of ground-wrapped WP dr_tfiwp2=dr_tfwp+2*t_tfgw2 ! radial build of ground-wrapped WP dz_tfiwp2=dz_tfwp+2*t_tfgw2 ! toroidal build of ground-wrapped WP /com /com PF & Plasma Geometry (Rc, Zc, dr, dz) from Brown's PDR Overview /com *dim,pf_geo,,4,n_pf pf_geo(1,1)= 8.625*k, 9.438*k,dr_pfcell*nr1-t_pflay,dz_pfcell*(nz1+1) ! PF1 pf_geo(1,2)= 8.625*k,28.313*k,dr_pfcell*nr2-t_pflay,dz_pfcell*(nz2+1) ! PF2 pf_geo(1,3)= 8.625*k,47.188*k,dr_pfcell*nr3-t_pflay,dz_pfcell*(nz3+1) ! PF3 pf_geo(1,4)= 20.549*k,62.340*k,dr_pfcell*nr4-t_pflay,dz_pfcell*(nz4+1) ! PF4 pf_geo(1,5)= 87.527*k,60.250*k,dr_pfcell*nr5-t_pflay,dz_pfcell*(nz5+1) ! PF5 pf_geo(1,6)=107.105*k,37.562*k,dr_pfcell*nr6-t_pflay,dz_pfcell*(nz6+1) ! PF6 pf_geo(1,7)= r0, 0.0, 0.04, 0.04 ! Plasma /com /com Conventional Coil Element Type /com et,99,36 ! Current Source Primitive /com /com Pull in Modular Coils /com esel,none /input,onlymodcoil21,cdb cm,mcs,elem /com /com PFs and Plasma /com /eshap,1,1 csys,1 *do,j,1,n_pf allsel *get,nmx,node,,num,max n1_pf%j%=nmx+1 n,n1_pf%j%+0,pf_geo(1,j),-th_model/2,pf_geo(2,j) n,n1_pf%j%+1,pf_geo(1,j),,pf_geo(2,j) n,n1_pf%j%+2,pf_geo(1,j),+th_model/2,pf_geo(2,j) n,n1_pf%j%+3,,,pf_geo(2,j) n,n1_pf%j%+10,pf_geo(1,j),-th_model/2,-pf_geo(2,j) n,n1_pf%j%+11,pf_geo(1,j),,-pf_geo(2,j) n,n1_pf%j%+12,pf_geo(1,j),+th_model/2,-pf_geo(2,j) n,n1_pf%j%+13,,,-pf_geo(2,j) r,1000+%j%,3,(nr%j%*nz%j%)*i_coils(lcnum,j+4),pf_geo(3,j),pf_geo(4,j) mat,1000+j $real,1000+j $type,99 e,n1_pf%j%+0,n1_pf%j%+1,n1_pf%j%+3 e,n1_pf%j%+1,n1_pf%j%+2,n1_pf%j%+3 *if,j,ne,n_pf,then ! Don't make the plasma twice e,n1_pf%j%+10,n1_pf%j%+11,n1_pf%j%+13 e,n1_pf%j%+11,n1_pf%j%+12,n1_pf%j%+13 *endif *enddo /com /com Centers of sweep and inside radii (takes some fussing to get the inside radii right) /com x_off=12.494*k ! distance from machine axis to Insulated WP inner edge x11=r0 ! x position of local 11 z11=0.0 ! z position of local 11 ri11=r0-x_off-dr_tfiwp1 ! inside radius of coil in local 11 /com x12=43.234*k ! x position of local 12 z12=28.785*k ! z position of local 12 ri12=27.423*k ! inside radius of coil in local 12 /com x13=54.805*k ! x position of local 13 z13=7.155*k ! z position of local 13 ri13=51.953*k ! inside radius of coil in local 13 /com x14=54.805*k ! x position of local 14 z14=0.000*k ! z position of local 14 ri14=ri13+z13 ! inside radius of coil in local 14 /com x15=59.287*k ! x position of local 15 z15=10.894*k ! z position of local 15 ri15=48.214*k ! inside radius of coil in local 15 /com x16=x15 ! x position of local 16 z16=z15 ! z position of local 16 ri16=ri15 ! inside radius of coil in local 16 /com x17=x15 ! x position of local 17 z17=-z15 ! z position of local 17 ri17=ri15 ! inside radius of coil in local 17 /com x18=x15 ! x position of local 18 z18=-z15 ! z position of local 18 ri18=ri15 ! inside radius of coil in local 18 /com x19=x13 ! x position of local 19 z19=-z13 ! z position of local 19 ri19=ri13 ! inside radius of coil in local 19 /com x20=x12 ! x position of local 20 z20=-z12 ! z position of local 20 ri20=ri12 ! inside radius of coil in local 20 /com /com Swept Angles (and straight-lengths) /com dy11=2*z12 dy12=abs(atan((z12-z13)/(x13-x12))) dy13=90-dy12 dy14=4.482*k ! length of section 14 dy15=90 dy16=2*z15 dy17=dy15 dy18=dy14 dy19=dy13 dy20=dy12 /com /com coordinate systems /com /com Local 11 csys wpcsys wpoff,x11,,z11 wprot,,-90 wprot,180 cswpla,11 /com Local 12 csys wpcsys wpoff,x12,,z12 wprot,,-90 wprot,180 cswpla,12,1 /com Local 13 csys wpcsys wpoff,x13,,z13 wprot,,-90 wprot,180 wprot,dy12 cswpla,13,1 /com Local 14 csys wpcsys wpoff,x14,,z14 wprot,,-90 wprot,180 wprot,90 cswpla,14 /com Local 15 dy1215=90 csys wpcsys wpoff,x15,,z15 wprot,,-90 wprot,180 wprot,90 cswpla,15,1 /com Local 16 csys wpcsys wpoff,x16,,z16 wprot,,-90 wprot,180 wprot,90+dy15 cswpla,16!,1 /com Local 17 csys wpcsys wpoff,x17,,z17 wprot,,-90 wprot,180 wprot,180!+dy16/2 cswpla,17,1 /com Local 18 csys wpcsys wpoff,x18,,z18 wprot,,-90 wprot,180 wprot,180+90 cswpla,18 /com Local 19 csys wpcsys wpoff,x19,,z19 wprot,,-90 wprot,180 wprot,180+90 cswpla,19,1 /com Local 20 csys wpcsys wpoff,x20,,z20 wprot,,-90 wprot,180 wprot,180+90+dy19 cswpla,20,1 /com /com TFs /com r,11+n_pf+0,2,i_coils(lcnum,12)*(n_tfpan*n_tflay),dz_tfwp,dr_tfwp ! Bar r,11+n_pf+1,3,i_coils(lcnum,12)*(n_tfpan*n_tflay),dr_tfwp,dz_tfwp ! Arc *do,j,12,20 nsel,all *get,nmx,node,,num,max n1_tf%j%=nmx+1 csys,j n,n1_tf%j%+0,ri%j%+dr_tfiwp/2 n,n1_tf%j%+1,ri%j%+dr_tfiwp/2,dy%j% n,n1_tf%j%+2 *if,j,eq,14,or,j,eq,18,then mat,11+n_pf $real,11+n_pf+0 $type,99 *elseif,j,eq,16 mat,11+n_pf $real,11+n_pf+0 $type,99 *else mat,11+n_pf $real,11+n_pf+1 $type,99 *endif e,n1_tf%j%+0,n1_tf%j%+1,n1_tf%j%+2 *enddo /com Make the Inboard Straight Leg mat,11+n_pf $real,11+n_pf+0 $type,99 e,n1_tf20+1,n1_tf12+0,n1_tf12+2 /com /com Move this one TF Coil and Generate all TF coils /com num_tf=nint(n_tf*th_model/360) esel,s,mat,,11+n_pf nsle *get,dntf,node,,count csys,1 ngen,2,,all,,,,-th_model/2+360/n_tf/2 ngen,num_tf,dntf,all,,,,360/n_tf egen,num_tf,dntf,all /com /com Apply Modular Coil Currents /com cmsel,s,n_m1 $f,all,amps,tpmc1*i_coils(lcnum,2) cmsel,s,n_m2 $f,all,amps,tpmc2*i_coils(lcnum,3) cmsel,s,n_m3 $f,all,amps,tpmc3*i_coils(lcnum,4) allsel save fini /solu /com Solve the Conduction Problem in the MCs cmsel,s,mcs nsle d,all,mag d,all,temp solve /com /com Solve for the fields on these nodes... /com ...from these elements (do not select sourc36 elements since these Bs are already calc'd) /com cmsel,s,mcs nsle esel,all biot,new /com Solve for the fields cmsel,s,mcs nsle esel,u,type,,99 solve fini :1000 /post1 set,last cmsel,s,mcs nsle /title,mcforces2%rn% Modular Coil Fields from Load Case #%lcnum% plns,b,sum /com /com Write an array with Element Centroid Forces divided into /com Nodal Forces on original higher-order WP elements /com (-1/8 at the corners, +1/6 at the mid-sides) /com rsys csys *do,cn,1,3 /nopr cmsel,s,e_coil%cn% *get,ect%cn%,elem,,count *dim,cn%cn%fxyz,,ect%cn%,21,3 etab,fx,fmag,x etab,fy,fmag,y etab,fz,fmag,z /com Net Force on each coil /gopr ssum *get,fx%cn%,ssum,,item,fx *get,fy%cn%,ssum,,item,fy *get,fz%cn%,ssum,,item,fz /nopr cnt=0 *do,j,emn%cn%,emx%cn% *if,esel(j),ne,1,cycle cnt=cnt+1 *get,fxj,elem,j,etab,fx *get,fyj,elem,j,etab,fy *get,fzj,elem,j,etab,fz cn%cn%fxyz(cnt,1,1)=j cn%cn%fxyz(cnt,1,2)=j cn%cn%fxyz(cnt,1,3)=j *do,jj,1,20 *if,jj,le,8,then cn%cn%fxyz(cnt,jj+1,1)=-fxj/8 cn%cn%fxyz(cnt,jj+1,2)=-fyj/8 cn%cn%fxyz(cnt,jj+1,3)=-fzj/8 *else cn%cn%fxyz(cnt,jj+1,1)=+fxj/6 cn%cn%fxyz(cnt,jj+1,2)=+fyj/6 cn%cn%fxyz(cnt,jj+1,3)=+fzj/6 *endif *enddo *enddo *enddo save fini /prep7 /com /com Then write force commands to files which can be read into analyses of individual coils /com noff1=nc2_off+nc3_off ! number to be subtracted from MC1 nodes to return to original node numbers noff2=nc3_off ! number to be subtracted from MC2 nodes to return to original node numbers noff3=0 ! number to be subtracted from MC3 nodes to return to original node numbers *do,cn,1,3 *cfopen,fxyz_cn%cn%_lc%lcnum%,out *cfwrite,CoilNum=%cn% *cfwrite,LCNum=%lcnum% *cfwrite,fx=nint(fx%cn%) *cfwrite,fy=nint(fy%cn%) *cfwrite,fz=nint(fz%cn%) *cfwrite,fcum,add *cfwrite,/nopr *do,j,1,ect%cn% *do,jj,1,20 *cfwrite,f,cn%cn%en(j,jj+1)-noff%cn%,fx,cn%cn%fxyz(j,jj+1,1) *cfwrite,f,cn%cn%en(j,jj+1)-noff%cn%,fy,cn%cn%fxyz(j,jj+1,2) *cfwrite,f,cn%cn%en(j,jj+1)-noff%cn%,fz,cn%cn%fxyz(j,jj+1,3) *enddo *enddo *cfwrite,/gopr *cfclos *enddo fini /exit,all /eof