This project establishes a workflow for evaluating thermal stress in a 3D crystal geometry, based on boundary conditions extracted from an earlier 2D axisymmetric simulation.
This repository contains CsI Czochralski crystal growth cases using Elmer.
- CsI-reference case : 2D simulation of CsI Czochralski growth
- CsI-optimized case : 2D simulation of optimized CsI Czochralski growth
If you use this code in your research, please cite our open-access publication:
N. Sagias, A. Sabanskis, and K. Dadzis, “ Optimization of Thermal Stresses During Czochralski Growth of Oxides and Halides.” Cryst. Res. Technol. 61, no. 1 (2026): e70061. https://doi.org/10.1002/crat.70061
The setup for the simulations is provided in form of a docker image, so just an installation of Docker is required on your system. The image nemocrys/opencgs:v1.0.1 is used (see opencgs for more information).
On Windows, the container can be started with the following command:
docker run -it --rm -v ${PWD}:/home/workdir nemocrys/opencgs:v1.0.1 bash
On Linux, the container can be started with:
docker run -it --rm -v $PWD:/home/workdir -e LOCAL_UID=$(id -u $USER) -e LOCAL_GID=$(id -g $USER) nemocrys/opencgs:v1.0.1 bash
This will map the current working directory (e.g., a copy of this repository) into the container and, on Linux, set the user's group and user id. The simulation can then be executed using the provided python3.
The simulation pipeline consists of the following steps:
-
2D-axisymmetric Simulation: A 2D Electromagnetic-thermal axisymmetric simulation is performed to obtain the thermal field and phase interface. The reference case is located at
2D/Csi_reference_case. -
Thermal Boundary Extraction: Temperature boundaries are extracted from the 2D simulation. Specifically, temperature profiles for the crystal side, top, and the crystal-melt interface are processed.
-
3D Geometry Generation: A 3D mesh of the crystal is generated. The shape of the crystal bottom is determined by the extracted boundary conditions.
-
3D Thermal Stress Calculation: The 3D geometry and boundary conditions are used to run a thermal stress simulation.
sim-cz-stress/
├── 2D/ # 2D simulation EM-Thermal simulations
│ ├── Csi_reference_case/ # Reference case for CsI crystal
│ │ ├── geometry.py # 2D geometry generation
│ │ ├── setup.py # 2D simulation Elmer setup
│ │ ├── my_tools.py # 2D utility functions
│ │ ├── post.py # Post-processing scripts
│ │ ├── run.py # 2D simulation runner
│ │ ├── config_geometry.yml # 2D geometry configuration
│ │ ├── config_sim.yml # 2D simulation parameters
│ │ ├── config_mat.yml # 2D material properties
│ │ ├── config_elmer.yml # 2D Elmer solver configuration
│ │ └── simdata/ # 2D simulation output
│ │ └── 01_case/
│ │ └── results/ # Results (.dat, .vtu files)
│ └── Csi_optimum/ # Optimized case for CsI crystal (same structure as reference case)
│ └── ...
├── 3D/ # 3D Thermal stress simulations
│ ├── geo_3D.py # 3D geometry generation from 2D results
│ ├── T_boundary_from2Dto3D.py # Temperature boundary condition extraction from 2D
│ ├── setup.py # Elmer simulation setup
│ ├── my_tools.py # 3D utility functions
│ ├── run.py # 3D simulation runner
│ ├── config_geometry.yml
│ ├── config_sim.yml
│ ├── config_mat.yml
│ ├── config_elmer.yml # Elmer solver configuration
│ └── simdata/ # 3D simulation output directory
│ └── <case_name>/ # Results
├── runAll.py # Top-level script to run 2D + 3D workflow
└── README.md
-
Prepare 2D Results:
First, run the 2D simulation to generate the required boundary condition files:
cd 2D/Csi_reference_case python3 setup.pyThis will create the necessary
.datfiles (e.g.,crystal_T_boundary_side.dat,phase-if.dat) in the2D/Csi_reference_case/simdata/01_case/results/directory, which are required for the 3D simulation. -
Configure Simulation:
- Navigate to the
3D/directory. - Edit
run.pyto select the desired simulation case from thesimulationslist. - Adjust
config_geometry.yml,config_sim.yml, andconfig_mat.ymlas needed.
- Navigate to the
-
Run the 3D Simulation: Execute the 3D simulation script:
cd 3D python3 run.pyThis script will:
- Create a directory for the simulation in
3D/simdata/. - Generate the 3D crystal mesh (
mesh.msh). - Create the temperature boundary condition files from 2D simulation.
- Generate the Elmer simulation files (
case.sif, etc.). - Run
ElmerGridto convert the mesh. - Run
ElmerSolverto perform the simulation.
- Create a directory for the simulation in
To run both the 2D and 3D simulations sequentially, use the top-level script:
python3 runAll.pyThis will:
- Execute the 2D simulation in
2D/Csi_reference_case/ - Execute the 3D simulation in
3D/using the 2D results
The simulation results are stored in the following locations:
2D Simulation Results:
- Location:
2D/<case_name>/simdata/01_case/results/ - Files: Temperature and field data (
.datfiles), ParaView visualization files (.vtu) andphase-if.dat,crystal_T_boundary_side.dat,crystal_T_boundary_top.dat
3D Simulation Results:
- Location:
3D/simdata/<case_name>/ - Files: ParaView visualization files (
.vtu) regarding thermal stress calculation.
You can visualize both 2D and 3D results using ParaView.
This project has received funding from the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation programme (grant agreement No 851768).




