Skip to content

Commit

Permalink
Add 2D stability plot to text
Browse files Browse the repository at this point in the history
  • Loading branch information
danshapero committed Jun 29, 2023
1 parent 0d118c4 commit f1590bd
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

tensor-product-stokes.pdf: tensor-product-stokes.tex tensor-product-stokes.bib
cd demo/flow-around-cylinder && make cylinder_flow.pdf && cd ../../
cd demo/lbb-stability && make results-2d.pdf && cd ../../
pdflatex tensor-product-stokes.tex
bibtex tensor-product-stokes
pdflatex tensor-product-stokes.tex
Expand Down
14 changes: 6 additions & 8 deletions demo/lbb-stability/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
all: taylor-hood-2d.png taylor-hood-3d.png taylor-hood-3d-2layer.png

taylor-hood-2d.png: lbb-stability.py
python3 lbb-stability.py --dimension 2 --output $@
results-2d.pdf: results-2d.json make_plots.py
python make_plots.py --input $< --output $@

taylor-hood-3d.png: lbb-stability.py
python3 lbb-stability.py --dimension 3 --output $@

taylor-hood-3d-2layer.png: lbb-stability.py
python3 lbb-stability.py --dimension 3 --num-layers 2 --output $@
results-2d.json: lbb-stability.py
python lbb-stability.py --dimension 2 --element mini --output $@
python lbb-stability.py --dimension 2 --element taylor-hood --output $@
python lbb-stability.py --dimension 2 --element crouzeix-raviart --output $@
17 changes: 15 additions & 2 deletions tensor-product-stokes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,16 @@ \section{Demonstrations}

\subsection{Empirical confirmation of inf-sup stability}

Given a mesh of the spatial domain and a pair of discrete spaces $V^h$, $Q^h$, we can check empirically whether they satisfy the inf-sup condition by solving a generalized eigenvalue problem \citep{rognes2012automated}.
This empirical check is not a substitute for a formal proof of inf-sup stability, but rather serves as a ``smoke test'' that our numerical implementation and our proofs are not obviously wrong.
\begin{figure}
\begin{center}
\includegraphics[width=0.6\linewidth]{demo/lbb-stability/results-2d.pdf}
\end{center}
\caption{Empirical inf-sup constants for the three 2D element families on the unit square as the mesh is refined.
These elements are known to stable for the 2D Stokes problem.}
\label{fig:empirical-lbb-2d}
\end{figure}

Given a mesh of the spatial domain and a pair of discrete spaces $V^h$, $Q^h$, we can check empirically whether they satisfy the inf-sup condition by solving a generalized eigenvalue problem \citep{rognes2012automated}.
Let $M$ and $N$ be the Riesz representers for the canonical mapping from $V \to V^*$ and $Q \to Q^*$ respectively.
Consider the following eigenproblem: find velocity-pressure pairs $u$, $p$ and scalars $\lambda$ such that
\begin{align}
Expand All @@ -283,6 +290,12 @@ \subsection{Empirical confirmation of inf-sup stability}
\end{align}
The eigenvalues of this problem are all real and positive, and the square root of the smallest eigenvalue is equal to the inf-sup constant for $V^h$, $Q^h$ \citep{malkus1981eigenproblems}.
We can form this eigenproblem in Firedrake and then call out to the SLEPc package to solve it \citep{hernandez2005slepc}.
This empirical check is not a substitute for a formal proof of inf-sup stability, but rather serves as a ``smoke test'' that our numerical implementation and our proofs are not obviously wrong.

We performed the empirical inf-sup stability check using the unit square as our footprint domain, with a mesh spacing starting at 1/4 and going down to 1/32.
Figure \ref{fig:empirical-lbb-2d} shows the results for 2D elements which we know to be inf-sup stable.
\textcolor{red}{Do the 3D elements.}


\subsection{Lid-driven cavity flow}

Expand Down

0 comments on commit f1590bd

Please sign in to comment.