\documentclass[12pt,a4paper]{uebungen} \usepackage{german} \usepackage[utf8]{inputenc} \usepackage{epsfig} \usepackage[amssymb]{SIunits} \usepackage{wrapfig} \usepackage{graphics} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsmath} \usepackage{url} \usepackage{pgf} \usepackage{listings} \lstset{language=[ANSI]C++,basicstyle=\ttfamily,commentstyle=\itshape, keywordstyle=\bfseries,extendedchars=true,backgroundcolor=\color{gray}} %------------------------------------------------------------------------------ %\graphicspath{{../../../GALLERY/}} %------------------------------------------------------------------------------ \setlength{\topmargin}{-2.5cm} \setlength{\textheight}{26.0cm} \setlength{\textwidth}{17cm} \setlength{\oddsidemargin}{-0.5cm} \setlength{\evensidemargin}{-0.5cm} \setlength{\parskip}{0pt} \setlength{\parindent}{0pt} \pagestyle{empty} %------------------------------------------------------------------------------ \newcommand{\vt}[1]{\vec{#1}} \newcommand{\mt}[1]{\underline{\underline{#1}}} \newcommand{\dt}[1]{\left\vert\underline{\underline{#1}}\right\vert} \newcommand{\mo}{\!\!\!\!\!-1} %------------------------------------------------------------------------------ \def\bbbr{{\rm I\!R}} %------------------------------------------------------------------------------ \begin{document} %------------------------------------------------------------------------------ \thispagestyle{myheadings} \begin{center} {\bf \underline{\Large Exercises in ``Numerical Methods in Plasma Astrophysics''}}\\ %\hfill\\ %{\bf \large }\\ \hfill\\ {\bf \large Winter 2022/23 \hfill Exercise 7}\\ \end{center} \noindent % \section*{\large Exercise 7: Incompressible Navier-Stokes equation}\vspace*{-0.0cm} % The motion of incompressible fluids is described by the Navier-Stokes equation \begin{align} \partial_t \vec{u} + \vec{u}\cdot\nabla\vec{u} &= \nu\Delta\vec{u}\\ \nabla\cdot\vec{u} &= 0 \end{align} Following the Helmholtz theorem $\vec u$ can be decomposed into a curl-free and divergence-free part. This leads to the vorticity stream formulation \begin{align} \vec \omega &= \nabla\times\vec u\\ \vec u &= \nabla \times \Psi\\ \Rightarrow \Delta \vec \Psi &= - \vec \omega \end{align} The advantage of this formulation is that $\vec u$ is automatically divergence-free. Additionally $\vec \Psi$ and $\vec \omega$ become pseudo-scalars for the 2D case. The Navier-Stokes equation in the vorticity-stream formulation in two dimensions is given by \begin{align} \partial_t \omega &= (\omega \nabla)\vec u + \nu \Delta \omega \end{align} This can be solved using a pseudospectral method \begin{align} \partial_t \tilde\omega &= \widetilde{(\omega \nabla)\vec u} + \nu \Delta \tilde\omega \end{align} The nonlinearity has to be solved in real space (which makes it a pseudospectral method). \bigskip \textbf{a)} Write a pseudospectral solver for the vorticity-stream formulation. $\omega$ and $\Psi$ are treated as pseudoscalars. The nonlinearity is calculated in realspace and then transformed to Fourier space. In order to avoid aliasing the upper two thirds of the spectrum should be zeroed. \textbf{b)} Perform simulations using the testcase $$\omega(x,y) = A\cdot\left(\exp\left[-\alpha((x-x_1)^2+(y-y_1)^2)\right] + \exp\left[-\alpha((x-x_2)^2+(y-y_2)^2)\right] \right) $$ %\textbf{c)} Calculate the conservation of $u$. \vfill Rubber ducks like swimming in incompressible fluids. \end{document} %------------------------------------------------------------------------------