Пример #1
0
 def __init__(self, config, family='S', nTF=16, obj='L'):
     self.nTF = nTF
     self.config = config
     datadir = trim_dir('../../Data')
     file = 'salome_input'  #  config #  +'_{}{}{}'.format(family,nTF,obj)
     self.filename = datadir + '/' + file + '.json'
     self.profile = Profile(config['TF'],
                            family=family,
                            load=True,
                            part='TF',
                            nTF=nTF,
                            obj=obj,
                            npoints=250)
     setup = Setup(config['eq'])
     self.sf = SF(setup.filename)
     self.tf = TF(self.profile, sf=self.sf)
     self.pf = PF(self.sf.eqdsk)
     self.PF_support()  # calculate PF support seats
     self.CS_support()  # calculate CS support seats
     self.Gravity_support()
     self.cage = coil_cage(nTF=nTF,
                           rc=self.tf.rc,
                           ny=3,
                           plasma={'config': config['eq']},
                           coil=self.tf.x['cl'])
     self.eq = EQ(self.sf,
                  self.pf,
                  dCoil=0.5,
                  sigma=0,
                  boundary=self.sf.get_sep(expand=0.5),
                  n=1e3)
     self.eq.plasma()
     self.ff = force_feild(self.pf.index, self.pf.coil, self.eq.coil,
                           self.eq.plasma_coil)
Пример #2
0
'''
inv = INV(sf,eq,tf)
L = inv.grid_coils(offset=0.3)
inv.fix_boundary_psi(N=25,alpha=1-1e-4,factor=1)  # add boundary points
inv.fix_boundary_feild(N=25,alpha=1-1e-4,factor=1)  # add boundary points
inv.add_null(factor=1,point=sf.Xpoint) 

inv.set_swing(width=250)
inv.initialize_log()
inv.set_background()
inv.get_weight()
inv.set_Lo(L)  # set position bounds
Lnorm = loops.normalize_variables(inv.Lo)
inv.update_position(Lnorm,update_area=True)
inv.plot_fix(tails=True)
eq.gen_opp()
'''

pf.plot(coils=pf.coil, label=True, current=True)
pf.plot(coils=eq.coil, label=False, plasma=True, current=False)
sf.contour(boundary=True)

ff = force_feild(eq.pf.index,
                 eq.pf.coil,
                 eq.coil,
                 eq.plasma_coil,
                 multi_filament=True)

ff.plot(scale=1.5)

#sf.eqwrite(pf,config=config['eq'])
Пример #3
0
        font_scale=7/8,rc=rc)

nTF,nPF,nCS = 18,4,3
config = {'TF':'dtt','eq':'SN'}
config,setup = select(config,nTF=nTF,nPF=nPF,nCS=nCS,update=False)
profile = Profile(config['TF'],family='S',part='TF',
                  nTF=nTF,obj='L',load=True,npoints=50)
sf = SF(setup.filename)
tf = TF(profile,sf=sf)
tf.fill()

#rb = RB(setup,sf)
pf = PF(sf.eqdsk)
eq = EQ(sf,pf,boundary=tf.get_loop(expand=0.5),n=1e3,sigma=0)  
eq.get_plasma_coil()
ff = force_feild(pf.index,pf.coil,eq.coil,eq.plasma_coil)
        
#eq.run()
#eq.plotj()
#pf.coil['Coil6']['r'] -= 1.5
#eq.coils()
#eq.gen_opp(sf.Mpoint[1])
#eq.resample()
#eq.plotb(alpha=1)

#inv = INV(sf,pf,eq)

pf.plot(coils=eq.coil,label=False,plasma=True,current=False,alpha=0.5) 
#inv.plot_coils()
sf.contour()