Ejemplo n.º 1
0
@author: lei

unit test for sdp.model.wave.Propagator
"""
import time

import numpy as np

import model.lightbeam as lb
import sdp.model.wave.propagator as prop
import sdp.plasma.analytic.testparameter as tp
import sdp.plasma.dielectensor as dt
from sdp.settings.unitsystem import cgs

tp.set_parameter1D(Te_0=10 * cgs['keV'])
tp.set_parameter2D(Te_0=10 * cgs['keV'])

p1d = tp.create_profile1D(True, 0)
p1d.setup_interps()

p2d = tp.create_profile2D(True, 0)
p2d_uni = tp.simulate_1D(p1d, p2d.grid)
p2d.setup_interps()
p2d_uni.setup_interps()

start_plane = tp.grid.Cartesian2D(DownLeft=(-20, -20),
                                  UpRight=(40, 20),
                                  NR=65,
                                  NZ=256)
x_start = 250
"""
Created on Mon Jan 25 18:21:07 2016

@author: lei

test for DielectricTensor
"""

import numpy as np

import sdp.plasma.dielectensor as dt
import sdp.plasma.analytic.testparameter as tp

#p2d = tp.create_profile2D(True)
tp.set_parameter1D(Te_0=10 * tp.cgs['keV'],
                   Te_shape='uniform',
                   ne_shape='uniform')

p1d = tp.create_profile1D()
p1d.setup_interps()

omega = 8e11
c = 3e10
pi = np.pi

k_para = omega / (c * 12)
k_perp = omega / c

X = np.linspace(250, 150, 201)

#chi_e_cold = dt.SusceptCold(p1d,'e')
import numpy as np

import sdp.model.wave.disprel as dr
import sdp.plasma.dielectensor as dt
import sdp.plasma.analytic.testparameter as tp
from sdp.settings.unitsystem import cgs

c = cgs['c']
m_e = cgs['m_e']
e = cgs['e']
keV = cgs['keV']
pi = np.pi

tp.set_parameter1D(ne_shape='uniform',
                   ne_0=6.0e13,
                   Te_shape='uniform',
                   Te_0=15 * keV,
                   B_0=3.0e4)

p1d = tp.create_profile1D()
p1d.setup_interps()
c_dielect = dt.ColdElectronColdIon(p1d)
r_dielect_1 = dt.RelElectronColdIon(p1d, max_harmonic=1, max_power=5)
r_dielect_2 = dt.RelElectronColdIon(p1d, max_harmonic=2, max_power=5)
r_dielect_3 = dt.RelElectronColdIon(p1d, max_harmonic=3, max_power=5)
r_dielect_4 = dt.RelElectronColdIon(p1d, max_harmonic=4, max_power=5)
r_dielect_5 = dt.RelElectronColdIon(p1d, max_harmonic=5, max_power=5)
r_dielect_1_1 = dt.RelElectronColdIon(p1d, max_harmonic=1, max_power=1)

omega = 124e9 * 2 * pi
k_para = 0
Ejemplo n.º 4
0
# -*- coding: utf-8 -*-
"""
generate plasma.cdf for FWR2D runs

Created on Wed Aug 17 13:36:21 2016

@author: lei
"""
import sdp.diagnostic.fwr.fwr2d.input as fwr_input
import sdp.plasma.analytic.testparameter as tp

tp.set_parameter1D(**tp.Parameter_DIIID)
tp.set_parameter2D(**tp.Parameter_DIIID)

p1d = tp.create_profile1D()
p2d = tp.create_profile2D()
p2d_uniform = tp.simulate_1D(p1d, p2d.grid)

fwr_input.generate_cdf(p2d_uniform)