/** # Simulated Navier-Stokes trefoil The evolution of a trefoil vortex knot is simulated as in Kerr (2015). The goal of the physical space initialisation is to map an analytically defined trefoil vortex onto an Eulerian (static) numerical mesh. The trefoil trajectory discussed in here is defined by: $$ x = \sin{(t)} + 2 \sin{(2t)} $$ $$ y = \cos{(t)} - 2 \cos{(2t)} $$ $$ z = -3 \sin{(3t)} $$ where $t$ ranges between 0 and $2\pi$. For this example, we use the (compressible) Navier-Stokes equations inside a triple periodic box. ![Space-curve of a trefoil vortex relative to the domain size](trefoil/trefoil0.png) Which results in something like this ![The movie shows a $\lambda_2=0$ isosurface](trefoil/trefoil1.mp4) ![The movie shows a $\lambda_2=0$ isosurface on top of a slice of $\omega_z$](trefoil/trefoil3.mp4) */ #include "grid/octree.h" #include "navier-stokes/centered.h" #include "PointTriangle.h" #define MINLEVEL 4 int n_seg = 128; double as = 0.1; int main() { L0 = 16; X0 = Y0 = Z0 = -L0/2; DT = 0.01; N = 1<