Skip to content

Commit 9a3058d

Browse files
committed
fix flowWithShocks example
1 parent dcd6327 commit 9a3058d

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

source/tutorials/flowWithShocks.rst

+5-7
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,21 @@ A Flow with Shocks
22
==================
33

44
Compressible Euler equations should be discretized with Finite Volumes or FEM with flux up-winding scheme but these are not implemented in **FreeFEM**.
5-
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.
5+
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:
66

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

1716
.. math::
1817
\begin{array}{rcl}
19-
\frac 1{(\gamma-1)\delta t\bar p^m} (p^{m+1}-p^m \circ X^m) + \nabla\cdot u^{m+1} &=& 0\nonumber\\
20-
\frac{\bar\rho^m}{\delta t}(u^{m+1}-u^m \circ {\tilde X}^m ) +\nabla p^{m+1} &=& 0\nonumber\\
21-
\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)
18+
\frac{1}{\delta t} (\rho^{m+1}-\rho^m \circ X^m) + \nabla\cdot u^{m+1} &=& 0\nonumber\\
19+
\frac{1}{\delta t}(u^{m+1}-u^m \circ {\tilde X}^m ) +\nabla \rho^{m+1} &=& 0\nonumber\\
2220
\end{array}
2321
:label: eulalgo
2422

0 commit comments

Comments
 (0)