From 5693bd2d20e24201ff15e84f721220e939c75bf9 Mon Sep 17 00:00:00 2001 From: Henrik Kjedsberg Date: Wed, 8 Nov 2023 22:13:54 +0100 Subject: [PATCH] Remove unnecesary align and use X instead of chi for ALE coordinates --- docs/_config.yml | 2 ++ docs/getting_started.md | 1 - docs/index.md | 4 ++-- docs/movingcylinder.md | 13 ++----------- docs/movingtg.md | 26 ++++++++++---------------- docs/movingvortex.md | 17 +++++------------ docs/movingwall.md | 3 --- docs/parameters.md | 9 +++------ docs/restart.md | 2 +- docs/stenosis.md | 10 ++++------ 10 files changed, 29 insertions(+), 58 deletions(-) diff --git a/docs/_config.yml b/docs/_config.yml index 5156943..bd348d5 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -17,6 +17,7 @@ execute: # Define the name of the latex output file for PDF builds latex: + latex_engine: xelatex latex_documents: targetname: book.tex @@ -39,6 +40,7 @@ sphinx: config: html_last_updated_fmt: "%b %d, %Y" suppress_warnings: [ "mystnb.unknown_mime_type" ] + mathjax_path: https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js launch_buttons: notebook_interface: "jupyterlab" diff --git a/docs/getting_started.md b/docs/getting_started.md index a9c4061..dfb039d 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -37,7 +37,6 @@ When loading a problem file, OasisMove will start by looking inside the `problem look in the current working directory. If the problem you have specified after `problem=` is not located in either locations, an error will occur. ``` -## References ```{bibliography} references.bib :filter: docname in docnames diff --git a/docs/index.md b/docs/index.md index c6472a4..0d63b72 100644 --- a/docs/index.md +++ b/docs/index.md @@ -3,9 +3,9 @@ [OasisMove](https://github.com/KVSlab/OasisMove) is a high-level/high-performance open-source Navier-Stokes solver written in Python/[FEniCS](https://fenicsproject.org/), and is an extension of the computational fluid dynamics (CFD) solver [Oasis](https://github.com/mikaem/Oasis). In OasisMove the Navier-Stokes equations are expressed in the arbitrary -Lagrangian-Eulerian formulation, which is suitable for handling moving domains. Through verification the solver has +Lagrangian-Eulerian (ALE) formulation, which is suitable for handling moving domains. Through verification the solver has shown to follow theoretical convergence rates, begin second order accurate in time, and second and third order accurate -in space with P1/P1 and P2/P1 finite elements. Through validation the solver has showed good agreement with existing +in space with $\mathbb{P_1}/\mathbb{P_1}$ and $\mathbb{P_2}/\mathbb{P_1}$ finite elements. Through validation the solver has showed good agreement with existing benchmark results, and demonstrates the ability of the solver to capture vortex patterns in transitional and turbulent-like flow regimes. diff --git a/docs/movingcylinder.md b/docs/movingcylinder.md index 765f99d..c5ea34e 100644 --- a/docs/movingcylinder.md +++ b/docs/movingcylinder.md @@ -36,18 +36,14 @@ frequency of the oscillations are defined as: ```{math} :label: eq-freq -\begin{align} -f = \frac{St U_{\infty}F}{D}. -\end{align} + f = \frac{St U_{\infty}F}{D}. ``` Furthermore, the cylinder position followed a sinusoidal profile in the transverse direction to the flow: ```{math} :label: eq-sine -\begin{align} - \mathbf x(\mathbf \chi, t) = (0, A \sin (2 \pi f t )), -\end{align} + \mathbf x( \mathbf X, t) = (0, A \sin (2 \pi f t )), ``` where $A = A_{ratio}D$ is the amplitude. @@ -78,9 +74,7 @@ $C_L$) coefficient defined as: ```{math} :label: eq-force -\begin{align} C_D = \frac{2 F_D}{\rho U_\infty^2 D}, \qquad C_L = \frac{2F_L}{\rho U_\infty^2 D}, -\end{align} ``` stored in the `forces.txt` file. In {numref}`vel-cylinder` we display the resulting velocity field, where we have added @@ -127,12 +121,9 @@ Reynolds number by definition: ```{math} :label: eq-re -\begin{align} \text{Re } = \frac{U_{\infty} D}{\nu} -\end{align} ``` -## References ```{bibliography} references.bib :filter: docname in docnames diff --git a/docs/movingtg.md b/docs/movingtg.md index 6564e61..940a0cc 100644 --- a/docs/movingtg.md +++ b/docs/movingtg.md @@ -17,13 +17,11 @@ absence of body forces, $\mathbf{f} = 0$, namely: ```{math} :label: eq-tg3d -\begin{align} - \mathbf u(\mathbf x,t = 0) &= (u(\mathbf x),v(\mathbf x),w(\mathbf x)\\ + \mathbf u(\mathbf x,t = 0) &= (u(\mathbf x),v(\mathbf x),w(\mathbf x))\\ u(\mathbf x) &= + \sin(x) \cos(y) \cos(z) \\ v(\mathbf x) &= -\cos(x) \sin(y) \cos(z) \\ w(\mathbf x) &= 0 \\ p(\mathbf x,t=0) &= \frac{1}{16}(\cos(2x) + \cos(2y)) (\cos(2z) + 2). -\end{align} ``` The domain boundaries are prescribed a movement described by the following mesh motion from Fehn et al. @@ -31,20 +29,18 @@ The domain boundaries are prescribed a movement described by the following mesh ```{math} :label: eq-tg3d-d - \begin{align} - \mathbf x(\mathbf \chi,t) &= \mathbf \chi + A_0 \sin \left(\frac{2 \pi t}{T_G}\right) + \mathbf x(\mathbf X,t) &= \mathbf X + A_0 \sin \left(\frac{2 \pi t}{T_G}\right) \begin{pmatrix} - \sin \left(2\pi \frac{\chi_2 + L / 2}{L}\right) \sin\left(2\pi \frac{\chi_3 + L / 2}{L}\right) \\ - \sin\left(2\pi \frac{\chi_1 + L / 2}{L}\right) \sin\left(2\pi \frac{\chi_3 + L / 2}{L}\right) \\ - \sin\left(2\pi \frac{\chi_1 + L / 2}{L}\right) \sin\left(2\pi \frac{\chi_2 + L / 2}{L}\right) + \sin \left(2\pi \frac{X_2 + L / 2}{L}\right) \sin\left(2\pi \frac{X_3 + L / 2}{L}\right) \\ + \sin\left(2\pi \frac{X_1 + L / 2}{L}\right) \sin\left(2\pi \frac{X_3 + L / 2}{L}\right) \\ + \sin\left(2\pi \frac{X_1 + L / 2}{L}\right) \sin\left(2\pi \frac{X_2 + L / 2}{L}\right) \end{pmatrix}\\ - \mathbf w (\mathbf \chi, t) &= \frac{\partial \mathbf x}{\partial t} -\end{align} + \mathbf w (\mathbf X, t) &= \frac{\partial \mathbf x}{\partial t} ``` -where $\mathbf \chi = (\chi_1, \chi_2)$ are the ALE coordinates, $A_0=\pi / 6$ is the amplitude, and $T_G=20$ is the -period. Further parameters include the total simulation time $T$, and $L=1$ describing the height, width, and depth of -the box mesh. By default, the Reynolds number is set to Re = $1/\nu=1600$. +where $\mathbf X = (X_1, X_2, X_3)$ are the ALE coordinates, $A_0=\pi / 6$ is the amplitude, and $T_G=20$ is the period. +Further parameters include the total simulation time $T$, and $L=1$ describing the height, width, and depth of the box +mesh. By default, the Reynolds number is set to $\text{Re} = 1/\nu = 1600$. ## (HPC) Simulation in OasisMove @@ -87,7 +83,7 @@ resolution parameters $N_x=32$, $N_y=32$, and $N_z=32$. In contrast to the 2D [m the number of tetrahedral cells are now computed using the following formula: ```{math} -\text{Number of tetrahedral cells } = 6\times N_x \times N_y \times N_z, + \text{Number of tetrahedral cells } = 6\times N_x \times N_y \times N_z, ``` resulting in a total of 196 608 cells using the default parameters. To increase the mesh resolution, we can supply these @@ -98,8 +94,6 @@ we can run the following command: $ oasismove NSfracStepMove problem=MovingTaylorGreen3D Nx=50 Ny=50 Nz=50 ``` -## References - ```{bibliography} references.bib :filter: docname in docnames ``` diff --git a/docs/movingvortex.md b/docs/movingvortex.md index e1ae879..d1b2438 100644 --- a/docs/movingvortex.md +++ b/docs/movingvortex.md @@ -14,10 +14,8 @@ body forces, $\mathbf{f} = 0$, namely: ```{math} :label: eq-vortex -\begin{align} \mathbf u(\mathbf x,t) &= (-\sin (2\pi x_2), \sin(2\pi x_1))e^{-4\nu \pi^2 t}\\ p(\mathbf x,t) &= -\cos(2\pi x_1)\cos(2\pi x_2)e^{-8\nu \pi^2 t} -\end{align} ``` where $\mathbf x = (x_1, x_2)$ are the Euclidean coordinates, and $\nu = 0.025$ $\text{m}^2$/s. Furthermore, the mesh @@ -25,13 +23,11 @@ velocity $\mathbf w$ is determined by the following displacement field: ```{math} :label: eq-vortex-d - \begin{align} - \mathbf x(\mathbf \chi,t) &= \mathbf \chi + A_0 \sin \left(\frac{2 \pi t}{T_G}\right) \left(\sin\left(2\pi \frac{\chi_2 + L / 2}{L}\right),\sin\left(2\pi \frac{\chi_1 + L / 2}{L}\right)\right)\\ - \mathbf w (\mathbf \chi, t) &= \frac{\partial \mathbf x}{\partial t} - \end{align} + \mathbf x(\mathbf X , t) &= \chi + A_0 \sin \left(\frac{2 \pi t}{T_G}\right) \left(\sin\left(2\pi \frac{\chi_2 + L / 2}{L}\right),\sin\left(2\pi \frac{\chi_1 + L / 2}{L}\right)\right)\\ + \mathbf w(\mathbf X , t) &= \frac{\partial \mathbf x}{\partial t} ``` -where $\mathbf \chi = (\chi_1, \chi_2)$ are the ALE coordinates, $A_0=0.08$ is the amplitude, $T_G=4T$ is the period +where $\mathbf X= (X_1, X_2)$ are the ALE coordinates, $A_0=0.08$ is the amplitude, $T_G=4T$ is the period length of the mesh motion, $T$ is the length of one cycle, and $L=1$. ## Simulation in OasisMove @@ -84,15 +80,12 @@ $ oasismove NSfracStepMove problem=MovingVortex T=1 dt=0.001 When adjusting spatial and temporal resolution is important to know relationship between the cell size and the time-step size, which are closely related through the Courant number ($C$) given by the Courant-Friedrichs-Lewy (CFL) condition: $$ -\begin{align} -C ={\frac {u\,\Delta t}{\Delta x}} < C_{\max }, -\end{align} -$$ + C ={\frac {u\,\Delta t}{\Delta x}} < C_{\max }, +$$ (eq:cfl-vortex) where $u$ is the velocity magnitude, $\Delta t$ is the time step size, and $\Delta x$ is the length interval. The general consensus is that $C_{\max} = 1$. ``` -## References ```{bibliography} references.bib :filter: docname in docnames diff --git a/docs/movingwall.md b/docs/movingwall.md index 793a9eb..74a9baa 100644 --- a/docs/movingwall.md +++ b/docs/movingwall.md @@ -15,9 +15,7 @@ which remains parallel to the x-axis, defined as: ```{math} :label: eq-wall-height -\begin{equation} h(t) = h_0 (1 + \epsilon e^{-i\omega t}), -\end{equation} ``` where $\omega$ is the pulsation of the movement, $h_0$ is the mean distance between the symmetry axis $(y = 0)$ and the @@ -56,7 +54,6 @@ name: vel-wall On top, the grid displacement, and on the bottom, the velocity field for the wall-driven channel flow, where the vector arrows have been scaled by the velocity magnitude. ``` -## References ```{bibliography} references.bib :filter: docname in docnames diff --git a/docs/parameters.md b/docs/parameters.md index 7413d46..8d12a05 100644 --- a/docs/parameters.md +++ b/docs/parameters.md @@ -58,15 +58,12 @@ Ny = 50 By adjusting `Nx` and `Ny` we adjust the resolution of the computational domain, which for the `DrivenCavity` problem is a 2D unit square mesh consisting of triangular elements. The parameters `Nx` and `Ny` determine the number of uniform cell intervals in the $x$ and $y$ direction, respectively. These parameters can also be used to compute the totan number -of triangular cells (in 2D) or tetrehedral cells (in 3D) the computational domain consists of: +of triangular cells in 2D: or tetrehedral cells (in 3D) the computational domain consists of: ```{math} -\begin{align} - \text{Number of cells (2D) } &= 2 \times N_x \times N_y \\[0.5em] - \text{Number of cells (3D) } &= 6 \times N_x \times N_y \times N_z -\end{align} + \text{Number of cells (2D) } &= 2 \times N_x \times N_y \\ + \text{Number of cells (3D) } &= 6 \times N_x \times N_y \times N_z ``` - ### `Fluid` parameters Fluid parameters are related to the fluid properties. In regard to the `DrivenCavity` diff --git a/docs/restart.md b/docs/restart.md index 0da1126..3f1d1a2 100644 --- a/docs/restart.md +++ b/docs/restart.md @@ -36,7 +36,7 @@ the `Checkpoint` folder: $ oasismove NSfracStep solver=IPCS_ABCN problem=DrivenCavity restart_folder=results_driven_cavity/data/1/Checkpoint ``` -The simulation should now restart at the latest checkpoint, and continue as normal until $T=10. +The simulation should now restart at the latest checkpoint, and continue as normal until $T=10$. ### Restarting a finished simulation diff --git a/docs/stenosis.md b/docs/stenosis.md index 5ee02d4..cb250b6 100644 --- a/docs/stenosis.md +++ b/docs/stenosis.md @@ -14,7 +14,7 @@ implementation of backflow stabilization is general, and works for both rigid an name: stenosis-fig --- A schematic of the two-dimensional stenosis model with a slight eccentricity of the stenosis, borrowed from -Varghese et al. {cite}`varghese2007direct`. +Varghese et al. ``` ## Problem description @@ -46,14 +46,14 @@ rather common in cardiovascular flows, particularly in blood flow in large vesse left atrium. Because backflow is a naturally occurring physiologic phenomenon, careful treatment is necessary to realistically model backflow without artificially altering the local flow dynamics. To achieve this we consider the first backflow stabilization method first proposed by Bazilevs et al. {cite}`bazilevs2009patient` and rigorously tested -by Moghadam et al. {cite}`esmaily2011comparison`. In short, the method modifies the weak formulation of the +by Moghadam et al. In short, the method modifies the weak formulation of the Navier-Stokes equations by adding a backflow stabilization term for the Neumann boundaries, in this case the outlet. Specifically, the following convective traction term is added to the weak form on each Neumann boundary to be stabilized: ```{math} :label: eq-weak --\beta \int_{\partial \Omega} (\mathbf u \cdot \mathbf n)\_\mathbf u \cdot \mathbf v \, \text{d}s, + -\beta \int_{\partial \Omega} (\mathbf u \cdot \mathbf n)\_\mathbf u \cdot \mathbf v \, \text{d}s, ``` where $\beta$ is a positive coefficient between 0.0 and 1.0, $\mathbf u$ is the velocity vector, $\mathbf v$ is the @@ -61,7 +61,7 @@ velocity test function, $\partial \Omega$ denotes the boundary, and $(\mathbf u ```{math} :label: eq-weak2 -(\mathbf u \cdot \mathbf n)\_ \,=\, \frac{\mathbf u\cdot \mathbf n - \| \mathbf u \cdot \mathbf n\|} {2}. + (\mathbf u \cdot \mathbf n)\_ \,=\, \frac{\mathbf u\cdot \mathbf n - \| \mathbf u \cdot \mathbf n\|}{2}. ``` In OasisMove, the backflow stabilization method is applied by supplying the @@ -120,8 +120,6 @@ The velocity field for the stenosis problem without (top) and with (bottom) back arrows that have been scaled by the velocity magnitude. ``` -## References - ```{bibliography} references.bib :filter: docname in docnames ```