From 0ab0fcbf60f876ca08a5c90142246ff772d22be1 Mon Sep 17 00:00:00 2001 From: Michele Guerini Rocco Date: Sat, 9 Nov 2024 12:02:14 +0100 Subject: [PATCH] document the wave polarisation convention --- default.nix | 2 +- doc/1.intro.md | 6 +- doc/2.physics.md | 118 +++++++------- doc/man/gray.ini.5.md | 15 +- doc/res/ellipse.svg | 367 ++++++++++++++++++++++++++++++++++++++++++ doc/res/style.css | 13 +- src/polarization.f90 | 62 ++++--- 7 files changed, 499 insertions(+), 84 deletions(-) create mode 100644 doc/res/ellipse.svg diff --git a/default.nix b/default.nix index 681521f..1acb3af 100644 --- a/default.nix +++ b/default.nix @@ -42,7 +42,7 @@ in makefile2graph graphviz # documentation - help2man pandoc + help2man pandoc librsvg haskellPackages.pandoc-crossref (texlive.combine { inherit (texlive) scheme-small xetex fontspec; diff --git a/doc/1.intro.md b/doc/1.intro.md index 700545b..e1dedad 100644 --- a/doc/1.intro.md +++ b/doc/1.intro.md @@ -5,7 +5,7 @@ author: - L. Figini[^1] - A. Mariani[^1] - M. Guerini Rocco[^2] -date: 'November 30, 2012. Updated: November 30, 2021' +date: 'November 30, 2012. Updated: November 9, 2024' lang: en-GB language: english @@ -124,8 +124,8 @@ header-includes: | ```{=latex} % Set font only if available \IfFontExistsTF{Libertinus Serif}{\setmainfont{Libertinus Serif}}{} - \IfFontExistsTF{Libertinus Math}{\setmonofont{Libertinus Math}}{} - \IfFontExistsTF{blabla}{\setsansfont{blablabla}}{} + \IfFontExistsTF{Libertinus Math}{\setmathfont{Libertinus Math}}{} + \IfFontExistsTF{Julia Mono}{\setmathfont{Julia Mono}}{} ``` ... diff --git a/doc/2.physics.md b/doc/2.physics.md index b5fa18c..6862000 100644 --- a/doc/2.physics.md +++ b/doc/2.physics.md @@ -3,22 +3,22 @@ ## Coordinate Reference systems A few sets of coordinate systems are used in the code. The reference system is -the right handed cartesian orthogonal system $(x, y, z)$ with $z$ axis being +the right handed Cartesian orthogonal system $(x, y, z)$ with $z$ axis being the tokamak symmetry axis. For the purpose of the physics analysis this coordinate system may be rotated around the $z-$axis so that the $x z$ plane contains the launching point, i.e., $z$ vertical, $x$ radially outward through the port center, and $y$ pointing in the counter clockwise direction when viewed from above. -In addition to the right handed cartesian orthogonal system specified above, we +In addition to the right handed Cartesian orthogonal system specified above, we introduce also a right-handed cylindrical system $(R,φ,Z)$ with transformation -from the cylindrical to the cartesian system given by $x= R\cosφ$, $y=R\sinφ$, +from the cylindrical to the Cartesian system given by $x= R\cosφ$, $y=R\sinφ$, $z=Z$. ## Quasi-optical approximation -In the complex eikonal framework, the a solution of the wave equation for the +In the complex eikonal framework, a solution of the wave equation for the electric field is looked for in the form $$ @@ -28,9 +28,9 @@ $$ $$ {#eq:eikonal-ansatz} such that it allows for Gaussian beam descriptions. -In [@eq:eikonal-ansatz], $ω$ is the real frequency, $k_0 = ω/c$ the -wavevector amplitude in vacuum, ${\bf e}({\bf x})$ the polarisation versor and -$E_0({\bf x})$ the slowly varying wave amplitude. +In [@eq:eikonal-ansatz], $ω$ is the real frequency, $k_0 = ω/c$ the wavevector +amplitude in vacuum, ${\bf e}({\bf x})$ the normalised polarisation (Jones) +vector and $E_0({\bf x})$ the slowly varying wave amplitude. The function $S({\bf x})$ is the complex eikonal, $S = S_R({\bf x}) + i S_I ({\bf x})$, in which the real part $S_R({\bf x})$ is related to the beam @@ -456,16 +456,53 @@ $$ $$ {#eq:pjgauss} -## Reflection at inner wall and polarisation +## Mode coupling and reflection at inner wall + +The polarisation of the beam is used to compute the coupling to the Ordinary +(O) and Extraordinary (X) plasma modes when the beam crosses the +vacuum-plasma interface. The fraction of power converted into a mode is given +by the coupling coefficient +$$ + c_\text{mode} = (\hat{\mathbf e}_\text{mode}⋅\hat{\mathbf e})², +$$ +where $\hat{\mathbf e}_\text{mode},\hat{\mathbf e}$ are the plasma mode and +beam Jones vectors, respectively. The mode vector is defined as the +eigenvector of the cold plasma dielectric tensor in the low density limit. +The beam vector at launch is computed from the polarisation ellipse parameters +using the formula: +$$ + \begin{aligned} + \hat{e}₁ &= \cosχ\cosψ + i\sinχ\sinψ \\ + \hat{e}₂ &= \cosχ\sinψ - i\sinχ\cosψ + \end{aligned} +$$ {#eq:ellipse2field} + +The following convention is assumed (illustrated in [@fig:ellipse]): + +- $ψ$ is the angle between the $x$ axis and the major axis. + +- $χ = \tan(b/a)$ where $a,b$ are ellipse major and minor semi-axes, respectively. + +- A positive $ψ$ corresponds to an ellipse rotated counterclockwise in the + $x∧y$ plane. + +- A positive $χ$ corresponds to an ellipse traced clockwise in the $x∧y$ plane + with the $z$ axis in the direction of the wave propagation. In other words: + negative helicity (projection of spin angular momentum unto wavevector) or + left handed wave (IEEE convention). + +If the initial polarisation is not specified, 100% coupling to a given mode +is assumed. + +![Polarisation ellipse](res/ellipse.svg){#fig:ellipse} A model for wave reflection on a smooth surface is included in GRAY. This is -used to describe beam reflection on the inner wall of the tokamak in the cases -where only partial absorption occurs at the first pass in the plasma. An ideal -conductor is assumed for the reflecting surface, so that the full power of the -incident beam is transferred to the reflected one. The vector refractive index -${\bf N}_{\rm{refl}}$ and the unit electric field $\hat {\bf e}_{\rm{refl}}$ of -the reflected wave are - +used to describe the beam reflection on the inner wall of the tokamak in the +cases where only partial absorption occurs at the first pass in the plasma. +An ideal conductor is assumed for the reflecting surface, so that the full +power of the incident beam is transferred to the reflected one. The vector +refractive index ${\bf N}_{\rm{refl}}$ and the Jones vector $\hat {\bf +e}_{\rm{refl}}$ of the reflected beam are $$ {\bf N}_{\rm{refl}} = {\bf N}_{\rm{in}} - 2 ({\bf N}_{\rm{in}} @@ -474,50 +511,23 @@ $$ -\hat {\bf e}_{\rm{in}} + 2 (\hat {\bf e}_{\rm{in}} \cdot \hat {\bf n}) \hat {\bf n}, $$ - being ${\bf N}_{\rm{in}}$ and $\hat {\bf e}_{\rm{in}}$ the vector refractive -index and the unit electric field of the incoming wave, and $\hat {\bf n}$ the +index and the Jones vector of the incoming wave, and $\hat {\bf n}$ the normal unit vector to the wall at the beam incidence point. -The Stokes parameter for the unit electric vector $\hat {\bf e}$ in vacuum are -defined in the beam reference system $({\bar x},{\bar y},{\bar z})$ as +The reflected beam Jones vector is again used to compute the coupling +to the plasma modes at the second and successive pass, with potentially +$2^{n-1}$ independent modes being traced after n reflections. +Note that the Jones vectors of the ordinary and extraordinary modes are +orthogonal w.r.t. the standard Hermitian product: $\hat{\mathbf e}_{\rm +O}⋅\hat{\mathbf e}_{\rm X}^* = 0$. +From [@eq:ellipse2field] it then follows that these relations hold: $$ \begin{aligned} - I &= \vert \hat e_{\bar x} \vert^2 + \vert \hat e_{\bar y} \vert^2 = 1 \\ - Q &= \vert \hat e_{\bar x} \vert^2 - \vert \hat e_{\bar y} \vert^2 \\ - U &= 2 \cdot {\rm Re} (\hat e_{\bar x} \hat e_{\bar y}^*) \\ - V &= 2 \cdot {\rm Im} (\hat e_{\bar x} \hat e_{\bar y}^*). - \end{aligned} -$$ {#eq:stokes} - -Alternatively, the two angles $\psi_p$ and $\chi_p$ can be used: - -$$ - \begin{aligned} - Q &= \cos {2 \psi_p} \cos {2 \chi_p} \\ - U &= \sin {2 \psi_p} \cos {2 \chi_p} \\ - V &= \sin {2 \chi_p} + ψ_{\rm O} &= ψ_{\rm X} + \frac{π}{2} \\ + χ_{\rm O} &= -χ_{\rm X} \\ + 1 &= c_{\rm O} + c_{\rm X} \end{aligned} $$ - -which define respectively the major axis orientation and the ellipticity of the -polarisation ellipse. The polarisation parameters of the reflected wave are -used to compute the coupling with the Ordinary (OM) and Extraordinary (XM) -modes at the vacuum-plasma interface before the calculation of the second pass -in the plasma. At the second pass both modes are traced, taking into account -that the power fraction coupled to each mode is - -$$ - P_{\rm O,X} = - \frac{P_{\rm in}}{2} - (1 + Q_{\rm in} Q_{\rm O,X} - + U_{\rm in} U_{\rm O,X} - + V_{\rm in} V_{\rm O,X}). -$$ - -Note that the polarisation vectors of OM and XM form an orthogonal base: -$\psi_{p{\rm O}}=\psi_{p{\rm X}}+\pi/2$, $\chi_{p{\rm O}}=-\chi_{p{\rm X}}$ and -as a consequence $Q_{\rm O}=-Q_{\rm X}$, $U_{\rm O}=-U_{\rm X}$, and $V_{\rm -O}=-V_{\rm X}$, so that $P_{\rm O} + P_{\rm X} = P_{\rm in}$, i.e. all the -incoming power is coupled to the plasma. +with the latter meaning all the incoming power is coupled to the plasma. diff --git a/doc/man/gray.ini.5.md b/doc/man/gray.ini.5.md index c910388..cd135cc 100644 --- a/doc/man/gray.ini.5.md +++ b/doc/man/gray.ini.5.md @@ -113,14 +113,21 @@ Antenna/beam launcher parameters - *MODE_X*, extraordinary (X) **psi** (default: **0.0**) -: ψ (deg), angle between the principal axes of the polarisation - ellipse and the (x,y) axes +: ψ (deg), angle between the x and the major axis of the + polarisation ellipse. ψ∈[-90, 90] and is positive for + rotating counterclockwise. Note: only used in alternative to *iox* if *ipol=.true.*. **chi** (default: **0.0**) -: χ=atan(ε) (deg), where ε is the ellipticity of the polarisation - ellipse +: χ (deg), angle between the principal axes of the polarisation + ellipse. χ∈[-45, 45] and is defined by tan(χ) = b/a, where + a,b are the major,minor semi-axis, respective. + + χ>0 means the ellipse is traced clockwise in the x∧y plane + with the z axis in the direction of the wave propagation. + In other words: negative helicity (projection of spin angular + momentum unto wavevector) or left handed wave (IEEE convention). Note: only used in alternative to *iox* if *ipol=.true.*. diff --git a/doc/res/ellipse.svg b/doc/res/ellipse.svg new file mode 100644 index 0000000..11705af --- /dev/null +++ b/doc/res/ellipse.svg @@ -0,0 +1,367 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + ψ + χ + b + a + + + + + + + + + + + + + + + + + + + + + + x + y + + + diff --git a/doc/res/style.css b/doc/res/style.css index 069937d..ccdcb94 100644 --- a/doc/res/style.css +++ b/doc/res/style.css @@ -3,6 +3,12 @@ box-sizing: border-box; } +/* Justify all text */ +body { + text-align: justify; + hypens: auto; +} + /* Make headings smaller */ h1 { font-size: 1.8em } @@ -39,10 +45,15 @@ h3:hover > .header-section-number { opacity: 0; } /* Fix spacing of numbered equations */ td .katex-display { margin: 0 } +/* Fix equations width */ +div[id^="eq"] table { width: 100%; } /* Center the title */ header { text-align: center } +/* Center figures */ +figure { text-align: center } + /* Inline the authors */ header .author { display: inline-block; @@ -95,7 +106,7 @@ nav { color: #d0d6e2; padding: 1.2em; padding-left: 0; - overflow-y: scroll; + overflow-y: auto; } nav a:link { text-decoration: none } nav a:link, a:visited { color: #d0d6e2 } diff --git a/src/polarization.f90 b/src/polarization.f90 index 30d0a28..0a48ee1 100644 --- a/src/polarization.f90 +++ b/src/polarization.f90 @@ -17,33 +17,41 @@ contains ! polarisation ellipse angles ψ, χ ! ! Notes: - ! - ψ∈[-π/2, π/2] is the angle between the x and the major axis + ! - ψ∈[-π/2, π/2] is the angle between the x and the major axis. + ! ! - χ∈[-π/4, π/4] is defined by tan(χ) = b/a, where a,b are the - ! major,minor semi-axis, respectively; χ>0 for positive helicity - ! (left-handed wave), χ<0 for negative helicity (right-handed wave). + ! major,minor semi-axis, respectively. + ! + ! - χ>0 means the ellipse is traced clockwise in the x∧y plane + ! with the z axis in the direction of the wave propagation. + ! In other words: negative helicity (projection of spin angular + ! momentum unto wavevector) or left handed wave (IEEE convention). + ! + ! - ψ>0 rotates the ellipse counterclockwise ! subroutine arguments real(wp_), intent(in) :: psi, chi complex(wp_), intent(out) :: e_x(:), e_y(:) - ! The Eikonal ansatz is: + ! Consider a plane wave with the electric field given as ! - ! E̅(r̅, t) = Re e̅(r̅) exp(-ik₀S(r̅) + iωt) + ! E̅(r̅, t) = Re e̅(r̅) exp(ik̅⋅r̅ - iωt) ! - ! where e̅(r̅) = [|e₁|exp(iφ₁), |e₂|exp(iφ₂), 0], since the wave - ! is transversal in vacuum. At a fixed position r̅=0, ignoring - ! the third component, we have: + ! where k̅ = k₀z and e̅(r̅) = [|e₁|exp(iφ₁), |e₂|exp(iφ₂), 0], + ! since the wave is transversal in a vacuum. At a fixed position + ! r̅=0, ignoring the third component, we have: ! - ! E̅(0, t) = [|e₁|cos(φ₁ + ωt), |e₂|cos(φ₂ + ωt)] - ! = [|e₁|cos(φ₁)cos(ωt) - |e₁|sin(φ₁)sin(ωt), - ! |e₂|cos(φ₂)cos(ωt) - |e₂|sin(φ₂)sin(ωt)] + ! E̅(0, t) = [|e₁|cos(φ₁ - ωt), |e₂|cos(φ₂ - ωt)] + ! = [|e₁|cos(φ₁)cos(ωt) + |e₁|sin(φ₁)sin(ωt), + ! |e₂|cos(φ₂)cos(ωt) + |e₂|sin(φ₂)sin(ωt)] ! - ! Then, we compare this to the parametric equation of - ! an ellipse rotated by ψ through the origin, + ! Then, we compare this to the parametric equation of an ellipse + ! rotated by ψ through the origin (traced in the same direction + ! as for the electric field), ! - ! P̅(t) = R(ψ) [acos(ωt), bsin(ωt)] - ! = [cos(ψ)a⋅cos(ωt), -sin(ψ)b⋅sin(ωt), - ! sin(ψ)a⋅cos(ωt), cos(ψ)b⋅sin(ωt)] + ! P̅(t) = R(ψ) [a⋅cos(ωt), -b⋅sin(ωt)] + ! = [cos(ψ)a⋅cos(ωt) +sin(ψ)b⋅sin(ωt), + ! sin(ψ)a⋅cos(ωt) -cos(ψ)b⋅sin(ωt)] ! ! at ωt=0 and ωt=π/2, so: ! @@ -76,6 +84,7 @@ contains ! e_x = cosd(chi)*cosd(psi) + im * sind(chi)*sind(psi) e_y = cosd(chi)*sind(psi) - im * sind(chi)*cosd(psi) + end subroutine ellipse_to_field @@ -118,17 +127,27 @@ contains ! chi = asind(imag(2 * e_x * conjg(e_y))) / 2 psi = atan2d(real(2 * e_x * conjg(e_y)), abs(e_x)**2 - abs(e_y)**2) / 2 + end subroutine field_to_ellipse + pure subroutine pol_limit(N, B, Bres, sox, e_x, e_y) ! Computes the Jones vectors of the cold plasma dispersion ! relation in the limit of vanishing electron density ! - ! Note: the Jones vectors are given in the local beam frame, - ! that is, the z axis is aligned with the wave vector and x axis - ! lies in the tokamak equatorial plane. - ! This allows to directly compare the beam polarisation with - ! the plasma modes Jones vectors to obtain the power couplings. + ! Notes: + ! - The Jones vectors are given in the local beam frame, + ! that is, the z axis is aligned with the wave vector + ! and the x axis lies in the tokamak equatorial plane. + ! This allows to directly compare the beam polarisation with + ! the plasma modes Jones vectors to obtain the power couplings. + ! + ! - The dielectric tensor is obtained using the convention + ! + ! E̅(r̅, t) = ∫ d³k dω/(2π)⁴ E̅(k̅, ω) exp(ik̅⋅r̅ - iωt) + ! + ! for the Fourier transform. This is commonplace, but it's + ! the opposite of the eikonal ansatz, so the Jones vector ! subroutine arguments real(wp_), intent(in) :: N(3) ! N̅ refractive index @@ -287,6 +306,7 @@ contains e = matmul(R, e) e_x = e(1) e_y = e(2) + end subroutine pol_limit end module polarization