Commit fa9b009d authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

LBM chapter - moved figures to better locations

parent b0b30d4b
Loading
Loading
Loading
Loading
Loading
+13 −13
Original line number Diff line number Diff line
@@ -176,18 +176,6 @@ The alternative, yet equivalent scheme can be formulated as:
This scheme is called the \emph{pull scheme}, since the streaming step propagates the values to the reference lattice site $\vec x \in \mathcal L_\Omega$ from its neighbors.
The visualization of the difference between the push and pull streaming schemes is illustrated in \cref{fig:lbm:AB push,fig:lbm:AB pull} for a D2Q9 velocity set.

Note that regardless of the chosen streaming scheme, the collision step is \emph{local} in terms of the lattice sites $\vec x \in \mathcal L_\Omega$ (i.e., collisions in different lattice sites are independent of each other), but collective for all $q \in \{1, \ldots, Q\}$ since the collision operator $\mathcal C_q$ depends on the whole set of discrete density distribution functions in given lattice site.
On the other hand, the operations in the streaming step are \emph{non-local}, but trivial as they do not require any computation (the post-collision values are merely transferred from one place to another).

Both the push and pull schemes require attention during the implementation to avoid overwriting memory locations containing values that may be needed in the future.
In the former scheme, the values of $f_q$ at $t + \Delta t$ cannot be pushed to the neighboring lattice sites overwriting the values at current time level $t$, because the neighboring nodes may be still unprocessed in this time step.
Similarly, after the collision step in the pull scheme, the values of $f_q^\ast$ cannot overwrite the values of $f_q$ in the reference lattice site, because those values may be pulled later when processing neighboring nodes in the same time step.
Hence, the classical implementation of LBM based on the push or pull scheme requires the use of two arrays for storing the state of the simulated system.
In each time step, an array A is used for input and array B is used for output, and while going to the next time step (i.e., from $t$ to $t + \Delta t$), the arrays A and B are swapped.
Hence, this approach is named the \emph{A-B pattern}.
The difference between the push and pull schemes is that while the arrays A and B in the push scheme contain the values of $f_q$ at two successive time levels, the arrays in the pull scheme contain the values of $f_q^\ast$.
However, this is not a problem since these values are not directly visualized, correct values are still used thanks to the placement of the streaming in the time step, and the relevant macroscopic quantities computed just before the collision step can be output for consistent visualization of the results.

\begin{figure}[tb]
    \centering
    \includegraphics[width=\textwidth]{figures/lbm/pattern_AB_push.pdf}
@@ -201,6 +189,18 @@ However, this is not a problem since these values are not directly visualized, c
    \label{fig:lbm:AB pull}
\end{figure}

Note that regardless of the chosen streaming scheme, the collision step is \emph{local} in terms of the lattice sites $\vec x \in \mathcal L_\Omega$ (i.e., collisions in different lattice sites are independent of each other), but collective for all $q \in \{1, \ldots, Q\}$ since the collision operator $\mathcal C_q$ depends on the whole set of discrete density distribution functions in given lattice site.
On the other hand, the operations in the streaming step are \emph{non-local}, but trivial as they do not require any computation (the post-collision values are merely transferred from one place to another).

Both the push and pull schemes require attention during the implementation to avoid overwriting memory locations containing values that may be needed in the future.
In the former scheme, the values of $f_q$ at $t + \Delta t$ cannot be pushed to the neighboring lattice sites overwriting the values at current time level $t$, because the neighboring nodes may be still unprocessed in this time step.
Similarly, after the collision step in the pull scheme, the values of $f_q^\ast$ cannot overwrite the values of $f_q$ in the reference lattice site, because those values may be pulled later when processing neighboring nodes in the same time step.
Hence, the classical implementation of LBM based on the push or pull scheme requires the use of two arrays for storing the state of the simulated system.
In each time step, an array A is used for input and array B is used for output, and while going to the next time step (i.e., from $t$ to $t + \Delta t$), the arrays A and B are swapped.
Hence, this approach is named the \emph{A-B pattern}.
The difference between the push and pull schemes is that while the arrays A and B in the push scheme contain the values of $f_q$ at two successive time levels, the arrays in the pull scheme contain the values of $f_q^\ast$.
However, this is not a problem since these values are not directly visualized, correct values are still used thanks to the placement of the streaming in the time step, and the relevant macroscopic quantities computed just before the collision step can be output for consistent visualization of the results.

\subsection{A-A pattern}

The \emph{A-A pattern} \cite{bailey:2009accelerating,wittmann:2013comparison} is an alternative approach which allows to perform the streaming step in-place using just one storage array $\texttt{A}$ for the density distribution functions.
@@ -263,7 +263,7 @@ The A-A pattern reduces memory requirements for LBM, but removes the freedom of
This causes problems when implementing certain types of boundary conditions, such as those based on extrapolation.
The author is not aware of any literature dealing with issues related to correct implementation of boundary conditions using the A-A pattern.

\begin{figure}[tb]
\begin{figure}[b]
    \centering
    \includegraphics[width=\textwidth]{figures/lbm/pattern_AA_even.pdf}
    \caption{Illustration of the \emph{A-A pattern} streaming scheme in the \emph{even iteration}.}