|
Peano
|
New exercise, new equation! This time we will be simulating the euler equations, which approximate the flow of non-viscous fluids, but do take into account pressure differentials. In two dimensions, these take following form:
\(\begin{equation*} \label{Euler_equation} \frac{\partial}{\partial t}\left( \begin{array}{lr} \rho \\ \rho u_1 \\ \rho u_2 \\ E_t \end{array} \right) + \nabla \begin{pmatrix} \rho u_1 & \rho u_2\\ \rho u_1^2 + p & \rho u_1 u_2 \\ \rho u_2 u_1 & \rho u_2^2 + p \\ (E_t + p) u_1 & (E_t + p) u_2 \end{pmatrix} = \vec{0} \end{equation*} \)
The eigenvalues of the 2 dimensional euler equation are:
\(\begin{equation*} \left( \begin{array}{lr} \lambda_1 \\ \lambda_2 \\ \lambda_3 \end{array} \right) = \left( \begin{array}{lr} u - c \\ u \\ u + c \end{array} \right) \end{equation*} \)
We've also made use of two variables, the speed of sound in a medium c is defined as: \(\begin{equation} c = \sqrt{\frac{\gamma p}{\rho} } \end{equation} \)
And the pressure p can, for an ideal gas, be computed as: \(\begin{equation} p = (\gamma - 1) (E - \frac{\rho}{2} (u_1^2 + u_2^2) ) \end{equation} \) (Hint: this uses velocities u, not the momenta in either direction as the equation does)
Finally, \( \gamma \) is the ratio of specific heats, which here we choose as 1.4, corresponding to that of dry air at room temperature.
We have not provided you with a configuration file, so you will need to make your own. However since the Euler equations and the scenario we will attempt next are somewhat more unstable than the previous two (and also just to show of the features of ExaHyPE 2) we will use a different solver. This time, we will use a Finite Volumes solver. This can be created in the configuration as follows:
my_solver = exahype2.solvers.fv.godunov.GlobalAdaptiveTimeStep(
name = "EulerSolver",
patch_size = 22,
min_volume_h = min_h,
max_volume_h = max_h,
time_step_relaxation = 0.5,
unknowns = unknowns,
auxiliary_variables = auxiliary_variables
)
This configuration is similar to that of the ADER-DG solver, obviously. The only parameter that we haven't encountered so far is patch_size, this controls the number of finite volumes which should be assembled together as one patch, i.e. which are solved at the same time. Here 22 means that there are 22 volumes per spatial dimension, so for a 2D problem this is 22x22=484 cells per patch.
The initial conditions should look like this:
If you are stuck, you can look at the solutions over at: