diff --git a/nummeth-ws22/skript.tex b/nummeth-ws22/skript.tex index 5dc60db..bf27e37 100644 --- a/nummeth-ws22/skript.tex +++ b/nummeth-ws22/skript.tex @@ -4317,7 +4317,7 @@ such that the frozen-in condition applies to the electron fluid velocity $\mathbf{u}_{e}$ instead of the bulk velocity $\mathbf{u}$. \begin{figure}[b] \begin{center} -\includegraphics[scale=0.4]{./01-MHD/fig1} +\includegraphics[scale=0.4]{./fig_chapter6/fig1} \par\end{center} \caption{Illustration of magnetic line conservation for fluid elements $f_{1}$ and $f_{2}$.} @@ -4472,6 +4472,16 @@ The essential step, therefore, is to solve this Poisson equation. After this the \end{align} The actual solution of the Poisson equation can be obtained by many different methods quite easily. For this work we used a multi-grid solver or a Fourier solver (the latter was used whenever use of the fftw (see Frigo 2004) library was necessary anyhow ) for the solution of this equation. For both solvers we showed the solenoidality of the magnetic field to be assured up to the round off error. For a numerical solver, however, this can only be achieved for one kind of discretisation i.e. we have to decide for one discretisation of the divergence of the magnetic induction – only for this discretisation we will be able to assure the solenoidality. This is also true for any other method to assure the solenoidality of the magnetic field. +\begin{figure} + \begin{center} + \pgfimage[width=.9\textwidth]{fig_chapter6/fig_ralph3.4} + \end{center} + \caption{Visualisation of the accumulation of fluctuation energy at small spatial scales for the projection +schemes (left). These results are compared to those obtained with a constrained transport scheme (right). All +values are normalised.} + \label{fig:ralph3.4} +\end{figure} + Despite the fact that this method yields divergence-free fields to the round off error it proved to be not acceptable for turbulence simulations. This is due to the fact that the method introduces additional small-scale fluctuations, which produce unphysical fluctuation spectra for the highest wavenumbers. There is an unphysical pile up of fluctuation energy at large wavenumbers for the former solution. This was also observed by Balsara and Kim (2004). They found @@ -4481,15 +4491,112 @@ that the excessive fluctuation energy at small scales is connected to the decoup \subsection{Constrained Transport Schemes} The idea with constrained transport schemes is to formulate the equations in a way that the divergence of the magnetic induction vanishes in the desired discretisation. Originally this method was introduced by Evans and Hawley (1988) where the authors introduce a staggered grid for the magnetic induction to maintain the solenoidality of the scheme for finite difference schemes. For this they write the induction equation explicitly via the curl of the electric field: - -%- Finite Differenzen -%- Finite Volumina -%- Flux-Limiter -%- Positivity -%- Fluiddynamik -%- MHD +\begin{align} + \diffp{\vec B}{t} = -\nabla \cdot \vec E +\end{align} +Their main idea is to place – for the 2D case – the electric field at the cell corners. + +\begin{figure} + \begin{center} + \pgfimage[width=.9\textwidth]{fig_chapter6/fig_ralph3.5} + \end{center} + \caption{Spatial arrangement of electromagnetic quantities for constrained transport schemes. For further +discussions on the scheme cf. the text.} + \label{fig:ralph3.5} +\end{figure} +This spatial arrangement is also visualised in Fig. \ref{fig:ralph3.5}. T + +Therefore, an initially solenoidal magnetic induction will remain so up to the truncation error of the +variables used in the code. This property has been verified using the above scheme. This method can +be easily implemented and very successful for finite difference schemes. When, however, dealing with +fluids for which shocks might occur one has to use a method like CWENO also for the magnetic field +evolution. This problem was solved by Balsara and Spicer (1999), where they combine the constrained +transport idea with a Godunov type base scheme. This is done via the identification of the electrical field +with the numerical fluxes. + +\section{Spectral methods} + +Fourier transforms can be used to transform differential equations into ordinary equations using the relation +\begin{align} + \widetilde{\partial_x f} = \int \dd x \exp(i k\cdot x) \partial_x f = k f +\end{align} +This allows for a different approach to solving hyperbolic conservation laws. As we will figure out the core problem is that terms of the $(\vec u \nabla) \vec u$ cannot be transformed easily into Fourier space. This leads to the distinction of two different types of spectral methods +\begin{itemize} + \item Spectral methods: Nonlinear terms are evaluated in Fourier space, i.e. everything is performed in Fourier space. This requires a convolution in order to evaluate nonlinearities + \item Pseudospectral methods: Nonlinear terms are evaluated in real space. This requires an inverse Fourier transform of all involved quantities and the Fourier transform of the actual nonlinearity. +\end{itemize} +In both cases a computationally expensive task is involved (Fourier transform or convolution) which makes spectral methods only in special cases relevant. The one case we will discuss here in more detail is the incompressible MHD equations. These can be described by the two conditions +\begin{align} + \nabla\cdot \vec B &= 0\\ + \nabla\cdot \vec u &= 0 +\end{align} +While the the first condition is an initial condition for the Maxwell equation which will be fulfilled always (except for numerical errors), the second one has to be enforced in every time step. In fact a pressure term will ensure this. Typically in ``normal'' simulations a pressure term will enforce the incompressibility. This leads to a Poisson equation which is as expensive to solve as a Fourier transform. + +We will now consider the following set of MHD equations in Fourier space +\begin{align} + \pa{\vec{\tilde u}}{t} &= \int \text{d}^3 x \text{ } e^{i\vec k \vec x} \left( \vec{b} \cdot \nabla \vec{b} \right) - \int \text{d}^3 x \text{ } e^{i\vec k + \vec x} \left( \vec{u} \cdot \nabla \vec{u} \right) - i\vec k \tilde P - \nu_n \vec k^{2n} \vec{\tilde u}, \\ + \pa{\vec{\tilde b}}{t} &= \int \text{d}^3 x \text{ } e^{i\vec k \vec x} \left( \vec{b} \cdot \nabla \vec{u} \right) -\int \text{d}^3 x \text{ } e^{i\vec k + \vec x} \left(\vec{u} \cdot \nabla \vec{b}\right) - \nu_n \vec k^{2n} \vec{\tilde b}, \\ + \vec k \cdot \vec{\tilde u} &= 0, \\ + \vec k \cdot \vec{\tilde b} &= 0, +\end{align} + +The pressure term can be expressed using the incompressibility condition and the Einstein sum convention +\begin{equation} + -\nabla P = -ik_\gamma\left( \delta_{\alpha \beta} - \frac{k_\alpha k_\beta}{k^2} \right) \left( \widetilde{u_\beta u_\gamma} - \widetilde{b_\beta b_\gamma} + \right) +i k_\beta \left( \widetilde{u_\alpha u_\beta } - \widetilde{b_\alpha b_\beta } \right) +\end{equation} +Using the Kronecker delta this leads to +\begin{align} + -ik_\gamma \delta_{\alpha \beta} \left( \widetilde{u_\beta u_\gamma} - \widetilde{b_\beta b_\gamma} \right) &= -ik_\gamma \left( \widetilde{u_\alpha u_\gamma} + - \widetilde{b_\alpha b_\gamma} \right) \nonumber \\ +&= -ik_\beta \left( \widetilde{u_\alpha u_\beta} - \widetilde{b_\alpha b_\beta} \right) +\end{align} +and finally +\begin{equation} + \widetilde{\nabla P} = -i \frac{k_\alpha k_\beta k_\gamma}{k^2} \left( \widetilde{u_\beta u_\gamma} - \widetilde{b_\beta b_\gamma} \right), +\end{equation} +and +\begin{equation} + \tilde P = - \frac{k_\beta k_\gamma}{k^2} \left( \widetilde{u_\beta u_\gamma} - \widetilde{b_\beta b_\gamma} \right) +\end{equation} +This is equivalent to the closure condition in real space +\begin{equation} + \Delta P = \nabla \vec b \otimes \nabla \vec b -\nabla \vec v \otimes \nabla \vec v. +\end{equation} +The other MHD equations in component description are then +\begin{align} + \pa{\tilde u_\alpha}{t} &= -ik_\gamma\left( \delta_{\alpha \beta} - \frac{k_\alpha k_\beta}{k^2} \right) \left( \widetilde{u_\beta u_\gamma} - + \widetilde{b_\beta b_\gamma} \right) - \nu k^2 \tilde u_\alpha \label{eq:k-raum_mhd-impuls} \\ + \pa{\tilde b_\alpha}{t} &= -ik_\beta \left( \widetilde{u_\beta b_\alpha} - \widetilde{b_\beta u_\alpha} \right)- \nu k^2 \tilde b_\alpha \label{eq:k-raum_mhd + -induktion}\\ +k_\alpha \tilde u_\alpha &= 0 \label{eq:k-raum_mhd-inkompressibel}\\ +k_\alpha \tilde b_\alpha &= 0, \label{eq:k-raum_mhd-Bmonopol} +\end{align} + +Since the incompressible MHD equations describe Alfv\'en waves it is helpful to introduce the Elsasser notation +das Gleichungssystem im Fourierraum. Unter Verwendung der Definitionen \ref{eq:defwpm} erhält man nach einigen +\begin{align} + \left(\partial_t - v_A k_z \right)\tilde w_\alpha^- &= \frac{i}{2} \frac{k_\alpha k_\beta k_\gamma}{k^2} \left(\widetilde{w_\beta^+ w_\gamma^-} + + \widetilde{w_\beta^- w_\gamma^+}\right) -ik_\beta \; \widetilde{w_\alpha^- w_\beta^+} - \frac{\nu}{2} k^{2n} \tilde w_\alpha^- \\ + \left(\partial_t + v_A k_z \right)\tilde w_\alpha^+ &= \frac{i}{2} \frac{k_\alpha k_\beta k_\gamma}{k^2} \left(\widetilde{w_\beta^+ w_\gamma^-} + + \widetilde{w_\beta^- w_\gamma^+}\right) -ik_\beta \; \widetilde{w_\alpha^+ w_\beta^-} - \frac{\nu}{2} k^{2n} \tilde w_\alpha^+ \\ + k_\alpha \tilde w_\alpha^\pm &= 0 +\end{align} +which describe forward and backward moving Alfv\'en waves. + +Using this notation now we notice that the over $\beta$ and $\gamma$ are independent from the $\alpha$ summation: +\begin{align} + \left(\partial_t - v_A k_z \right)\tilde w_\alpha^- &= i \frac{k_\alpha k_\beta k_\gamma}{k^2} \; \widetilde{w_\beta^+ w_\gamma^-} -ik_\beta \; + \widetilde{w_\alpha^- w_\beta^+} - \frac{\nu}{2} k^{2h} \tilde w_\alpha^- \label{eq:elsmhdfinal1} \\ + \left(\partial_t + v_A k_z \right)\tilde w_\alpha^+ &= i \frac{k_\alpha k_\beta k_\gamma}{k^2} \; \widetilde{w_\beta^+ w_\gamma^-} -ik_\beta \; + \widetilde{w_\alpha^+ w_\beta^-} - \frac{\nu}{2} k^{2h} \tilde w_\alpha^+ \\ + k_\alpha \tilde w_\alpha^\pm &= 0 \label{eq:elsmhdfinal3} +\end{align} + + -\chapter{Spectral methods} \chapter{Hybridcodes}