-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
11 changed files
with
335 additions
and
82 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.