Tutorial: Growth of a 2D crystal¶
This tutorial describes how to pre-process, run and post-process a simple crystal growth case with phaseFieldFoam.
Pre-processing¶
Change to the case directory.
$ cd phaseFieldFoam/tutorials/multiphase/phaseFieldFoam/phase
Mesh generation¶
Generate the mesh in the case directory using blockMesh.
$ blockMesh
Boundary and initial conditions¶
The boundary conditions are in the 0 folder.
$ less 0/fi.orig
$ less 0/dT
Initialize the fields.
$ setFields
Physical properties¶
The physical properties are prescribed in the constant/physicalProperties dictionary file.
Example usage:
DT DT [0 2 -1 0 0 0 0] 2.25;
tau tau [0 0 1 0 0 0 0] 3e-04;
alpha alpha [0 1 0 0 0 0 0] 0.015;
c c [0 0 0 0 0 0 0] 0.02;
N N [0 0 0 0 0 0 0] 6;
Other properties are also prescribed in the constant/fvModels dictionary file.
Example usage:
anisotropy
{
type anisotropySource;
active yes;
anisotropySourceCoeffs
{
selectionMode all;
tau 0.0003;
kappa1 0.9;
kappa2 20;
}
}
Run the application¶
In the case directory, run:
$ phaseFieldFoam
Post-processing¶
Contour plots¶
The sump profile can be plotted from the VTK files that are saved in the
postProcessing directory using the phase.plot.plot_crystal()
function.
Benchmarking¶
To check if the numerical predictions are identical to the benchmark, run the following commands in the case directory:
$ cd test
$ cmake -S . -B build
$ cd build
$ make
$ BOOST_TEST_LOG_LEVEL=message ./test_phasefield