Welcome to the code repository for the doctoral thesis A Finite Element Method for Phase Transitions in Rarefied Gas Dynamics by D. Weniger. This repository contains all the necessary files to recompute and adjust the problems presented in the thesis.
The code is based on FEniCSx (dolfinx v0.10.0-r1).
In the thesis, we present several cases that can be found here using the provided benchmark files. These files are named benchmark_<NAME>.py. Simply run the provided scripts to generate the results. Information is printed in a logfile meshing.log and the output is given as .vtk files in corresponding folders. To view the files, we recommend paraview. Simply open the .pvd - files in paraview in the created folder and you can investigate the whole time series.
- We provide a docker container based on the official dolfinx docker container with all required dependencies. Install docker on your system and run
docker run -ti ghcr.io/do-wen/fem_for_phase_transitions:latest
- Then navigate to
/home/fem_for_phase_transitions/for the python scripts and pull the most recent version of the repository by runninggit pull
- You can also use the corresponding, official Docker container from dolfinx. Install docker on your system and run
docker run -ti dolfinx/dolfinx:v0.10.0-r1
- If remeshing using mmg is desired, mmg must be installed. Follow the installation guide on the official website and install shared libraries. The code was tested for version 5.8.0 and a specific git commit. Short tutorial:
cd /home git clone https://github.com/MmgTools/mmg.git cd mmg git checkout 4d8232c8aebfed877935d75d4d4a67e850962422 mkdir build cd build cmake -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON .. make make install ldconfig
- In the container, clone into this repository and install the remaining requirements:
cd /home git clone https://github.com/do-wen/fem_for_phase_transitions.git cd fem_for_phase_transitions python -m pip install -r requirements.txt
- Then make the mmg interface:
cd /home/fem_for_phase_transitions/mmg make cd ..
- Install FEniCSx and all dependencies, including PETSc and SLEPc. Follow the installation guide on the official website. The code was tested for version 0.10.0-r1.
- (optional) If remeshing using mmg is desired, mmg must be installed. Follow the installation guide on the official website and install shared libraries. The code was tested for version 5.8.0 and a specific git commit. Short tutorial:
git clone https://github.com/MmgTools/mmg.git cd mmg git checkout 4d8232c8aebfed877935d75d4d4a67e850962422 mkdir build cd build cmake -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON .. make make install ldconfig
- Clone into this repository and install the remaining requirements:
git clone https://github.com/do-wen/fem_for_phase_transitions.git cd fem_for_phase_transitions python -m pip install -r requirements.txt - Make the mmg interface:
cd mmg make cd ..
Run the python scripts called benchmark_<NAME>.py by calling, for example,
python benchmark_slab_melting.pyAdjust mesh size, number of time steps and dimensionless parameters as desired.
- MPI is not supported. Run with
python3 benchmark_<NAME>.py - You can download the output
- Due to the non-binary .vtk output, the output folder might carry lots of files. If using docker, it might be necessary to compress the output folder first before downloading to the system.
- Sometimes, especially when interupting a running compilation of a DOLFINx weak form, a JIT timeout may occur. This can be solved by deleting the fenics cache:
rm /root/.cache/fenics/*. The error message will tell the same. - If there are problems with Mmg, try to re-make the interface:
cd /home/fem_for_phase_transitions/mmg/ make clean make
This project is licensed under the GNU General Public License v3.0 (GPLv3) - see the LICENSE file for details.