world = World() plasma = build_slab_plasma(peak_density=5e19, impurities=[(carbon, 6, 0.005)], parent=world) plasma.atomic_data = OpenADAS(permit_extrapolation=True) #################### # Visualise Plasma # h0 = plasma.composition.get(hydrogen, 0) h1 = plasma.composition.get(hydrogen, 1) c6 = plasma.composition.get(carbon, 6) # Run some plots to check the distribution functions and emission profile are as expected r, _, z, t_samples = sample3d(h1.distribution.effective_temperature, (-1, 2, 200), (0, 0, 1), (-1, 1, 200)) plt.imshow(np.transpose(np.squeeze(t_samples)), extent=[-1, 2, -1, 1]) plt.colorbar() plt.axis('equal') plt.xlabel('x axis') plt.ylabel('z axis') plt.title("Ion temperature profile in x-z plane") plt.figure() r, _, z, t_samples = sample3d(h1.distribution.effective_temperature, (0, 0, 1), (-1, 1, 200), (-1, 1, 200)) plt.imshow(np.transpose(np.squeeze(t_samples)), extent=[-1, 1, -1, 1]) plt.colorbar() plt.axis('equal') plt.xlabel('x axis') plt.ylabel('y axis')
# make a slab plasma world = World() plasma = build_slab_plasma(peak_density=5e19, impurities=[(carbon, 6, 0.005)], parent=world) plasma.atomic_data = OpenADAS(permit_extrapolation=True) #################### # Visualise Plasma # h0 = plasma.composition.get(hydrogen, 0) h1 = plasma.composition.get(hydrogen, 1) c6 = plasma.composition.get(carbon, 6) r, _, z, t_samples = sample3d(h1.distribution.effective_temperature, (-1, 2, 200), (0, 0, 1), (-1, 1, 200)) plt.imshow(np.transpose(np.squeeze(t_samples)), extent=[-1, 2, -1, 1]) plt.colorbar() plt.axis('equal') plt.xlabel('x axis') plt.ylabel('z axis') plt.title("Ion temperature profile in x-z plane") plt.figure() r, _, z, t_samples = sample3d(h1.distribution.effective_temperature, (0, 0, 1), (-1, 1, 200), (-1, 1, 200)) plt.imshow(np.transpose(np.squeeze(t_samples)), extent=[-1, 1, -1, 1]) plt.colorbar() plt.axis('equal') plt.xlabel('x axis') plt.ylabel('y axis')
plasma.atomic_data = OpenADAS(permit_extrapolation=True) # add background emission d_alpha = Line(hydrogen, 0, (3, 2)) plasma.models = [ExcitationLine(d_alpha), RecombinationLine(d_alpha)] #################### # Visualise Plasma # h0 = plasma.composition.get(hydrogen, 0) h1 = plasma.composition.get(hydrogen, 1) c6 = plasma.composition.get(carbon, 6) # Run some plots to check the distribution functions and emission profile are as expected ti = h1.distribution.effective_temperature r, _, z, t_samples = sample3d(ti, (-1, 2, 200), (0, 0, 1), (-1, 1, 200)) plt.imshow(np.transpose(np.squeeze(t_samples)), extent=[-1, 2, -1, 1]) plt.colorbar() plt.axis('equal') plt.xlabel('x axis') plt.ylabel('z axis') plt.title("Ion temperature profile in x-z plane") plt.figure() r, _, z, t_samples = sample3d(h0.distribution.density, (-1, 2, 200), (0, 0, 1), (-1, 1, 200)) plt.imshow(np.transpose(np.squeeze(t_samples)), extent=[-1, 2, -1, 1]) plt.colorbar() plt.axis('equal') plt.xlabel('x axis') plt.ylabel('z axis')
# define species plasma.b_field = ConstantVector3D(Vector3D(0, 0, 0)) plasma.electron_distribution = e_distribution plasma.composition = species #################### # Visualise Plasma # h0 = plasma.composition.get(hydrogen, 0) h1 = plasma.composition.get(hydrogen, 1) c6 = plasma.composition.get(carbon, 6) # Run some plots to check the distribution functions and emission profile are as expected h1_temp = h1.distribution.effective_temperature r, _, z, t_samples = sample3d(h1_temp, (-1, 2, 200), (0, 0, 1), (-1, 1, 200)) plt.imshow(np.transpose(np.squeeze(t_samples)), extent=[-1, 2, -1, 1]) plt.colorbar() plt.axis('equal') plt.xlabel('x axis') plt.ylabel('z axis') plt.title("Ion temperature profile in x-z plane") plt.figure() r, _, z, t_samples = sample3d(h1_temp, (0, 0, 1), (-1, 1, 200), (-1, 1, 200)) plt.imshow(np.transpose(np.squeeze(t_samples)), extent=[-1, 1, -1, 1]) plt.colorbar() plt.axis('equal') plt.xlabel('x axis') plt.ylabel('y axis') plt.title("Ion temperature profile in y-z plane")
# 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() r, _, z, t_samples = sample3d(d1_temperature, (-4, 4, 400), (-4, 4, 400), (0, 0, 1)) plt.imshow(np.transpose(np.squeeze(t_samples)), extent=[-4, 4, -4, 4]) plt.colorbar() plt.axis('equal') plt.xlabel('x axis') plt.ylabel('y axis') plt.title("Ion temperature profile in x-y plane")