diff --git a/examples/cfd/test_02_convection_nonlinear.ipynb b/examples/cfd/test_02_convection_nonlinear.ipynb index 5e0164e455..b4ab4e32bd 100644 --- a/examples/cfd/test_02_convection_nonlinear.ipynb +++ b/examples/cfd/test_02_convection_nonlinear.ipynb @@ -10,15 +10,19 @@ "\n", "The full set of coupled equations is now\n", "\n", - "$$\\frac{\\partial u}{\\partial t} + u \\frac{\\partial u}{\\partial x} + v \\frac{\\partial u}{\\partial y} = 0$$\n", - " \n", - "$$\\frac{\\partial v}{\\partial t} + u \\frac{\\partial v}{\\partial x} + v \\frac{\\partial v}{\\partial y} = 0$$\n", + "\\begin{aligned}\n", + "\\frac{\\partial u}{\\partial t} + u \\frac{\\partial u}{\\partial x} + v \\frac{\\partial u}{\\partial y} = 0 \\\\\n", + "\\\\\n", + "\\frac{\\partial v}{\\partial t} + u \\frac{\\partial v}{\\partial x} + v \\frac{\\partial v}{\\partial y} = 0\\\\\n", + "\\end{aligned}\n", "\n", "and rearranging the discretised version gives us an expression for the update of both variables\n", "\n", - "$$u_{i,j}^{n+1} = u_{i,j}^n - u_{i,j} \\frac{\\Delta t}{\\Delta x} (u_{i,j}^n-u_{i-1,j}^n) - v_{i,j}^n \\frac{\\Delta t}{\\Delta y} (u_{i,j}^n-u_{i,j-1}^n)$$\n", - " \n", - "$$v_{i,j}^{n+1} = v_{i,j}^n - u_{i,j} \\frac{\\Delta t}{\\Delta x} (v_{i,j}^n-v_{i-1,j}^n) - v_{i,j}^n \\frac{\\Delta t}{\\Delta y} (v_{i,j}^n-v_{i,j-1}^n)$$\n", + "\\begin{aligned}\n", + "u_{i,j}^{n+1} &= u_{i,j}^n - u_{i,j} \\frac{\\Delta t}{\\Delta x} (u_{i,j}^n-u_{i-1,j}^n) - v_{i,j}^n \\frac{\\Delta t}{\\Delta y} (u_{i,j}^n-u_{i,j-1}^n) \\\\\n", + "\\\\\n", + "v_{i,j}^{n+1} &= v_{i,j}^n - u_{i,j} \\frac{\\Delta t}{\\Delta x} (v_{i,j}^n-v_{i-1,j}^n) - v_{i,j}^n \\frac{\\Delta t}{\\Delta y} (v_{i,j}^n-v_{i,j-1}^n)\n", + "\\end{aligned}\n", "\n", "So, for starters we will re-create the original example run in pure NumPy array notation, before demonstrating \n", "the Devito version. Let's start again with some utilities and parameters:" diff --git a/examples/cfd/test_04_burgers.ipynb b/examples/cfd/test_04_burgers.ipynb index a584f9604d..ac0134f8b9 100644 --- a/examples/cfd/test_04_burgers.ipynb +++ b/examples/cfd/test_04_burgers.ipynb @@ -14,6 +14,7 @@ "$$ \\frac{\\partial v}{\\partial t} + u \\frac{\\partial v}{\\partial x} + v \\frac{\\partial v}{\\partial y} = \\nu \\; \\left(\\frac{\\partial ^2 v}{\\partial x^2} + \\frac{\\partial ^2 v}{\\partial y^2}\\right)$$\n", "\n", "The discretized and rearranged form then looks like this:\n", + "\n", "\\begin{aligned}\n", "u_{i,j}^{n+1} &= u_{i,j}^n - \\frac{\\Delta t}{\\Delta x} u_{i,j}^n (u_{i,j}^n - u_{i-1,j}^n) - \\frac{\\Delta t}{\\Delta y} v_{i,j}^n (u_{i,j}^n - u_{i,j-1}^n) \\\\\n", "&+ \\frac{\\nu \\Delta t}{\\Delta x^2}(u_{i+1,j}^n-2u_{i,j}^n+u_{i-1,j}^n) + \\frac{\\nu \\Delta t}{\\Delta y^2} (u_{i,j+1}^n - 2u_{i,j}^n + u_{i,j+1}^n)\n",