def DIIID_edge_ECE_run(): tp.set_parameter2D(**tp.Parameter_DIIID) tp.Parameter2D['dne_ne']['dx'] = 5 tp.Parameter2D['dte_te']['dx'] = 5 tp.Parameter2D['timesteps'] = np.arange(16) tp.Parameter2D['dt'] = 2.5e-6/4 p2d_low = tp.create_profile2D(fluctuation=True) tp.Parameter2D['dne_ne']['level'] = 0.1 p2d_high = tp.create_profile2D(fluctuation=True) pcpr = pc.PlasmaCharProfile(p2d_low) x_array = np.linspace(222, 235, 8) omega_array = \ 2*pc.omega_ce(p2d_low.get_B0([[0 for x in x_array],x_array])) k_array = omega_array/c detector_array = [ecei2d.GaussianAntenna(omega_list=[omega_array[i]], k_list=[k_array[i]], power_list=[1], waist_x=x, waist_y=0, w_0y=2) \ for i, x in enumerate(x_array)] ecei = ecei2d.ECEImagingSystem(p2d_low, detector_array, max_harmonic=2, max_power=2)
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 x_end = 150 nx = 100 Z1D, Y1D = start_plane.get_mesh() Z2D, Y2D = start_plane.get_ndmesh() X2D = np.ones_like(Y2D) * x_start
keV = cgs['keV'] e = cgs['e'] me = cgs['m_e'] tp.set_parameter2D(Te_0=10 * keV, Te_shape='uniform', ne_shape='Hmode', dte_te=0.2, dne_ne=0.1, dB_B=0, NR=100, NZ=40, DownLeft=(-40, 100), UpRight=(40, 300), timesteps=np.arange(5)) p2d = tp.create_profile2D(random_fluctuation=True) p2d.setup_interps() omega = 8e11 k = omega / c # single frequency detector detector1 = GaussianAntenna(omega_list=[omega], k_list=[k], power_list=[1], waist_x=172, waist_y=2, waist_z=2, w_0y=2, w_0z=5, tilt_v=0, tilt_h=np.pi / 20)
import sdp.plasma.analytic.testparameter as tp from sdp.settings.unitsystem import cgs import numpy as np import sdp.math.pdf as pdf plasma = tp.create_profile2D() NR = plasma.grid.NR NZ = plasma.grid.NZ R1D = plasma.grid.R2D[0,:] Z1D = plasma.grid.Z2D[:,0] c = cgs['c'] m_e = cgs['m_e'] e = cgs['e'] keV = cgs['keV'] Zmid = NZ/2+1 ne = plasma.ne[Zmid,:] B = plasma.B[Zmid,:] Te = plasma.Te[Zmid,:] vt = np.sqrt(Te/m_e) omega_c = e*B/(m_e*c) alpha = m_e*c**2/Te N = 2
dne_ne['params']['level'] = 0.03 dne_ne['params']['omega'] = 2*np.pi*freq_fluc dne_ne['params']['phi0'] = 0 # We set dB to be zero for simplicity dB_B = tp.Parameter2D['dB_B'] dB_B['params']['level'] = 0 # We devide a whole period of fluctuation into n time steps ntstep = 20 tp.set_parameter2D(Te_0 = Te0, ne_0=ne0, Te_shape='uniform', ne_shape='Hmode',dte_te=dte_te, dne_ne=dne_ne, dB_B=dB_B, NR=400, NZ=400, timesteps=np.arange(ntstep), dt=1/(ntstep*freq_fluc)) p2d_fluc = tp.create_profile2D(fluctuation=True) p2d_fluc.setup_interps() omega = 2*pc.omega_ce(p2d_fluc.get_B0([0, 220]))[0] x= 220 y_array = np.linspace(-5, 5, 8) ch_wid = 1 k = omega/c detector_array = [GaussianAntenna(omega_list=[omega], k_list=[k], power_list=[1], waist_x=x, waist_y=y, w_0y=ch_wid, tilt_h=0) \ for y in y_array]
# -*- 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)