{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Heatflux post processing\n", "\n", "Documenation of the EMC3-EIRENE is part of the [EMC3-EIRENE documentation](https://emc3-eirene.pages.mpcdf.de/EMC3/page/post/deposition.html)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "* map particle and density deposition `ENERGY_DEPO` and `PARTICLE_DEPO` to the target structures\n", "* Target heatflux contains contribution from potential energy\n", "* Neutrals are not included\n", "* plasma radiation not included" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Ensure the example data is present\n", "from get_data import load_example_data\n", "\n", "_ = load_example_data()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Input file\n", "! cat ../../example-data/emc3_example/fort.3" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Input file\n", "! cat ../../example-data/emc3_example/fort.79" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 3D plotting\n", "`xemc3-divertor` can be used for 3D plotting of the divertor heat flux.\n", "\n", "Mayavi is needed for this.\n", "\n", "Currently this does not work in binder." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "! xemc3-divertor ../../example-data/emc3_example/ -gls -t 'Example data'" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "![screenshot of the 3D divertor plot](heatflux_screenshot.png \"Example screenshot\")\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Analysing the data" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import xemc3" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plates = xemc3.load.plates(\"../../example-data/emc3_example/\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plates" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The data contains padding such that they can be combined into a numpy-data-block" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": true }, "outputs": [], "source": [ "plates[\"f_E\"].isel(plate_ind=13).plot()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Using the `ds.emc3[]` the padding can be removed, if it not not needed for the current data, i.e. if only a single plate is included:" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": true }, "outputs": [], "source": [ "nosym = list(plates.emc3.iter_plates())\n", "nosym[13].emc3[\"f_E\"].plot()\n", "nosym[13]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "It is possible to get all plates, rather then just the simulated half-module using the `ds.emc3.iter_plates` function:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sym = list(plates.emc3.iter_plates(symmetry=True, segments=5))\n", "len(sym)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.14.4" } }, "nbformat": 4, "nbformat_minor": 4 }