From bfd8ef10da629be2180034b3876e8fcfab157f09 Mon Sep 17 00:00:00 2001 From: NT Date: Wed, 4 May 2022 13:00:23 +0200 Subject: [PATCH] fixed Delta t typo in NS equations --- diffphys-code-ns.ipynb | 2 +- make-pdf.sh | 2 +- overview-equations.md | 18 +++++++----------- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/diffphys-code-ns.ipynb b/diffphys-code-ns.ipynb index de306f0..879b1af 100644 --- a/diffphys-code-ns.ipynb +++ b/diffphys-code-ns.ipynb @@ -12,7 +12,7 @@ "\n", "## Physical Model\n", "\n", - "We'll use a Navier-Stokes model with velocity $\\mathbf{u}$, no explicit viscosity term, and a smoke marker density $s$ that drives a simple Boussinesq buoyancy term $\\eta d$ adding a force along the y dimension. For the velocity this gives:\n", + "We'll use an inviscid Navier-Stokes model with velocity $\\mathbf{u}$, no explicit viscosity term, and a smoke marker density $s$ that drives a simple Boussinesq buoyancy term $\\eta d$ adding a force along the y dimension. Due to a lack of an explicit viscosity, the equations are equivalent to the Euler equations. This gives:\n", "\n", "$$\\begin{aligned}\n", " \\frac{\\partial u_x}{\\partial{t}} + \\mathbf{u} \\cdot \\nabla u_x &= - \\frac{1}{\\rho} \\nabla p \n", diff --git a/make-pdf.sh b/make-pdf.sh index 5a3daca..2c6aeae 100755 --- a/make-pdf.sh +++ b/make-pdf.sh @@ -3,7 +3,7 @@ # note this script assumes the following paths/versions: python3.7 , /Users/thuerey/Library/Python/3.7/bin/jupyter-book # do clean git checkout for changes from json-cleanup-for-pdf.py via: -# git checkout diffphys-code-burgers.ipynb diffphys-code-ns.ipynb diffphys-code-sol.ipynb physicalloss-code.ipynb bayesian-code.ipynb supervised-airfoils.ipynb reinflearn-code.ipynb +# git checkout diffphys-code-burgers.ipynb diffphys-code-ns.ipynb diffphys-code-sol.ipynb physicalloss-code.ipynb bayesian-code.ipynb supervised-airfoils.ipynb reinflearn-code.ipynb physgrad-code.ipynb physgrad-comparison.ipynb physgrad-hig-code.ipynb echo echo WARNING - still requires one manual quit of first pdf/latex pass, use shift-x to quit diff --git a/overview-equations.md b/overview-equations.md index 044bffe..4500a48 100644 --- a/overview-equations.md +++ b/overview-equations.md @@ -187,19 +187,15 @@ In 2D, the Navier-Stokes equations without any external forces can be written as $$\begin{aligned} \frac{\partial u_x}{\partial{t}} + \mathbf{u} \cdot \nabla u_x &= - - \frac{\Delta t}{\rho}\nabla{p} + \nu \nabla\cdot \nabla u_x + - \frac{1}{\rho}\nabla{p} + \nu \nabla\cdot \nabla u_x \\ \frac{\partial u_y}{\partial{t}} + \mathbf{u} \cdot \nabla u_y &= - - \frac{\Delta t}{\rho}\nabla{p} + \nu \nabla\cdot \nabla u_y + - \frac{1}{\rho}\nabla{p} + \nu \nabla\cdot \nabla u_y \\ \text{subject to} \quad \nabla \cdot \mathbf{u} &= 0 \end{aligned}$$ (model-ns2d) where, like before, $\nu$ denotes a diffusion constant for viscosity. -In practice, the $\Delta t$ factor for the pressure term can be often simplified to -$1/\rho$ as it simply yields a scaling of the pressure gradient used to make -the velocity divergence free. We'll typically use this simplification later on -in implementations, effectively computing an instantaneous pressure. An interesting variant is obtained by including the [Boussinesq approximation](https://en.wikipedia.org/wiki/Boussinesq_approximation_(buoyancy)) @@ -208,9 +204,9 @@ With a marker field $v$ that indicates regions of high temperature, it yields the following set of equations: $$\begin{aligned} - \frac{\partial u_x}{\partial{t}} + \mathbf{u} \cdot \nabla u_x &= - \frac{\Delta t}{\rho} \nabla p + \frac{\partial u_x}{\partial{t}} + \mathbf{u} \cdot \nabla u_x &= - \frac{1}{\rho} \nabla p \\ - \frac{\partial u_y}{\partial{t}} + \mathbf{u} \cdot \nabla u_y &= - \frac{\Delta t}{\rho} \nabla p + \xi v + \frac{\partial u_y}{\partial{t}} + \mathbf{u} \cdot \nabla u_y &= - \frac{1}{\rho} \nabla p + \xi v \\ \text{subject to} \quad \nabla \cdot \mathbf{u} &= 0, \\ @@ -223,11 +219,11 @@ And finally, the Navier-Stokes model in 3D give the following set of equations: $$ \begin{aligned} - \frac{\partial u_x}{\partial{t}} + \mathbf{u} \cdot \nabla u_x &= - \frac{\Delta t}{\rho} \nabla p + \nu \nabla\cdot \nabla u_x + \frac{\partial u_x}{\partial{t}} + \mathbf{u} \cdot \nabla u_x &= - \frac{1}{\rho} \nabla p + \nu \nabla\cdot \nabla u_x \\ - \frac{\partial u_y}{\partial{t}} + \mathbf{u} \cdot \nabla u_y &= - \frac{\Delta t}{\rho} \nabla p + \nu \nabla\cdot \nabla u_y + \frac{\partial u_y}{\partial{t}} + \mathbf{u} \cdot \nabla u_y &= - \frac{1}{\rho} \nabla p + \nu \nabla\cdot \nabla u_y \\ - \frac{\partial u_z}{\partial{t}} + \mathbf{u} \cdot \nabla u_z &= - \frac{\Delta t}{\rho} \nabla p + \nu \nabla\cdot \nabla u_z + \frac{\partial u_z}{\partial{t}} + \mathbf{u} \cdot \nabla u_z &= - \frac{1}{\rho} \nabla p + \nu \nabla\cdot \nabla u_z \\ \text{subject to} \quad \nabla \cdot \mathbf{u} &= 0. \end{aligned}