One dimensional Compressible Euler Equations solved with moving mesh approach described in the PhD thesis
A moving mesh finite element method for the numerical solution of partial differential equations and systems.
which can be found here.
The Compressible Euler equations are described by the non-linear system of partial differential equations
ρ_t + (ρu)_x = 0
(ρu)_t + (ρu^2 + P)_x = 0
E_t + (u(E+P))_x = 0
where ρ
, u
, P
and E
are the density, velocity, pressure and energy of the gas being modelled. The equation state for an ideal gas is used which is given by
E=P/(1-γ) + 0.5ρv^2
where γ
is the ratio of specific heats for the gas.
The one-dimensional Euler Equations are solved using a moving mesh
method which uses the monitor function M=u(x,t)
in the moving mesh
equations for the mesh velocity. The mesh is advanced forwards in time
using a forward Euler time-stepping scheme. The solution to the Euler
equations are obtained by solving the Arbitrary Lagrangian Eulerian (ALE)
formation of the equations with a finite volume method. All the moving mesh
equations are solved using linear finite elements.
Developing locally requires Docker for Windows. Run the command
docker build -t 1deuler .
to build the docker image which pulls the gcc base image containing gfortran and maps the source code into the container.
Then run image with the command:
docker run -i -t -v /f/git/src/github.com/bvwells/1deuler:/app 1deuler
This command maps the local workspace into the running image so any changes made in the running image will be reflected on the local workspace.
Within the running image generate the make files for the release version by running the command:
cmake .
To build the debug version of the code run the command:
cmake -DCMAKE_BUILD_TYPE=Debug
Build the executable by running the command:
make
The program takes the file variables.data as input to the simulation. The program can be run from the base of the repo with the command:
./bin/1deuler.exe
The program outputs the mesh and solution over time into the files SolutionXXX.m
. The variables for the solution are written to the file variables.m
.
The output from the simulation can be plotted in Octave by running the plotting file plot_solution.m in the root of the repo.