From: Wolfgang Bangerth Date: Mon, 18 Jul 2022 22:47:11 +0000 (-0600) Subject: Fix formula mark-up. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F103%2Fhead;p=code-gallery.git Fix formula mark-up. --- diff --git a/NavierStokes_TRBDF2_DG/README.md b/NavierStokes_TRBDF2_DG/README.md index fe99cfe..bddfb35 100644 --- a/NavierStokes_TRBDF2_DG/README.md +++ b/NavierStokes_TRBDF2_DG/README.md @@ -22,59 +22,47 @@ the same folder of the executable, following the same structure employed in step ### The Navier-Stokes equations and the time discretization strategy ### In this section, we briefly describe the problem and the approach employed. A detailed explanation of the numerical scheme is reported in [1]. We consider the classical unsteady incompressible Navier-Stokes equations, written in non-dimensional form as: -$$ -\begin{align*} +@f{align*}{ \frac{\partial \mathbf{u}}{\partial t} + \nabla\cdot\left(\mathbf{u} \otimes\mathbf{u}\right) + \nabla p &= \frac{1}{Re}\Delta\mathbf{u} + \mathbf{f} \\ \nabla\cdot\mathbf{u} = 0, -\end{align*} -$$ +@f} where $Re$ denotes the Reynolds number. In the case of projection methods, difficulties arise in choosing the boundary conditions to be imposed for the Poisson equation which is to be solved at each time step to compute the pressure. An alternative that allows to avoid or reduce some of these problems is the so-called artificial compressibility formulation. In this formulation, the incompressibility constraint is relaxed and a time evolution equation for the pressure is introduced, which is characterized by an artificial sound speed $c$, so as to obtain: -$$ -\begin{align*} +@f{align*}{ \frac{\partial\mathbf{u}}{\partial t} + \nabla\cdot\left(\mathbf{u}\otimes\mathbf{u}\right) + \nabla p &= \frac{1}{Re}\Delta\mathbf{u} + \mathbf{f} \\ \frac{1}{c^2}\frac{\partial p}{\partial t} + \nabla\cdot\mathbf{u} = 0. -\end{align*} -$$ +@f} For the sake of simplicity, we shall only consider $\mathbf{f} = \mathbf{0}$. The numerical scheme is an extension of the projection method introduced in [2] based on the TR-BDF2 method. For a generic time-dependent problem $\mathbf{u}' = \mathcal{N}(\mathbf{u})$, the TR-BDF2 method can be described in terms of two stages as follows: -$$ -\begin{align*} +@f{align*}{ \frac{\mathbf{u}^{n+\gamma} - \mathbf{u}^{n}}{\gamma\Delta t} &= \frac{1}{2}\mathcal{N}\left(\mathbf{u}^{n+\gamma}\right) + \frac{1}{2}\mathcal{N}\left(\mathbf{u}^{n}\right) \\ \frac{\mathbf{u}^{n+1} - \mathbf{u}^{n + \gamma}}{\left(1 - \gamma\right)\Delta t} &= \frac{1}{2 - \gamma}\mathcal{N}\left(\mathbf{u}^{n+1}\right) + \frac{1 - \gamma}{2\left(2 - \gamma\right)}\mathcal{N}\left(\mathbf{u}^{n+\gamma}\right) + \frac{1 - \gamma}{2\left(2 - \gamma\right)}\mathcal{N}\left(\mathbf{u}^{n}\right). -\end{align*} -$$ +@f} Following then the projection approach described in [2], the momentum predictor equation for the first stage reads: -$$ -\begin{align*} +@f{align*}{ &&\frac{\mathbf{u}^{n+\gamma,\ast} - \mathbf{u}^{n}}{\gamma\Delta t} - \frac{1}{2Re}\Delta\mathbf{u}^{n+\gamma,\ast} + \frac{1}{2}\nabla\cdot\left(\mathbf{u}^{n+\gamma,\ast}\otimes\mathbf{u}^{n+\frac{\gamma}{2}}\right) = \nonumber \\ &&\frac{1}{2Re}\Delta\mathbf{u}^{n} - \frac{1}{2}\nabla\cdot\left(\mathbf{u}^{n}\otimes\mathbf{u}^{n+\frac{\gamma}{2}}\right) - \nabla p^n \nonumber \\ &&\mathbf{u}^{n+\gamma,\ast}\rvert_{\partial\Omega} = \mathbf{u}_D^{n+\gamma}. \nonumber -\end{align*} -$$ +@f} Notice that, in order to avoid solving a nonlinear system at each time step, an approximation is introduced in the nonlinear momentum advection term, so that $\mathbf{u}^{n + \frac{\gamma}{2}}$ is defined by extrapolation as -$$ -\begin{align*} +@f{align*}{ \mathbf{u}^{n + \frac{\gamma}{2}} = \left(1 + \frac{\gamma}{2\left(1-\gamma\right)}\right)\mathbf{u}^{n} - \frac{\gamma}{2\left(1-\gamma\right)}\mathbf{u}^{n-1}. -\end{align*} -$$ +@f} For what concerns the pressure, we introduce the intermediate update $\mathbf{u}^{n+\gamma,\ast\ast} = \mathbf{u}^{n+\gamma,\ast} + \gamma\Delta t\nabla p^{n}$, and we solve the following Helmholtz equation -$$ -\begin{align*} +@f{align*}{ \frac{1}{c^2}\frac{p^{n+\gamma}}{\gamma^2\Delta t^2} -\Delta p^{n+\gamma} = - \frac{1}{\gamma\Delta t} \nabla\cdot\mathbf{u}^{n+\gamma,\ast\ast} + \frac{1}{c^2}\frac{p^{n }}{\gamma^2\Delta t^2} -\end{align*} -$$ +@f} and, finally, we set $\mathbf{u}^{n+\gamma} = \mathbf{u}^{n+\gamma,\ast\ast} - \gamma\Delta t\nabla p^{n+\gamma}$. The second stage of the TR-BDF2 scheme is performed in a similar manner (see [1] for all the details). @@ -83,9 +71,9 @@ The second stage of the TR-BDF2 scheme is performed in a similar manner (see [1] A matrix-free approach was employed like for step-37 or step-50. Another feature of the library which it is possible to employ during the numerical simulations is the mesh adaptation capability. On each element $K$ we define the quantity -$$ +@f[ \eta_K = \text{diam}(K)^2\left\|\nabla \times \mathbf{u}\right\|^2_K -$$ +@f] that acts as local refinement indicator. The preconditioned conjugate gradient method implemented in the function SolverCG was employed to solve the Helmholtz equations, whereas, for the momentum equations, the GMRES solver implemented in the function SolverGMRES was used.