{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Plasma Coupling Using COMSOL Results" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In this example, we use a COMSOL front-face coupling calculation provided by ORNL, exported as a standard Touchstone file.\n", "\n", "The Touchstone file is first import as a scikit-rf Network, which is then modified to fit the WEST ICRH antenna electrical model requirements." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import skrf as rf\n", "\n", "# WEST ICRH Antenna package\n", "import sys; sys.path.append('..')\n", "from west_ic_antenna import WestIcrhAntenna" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "front_face_conventional = rf.Network(\n", " '../west_ic_antenna/data/Sparameters/front_faces/COMSOL/ORNL_front_face_conventional.s4p')\n", "print(front_face_conventional) # 50 Ohm S-param component at a single frequency of 55 MHz" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The ports have been defined as:\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "So before to use the S-parameters directly to feed the electrical model, we need to:\n", "- deembed the ports by 0.3m.\n", "- renomalize port reference impedance to the front-face coax characteristic impedances. \n", "- reverse ports 2 and 3." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# creating a 50 Ohm dummy coax line to be removed from the front face \n", "media_coax = rf.DefinedGammaZ0(frequency=front_face_conventional.frequency) # 50 Ohm TEM media\n", "extra_line = media_coax.line(d=0.3, unit='m')\n", "# deembedding all the 4 pourts\n", "for port_idx in range(4):\n", " front_face_conventional = rf.connect(front_face_conventional, port_idx, extra_line.inv, 0)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We expect the port to have a characteristic impedance of about 46.64 ohm, so we renormalize the Network to fit this need:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "front_face_conventional.renormalize(46.64) # done inplace" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "And finally, for historical reasons (may change in a near future ;), the S-matrix port ordering should be ajusted:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "front_face_conventional.renumber([1, 2], [2, 1]) # done inplace" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "OK, so now we can create the WEST antenna object:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ant = WestIcrhAntenna(front_face=front_face_conventional,\n", " frequency=front_face_conventional.frequency) # restrict to single frequ" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's match the antenna for this coupling:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "Cs = ant.match_both_sides(f_match=55e6)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The coupling resistance of the antenna for this coupling in a nominal dipole excitation is:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "power = [1, 1]\n", "phase = [0, np.pi]\n", "\n", "# Coupling resistance\n", "ant.Rc(power, phase)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The voltage and currents are:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "power = [1.6/2, 1.6/2] # MW, to adjust to fit with experiment\n", "phase = [0, np.pi] # rad\n", "\n", "abs(ant.voltages(power, phase)) # results in kV" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "abs(ant.currents(power, phase)) # results in kA" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "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.11.7" } }, "nbformat": 4, "nbformat_minor": 4 }