\documentclass[a4paper]{article}

\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage[english]{babel}
\usepackage[squaren]{SIunits}
\usepackage[latin1]{inputenc}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{epsfig}
\usepackage{subfig}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Renew commands 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand{\de}{\partial}
\newcommand{\dd}{\mathrm{d}}

\newcommand{\er}{\mathbf{e_r}}
\newcommand{\ez}{\mathbf{e_z}}
\newcommand{\et}{\mathbf{e_\theta}}
\newcommand{\ep}{\mathbf{e_\phi}}
\newcommand{\B}{\mathbf{B}}
\newcommand{\E}{\mathbf{E}}
\renewcommand{\j}{\mathbf{j}}
\newcommand{\psih}{\hat{\psi}}

\newcommand{\be}{\begin{equation}}
\newcommand{\ee}{\end{equation}}

\newcommand{\ba}{\begin{align}}
\newcommand{\ea}{\end{align}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\didi}[2]{\ensuremath{\frac{\dd{#1}}{\dd{#2}}}}
\newcommand{\dede}[2]{\ensuremath{\frac{\partial{#1}}{\partial{#2}}}}
\newcommand{\ddedde}[2]{\ensuremath{\frac{\partial^2{#1}}{\partial{#2}^2}}}
\newcommand{\psihat}{\hat{\psi}}
\newcommand{\Tehat}{\hat{T_e}}
\newcommand{\rhohat}{\hat{\rho}}
\newcommand{\psihb}{\hat{\boldsymbol{\psi}}}

\newcommand{\cmd}[1]{\textsf{#1}}

\newcommand{\Simulink}{\textsc{Simulink}}
\newcommand{\Matlab}{\textsc{Matlab}}

% units
\newcommand{\eV}{\electronvolt}
\newcommand{\keV}{\kilo\electronvolt}

% fonts
\newcommand{\bs}[1]{\boldsymbol{#1}}


%%%%%%%%%%%%%%%%%%%%%%

\title{RAPTOR equation summary}
\author{F. Felici, f.felici@tue.nl}

\bibliographystyle{unsrt}

\begin{document}
\maketitle


\section{Definitions}
$V' = \dede{V}{\rho}$,
$G_1 = \left\langle (\nabla \rho)^2\right\rangle$,
$G_2 = \frac{V'}{4\pi^2}\left\langle \frac{(\nabla \rho)^2}{R^2}\right\rangle$.

$g_1 = \left\langle (\nabla V)^2 \right\rangle$,
$g_2 = \left\langle \frac{(\nabla V)^2}{R^2}\right\rangle$,
$g_3 = \left\langle \frac{1}{R^2}\right\rangle$.

$\rho_e = \sqrt{\Phi_b / \pi B_0}$,
$F = RB_\phi$

$j_{ni} = \frac{\langle \mathbf{j_{ni}} \cdot \mathbf{B}\rangle}{B_0}$

\section{Flux transport}
Flux surface averaged ohm's law in general form:

\begin{align}
 \sigma_\parallel \left. \dede{\Phi}{t} \right|_\psi
 &= \frac{F^2}{2\pi \mu_0} \dede{}{\psi}\left[ \frac{g_2 }{F} \dede{\psi}{V} \right]
 -  \dede{V}{\psi} \langle \j_{ni} \cdot \B \rangle
\end{align}

We can then re-write this with $\psi$ or $\Phi$ or $\rho$ as independent variable:

\subsection{$\Phi$}
$\hat\Phi = \Phi/\Phi_b$, always [0,1]
\begin{align}
\sigma_\parallel \left( \left. \dede{\psi}{t} \right|_{\hat{\Phi}} - \frac{\hat\Phi \dot{\Phi_b}}{\Phi_b}\dede{\psi}{\hat\Phi} \right)
&= \frac{F^2}{4\pi^2 \mu_0\Phi_b^2} \dede{}{\hat\Phi}\left[ g_2 g_3 \dede{\psi}{\hat\Phi} \right]
 -  \frac{1}{\Phi_b}\dede{V}{\hat\Phi} \langle \j_{ni} \cdot \B \rangle
\end{align}
Which is equal to E. Fable's notes.

\subsection{$\rho$}
$\rho = \sqrt{\Phi/\pi B_0}, d\Phi = 2\pi B_0 \rho d\rho$, and $\hat\rho = \sqrt{\hat\Phi} = \sqrt{\Phi/\Phi_b}, d\Phi = 2\Phi_b \hat\rho d\hat\rho$
\begin{align}
\sigma_\parallel \left( \left. \dede{\psi}{t} \right|_\rho - \frac{\rho \dot B_0}{2B_0}\dede{\psi}{\rho}\right)
&= \frac{F^2}{16\pi^4 \mu_0 B_0^2 \rho} \dede{}{\rho}\left[ \frac{g_2 g_3}{\rho} \dede{\psi}{\rho} \right]
 - \frac{1}{2\pi \rho} \dede{V}{\rho} \frac{\langle \j_{ni} \cdot \B \rangle}{B_0}
 \end{align}
 Which is equal to \cite{Pereverzev1991} since $\frac{G_2}{J} = \frac{R_0}{16\pi^4} \frac{g_2g_3}{\rho}$

 \begin{align}
 \sigma_\parallel \left( \left. \dede{\psi}{t} \right|_{\hat\rho} - \frac{\hat \rho \dot \Phi_b}{2\Phi_b}\dede{\psi}{\hat \rho}\right)
&= \frac{F^2}{16\pi^2 \mu_0 \Phi_b^2 \hat\rho} \dede{}{\hat \rho}\left[ \frac{g_2 g_3}{\hat \rho} \dede{\psi}{\hat \rho} \right]
 - \frac{B_0}{2\Phi_b \hat \rho} \dede{V}{\hat \rho} \frac{\langle \j_{ni} \cdot \B \rangle}{B_0}
\end{align}

\section{Thermal transport}
\be
V' \dede{}{t} [n_e T_e] = \frac{\pi B_0}{\Phi_b}\dede{}{\hat\rho} \frac{g_1 n_e}{V'} \chi_e \dede{T_e}{\hat\rho} + V'P_e
\ee


\section{Finite Element forms}
\be
 \sigma_\parallel \left( \left. \dede{\psi}{t} \right|_{\hat\rho} - \frac{\hat \rho \dot \Phi_b}{2\Phi_b}\dede{\psi}{\hat \rho}\right)
= \frac{F^2}{16\pi^2 \mu_0 \Phi_b^2 \hat\rho} \dede{}{\hat \rho}\left[ \frac{g_2 g_3}{\hat \rho} \dede{\psi}{\hat \rho} \right]
 - \frac{B_0}{2\Phi_b \hat \rho} \dede{V}{\hat \rho} j_{ni}
\ee
is rewritten as
\be
 \frac{16\pi^2 \mu_0 \Phi_b^2 \hat\rho \sigma_{\parallel}}{F^2} \left. \dede{\psi}{t} \right|_{\hat\rho} 
= 
  \dede{}{\hat \rho}\left[ \frac{g_2 g_3}{\hat \rho} \dede{\psi}{\hat \rho} \right]
  +  \frac{16\pi^2 \mu_0 \Phi_b^2 \hat\rho \sigma_{\parallel}}{F^2}\frac{\hat \rho \dot \Phi_b}{2\Phi_b}\dede{\psi}{\hat \rho}
 -   \frac{16\pi^2 \mu_0 \Phi_b}{2F^2} \dede{V}{\hat \rho} \langle \j_{ni} \cdot \B \rangle
\ee
  or
  \be
  m_\psi \dede{\psi}{t}=  a_\psi \dede{\psi}{\hat\rho} + \dede{}{\hat\rho} d_{\psi} \dede{\psi}{\hat\rho}  + s_\psi
  \ee
  with
\begin{align}
  m_\psi &=16\pi^2 \mu_0 \hat\rho  \frac{\Phi_b^2 \sigma_{\parallel}}{F^2} \\ 
  a_\psi &= 16\pi^2 \mu_0 \hat\rho^2  \frac{ \dot \Phi_b \Phi_b \sigma_{\parallel}}{2F^2}\\
  d_\psi &=  \frac{g_2 g_3}{\hat \rho}  \\
  s_\psi &=  -8\pi^2 \mu_0 \frac{B_0\Phi_b}{F^2} \dede{V}{\hat \rho} j_{ni} \\
\end{align}
Now write $\psi$ as a sum of spatial basis functions
\be
\psi(\rho,t) = \sum_{\alpha = 1}^{n_{sp}} \Lambda_\alpha(\hat\rho) \hat{y}_\alpha(t)
\ee
then the weak form, after projection on $\Lambda_b$ and integration by parts is
\begin{align}
\sum_{\alpha=1}^{n_{sp}} \didi{\hat y_\alpha (t)}{t} \int_0^1 m\Lambda_\beta \Lambda_\alpha \dd \hat \rho &=
\sum_{\alpha=1}^{n_{sp}} \hat y_\alpha \int_0^1 a_\psi \Lambda_\beta \dede{\Lambda_\alpha}{\hat\rho} \dd \hat \rho\\
- \sum_{\alpha=1}^{n_{sp}} \hat y_\alpha \int_0^1 d_\psi \dede{\Lambda_\beta}{\hat\rho} \dede{\Lambda_\alpha}{\hat\rho} \dd \hat \rho& 
 +\left[ d_\psi \Lambda_\beta \dede{\psi}{\hat\rho} \right]_0^1
+\int_0^1 \Lambda_\beta s_\psi \dd \hat\rho
\end{align}
which gives the matrix form
\be
\mathbf{M_\psi}\didi{\hat\psi}{t} = (-\mathbf{D}_\psi+ \mathbf{A}_\psi) \hat{\psi} + \mathbf{l} + \mathbf{s}
\ee

The boundary term $\mathbf{l}$ contains only the last element
\be
\left. d_\psi  \Lambda_\beta \dede{\psi}{\hat\rho} \right]_{\rho=1} = \left.  \frac{g_2g_3}{\hat\rho}\dede{\psi}{\hat\rho} \right]_{\rho=1} = \frac{16\pi^3\mu_0\Phi_b}{R_0B_0} I_p 
\ee

\section{Other quantities}
\be
\iota = \frac{1}{q}  = \dede{\psi}{\Phi} = \dede{\rho}{\Phi}\dede{\hat\rho}{\rho}\dede{\psi}{\hat\rho} = \frac{1}{2\Phi_b\hat\rho}\dede{\psi}{\hat\rho}
\ee
\be
I_p = \frac{F}{8\pi^3 \mu_0 \Phi_b} \frac{g_2g_3}{2\hat\rho} \dede{\psi}{\hat\rho} = \frac{g_2 g_3}{8\pi^3 \mu_0} \frac{F}{q}
\ee
\be
j_{tor} = \frac{R_0}{2\pi \mu_0} \dede{}{V} g_2 \dede{\psi}{V} = 
\frac{R_0}{2\pi \mu_0\hat V'} \dede{}{\hat \rho} \frac{g_2}{\hat V'} \dede{\psi}{\hat \rho} 
\ee


  \bibliography{/Users/ffelici/Documents/CRPP/References/Fusion_References}

  \end{document}


