Skip to content

Commit

Permalink
fix flowWithShocks example
Browse files Browse the repository at this point in the history
  • Loading branch information
phtournier committed Oct 2, 2024
1 parent dcd6327 commit 9a3058d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions source/tutorials/flowWithShocks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,21 @@ A Flow with Shocks
==================

Compressible Euler equations should be discretized with Finite Volumes or FEM with flux up-winding scheme but these are not implemented in **FreeFEM**.
Nevertheless acceptable results can be obtained with the method of characteristics provided that the mean values :math:`\displaystyle \bar f=\frac12\left(f^++f^-\right)` are used at shocks in the scheme, and finally mesh adaptation.
Nevertheless acceptable results can be obtained with the method of characteristics provided that the mean values :math:`\displaystyle \bar f=\frac12\left(f^++f^-\right)` are used at shocks in the scheme, and finally mesh adaptation. As an example, consider the simplified system:

.. math::
\begin{array}{rcl}
\partial_t\rho+\bar u\nabla\rho + \bar\rho\nabla\cdot u &=& 0\nonumber\\
\bar\rho( \partial_t u+\frac{\overline{\rho u}}{\bar\rho}\nabla u +\nabla p &=& 0\nonumber\\
\partial_t p + \bar u\nabla p +(\gamma-1)\bar p\nabla\cdot u &=& 0\\
\partial_t\rho+\bar u\nabla\rho + \nabla\cdot u &=& 0\nonumber\\
\partial_t u+ \bar u\nabla u +\nabla \rho &=& 0\nonumber\\
\end{array}
:label: euler
One possibility is to couple :math:`u,p` and then update :math:`\rho`, i.e.:

.. math::
\begin{array}{rcl}
\frac 1{(\gamma-1)\delta t\bar p^m} (p^{m+1}-p^m \circ X^m) + \nabla\cdot u^{m+1} &=& 0\nonumber\\
\frac{\bar\rho^m}{\delta t}(u^{m+1}-u^m \circ {\tilde X}^m ) +\nabla p^{m+1} &=& 0\nonumber\\
\rho^{m+1} = \rho^m \circ X^m + \frac{\bar\rho^m}{(\gamma-1)\bar p^m}(p^{m+1} &-& p^m \circ X^m)
\frac{1}{\delta t} (\rho^{m+1}-\rho^m \circ X^m) + \nabla\cdot u^{m+1} &=& 0\nonumber\\
\frac{1}{\delta t}(u^{m+1}-u^m \circ {\tilde X}^m ) +\nabla \rho^{m+1} &=& 0\nonumber\\
\end{array}
:label: eulalgo
Expand Down

0 comments on commit 9a3058d

Please sign in to comment.