예제 #1
0
파일: force.py 프로젝트: tokasamwin/Nova
    from nova.config import Setup
    from nova.streamfunction import SF
    from nova.elliptic import EQ
    from nova.coils import PF
    from nova.radial_build import RB

    setup = Setup('SN_3PF_18TF')

    sf = SF(setup.filename)
    pf = PF(sf.eqdsk)
    rb = RB(setup, sf)
    eq = EQ(sf,
            pf,
            dCoil=0.25,
            sigma=0,
            boundary=rb.get_fw(expand=0.25),
            n=1e3)
    eq.get_plasma_coil()
    #eq.gen_opp()

    ff = force_feild(pf.index, pf.coil, eq.coil, eq.plasma_coil)
    Fcoil = ff.get_force()

    ff.plot()
    pf.plot(coils=pf.coil, label=True, plasma=False, current=True)
    pf.plot(coils=eq.coil, label=False, plasma=True, current=False)
    pl.axis('equal')
    pl.axis('off')
    print(Fcoil['F'][:, 1])
    '''
    print('writing',self.filename,self.nTF)
예제 #2
0
        ax[i][j].axis('off')

title = ['SN', 'X', 'SF-', 'SF+', 'SX', 'SXex']
for j, config in enumerate(['SN', 'X', 'SFm', 'SFp', 'SX', 'SXex']):
    print('')
    print(config)
    pl.sca(ax[0][j])
    pl.title(title[j])
    Color = cycle(sns.color_palette('Set2'))

    setup = Setup(config)
    sf = SF(setup.filename)
    rb = RB(setup, sf)
    pf = PF(sf.eqdsk)
    eq = EQ(sf, pf, sigma=0.1, boundary=rb.get_fw(expand=0.25), n=5e4)
    #eq = EQ(sf,pf,sigma=0.1,boundary=rb.get_fw(expand=0.25),n=5e3)
    sf.contour(Nlevel=21, lw=0.5)

    pl.plot([14, 14], [-14.5, 9.5], 'o', alpha=0)

    pf.plot(coils=pf.coil, label=False, plasma=False, current=False)
    rb.firstwall(calc=False, plot=True, debug=False)

    rb.vessel()
    tf = TF(nTF=16,
            shape={
                'vessel': rb.loop,
                'pf': pf,
                'fit': True,
                'setup': setup,