Ejemplo n.º 1
0
plasma.composition = [d0_species, d1_species]

# Setup elements.deuterium lines
d_alpha = Line(elements.deuterium, 0, (3, 2))
d_beta = Line(elements.deuterium, 0, (4, 2))
d_gamma = Line(elements.deuterium, 0, (5, 2))
d_delta = Line(elements.deuterium, 0, (6, 2))
d_epsilon = Line(elements.deuterium, 0, (7, 2))

plasma.models = [
    Bremsstrahlung(),
    ExcitationLine(d_alpha),
    ExcitationLine(d_beta),
    ExcitationLine(d_gamma),
    ExcitationLine(d_delta),
    ExcitationLine(d_epsilon),
    RecombinationLine(d_alpha),
    RecombinationLine(d_beta),
    RecombinationLine(d_gamma),
    RecombinationLine(d_delta),
    RecombinationLine(d_epsilon)
]

plt.ion()

r = Ray(origin=Point3D(0, 0, -5),
        direction=Vector3D(0, 0, 1),
        min_wavelength=100,
        max_wavelength=1000,
        bins=1e6)
s = r.trace(world)
Ejemplo n.º 2
0
# setup the Balmer lines
hydrogen_I_410 = Line(deuterium, 0, (6, 2))  # n = 6->2: 410.12nm
hydrogen_I_396 = Line(deuterium, 0, (7, 2))  # n = 7->2: 396.95nm

# setup the Nitrgon II line with multiplet splitting instructions
nitrogen_II_404 = Line(nitrogen, 1,
                       ("2s2 2p1 4f1 3G13.0", "2s2 2p1 3d1 3F10.0"))
multiplet = [[403.509, 404.132, 404.354, 404.479, 405.692],
             [0.205, 0.562, 0.175, 0.029, 0.029]]

# add all lines to the plasma
plasma.models = [
    ExcitationLine(hydrogen_I_410, lineshape=StarkBroadenedLine),
    RecombinationLine(hydrogen_I_410, lineshape=StarkBroadenedLine),
    ExcitationLine(hydrogen_I_396, lineshape=StarkBroadenedLine),
    RecombinationLine(hydrogen_I_396, lineshape=StarkBroadenedLine),
    ExcitationLine(nitrogen_II_404,
                   lineshape=MultipletLineShape,
                   lineshape_args=[multiplet]),
]

# Ray-trace and plot the results
plt.ion()
r = Ray(origin=Point3D(0, 0, -5),
        direction=Vector3D(0, 0, 1),
        min_wavelength=395,
        max_wavelength=415,
        bins=2000)
s = r.trace(world)
plt.plot(s.wavelengths, s.samples)
plt.xlabel('Wavelength (nm)')
Ejemplo n.º 3
0
                             deuterium.atomic_weight * atomic_mass)
d1_species = Species(deuterium, 1, d1_distribution)

# define the electron distribution
e_density = IonFunction(peak_density, 0, magnetic_axis)
e_temperature = IonFunction(peak_temperature, 0, magnetic_axis)
e_distribution = Maxwellian(e_density, e_temperature, zero_velocity, electron_mass)

# define species
plasma.b_field = ConstantVector3D(Vector3D(1.0, 1.0, 1.0))
plasma.electron_distribution = e_distribution
plasma.composition = [d0_species, d1_species]

# Add a balmer alpha line for visualisation purposes
d_alpha_excit = ExcitationLine(Line(deuterium, 0, (3, 2)))
plasma.models = [d_alpha_excit]


####################
# Visualise Plasma #

# Run some plots to check the distribution functions and emission profile are as expected
r, _, z, t_samples = sample3d(d1_temperature, (0, 4, 200), (0, 0, 1), (-2, 2, 200))
plt.imshow(np.transpose(np.squeeze(t_samples)), extent=[0, 4, -2, 2])
plt.colorbar()
plt.axis('equal')
plt.xlabel('r axis')
plt.ylabel('z axis')
plt.title("Ion temperature profile in r-z plane")

plt.figure()