Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation #2

Merged
merged 2 commits into from Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file added doc/COMSOL_WEST_port_index.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/automatic_matching_control_loop.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion doc/chart_manual_matching.ipynb
Expand Up @@ -114,7 +114,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.8"
"version": "3.11.7"
},
"toc": {
"base_numbering": 1,
Expand Down
274 changes: 274 additions & 0 deletions doc/coupling_to_plasma_from_COMSOL.ipynb
@@ -0,0 +1,274 @@
{
"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": 25,
"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": 26,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"4-Port Network: 'ORNL_front_face_conventional', 55000000.0-55000000.0 Hz, 1 pts, z0=[50.+0.j 50.+0.j 50.+0.j 50.+0.j]\n"
]
}
],
"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",
"<img src=\"COMSOL_WEST_port_index.png\" />\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": 27,
"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": 28,
"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": 29,
"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": 30,
"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": 31,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Looking for individual solutions separately for 1st guess...\n",
"Wrong solution (out of range capacitor) ! Re-doing...\n",
"False solution #1: [150. 150.]\n",
"True solution #1: [52.57986227 45.88696785]\n",
"True solution #1: [52.30894839 46.0700872 ]\n",
"Searching for the active match point solution...\n",
"Reducing search range to +/- 5pF around individual solutions\n",
"True solution #1: [53.67807308 46.12207788 53.62800637 46.30935881]\n"
]
}
],
"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": 32,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([0.70081638, 0.6878438 ])"
]
},
"execution_count": 32,
"metadata": {},
"output_type": "execute_result"
}
],
"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": 44,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([[22.16126386, 23.75535708, 20.56902439, 25.21223565]])"
]
},
"execution_count": 44,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"power = [1, 1] # 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": 41,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([[0.70248687, 0.75556107, 0.65298786, 0.80405425]])"
]
},
"execution_count": 41,
"metadata": {},
"output_type": "execute_result"
}
],
"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
}
58 changes: 10 additions & 48 deletions doc/digital_twin.ipynb

Large diffs are not rendered by default.

24 changes: 11 additions & 13 deletions doc/introduction.ipynb
Expand Up @@ -20,15 +20,6 @@
"## WEST IC antenna Python RF Model"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%matplotlib notebook"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -183,7 +174,7 @@
"source": [
"f_match = 54e6\n",
"C_match_left = antenna.match_one_side(f_match=f_match, \n",
" side='right', solution_number=1)"
" side='left', solution_number=1)"
]
},
{
Expand Down Expand Up @@ -363,16 +354,23 @@
"ax[1].legend(('I1','I2','I3','I4'))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The voltage and current values are of course not realistic, because the antenna is radiating on vacuum here, not on plasma."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Impedance at the T-junction\n",
"The WEST ICRH antennas design is based on the conjugate-T to insure a load-tolerance. In particular, they have been designed to operate with an impedance at the T-junction $Z_T$ close to 3 Ohm. An impedance transformer connects the T-junction to the feeding transmission line (30 Ohm line). Hence, matching the antenna is similar to having a 30 Ohm load connected to the feeding transmission line, such as no power is reflected (VSWR$\\to 1$), which should be equivalent of having an impedance of roughtly 3 Ohm at the T-junction.\n",
"\n",
"However, due to real-life design and manufacturing constraint, the optimal impedance at the T-junction is not necessarely 3 Ohm, but can be slightly different in both real and imaginary parts. \n",
"However, due to real-life design and manufacturing constraints, the optimal impedance at the T-junction is not necessarely 3 Ohm, but can be slightly different in both real and imaginary parts. \n",
"\n",
"So let's evaluate the impact of the impedance at the T-junction to the 30 Ohm feeder line (the one which really matter for the generator point-of-view).\n",
"So let's evaluate the impact of the realistic geometries (simulated from full-wave tools) on the impedance at the T-junction to the 30 Ohm feeder line (the one which really matter for the generator point-of-view).\n",
"\n",
"For that, let's take the impedance transformer/vacuum window/service stub network assembly of an antenna:"
]
Expand Down Expand Up @@ -520,7 +518,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.8"
"version": "3.11.7"
},
"toc": {
"base_numbering": 1,
Expand Down
4 changes: 2 additions & 2 deletions doc/tutorial_matching_automatic.ipynb
Expand Up @@ -738,7 +738,7 @@
"metadata": {},
"outputs": [],
"source": [
"C_opt_2 = antenna.matching_both_sides_iterative(f_match=55e6, power=power, phase=phase)"
"C_opt_2 = antenna.match_both_sides_iterative(f_match=55e6, power=power, phase=phase, Cs=[50, 50, 50, 50])"
]
},
{
Expand Down Expand Up @@ -896,7 +896,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
"version": "3.11.7"
}
},
"nbformat": 4,
Expand Down