{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "Typical atomic data used in PHiX\n", "===" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "from matplotlib import pyplot as plt\n", "from raysect.optical import World\n", "\n", "from cherab.phix.plasma import import_plasma\n", "\n", "plt.rcParams[\"font.size\"] = 14\n", "plt.rcParams[\"figure.dpi\"] = 150" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "jupyter": { "source_hidden": true } }, "outputs": [], "source": [ "world = World()\n", "plasma, eq = import_plasma(world)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The photon emission models used in PHiX are listed as follows:" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "jupyter": { "source_hidden": true } }, "outputs": [], "source": [ "[i for i in plasma.models]" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "Species taken into account are listed below as well." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "jupyter": { "source_hidden": true } }, "outputs": [], "source": [ "species = [i for i in plasma.composition]\n", "print(species)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "Plotting Photon Emissivity Coefficient (PEC) vs $T_\\text{e}$ for hydrogen transitions\n", "----" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "Plasma emissivity driven by the electron transition from $j$ to $i$ : $\\epsilon_{j\\rightarrow i}$ [$\\text{W/m}^3$] is represented by the following expression:\n", "\n", "$$\n", "\\epsilon_{j\\rightarrow i} = \\sum_\\rho \\text{PEC}_{\\rho, j\\rightarrow i}^\\text{(exc)}(n_\\text{e}, T_\\text{e})n_\\text{e} n_Z(\\rho) + \\sum_\\nu \\text{PEC}_{\\nu, j\\rightarrow i}^\\text{(rec)}(n_\\text{e}, T_\\text{e})n_\\text{e} n_{Z+1}(\\nu),\n", "$$\n", "\n", "where, $n_\\text{e}$: electron density, $T_\\text{e}$: electron temperature, $n_Z(\\rho)$: population number density $Z$ ions." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "jupyter": { "source_hidden": true }, "tags": [ "nbsphinx-thumbnail" ] }, "outputs": [], "source": [ "temp = [10**x for x in np.linspace(np.log10(1), np.log10(1000), num=100)]\n", "dens = [17, 20] # 10^x [m^-3]\n", "\n", "pec_exc = plasma.atomic_data.impact_excitation_pec(species[0].element, species[0].charge, (3, 2))\n", "pec_rem = plasma.atomic_data.recombination_pec(species[0].element, species[0].charge, (3, 2))\n", "\n", "fig, ax = plt.subplots(figsize=(8, 6))\n", "ax.loglog(temp, [pec_exc(10 ** dens[0], te) for te in temp], \"C0\")\n", "ax.loglog(temp, [pec_rem(10 ** dens[0], te) for te in temp], \"C1\")\n", "ax.loglog(temp, [pec_exc(10 ** dens[1], te) for te in temp], \"C0\", linestyle=\"--\")\n", "ax.loglog(temp, [pec_rem(10 ** dens[1], te) for te in temp], \"C1\", linestyle=\"--\")\n", "\n", "dens_index1 = str(dens[0])\n", "dens_index2 = str(dens[1])\n", "ax.legend(\n", " [\n", " \"Excitation $n_e=10^{}$$^{}$ m$^{}$$^{}$\".format(dens_index1[0], dens_index1[1], \"-\", \"3\"),\n", " \"Recombination $n_e=10^{}$$^{}$ m$^{}$$^{}$\".format(\n", " dens_index1[0], dens_index1[1], \"-\", \"3\"\n", " ),\n", " \"Excitation $n_e=10^{}$$^{}$ m$^{}$$^{}$\".format(dens_index2[0], dens_index2[1], \"-\", \"3\"),\n", " \"Recombination $n_e=10^{}$$^{}$ m$^{}$$^{}$\".format(\n", " dens_index2[0], dens_index2[1], \"-\", \"3\"\n", " ),\n", " ]\n", ")\n", "\n", "ax.set_title(\"H$\\\\alpha$ emission\")\n", "ax.set_xlabel(\"Temperature [eV]\")\n", "ax.set_ylabel(\"PEC [W m$^3$]\")\n", "plt.grid(which=\"both\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "jupyter": { "source_hidden": true } }, "outputs": [], "source": [ "pec_exc = plasma.atomic_data.impact_excitation_pec(species[0].element, species[0].charge, (4, 2))\n", "pec_rem = plasma.atomic_data.recombination_pec(species[0].element, species[0].charge, (4, 2))\n", "\n", "fig, ax = plt.subplots(figsize=(8, 6))\n", "ax.loglog(temp, [pec_exc(10 ** dens[0], te) for te in temp], \"C0\")\n", "ax.loglog(temp, [pec_rem(10 ** dens[0], te) for te in temp], \"C1\")\n", "ax.loglog(temp, [pec_exc(10 ** dens[1], te) for te in temp], \"C0\", linestyle=\"--\")\n", "ax.loglog(temp, [pec_rem(10 ** dens[1], te) for te in temp], \"C1\", linestyle=\"--\")\n", "\n", "dens_index1 = str(dens[0])\n", "dens_index2 = str(dens[1])\n", "ax.legend(\n", " [\n", " \"Excitation $n_e=10^{}$$^{}$ m$^{}$$^{}$\".format(dens_index1[0], dens_index1[1], \"-\", \"3\"),\n", " \"Recombination $n_e=10^{}$$^{}$ m$^{}$$^{}$\".format(\n", " dens_index1[0], dens_index1[1], \"-\", \"3\"\n", " ),\n", " \"Excitation $n_e=10^{}$$^{}$ m$^{}$$^{}$\".format(dens_index2[0], dens_index2[1], \"-\", \"3\"),\n", " \"Recombination $n_e=10^{}$$^{}$ m$^{}$$^{}$\".format(\n", " dens_index2[0], dens_index2[1], \"-\", \"3\"\n", " ),\n", " ]\n", ")\n", "\n", "ax.set_title(\"H$\\\\beta$ emission\")\n", "ax.set_xlabel(\"Temperature [eV]\")\n", "ax.set_ylabel(\"PEC [W m$^3$]\")\n", "plt.grid(which=\"both\")" ] } ], "metadata": { "celltoolbar": "Tags", "kernelspec": { "display_name": "cherab-phix-dev", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.15" }, "vscode": { "interpreter": { "hash": "2725905a4c02db19e04df9b8fdbbe5ec65a73ea52bebaf9474aa1cc98819834c" } } }, "nbformat": 4, "nbformat_minor": 4 }