![]() |
ORB5
v4.9.4
|
Antenna's implementation.
\(\newcommand{\ant}{_\mathrm{ant}} \renewcommand{\vec}[1]{\boldsymbol{\mathbf{#1}}} \newcommand{\grad}{\vec\nabla} \newcommand{\dm}{\Delta m} \renewcommand{\i}{\mathrm{i}}\)
In order to avoid recomputing the antenna field at every time step, its time dependence can be separated form its spatial dependence as follows:
\[ \begin{split} \phi\ant(s,\chi,\varphi,t)&=h(s)\mathrm{Re}\bigg(\sum_{\mu=1}^{N_\mu}A_\mu e^{\mathrm{i}(m_\mu\chi+n_\mu\varphi+\Phi_\mu)}(\alpha+\beta e^{\mathrm{i}\omega\ant t})\bigg)\\ &=\big(\alpha+\beta\cos(\omega\ant t)\big)\bigg(\underbrace{h(s)\sum_{\mu=1}^{N_\mu}A_\mu \cos(m_\mu\chi+n_\mu\varphi+\Phi_\mu)}_\texttt{field_t0}\bigg)+\beta\sin(\omega\ant t)\bigg(\underbrace{h(s)\sum_{\mu=1}^{N_\mu}A_\mu \cos\big(m_\mu\chi+n_\mu\varphi+\Phi_\mu+\frac{\pi}{2}\big)}_\texttt{field_tquarter}\bigg) \end{split} \]
The two spatial terms field_t0
and field_tquarter
are computed during the initialization phase. If \(\omega\ant=0\), field_tquarter
is not even computed as it is useless.
In the following sections, \(\phi\ant(s,\chi,\varphi)\) denotes only the field_t0
component. field_tquarter
is constructed identically, up to a phase shift.
solver_mod::assemblyRHS_antenna's routine projects the analytical field \( \phi\ant(\vec x) \) on B-spline coefficients \( \phi_{\mathrm{ant},ijk} \) by solving the weak formulation problem
\[ \iiint\eta(\vec x)\sum_{i,j,k}\phi_{\mathrm{ant},ijk}\Lambda_{ijk}(\vec x)~d^3\vec x = \iiint\eta(\vec x)\phi\ant(\vec x)~d^3\vec x \quad \forall\eta(\vec x) \]
The test functions \( \eta(\vec x) \) are chosen as \( \Lambda_{ijk}(\vec x) \), leading to
\[ \iiint\Lambda_{ijk}(\vec x)\sum_{i',j',k'}\phi_{\mathrm{ant},i'j'k'}\Lambda_{i'j'k'}(\vec x)~d^3\vec x = \iiint\Lambda_{ijk}(\vec x)\phi\ant(\vec x)~d^3\vec x \quad \forall i,j,k \]
which can be writen in the form of the system of equations
\[ M\phi\ant=b \]
where
\[ M_{ijk,i'j'k'}=\iiint \Lambda_{ijk}(\vec x)\Lambda_{i'j'k'}(\vec x)~d^3\vec x \]
and
\[ b_{ijk}=\iiint \phi\ant(\vec x)\Lambda_{ijk}(\vec x)~d^3\vec x \]
Going to magnetic coordinates gives
\[ M_{ijk,i'j'k'}=\iiint J_{s\chi\varphi}(s,\chi)\Lambda_i(s)\Lambda_{i'}(s)\Lambda_j(\chi)\Lambda_{j'}(\chi)\Lambda_k(\varphi)\Lambda_{k'}(\varphi)~ds~d\chi~d\varphi \]
and
\[ b_{ijk}=\iiint J_{s\chi\varphi}(s,\chi)\phi\ant(s,\chi,\varphi)\Lambda_i(s)\Lambda_j(\chi)\Lambda_k(\varphi)~ds~d\chi~d\varphi \]
Taking the discrete Fourier transform of previous system of equations gives
\[ \tilde M\tilde\phi=\tilde b \]
where
\[ \tilde M=FMF^{-1}\mathrm{,}\qquad\tilde\phi=F\phi\mathrm{,}\qquad\tilde b=Fb \]
\[ F_{imn,i'jk}=e^{-2\pi\i(mj/N_\chi+nk/N_\varphi)} \]
\[ F^{-1}_{imn,i'jk}=e^{2\pi\i(mj/N_\chi+nk/N_\varphi)}/N_\chi/N_\varphi \]
First, let's explicit the matrix elements:
\[ \tilde M_{imn,i'm'n'}=\int_{s_\mathrm{min}}^{s_\mathrm{max}}ds\int_0^{2\pi}d\chi J_{s\chi\varphi}(s,\chi)\Lambda_i(s)\Lambda_{i'}(s)\sum_j\Lambda_j(\chi)e^{-2\pi\i jm/N_\chi}\sum_{j'}\Lambda_{j'}(\chi)e^{2\pi\i j'm'/N_\chi}/N_\chi\int_0^{2\pi}d\varphi\sum_k\Lambda_k(\varphi)e^{-2\pi\i kn/N_\varphi}\sum_{k'}\Lambda_{k'}(\varphi)e^{2\pi\i k'n'/N_\varphi}/N_\varphi \]
Splitting the poloidal integral by intervals,
\[ \int_0^{2\pi}f(\chi)d\chi=\sum_{J=0}^{N_\chi-1}\int_0^{\Delta \chi}f(J\Delta\chi+\chi)d\chi \]
and playing with poloidal phases, we get
\[ \tilde M_{imn,i'm'n'}=\int_{s_\mathrm{min}}^{s_\mathrm{max}}ds\Lambda_i(s)\Lambda_{i'}(s)\int_0^{\Delta \chi}d\chi\underbrace{\sum_{J=0}^{N_\chi-1}J_{s\chi\varphi}(s,J\Delta \chi+\chi)e^{-2\pi\i J(m-m')/N_\chi}}_{\tilde J_{m-m'}(s,\chi)}\underbrace{\sum_{j=0}^p\Lambda_j(\chi)e^{-2\pi\i jm/N_\chi}}_{\tilde\Lambda_m(\chi)}\underbrace{\sum_{j'=0}^p\Lambda_{j'}(\chi)e^{2\pi\i j'm'/N_\chi}/N_\chi}_{\tilde\Lambda_{m'}^*(\chi)}\sum_{k'}\underbrace{\sum_{k}\int_0^{2\pi}d\varphi\Lambda_k(\varphi)\Lambda_{k'}(\varphi)e^{2\pi\i kn/N_\varphi}}_{M^{(n)}e^{-2\pi\i k'n/N_\varphi}}e^{2\pi\i k'n'/N_\varphi}/N_\varphi \]
The last step is to use Gaussian quadrature in radial and poloidal cells:
\[ \int_{s_\mathrm{min}}^{s_\mathrm{max}}f(s)ds=\sum_{I=0}^{N_s-1}\sum_{g_s=1}^{N_g}w_{g_s}f(s_{I,g_s}) \]
where \( s_{I,g_s}=s_{min}+I\Delta s+s_{g_s} \), and
\[ \int_0^{\Delta\chi}f(\chi)d\chi=\sum_{g_\chi=1}^{N_g}w_{g_\chi}f(\chi_{g_\chi}) \]
leading to
\[ \begin{split}\boxed{\tilde M_{imn,i'm'n'}=\delta_{nn'}M^{(n)}\sum_{I=0}^{N_s-1}\sum_{g_s=1}^{N_g}\sum_{g_\chi=1}^{N_g}w_{g_s}w_{g_\chi}\tilde J_{m-m'}(s_{I,g_s},\chi_{g_\chi})\Lambda_i(s_{I,g_s})\Lambda_{i'}(s_{I,g_s})\tilde\Lambda_m(\chi_{g_\chi})\tilde\Lambda_{m'}^*(\chi_{g_\chi})}\end{split} \]
Second, let's explicit the right-hand-side elements. The exponential form of \(\phi\ant\) can be used because the reality condition is ensured by the fact that only \(n\geq0\) modes are kept in the code.
\[ \begin{split} \tilde b_{imn}&=\int_{s_\mathrm{min}}^{s_\mathrm{max}}ds\int_0^{2\pi}d\chi\int_0^{2\pi}d\varphi J_{s\chi\varphi}(s,\chi)\phi\ant(s,\chi,\varphi)\Lambda_i(s)\sum_j\Lambda_j(\chi)e^{-2\pi\i jm/N_\chi}\sum_k\Lambda_k(\varphi)e^{-2\pi\i kn/N_\varphi}\\ &=\int_{s_\mathrm{min}}^{s_\mathrm{max}}ds\int_0^{2\pi}d\chi\int_0^{2\pi}d\varphi J_{s\chi\varphi}(s,\chi)\sum_\mu A_\mu h(s)e^{\i(m_\mu\chi+n_\mu\varphi+\Phi_\mu)}\Lambda_i(s)\sum_j\Lambda_j(\chi)e^{-2\pi\i jm/N_\chi}\sum_k\Lambda_k(\varphi)e^{-2\pi\i kn/N_\varphi}\\ &=\sum_\mu A_\mu e^{\i\Phi_\mu}\int_{s_\mathrm{min}}^{s_\mathrm{max}}ds~h(s)\Lambda_i(s)\sum_j\int_0^{2\pi}d\chi J_{s\chi\varphi}(s,\chi)\Lambda_j(\chi)e^{\i m_\mu\chi-2\pi\i jm/N_\chi}\sum_k\int_0^{2\pi}d\varphi\Lambda_k(\varphi)e^{\i n_\mu\varphi-2\pi\i kn/N_\varphi} \end{split} \]
Splitting the poloidal integral by intervals and changing toroidal variable \( \varphi\rightarrow\varphi-k\Delta\varphi \) yields
\[ \tilde b_{imn}=\sum_\mu A_\mu e^{\i\Phi_\mu}\int_{s_\mathrm{min}}^{s_\mathrm{max}}ds~h(s)\Lambda_i(s)\int_0^{\Delta\chi}d\chi e^{\i m_\mu\chi}\underbrace{\sum_J J_{s\chi\varphi}(s,J\Delta\chi+\chi)e^{-2\pi\i J(m-m_\mu)/N_\chi}}_{\tilde J_{m-m_\mu}(s,\chi)}\underbrace{\sum_j\Lambda_j(\chi)e^{-2\pi\i jm/N_\chi}}_{\tilde\Lambda_m(\chi)}\underbrace{\sum_ke^{2\pi\i k(n_\mu-n)/N_\varphi}}_{\delta_{n,n_\mu}}\underbrace{\int_0^{2\pi}d\varphi\Lambda_0(\varphi)e^{\i n_\mu\varphi}}_{\tilde\Lambda_{n_\mu}^*} \]
where \( \tilde\Lambda_n \) can be explicited using B-spline definition as successive convolutions with window function:
\[ \tilde\Lambda_n=\frac{2\pi}{N_\varphi}\mathrm{sinc}_\pi(n/N_\varphi)^{p+1}e^{\i\pi(p-1)n/N_\varphi} \]
To finish with, we use Gaussian quadrature in radial and poloidal cells:
\[ \begin{split} \boxed{\tilde b_{imn}=\tilde\Lambda_{n}^*\sum_{\mu|n_\mu=n} A_\mu e^{\i\Phi_\mu}\sum_{I=0}^{N_s-1}\sum_{g_s=1}^{N_g}\sum_{g_\chi=1}^{N_g}w_{g_s}w_{g_\chi}h(s_{I,g_s})\Lambda_i(s_{I,g_s}) \tilde J_{m-m_\mu}(\chi_{g_\chi})e^{\i m_\mu\chi_{g_\chi}}\tilde\Lambda_m(\chi_{g_\chi})}\end{split} \]