Interactive interface for microstructure generation and diffusion simulation in polycrystalline materials - powered by MSUtils and FANS
We provide an interactive easy-to-use interface to directly configure parameters, run simulations and visualize results. This includes:
- generating periodic Voronoi tessellations and corresponding voxel-based microstructures with prescribed grain boundary thickness
- defining diffusion coefficients for bulk and transversely isotropic grain boundaries either directly or via Arrhenius parameters and temperature
- computing full-field solutions (concentration, gradient and flux fields) as well as effective diffusivities
- visualizing full-field solutions for rapid insights into diffusion behavior
Note that in-app visualization is limited to low resolution results. For high-resolution results and for advanced investigations we recommend viewing the results in ParaView using the generated xdmf-file.
More detailed information is provided below.
Clone this repository to your system:
git clone https://github.com/DataAnalyticsEngineering/PolycrystalDiffusion
cd PolycrystalDiffusionWe recommend using pixi to effortlessly set up an isolated environment with all required dependencies:
# Install pixi if not done already
curl -fsSL https://pixi.sh/install.sh | sh
# Create the environment with all dependencies
pixi installIn general you can open a pixi environment shell via pixi shell.
Start the interactive interface to configure, run and visualize your simulations:
pixi run startThis will execute marimo run examples/run.py in the background and should open a browser tab.
The provided interface was built using marimo. In addition to the app-like option described above the interface can also be launched in an editable notebook-like mode:
pixi run edit # executes: marimo edit examples/run.pyIn addition to the interactive interface an overview of all required commands and scripts is provided below such that one can easily integrate it into existing frameworks and workflows.
Microstructure generation:
To generate a periodic Voronoi tessellation and voxel-based microstructure representation a python script is provided here. Number of grains, domain size and seed sampling technique as well as resolution and interface thickness can be set therein. For more information we refer directly to MSUtils.
Simulation:
All parameters (simulation as well as solver specific) are set in an input file. An example template is provided here. One can compute:
- concentration fluctuation field (
displacement_fluctuation) - concentration field (
displacement) - gradient field (
strain) - flux field (
stress) - effective diffusivity tensor (
homogenized_tangent) - here the loading can be set to arbitrary values
A detailed documentation can also be found in the FANS repository.
A FANS simulation can be launched by passing the number of processes (16) together with the paths to input file (.json) and results file (.h5):
mpiexec -n 16 FANS path/to/input.json path/to/results.h5Visualization:
To view all full-field solutions from a results file in ParaView a xdmf-file can be generated by running:
pixi run h52xdmf path/to/results.h5Funded by Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) under Germany’s Excellence Strategy - EXC 2075 – 390740016. We acknowledge the support of the Stuttgart Center for Simulation Science (SimTech).