1D Euler Smooth#

This problem solves the 1D conservative Euler equations

\[\begin{split}\frac{\partial }{\partial t} \begin{bmatrix}\rho \\ \rho u\\ \rho E \end{bmatrix} + \frac{\partial }{\partial x} \begin{bmatrix}\rho u \\ \rho u^2 +p\\ u(E+p) \end{bmatrix} = 0\end{split}\]

where the pressure \(p\) is related to the conserved quantities through the equation of the state

\[p=(\gamma -1)(\rho E-\frac{1}{2}\rho u^2)\]
  • Initial conditions in primitive variables:

    • \(\rho(x, 0) = 1 + 0.2 \sin(\pi x)\)

    • \(u(x,0) = 1\)

    • \(p(x,0) = 1\)

    • These are used to create the initial conditions in conservative variables.

  • By default, \(\gamma = 1.4\)

  • Domain is \([-1,1]\) with periodic BC

  • Analytical density as function of time \(t\) is given as \(\rho(t) = 1 + 0.2\sin(\pi (x-t))\)

  • Typically, integration is performed over \(t \in (0, 2)\)

  • The problem is adapted from this paper

Mesh#

python3 pressio-demoapps/meshing_scripts/create_full_mesh_for.py \
       --problem euler1dsmooth_s<stencilSize> -n <N> --outDir <destination-path>

where

  • N is the number of cells you want

  • <stencilSize> = 3 or 5 or 7: defines the neighboring connectivity of each cell

  • <destination-path>: full path to where you want the mesh files to be generated. The script creates the directory if it does not exist.

Important

When you set the <stencilSize>, keep in mind the following constraints (more on this below):

  • InviscidFluxReconstruction::FirstOrder requires <stencilSize> >= 3

  • InviscidFluxReconstruction::Weno3 requires <stencilSize> >= 5

  • InviscidFluxReconstruction::Weno5 requires <stencilSize> >= 7

C++ synopsis#

 #include "pressiodemoapps/euler1d.hpp"

 int main(){
   namespace pda = pressiodemoapps;

   const auto meshObj = pda::load_cellcentered_uniform_mesh_eigen("path-to-mesh");

   const auto probId = pda::Euler1d::PeriodicSmooth;
   const auto scheme = pda::InviscidFluxReconstruction::FirstOrder; //or Weno3, Weno5
   auto problem      = pda::create_problem_eigen(meshObj, probId, scheme);
}

Python synopsis#

import pressiodemoapps as pda

meshObj = pda.load_cellcentered_uniform_mesh("path-to-mesh")

probId  = pda.Euler1d.PeriodicSmooth
scheme  = pda.InviscidFluxReconstruction.FirstOrder # or Weno3, Weno5
problem = pda.create_problem(meshObj, probId, scheme)