Skip to content

ACoM-RWTH/fem_for_phase_transitions

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Repository for A Finite Element Method for Phase Transitions in Rarefied Gas Dynamics

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.

Overview

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.

Installation

Using the provided docker container (recommended):

  1. 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
  2. Then navigate to /home/fem_for_phase_transitions/ for the python scripts and pull the most recent version of the repository by running
    git pull

Using the official FEniCSx docker container:

  1. 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
  2. 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
  3. 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
  4. Then make the mmg interface:
    cd /home/fem_for_phase_transitions/mmg
    make
    cd ..

Manually:

  1. 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.
  2. (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
  3. 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
  4. Make the mmg interface:
    cd mmg
    make
    cd ..

Running the Examples

Run the python scripts called benchmark_<NAME>.py by calling, for example,

python benchmark_slab_melting.py

Adjust mesh size, number of time steps and dimensionless parameters as desired.

Notes & Troubleshooting

  • 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

License

This project is licensed under the GNU General Public License v3.0 (GPLv3) - see the LICENSE file for details.

About

A Finite Element Method for Phase Transitions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 96.3%
  • C 3.6%
  • Makefile 0.1%