rhop_grid = asim.rhop_grid Erad = np.trapz(tot_rad_dens[-1*n_rep:,:], axis=0) * 1.6e-13 Te_eV = radiation_cooling(rhop, rhop_grid, ne_cm3, nd_cm3, nz_init, Te_eV, Erad) ne_cm3, Te_eV = dilution_cooling(rhop, rhop_grid, ne_cm3, nd_cm3, Te_eV, nz_old, nz_init) kp['Te']['vals'] = Te_eV kp['ne']['vals'] = ne_cm3 Te_all.append(Te_eV) # update kinetic profile dependencies: asim.setup_kin_profs_depts() # plot charge state distributions over radius and time aurora.plot_tools.slider_plot(asim.rvol_grid, time_grid, nz_all.transpose(1,0,2), xlabel=r'$r_V$ [cm]', ylabel='time [s]', zlabel=r'$n_z$ [$cm^{-3}$]', labels=[str(i) for i in np.arange(0,nz_all.shape[1])], plot_sum=True, x_line=asim.rvol_lcfs) # plot radiation profiles over radius and time aurora.slider_plot(asim.rvol_grid, time_grid, line_rad_all.transpose(1,0,2), xlabel=r'$r_V$ [cm]', ylabel='time [s]', zlabel=r'Line radiation [$MW/m^3$]', labels=[str(i) for i in np.arange(0,nz_all.shape[1])], plot_sum=True, x_line=asim.rvol_lcfs) _Te_all = np.array(Te_all).T Te_arr = np.reshape(_Te_all, (1,len(rhop),len(time_grid[::5]))) aurora.slider_plot(rhop, time_grid[::5], Te_arr, xlabel=r'$rho_p$', ylabel='time [s]', zlabel=r'Te [eV]') #plt.show(block=True)
# run Aurora forward model and plot results out = asim.run_aurora(D_z, V_z, plot=plot) # extract densities and particle numbers in each simulation reservoir nz, N_wall, N_div, N_pump, N_ret, N_tsu, N_dsu, N_dsul, rcld_rate, rclw_rate = out # add radiation asim.rad = aurora.compute_rad(imp, nz.transpose(2,1,0), asim.ne, asim.Te, prad_flag=True, thermal_cx_rad_flag=False, spectral_brem_flag=False, sxr_flag=False) if plot: # plot radiation profiles over radius and time aurora.slider_plot(asim.rvol_grid, asim.time_out, asim.rad['line_rad'].transpose(1,2,0), xlabel=r'$r_V$ [cm]', ylabel='time [s]', zlabel=r'Line radiation [$MW/m^3$]', labels=[str(i) for i in np.arange(0,nz.shape[1])], plot_sum=True, x_line=asim.rvol_lcfs) # plot Delta-Zeff profiles over radius and time asim.calc_Zeff() if plot: # plot variation of Zeff due to simulated impurity: aurora.slider_plot(asim.rvol_grid, asim.time_out, asim.delta_Zeff.transpose(1,0,2), xlabel=r'$r_V$ [cm]', ylabel='time [s]', zlabel=r'$\Delta$ $Z_{eff}$', labels=[str(i) for i in np.arange(0,nz.shape[1])], plot_sum=True,x_line=asim.rvol_lcfs) # plot expected centrifugal asymmetry from finite rotation
zlabel=r"$n_z$ [$cm^{-3}$]", labels=[str(i) for i in np.arange(0, nz.shape[1])], plot_sum=True, x_line=asim.rvol_lcfs, ) # add radiation asim.rad = aurora.compute_rad( imp, nz.transpose(2, 1, 0), asim.ne, asim.Te, prad_flag=True, thermal_cx_rad_flag=False, spectral_brem_flag=False, sxr_flag=False, ) # plot radiation profiles over radius and time aurora.slider_plot( asim.rvol_grid, asim.time_out, asim.rad["line_rad"].transpose(1, 2, 0), xlabel=r"$r_V$ [cm]", ylabel="time [s]", zlabel=r"Line radiation [$MW/m^3$]", labels=[str(i) for i in np.arange(0, nz.shape[1])], plot_sum=True, x_line=asim.rvol_lcfs, )
# set time-independent transport coefficients (flat D=1 m^2/s, V=-2 cm/s) D_z = 1e4 * np.ones(len(asim.rvol_grid)) # cm^2/s V_z = -1e3 * asim.rhop_grid**5 # cm/s # run Aurora forward model and plot results out = asim.run_aurora(D_z, V_z, plot=True) # extract densities and particle numbers in each simulation reservoir nz, N_wall, N_div, N_pump, N_ret, N_tsu, N_dsu, N_dsul, rcld_rate, rclw_rate = out # plot radiation profiles over radius and time aurora.slider_plot(asim.rvol_grid, asim.time_out, nz.transpose(1, 0, 2), xlabel=r'$r_V$ [cm]', ylabel='time [s]', zlabel=r'$n_z$ [$cm^{-3}$]', labels=[str(i) for i in np.arange(0, nz.shape[1])], plot_sum=True, x_line=asim.rvol_lcfs) # weights for line integration line_int = exc_pec_vals * asim.ne * interp1d(rhop_lineint, weights_lineint)( asim.rhop_grid) spred_cs = line_int.T[:, None, :] * nz aurora.slider_plot(asim.rvol_grid, asim.time_out, spred_cs.transpose(1, 0, 2), xlabel=r'$r_V$ [cm]', ylabel='time [s]',
# extract densities and particle numbers in each simulation reservoir nz, N_wall, N_div, N_pump, N_ret, N_tsu, N_dsu, N_dsul, rcld_rate, rclw_rate = out # add radiation asim.rad = aurora.compute_rad( imp, nz.transpose(2, 1, 0), asim.ne, asim.Te, prad_flag=True, thermal_cx_rad_flag=False, spectral_brem_flag=False, sxr_flag=True, adas_files_sub={ 'pls': '/home/sciortino/atomlib/atomdat_master/pue2020_data/pls_Ca_9.dat', 'prs': '/home/sciortino/atomlib/atomdat_master/pue2020_data/prs_Ca_9.dat' }) # plot radiation profiles over radius and time aurora.slider_plot(asim.rhop_grid, asim.time_out, asim.rad['sxr_line_rad'].transpose(1, 2, 0), xlabel=r'$\rho_p$', ylabel='time [s]', zlabel=r'SXR Line radiation [$MW/m^3$]', labels=[str(i) for i in np.arange(0, nz.shape[1])], plot_sum=True, x_line=1.0)