SlideShare a Scribd company logo
Multi-phase-field simulations
with OpenPhase
Marvin Tegeler, Johannes Görler, Alexander Monas, Oleg Shchyglo and Ingo Steinbach
Interdisciplinary Centre for Advanced Materials Simulation, Ruhr-Universität Bochum, Bochum, Germany
2
Coarsening
Diffusion
Large
Deformation
Plasticity
Damage
Flow
OpenPhase Toolbox
• Physics-based microstructure
simulation framework.
• 100 man-years of research
and development since 2009
• Code is based on the multi-
phase field multi-component
PF-model
• Object oriented code written
in C++
• Modular structure allowing for
easy extension by addition of
new modules
3
Coarsening
Diffusion
Large
Deformation
Plasticity
Damage
Flow
OpenPhase Toolbox
• Simulation of coarsening and
ripening.
• Minimization of interfacial
energy leads to a realistic
grains size distribution:
• Examples:
• Tempering of steels.
• Coarsening of carbides.
4
Coarsening
Diffusion
Large
Deformation
Plasticity
Damage
Flow
OpenPhase Toolbox
• Simulation of multi-
component diffusion fluxes.
• Data from thermodynamic
and kinetic databases.
Supported interfaces to
.
• Examples:
• Segregation profiles
after solidification.
• Diffusion controlled
transformations.
g
5
OpenPhase Toolbox
g
• Simulation of deformations
up to several hundred
percents.
• Examples:
• Hot rolling of steels.
• Virtual tensile tests.
Coarsening
Diffusion
Large
Deformation
Plasticity
Damage
Flow
6
Coarsening
Diffusion
Large
Deformation
Plasticity
Damage
Flow
OpenPhase Toolbox
• Simulation of plastic
deformation.
• Reduction of elastic stresses
by plastic deformation. Full
implementation of a crystal
plasticity model.
• Examples:
• Creep deformation in Ni-
base superalloys
• Martensite in metals.
g
7
Coarsening
Diffusion
Large
Deformation
Plasticity
Damage
Flow
OpenPhase Toolbox
• Simulation of the effect of
mesoscopic damage in the
microstructure.
• Reduction of stiffness and
yield strength depending on
plastic strain.
• Examples:
• Virtual tensile tests.
• Simulation of creep
deformation.
8
Coarsening
Diffusion
Large
Deformation
Plasticity
Damage
Flow
OpenPhase Toolbox
• Simulation of liquid flow.
• Solving Lattice-Boltzmann
method under consideration
of solid grains.
g
9
Introduction to the Multiphase Field Method
The Multiphase Field Method
 A tool for the simulation of
microstructure evolution
 A set of continuous scalar functions
 1 in bulk, 0 when phase does not exist.
 Description of regions of different
properties (crystallographic structure,
orientations, etc)
 Motion of interfaces between regions
10
Introduction to the Multiphase Field Method

 compact 27-point stencil
 N = Number of active phase fields in a
grid point
 Active phase fields or
11
Overview
• Mg-Al alloy solidification
• OpenPhase Tutorial
• Parallelization
12
Mg-Al Microstructure and Thermodynamics
 Mg-Al alloys microstructure consist
of α-phase (HCP-Mg dendrites)
surrounded by closed shell Mg17Al12
β-phase
 properties as corrosion resistance
depend on the microstructure
Goal:
 Modeling as cast microstructures
using the phase field model
200µm
13
Experimental as-cast Mg-Al Microstructure
0.3 K/s 1.0 K/s 25 K/s
1 mm
(a): furnace control (b): air cooling (c): water cooling
14
Nucleation Modeling
 Create a list of virtual particles, that satisfies a given
nucleation density
 At every time step plant nuclei by creating a phase field
with value zero at the corresponding grid point, if the
parent phase is correct
 Compute driving force , if remove
the corresponding virtual particle from the list, otherwise
remove phase field.
15
Initial temperature: 875 K
Cooling rate: 10 K/s
Initial concentration: 5 at. % Al
System size: 200x200x200 μm
Grid spacing: 1.0 um
Solidification of MgAl
16
Temperature Curves Simulation
17
Effect of cooling rate on solidification microstructure
5 K/s
15 K/s
25 K/s
200µm
Mg-5at.%Al
α-Mg
β-Mg
18
α- and β-phase nucleation during solidification
α-Mg
β-Mg
 Primary α-phase dendrites fill
most of the volume.
 Secondary β-phase fills
interdendritic region.
19
Evolution of microstructure during solidification
α-Mg
β-Mg
100µm
300³ µm = 27 mio cells
one week calculation
time on 96 cores
20
100µm
Evolution of microstructure during solidification
100µm
21
3D Secondary β-phase Nucleation and Growth Modeling
α
β
100µm
22
3D Secondary β-phase Nucleation and Growth Modeling
20µm
23
α
α
β
20µm
Rapid coverage of α-liquid-interface with β-phase
 β-phase covers the α-liquid-interface
 Further β-phase growth depletes enclosed melt
 Nucleation of tertiary α-phase is neccessary for complete
solidification
Monas A et al.; “Divorced Eutectic Solidification of Mg-Al Alloys”, JOM (2015)
24
Mg-Al β-phase formation: experiment vs simulation
100µm 5µm
SEM-image of Mg-5%Al microstructure and enlarged view on the eutectic region.
dark: α-phase, bright: β-phase
Se-Jong Kim, Chang Dong Yim, KIMS, Korea
25
Tutorial
OpenPhase can be downloaded at
http://www.openphase.de/upload/content/OpenPhase.V0.9.1.zip
The tutorial will use the SolidificationMgAl example.
In order to compile the OpenPhase library just run 'make' in the main directory.
To compile an example call ‘make’ in the corresponding directory.
26
Load Modules
int main(int argc, char *argv[])
{
Settings OPSettings;
OPSettings.Initialize();
OPSettings.ReadInput();
PhaseField Phi(OPSettings);
DoubleObstacle DO(OPSettings);
InterfaceMobility Mu(OPSttings);
InterfaceEnergy Sigma(OPSettings);
InterfaceEnergySolidLiquid IE(OPSettings);
EquilibriumPartitionDiffusion DF(OPSettings);
Composition Cx(OPSettings);
Temperature Tx(OPSettings);
DrivingForce dG(OPSettings);
BoundaryConditions BC(OPSettings);
Nucleation Nuc(OPSettings);
27
ProjectInput.opi
28
Load Modules
dG.ReadInput();
Cx.ReadInput();
DF.ReadInput();
Tx.ReadInput();
BC.ReadInput();
Nuc.ReadInput();
Mu.ReadInput();
Sigma.ReadInput();
IE.ReadInput();
int id = Initializations::Single(Phi, 0, BC, OPSettings);
Phi.FieldsStatistics[id].State= Liquid;
DF.SetInitialComposition(Phi, Cx);
Tx.SetInitial(BC, Phi, 0);
29
ProjectInput.opi
30
Work Loop
for(int tStep = OPSettings.tStart + 1; tStep <
OPSettings.nSteps + 1; tStep++)
{
Nuc.GenerateNucleationSites(Phi, Tx);
Nuc.PlantNuclei(Phi, tStep);
Sigma.CalculateHex(Phi);
Mu.CalculateHex(Phi, Tx);
DF.SetPhaseFractions(Phi);
DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu);
DF.GetDrivingForce(Phi, Cx, Tx, dG);
dG.Average(Phi, BC);
Nuc.CheckNuclei(Phi, Sigma, dG, tStep);
dG.MergePhaseFieldIncrements(Phi, Sigma, Mu);
Phi.NormalizeIncrements(BC, dt);
DF.Solve(Phi, Cx, Tx, BC, dt);
Phi.MergeIncrements(BC, dt);
Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt);
}
31
Work Loop
for(int tStep = OPSettings.tStart + 1; tStep <
OPSettings.nSteps + 1; tStep++)
{
Nuc.GenerateNucleationSites(Phi, Tx);
Nuc.PlantNuclei(Phi, tStep);
Sigma.CalculateHex(Phi);
Mu.CalculateHex(Phi, Tx);
DF.SetPhaseFractions(Phi);
DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu);
DF.GetDrivingForce(Phi, Cx, Tx, dG);
dG.Average(Phi, BC);
Nuc.CheckNuclei(Phi, Sigma, dG, tStep);
dG.MergePhaseFieldIncrements(Phi, Sigma, Mu);
Phi.NormalizeIncrements(BC, dt);
DF.Solve(Phi, Cx, Tx, BC, dt);
Phi.MergeIncrements(BC, dt);
Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt);
}
Generates nucleation sites with a random size distribution the
first time this function is called.
32
Work Loop
for(int tStep = OPSettings.tStart + 1; tStep <
OPSettings.nSteps + 1; tStep++)
{
Nuc.GenerateNucleationSites(Phi, Tx);
Nuc.PlantNuclei(Phi, tStep);
Sigma.CalculateHex(Phi);
Mu.CalculateHex(Phi, Tx);
DF.SetPhaseFractions(Phi);
DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu);
DF.GetDrivingForce(Phi, Cx, Tx, dG);
dG.Average(Phi, BC);
Nuc.CheckNuclei(Phi, Sigma, dG, tStep);
dG.MergePhaseFieldIncrements(Phi, Sigma, Mu);
Phi.NormalizeIncrements(BC, dt);
DF.Solve(Phi, Cx, Tx, BC, dt);
Phi.MergeIncrements(BC, dt);
Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt);
}
Plant nuclei at the generated sites.
Add storage for a phase field with value zero.
33
Work Loop
for(int tStep = OPSettings.tStart + 1; tStep <
OPSettings.nSteps + 1; tStep++)
{
Nuc.GenerateNucleationSites(Phi, Tx);
Nuc.PlantNuclei(Phi, tStep);
Sigma.CalculateHex(Phi);
Mu.CalculateHex(Phi, Tx);
DF.SetPhaseFractions(Phi);
DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu);
DF.GetDrivingForce(Phi, Cx, Tx, dG);
dG.Average(Phi, BC);
Nuc.CheckNuclei(Phi, Sigma, dG, tStep);
dG.MergePhaseFieldIncrements(Phi, Sigma, Mu);
Phi.NormalizeIncrements(BC, dt);
DF.Solve(Phi, Cx, Tx, BC, dt);
Phi.MergeIncrements(BC, dt);
Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt);
}
Calculate interface stiffness
34
Work Loop
for(int tStep = OPSettings.tStart + 1; tStep <
OPSettings.nSteps + 1; tStep++)
{
Nuc.GenerateNucleationSites(Phi, Tx);
Nuc.PlantNuclei(Phi, tStep);
Sigma.CalculateHex(Phi);
Mu.CalculateHex(Phi, Tx);
DF.SetPhaseFractions(Phi);
DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu);
DF.GetDrivingForce(Phi, Cx, Tx, dG);
dG.Average(Phi, BC);
dG.MergePhaseFieldIncrements(Phi, Sigma, Mu);
Phi.NormalizeIncrements(BC, dt);
DF.Solve(Phi, Cx, Tx, BC, dt);
Phi.MergeIncrements(BC, dt);
Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt);
}
Calculate interface mobility
35
Work Loop
for(int tStep = OPSettings.tStart + 1; tStep <
OPSettings.nSteps + 1; tStep++)
{
Nuc.GenerateNucleationSites(Phi, Tx);
Nuc.PlantNuclei(Phi, tStep);
Sigma.CalculateHex(Phi);
Mu.CalculateHex(Phi, Tx);
DF.SetPhaseFractions(Phi);
DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu);
DF.GetDrivingForce(Phi, Cx, Tx, dG);
dG.Average(Phi, BC);
dG.MergePhaseFieldIncrements(Phi, Sigma, Mu);
Phi.NormalizeIncrements(BC, dt);
DF.Solve(Phi, Cx, Tx, BC, dt);
Phi.MergeIncrements(BC, dt);
Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt);
}
Calculate the sum of phase fields belonging to the same thermodynamic
phase in each grid point.
36
Work Loop
for(int tStep = OPSettings.tStart + 1; tStep <
OPSettings.nSteps + 1; tStep++)
{
Nuc.GenerateNucleationSites(Phi, Tx);
Nuc.PlantNuclei(Phi, tStep);
Sigma.CalculateHex(Phi);
Mu.CalculateHex(Phi, Tx);
DF.SetPhaseFractions(Phi);
DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu);
DF.GetDrivingForce(Phi, Cx, Tx, dG);
dG.Average(Phi, BC);
dG.MergePhaseFieldIncrements(Phi, Sigma, Mu);
Phi.NormalizeIncrements(BC, dt);
DF.Solve(Phi, Cx, Tx, BC, dt);
Phi.MergeIncrements(BC, dt);
Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt);
}
Calculate the double obstacle potential for αβ-interfaces
37
Work Loop
for(int tStep = OPSettings.tStart + 1; tStep <
OPSettings.nSteps + 1; tStep++)
{
Nuc.GenerateNucleationSites(Phi, Tx);
Nuc.PlantNuclei(Phi, tStep);
Sigma.CalculateHex(Phi);
Mu.CalculateHex(Phi, Tx);
DF.SetPhaseFractions(Phi);
DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu);
DF.GetDrivingForce(Phi, Cx, Tx, dG);
dG.Average(Phi, BC);
Nuc.CheckNuclei(Phi, Sigma, dG, tStep);
dG.MergePhaseFieldIncrements(Phi, Sigma, Mu);
Phi.NormalizeIncrements(BC, dt);
DF.Solve(Phi, Cx, Tx, BC, dt);
Phi.MergeIncrements(BC, dt);
Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt);
}
Calculate driving force
38
Work Loop
for(int tStep = OPSettings.tStart + 1; tStep <
OPSettings.nSteps + 1; tStep++)
{
Nuc.GenerateNucleationSites(Phi, Tx);
Nuc.PlantNuclei(Phi, tStep);
Sigma.CalculateHex(Phi);
Mu.CalculateHex(Phi, Tx);
DF.SetPhaseFractions(Phi);
DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu);
DF.GetDrivingForce(Phi, Cx, Tx, dG);
dG.Average(Phi, BC);
Nuc.CheckNuclei(Phi, Sigma, dG, tStep);
dG.MergePhaseFieldIncrements(Phi, Sigma, Mu);
Phi.NormalizeIncrements(BC, dt);
DF.Solve(Phi, Cx, Tx, BC, dt);
Phi.MergeIncrements(BC, dt);
Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt);
}
The correct phase field profile across the interface can only be obtained if the
driving force is constant across the interface and varies only along the
interface.
Therefore we calculate an average driving force , that is constant along
the normal direction of the interface.
39
Work Loop
for(int tStep = OPSettings.tStart + 1; tStep <
OPSettings.nSteps + 1; tStep++)
{
Nuc.GenerateNucleationSites(Phi, Tx);
Nuc.PlantNuclei(Phi, tStep);
Sigma.CalculateHex(Phi);
Mu.CalculateHex(Phi, Tx);
DF.SetPhaseFractions(Phi);
DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu);
DF.GetDrivingForce(Phi, Cx, Tx, dG);
dG.Average(Phi, BC);
dG.MergePhaseFieldIncrements(Phi, Sigma, Mu);
Phi.NormalizeIncrements(BC, dt);
DF.Solve(Phi, Cx, Tx, BC, dt);
Phi.MergeIncrements(BC, dt);
Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt)}
The correct phase field profile across the interface can only be obtained if the
driving force is constant across the interface and varies only along the
interface.
Therefore we calculate an average driving force , that is constant along
the normal direction of the interface.
The average is calculated in two steps
with
40
Work Loop
for(int tStep = OPSettings.tStart + 1; tStep <
OPSettings.nSteps + 1; tStep++)
{
Nuc.GenerateNucleationSites(Phi, Tx);
Nuc.PlantNuclei(Phi, tStep);
Sigma.CalculateHex(Phi);
Mu.CalculateHex(Phi, Tx);
DF.SetPhaseFractions(Phi);
DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu);
DF.GetDrivingForce(Phi, Cx, Tx, dG);
dG.Average(Phi, BC);
Nuc.CheckNuclei(Phi, Sigma, dG, tStep);
dG.MergePhaseFieldIncrements(Phi, Sigma, Mu);
Phi.NormalizeIncrements(BC, dt);
DF.Solve(Phi, Cx, Tx, BC, dt);
Phi.MergeIncrements(BC, dt);
Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt);
}
Check driving force of nuclei. Sucessfully planted nuclei are removed from
the list of nucleation sites.
41
Work Loop
for(int tStep = OPSettings.tStart + 1; tStep <
OPSettings.nSteps + 1; tStep++)
{
Nuc.GenerateNucleationSites(Phi, Tx);
Nuc.PlantNuclei(Phi, tStep);
Sigma.CalculateHex(Phi);
Mu.CalculateHex(Phi, Tx);
DF.SetPhaseFractions(Phi);
DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu);
DF.GetDrivingForce(Phi, Cx, Tx, dG);
dG.Average(Phi, BC);
Nuc.CheckNuclei(Phi, Sigma, dG, tStep);
dG.MergePhaseFieldIncrements(Phi, Sigma, Mu);
Phi.NormalizeIncrements(BC, dt);
DF.Solve(Phi, Cx, Tx, BC, dt);
Phi.MergeIncrements(BC, dt);
Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt);
}
Compute interface fields for the chemical driving force
42
Work Loop
for(int tStep = OPSettings.tStart + 1; tStep <
OPSettings.nSteps + 1; tStep++)
{
Nuc.GenerateNucleationSites(Phi, Tx);
Nuc.PlantNuclei(Phi, tStep);
Sigma.CalculateHex(Phi);
Mu.CalculateHex(Phi, Tx);
DF.SetPhaseFractions(Phi);
DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu);
DF.GetDrivingForce(Phi, Cx, Tx, dG);
dG.Average(Phi, BC);
Nuc.CheckNuclei(Phi, Sigma, dG, tStep);
dG.MergePhaseFieldIncrements(Phi, Sigma, Mu);
Phi.NormalizeIncrements(BC, dt);
DF.Solve(Phi, Cx, Tx, BC, dt);
Phi.MergeIncrements(BC, dt);
Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt);
}
Limit interface fields , so that the phase fields stay within bounds [0,1].
43
Work Loop
for(int tStep = OPSettings.tStart + 1; tStep <
OPSettings.nSteps + 1; tStep++)
{
Nuc.GenerateNucleationSites(Phi, Tx);
Nuc.PlantNuclei(Phi, tStep);
Sigma.CalculateHex(Phi);
Mu.CalculateHex(Phi, Tx);
DF.SetPhaseFractions(Phi);
DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu);
DF.GetDrivingForce(Phi, Cx, Tx, dG);
dG.Average(Phi, BC);
Nuc.CheckNuclei(Phi, Sigma, dG, tStep);
dG.MergePhaseFieldIncrements(Phi, Sigma, Mu);
Phi.NormalizeIncrements(BC, dt);
DF.Solve(Phi, Cx, Tx, BC, dt);
Phi.MergeIncrements(BC, dt);
Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt);
}
Solve diffusion equation for the phase concentrations
44
Work Loop
for(int tStep = OPSettings.tStart + 1; tStep <
OPSettings.nSteps + 1; tStep++)
{
Nuc.GenerateNucleationSites(Phi, Tx);
Nuc.PlantNuclei(Phi, tStep);
Sigma.CalculateHex(Phi);
Mu.CalculateHex(Phi, Tx);
DF.SetPhaseFractions(Phi);
DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu);
DF.GetDrivingForce(Phi, Cx, Tx, dG);
dG.Average(Phi, BC);
Nuc.CheckNuclei(Phi, Sigma, dG, tStep);
dG.MergePhaseFieldIncrements(Phi, Sigma, Mu);
Phi.NormalizeIncrements(BC, dt);
DF.Solve(Phi, Cx, Tx, BC, dt);
Phi.MergeIncrements(BC, dt);
Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt);
}
Compute the phase field update
45
Work Loop
for(int tStep = OPSettings.tStart + 1; tStep <
OPSettings.nSteps + 1; tStep++)
{
Nuc.GenerateNucleationSites(Phi, Tx);
Nuc.PlantNuclei(Phi, tStep);
Sigma.CalculateHex(Phi);
Mu.CalculateHex(Phi, Tx);
DF.SetPhaseFractions(Phi);
DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu);
DF.GetDrivingForce(Phi, Cx, Tx, dG);
dG.Average(Phi, BC);
Nuc.CheckNuclei(Phi, Sigma, dG, tStep);
dG.MergePhaseFieldIncrements(Phi, Sigma, Mu);
Phi.NormalizeIncrements(BC, dt);
DF.Solve(Phi, Cx, Tx, BC, dt);
Phi.MergeIncrements(BC, dt);
Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt);
}
Compute temperature update
46
OpenPhase Solutions GmbH
• A company has been founded that offers support
• Focused on industry
• GUI is in development
• Creation of ProjectInput.opi
• Creation of the .cpp file
• Sanity check on input values
• GUI will be commercial software
• OpenPhase will stay free
Johannes Görler
Matthias Stratmann
47
Parallelization
MPI-Parallelization
48
Parallelization
Thread (OpenMP)
 Simultaneous execution of
sequences of instruction
 Shared address space
Process (MPI)
 Instance of a program
 Own address space
 Message Passing
All cores should be
used efficiently
49
Parallelization
 Active phase fields or
 Dynamic storage for active phase field
 Contributions to the evolution equation only by
active phase fields
 Locally and temporally different number of active
phase fields
 Number of operations in each grid point can be
different and can change over time.
50
Parallelization
• OpenPhase uses stencil operations
• Domain decomposition to divide the work onto multiple processes
51
Parallelization
Use a domain decomposition to divide the work onto multiple processes.
52
Parallelization
The wide halo avoids communication at the expense of additional work.
This is used to limit us to one communication step per time step.
53
Load-balancing by Graph-partitioning
Over-decomposition
 Division of the domain into many more sub-domains
(blocks) than processes.
 Assignment of these sub-domains to processes
 Goal: minimize communication and load-imbalance.
54
Load-balancing by Graph-partitioning
Assignment of sub-
domains to processes.
 Simultaneous
minimization of imbalance
and communication
 Graph-partitioning
problem with vertex
weights
 Coloring of the graph with
minimal edge cut
 Constrainted sum of the
vertex weights with the
same color
Block ↔ Vertex
Communication ↔ Edge
Load ↔ Weight
Problem:
No accurate current polynomial algorithm
55
Load-balancing by Graph-partitioning
Greedy Graph-Partitioner
1. Start with color n = 1
2. Choose an uncolored vertex that
increases the edge cut the least
3. Color it with color n
4. If the sum of vertex weights with
color n is larger than set
n = n+1
5. If there are any uncolored vertices,
go to 2
56
Load-balancing by Graph-partitioning
Greedy Graph-Partitioner
1. Start with color n = 1
2. Choose an uncolored vertex that
increases the edge cut the least
3. Color it with color n
4. If the sum of vertex weights with
color n is larger than set
n = n+1
5. If there are any uncolored vertices,
go to 2
57
Load-balancing by Graph-partitioning
Graph Partitioning
 The Greedy Graph-Partitioner fulfills
 Because the last vertex added to each color fulfills
 Total work on process i.
 Average work .
 Maximum work among blocks.
Reducing limits the maximum load-imbalance.
This can be achieved by splitting blocks into smaller blocks.
58
Load-balancing by Graph-partitioning
Splitting Blocks, however, creates additional work
After splitting the most costly block the inequality becomes
59
Load-balancing by Graph-partitioning
Repeated splitting of the largest block gives
Allowing the same block to be split multiple times gives
Problem: The cost of splitting is unknown.
60
Load-balancing by Graph-partitioning
Problem: The cost of splitting is unknown.
 Self-Profiling in order to approximate the cost.
 Measure time for computations on each block.
 Fit parameters in a cost function
 that maps the number of phase fields in
each grid point to the computation time.
 This information is also used to determine the
optimal cutting plane.
61
Load-balancing by Graph-partitioning
62
Load-balancing by Graph-partitioning
63
Load-balancing by Graph-partitioning
Load-imbalance
Tolerance
Maximum Block
Maximum Process
Wall Time
64
Load-balancing by Graph-partitioning
Load-imbalance
Tolerance
Maximum Block
Maximum Process
Wall Time
65
Load-balancing by Graph-partitioning
Weak-Scaling Benchmark
Pure MPI
 96x48x48 grid
points per
core.
 2 particles per
core
 Gaussian
distribution
66
Load-balancing by Graph-partitioning
Weak-Scaling Benchmark
Hybrid
MPI+OpenMP
 96x48x48 grid
points per
core.
 2 particles per
core
 Gaussian
distribution
67
Load-balancing by Graph-partitioning
Hybrid-Parallelism reduces the
number of MPI-processes.
The number of blocks is reduced,
the blocks become larger.
Less overhead is created by the
wide halo.
A large number of threads loses
efficiency.
Only one thread per process
participates in communication.
Threads created on different sockets
can have slow memory access.
The best performance was seen with 6 or 12 threads per process.
68
Load-balancing using Phase Field
Load-balancing aims at simulatenous
reduction of idle time and communication.
Sub-domains need to
have the same
amount of work.
Surface between
sub-domains should
be minimized.
Idle time Communication
With an appropriate driving force the
multiphase field method can achieve this.
69
Load-balancing using Phase Field
 Domain decompostion with one sub-domain per process .
 Each process is associated with a phase field .
 The associated sub-domain is determined by the phase field .
 Balancing of the work between adjacent domains and by a driving force
that drives the interface into the direction of the higher computational load.
 An isotropic interface energy reduces the surface area between domains.
70
Load-balancing using Phase Field
Application to the Phase Field Method
 Two instances of phase field
 Simulation
 Load-balancing
 Using Wide Halo
71
Load-balancing using Phase Field
Application to the Phase Field Method
 Two instances of phase field
 Simulation
 Load-balancing
 Using Wide Halo
 Both on the same rectangular sub-
domain
 Interior points of the sub-domains can
overlap.
72
Load-balancing using Phase Field
Comparison with the previous load-
balancing scheme.
73
Load-balancing using Phase Field
Convergence of load-balance
 96 MPI processes
 20% Tolerance
74
Load-balancing using Phase Field
Convergence of load-balance
 96 MPI processes
 5% Tolerance
75
Load-balancing using Phase Field
Application to the Phase Field Method
 Two instances of phase field
 Simulation
 Load-balancing
 Using Wide Halo
 Both on the same rectangular sub-
domain , in which is the majority
phase.
 Interior points of the sub-domains can
overlap.
76
Load-balancing using Phase Field
Applied to Molecular Dynamics
 Cell-based molecular dynamics
 Lennard-Jones potential
 Start with a simple domain decomposition
 Colors indicate processes
 The phase fields are only updated with a probability of
With the maximum load among processes 𝜔 𝑚𝑎𝑥, the number of processes 𝑁 𝑝 and the
average time for load-balancing 𝑇𝐿𝐵.
77
Load-balancing using Phase Field
78
Two Spheres Move Over Periodic Boundary
79
Load-balancing using Phase Field
80
Summary
 OpenPhase is a flexible multi-phase-field framework,
that can handle an arbitrary number of phase fields
for a variety of applications
 MPI and OpenMP parallelization allow an efficient
usage of computational resources.
81
Summary
 OpenPhase is a flexible multi-phase-field framework,
that can handle an arbitrary number of phase fields
for a variety of applications
 MPI and OpenMP parallelization allow an efficient
usage of computational resources.
Thank you!

More Related Content

PPT
Nano Indentation Lecture1
PPT
Nanolithography
PDF
I. Electronic properties of nanomaterials
PDF
Extreme uv lithography
PDF
Optical properties of nanomaterials
PPTX
Super lattice and quantum well
PPTX
Nano lithography techniques
Nano Indentation Lecture1
Nanolithography
I. Electronic properties of nanomaterials
Extreme uv lithography
Optical properties of nanomaterials
Super lattice and quantum well
Nano lithography techniques

What's hot (20)

PPT
Atomic force microscopy
PPTX
Atomic force microscopy
PPTX
Transmission Electron microscopy
PDF
Introduction to DFT Part 2
PPTX
Synthesis of Nano Materials
PPTX
Electrospinning of poly vinylalcohol-polycaprolactone composites scaffolds fo...
PPTX
Electron beam lithography
PPTX
Magnetron sputtering
PPT
Nano Indentation Lecture2
PPT
Electrical measurements and two probe method
PDF
Mott metal insulator transitions satej soman, robert tang-kong
PDF
Density functional theory (DFT) and the concepts of the augmented-plane-wave ...
PPTX
Electrospinning
PPTX
Characterization of Carrier Lifetime
PPTX
PREPARATION OF NANOCOMPOSITES
PPTX
mems and nems
PDF
Part III - Quantum Mechanics
PDF
Introduction to atomic layer deposition (ALD): principles, applications, future
PPTX
Lithography 7.10.2020
PPTX
A brief description of photolithography
Atomic force microscopy
Atomic force microscopy
Transmission Electron microscopy
Introduction to DFT Part 2
Synthesis of Nano Materials
Electrospinning of poly vinylalcohol-polycaprolactone composites scaffolds fo...
Electron beam lithography
Magnetron sputtering
Nano Indentation Lecture2
Electrical measurements and two probe method
Mott metal insulator transitions satej soman, robert tang-kong
Density functional theory (DFT) and the concepts of the augmented-plane-wave ...
Electrospinning
Characterization of Carrier Lifetime
PREPARATION OF NANOCOMPOSITES
mems and nems
Part III - Quantum Mechanics
Introduction to atomic layer deposition (ALD): principles, applications, future
Lithography 7.10.2020
A brief description of photolithography
Ad

Similar to Multi-phase-field simulations with OpenPhase (20)

PDF
How to Leverage Artificial Intelligence to Accelerate Data Collection and Ana...
PDF
20091029%20 l edit%20by%20cwchang%20(for%20std)
PDF
summer report final
PPTX
Optimization for the fabrication of ternary halide perovskite solar cells via...
PDF
Avinash_PPT
PDF
Term Paper on nanofabrication materials synthesis
PDF
Understanding and predicting CO2 properties - Presentation by Richard Graham ...
PDF
2.6 latifs 17 dramix pisos sobre pilotes
PPTX
Numerical and analytical studies of single and multiphase starting jets and p...
PDF
Self-Balancing Multimemetic Algorithms in Dynamic Scale-Free Networks
PDF
INNOVATIVE EDFM TECHNOLOGY FOR REFRACTURING SIMULATION
PPT
PDF
ALEA:Fine-grain Energy Profiling with Basic Block sampling
PPTX
EEE413_Lec4_fab_part_3_ewu_bd_dhaka.pptx
PPTX
Product & technology portfolio of gridworld
PPTX
Unconventional Reservoirs Flow modelling challenges
PPTX
Ph d defense_rajmohan_muthaiah_University_of_oklahoma_07_28_2021
PPTX
Molecular Simulation to build models for enzyme induced fit
PDF
A 2D model of a DC Plasma torch in comsol
PDF
Heterojunction silicon based solar cells
How to Leverage Artificial Intelligence to Accelerate Data Collection and Ana...
20091029%20 l edit%20by%20cwchang%20(for%20std)
summer report final
Optimization for the fabrication of ternary halide perovskite solar cells via...
Avinash_PPT
Term Paper on nanofabrication materials synthesis
Understanding and predicting CO2 properties - Presentation by Richard Graham ...
2.6 latifs 17 dramix pisos sobre pilotes
Numerical and analytical studies of single and multiphase starting jets and p...
Self-Balancing Multimemetic Algorithms in Dynamic Scale-Free Networks
INNOVATIVE EDFM TECHNOLOGY FOR REFRACTURING SIMULATION
ALEA:Fine-grain Energy Profiling with Basic Block sampling
EEE413_Lec4_fab_part_3_ewu_bd_dhaka.pptx
Product & technology portfolio of gridworld
Unconventional Reservoirs Flow modelling challenges
Ph d defense_rajmohan_muthaiah_University_of_oklahoma_07_28_2021
Molecular Simulation to build models for enzyme induced fit
A 2D model of a DC Plasma torch in comsol
Heterojunction silicon based solar cells
Ad

More from PFHub PFHub (20)

PDF
C hi mad_phasefieldworkshop(1)
PDF
AI for Science Grand Challenges
PDF
Cobalt-based Superalloys Development in CHiMaD
PPTX
Microstructural Analysis and Machine Learning
PDF
Using phase field simulations to assist with experiments and experimental data
PDF
Uncertainty Propagation in CALPHAD-reinforced Elastochemical Phase-field Mode...
PDF
UNCERTAINTY QUANTIFICATION OF PHASE EQUILIBRIA AND THERMODYNAMICS
PDF
Implementing a neural network potential for exascale molecular dynamics
PPTX
Community-Driven Benchmark Problems for Phase Field Modeling
PPTX
The Phase Field Method: Mesoscale Simulation Aiding Materials Discovery
PPTX
Phase-field modeling of crystal nucleation: Comparison with simulations and e...
PDF
Nucleation III: Phase-field crystal modeling of nucleation process
PDF
Using an Explicit Nucleation Model in PRISIMS-PF to Predict Precipate Microst...
PDF
Phase-field modeling of crystal nucleation I: Fundamentals and methods
PDF
Benchmark 6 Update
PDF
Educating Researchers Using the CHiMaD Benchmark Problems
PDF
Phase-field modeling of crystal nucleation II: Comparison with simulations an...
PDF
Update on Benchmark 7
PDF
Theoretical and Applied Phase-Field: Glimpses of the activities in India
C hi mad_phasefieldworkshop(1)
AI for Science Grand Challenges
Cobalt-based Superalloys Development in CHiMaD
Microstructural Analysis and Machine Learning
Using phase field simulations to assist with experiments and experimental data
Uncertainty Propagation in CALPHAD-reinforced Elastochemical Phase-field Mode...
UNCERTAINTY QUANTIFICATION OF PHASE EQUILIBRIA AND THERMODYNAMICS
Implementing a neural network potential for exascale molecular dynamics
Community-Driven Benchmark Problems for Phase Field Modeling
The Phase Field Method: Mesoscale Simulation Aiding Materials Discovery
Phase-field modeling of crystal nucleation: Comparison with simulations and e...
Nucleation III: Phase-field crystal modeling of nucleation process
Using an Explicit Nucleation Model in PRISIMS-PF to Predict Precipate Microst...
Phase-field modeling of crystal nucleation I: Fundamentals and methods
Benchmark 6 Update
Educating Researchers Using the CHiMaD Benchmark Problems
Phase-field modeling of crystal nucleation II: Comparison with simulations an...
Update on Benchmark 7
Theoretical and Applied Phase-Field: Glimpses of the activities in India

Recently uploaded (20)

PPTX
TOTAL hIP ARTHROPLASTY Presentation.pptx
PPT
POSITIONING IN OPERATION THEATRE ROOM.ppt
PPTX
Overview of calcium in human muscles.pptx
PPTX
Introduction to Fisheries Biotechnology_Lesson 1.pptx
PDF
Lymphatic System MCQs & Practice Quiz – Functions, Organs, Nodes, Ducts
PPTX
Pharmacology of Autonomic nervous system
PDF
Warm, water-depleted rocky exoplanets with surfaceionic liquids: A proposed c...
PPTX
2. Earth - The Living Planet earth and life
PDF
SEHH2274 Organic Chemistry Notes 1 Structure and Bonding.pdf
PDF
Biophysics 2.pdffffffffffffffffffffffffff
PDF
Assessment of environmental effects of quarrying in Kitengela subcountyof Kaj...
DOCX
Q1_LE_Mathematics 8_Lesson 5_Week 5.docx
PPTX
Application of enzymes in medicine (2).pptx
PPTX
cpcsea ppt.pptxssssssssssssssjjdjdndndddd
PPTX
7. General Toxicologyfor clinical phrmacy.pptx
PDF
Sciences of Europe No 170 (2025)
PDF
CHAPTER 3 Cell Structures and Their Functions Lecture Outline.pdf
PDF
Looking into the jet cone of the neutrino-associated very high-energy blazar ...
PPTX
POULTRY PRODUCTION AND MANAGEMENTNNN.pptx
PPTX
ognitive-behavioral therapy, mindfulness-based approaches, coping skills trai...
TOTAL hIP ARTHROPLASTY Presentation.pptx
POSITIONING IN OPERATION THEATRE ROOM.ppt
Overview of calcium in human muscles.pptx
Introduction to Fisheries Biotechnology_Lesson 1.pptx
Lymphatic System MCQs & Practice Quiz – Functions, Organs, Nodes, Ducts
Pharmacology of Autonomic nervous system
Warm, water-depleted rocky exoplanets with surfaceionic liquids: A proposed c...
2. Earth - The Living Planet earth and life
SEHH2274 Organic Chemistry Notes 1 Structure and Bonding.pdf
Biophysics 2.pdffffffffffffffffffffffffff
Assessment of environmental effects of quarrying in Kitengela subcountyof Kaj...
Q1_LE_Mathematics 8_Lesson 5_Week 5.docx
Application of enzymes in medicine (2).pptx
cpcsea ppt.pptxssssssssssssssjjdjdndndddd
7. General Toxicologyfor clinical phrmacy.pptx
Sciences of Europe No 170 (2025)
CHAPTER 3 Cell Structures and Their Functions Lecture Outline.pdf
Looking into the jet cone of the neutrino-associated very high-energy blazar ...
POULTRY PRODUCTION AND MANAGEMENTNNN.pptx
ognitive-behavioral therapy, mindfulness-based approaches, coping skills trai...

Multi-phase-field simulations with OpenPhase

  • 1. Multi-phase-field simulations with OpenPhase Marvin Tegeler, Johannes Görler, Alexander Monas, Oleg Shchyglo and Ingo Steinbach Interdisciplinary Centre for Advanced Materials Simulation, Ruhr-Universität Bochum, Bochum, Germany
  • 2. 2 Coarsening Diffusion Large Deformation Plasticity Damage Flow OpenPhase Toolbox • Physics-based microstructure simulation framework. • 100 man-years of research and development since 2009 • Code is based on the multi- phase field multi-component PF-model • Object oriented code written in C++ • Modular structure allowing for easy extension by addition of new modules
  • 3. 3 Coarsening Diffusion Large Deformation Plasticity Damage Flow OpenPhase Toolbox • Simulation of coarsening and ripening. • Minimization of interfacial energy leads to a realistic grains size distribution: • Examples: • Tempering of steels. • Coarsening of carbides.
  • 4. 4 Coarsening Diffusion Large Deformation Plasticity Damage Flow OpenPhase Toolbox • Simulation of multi- component diffusion fluxes. • Data from thermodynamic and kinetic databases. Supported interfaces to . • Examples: • Segregation profiles after solidification. • Diffusion controlled transformations. g
  • 5. 5 OpenPhase Toolbox g • Simulation of deformations up to several hundred percents. • Examples: • Hot rolling of steels. • Virtual tensile tests. Coarsening Diffusion Large Deformation Plasticity Damage Flow
  • 6. 6 Coarsening Diffusion Large Deformation Plasticity Damage Flow OpenPhase Toolbox • Simulation of plastic deformation. • Reduction of elastic stresses by plastic deformation. Full implementation of a crystal plasticity model. • Examples: • Creep deformation in Ni- base superalloys • Martensite in metals. g
  • 7. 7 Coarsening Diffusion Large Deformation Plasticity Damage Flow OpenPhase Toolbox • Simulation of the effect of mesoscopic damage in the microstructure. • Reduction of stiffness and yield strength depending on plastic strain. • Examples: • Virtual tensile tests. • Simulation of creep deformation.
  • 8. 8 Coarsening Diffusion Large Deformation Plasticity Damage Flow OpenPhase Toolbox • Simulation of liquid flow. • Solving Lattice-Boltzmann method under consideration of solid grains. g
  • 9. 9 Introduction to the Multiphase Field Method The Multiphase Field Method  A tool for the simulation of microstructure evolution  A set of continuous scalar functions  1 in bulk, 0 when phase does not exist.  Description of regions of different properties (crystallographic structure, orientations, etc)  Motion of interfaces between regions
  • 10. 10 Introduction to the Multiphase Field Method   compact 27-point stencil  N = Number of active phase fields in a grid point  Active phase fields or
  • 11. 11 Overview • Mg-Al alloy solidification • OpenPhase Tutorial • Parallelization
  • 12. 12 Mg-Al Microstructure and Thermodynamics  Mg-Al alloys microstructure consist of α-phase (HCP-Mg dendrites) surrounded by closed shell Mg17Al12 β-phase  properties as corrosion resistance depend on the microstructure Goal:  Modeling as cast microstructures using the phase field model 200µm
  • 13. 13 Experimental as-cast Mg-Al Microstructure 0.3 K/s 1.0 K/s 25 K/s 1 mm (a): furnace control (b): air cooling (c): water cooling
  • 14. 14 Nucleation Modeling  Create a list of virtual particles, that satisfies a given nucleation density  At every time step plant nuclei by creating a phase field with value zero at the corresponding grid point, if the parent phase is correct  Compute driving force , if remove the corresponding virtual particle from the list, otherwise remove phase field.
  • 15. 15 Initial temperature: 875 K Cooling rate: 10 K/s Initial concentration: 5 at. % Al System size: 200x200x200 μm Grid spacing: 1.0 um Solidification of MgAl
  • 17. 17 Effect of cooling rate on solidification microstructure 5 K/s 15 K/s 25 K/s 200µm Mg-5at.%Al α-Mg β-Mg
  • 18. 18 α- and β-phase nucleation during solidification α-Mg β-Mg  Primary α-phase dendrites fill most of the volume.  Secondary β-phase fills interdendritic region.
  • 19. 19 Evolution of microstructure during solidification α-Mg β-Mg 100µm 300³ µm = 27 mio cells one week calculation time on 96 cores
  • 20. 20 100µm Evolution of microstructure during solidification 100µm
  • 21. 21 3D Secondary β-phase Nucleation and Growth Modeling α β 100µm
  • 22. 22 3D Secondary β-phase Nucleation and Growth Modeling 20µm
  • 23. 23 α α β 20µm Rapid coverage of α-liquid-interface with β-phase  β-phase covers the α-liquid-interface  Further β-phase growth depletes enclosed melt  Nucleation of tertiary α-phase is neccessary for complete solidification Monas A et al.; “Divorced Eutectic Solidification of Mg-Al Alloys”, JOM (2015)
  • 24. 24 Mg-Al β-phase formation: experiment vs simulation 100µm 5µm SEM-image of Mg-5%Al microstructure and enlarged view on the eutectic region. dark: α-phase, bright: β-phase Se-Jong Kim, Chang Dong Yim, KIMS, Korea
  • 25. 25 Tutorial OpenPhase can be downloaded at http://www.openphase.de/upload/content/OpenPhase.V0.9.1.zip The tutorial will use the SolidificationMgAl example. In order to compile the OpenPhase library just run 'make' in the main directory. To compile an example call ‘make’ in the corresponding directory.
  • 26. 26 Load Modules int main(int argc, char *argv[]) { Settings OPSettings; OPSettings.Initialize(); OPSettings.ReadInput(); PhaseField Phi(OPSettings); DoubleObstacle DO(OPSettings); InterfaceMobility Mu(OPSttings); InterfaceEnergy Sigma(OPSettings); InterfaceEnergySolidLiquid IE(OPSettings); EquilibriumPartitionDiffusion DF(OPSettings); Composition Cx(OPSettings); Temperature Tx(OPSettings); DrivingForce dG(OPSettings); BoundaryConditions BC(OPSettings); Nucleation Nuc(OPSettings);
  • 28. 28 Load Modules dG.ReadInput(); Cx.ReadInput(); DF.ReadInput(); Tx.ReadInput(); BC.ReadInput(); Nuc.ReadInput(); Mu.ReadInput(); Sigma.ReadInput(); IE.ReadInput(); int id = Initializations::Single(Phi, 0, BC, OPSettings); Phi.FieldsStatistics[id].State= Liquid; DF.SetInitialComposition(Phi, Cx); Tx.SetInitial(BC, Phi, 0);
  • 30. 30 Work Loop for(int tStep = OPSettings.tStart + 1; tStep < OPSettings.nSteps + 1; tStep++) { Nuc.GenerateNucleationSites(Phi, Tx); Nuc.PlantNuclei(Phi, tStep); Sigma.CalculateHex(Phi); Mu.CalculateHex(Phi, Tx); DF.SetPhaseFractions(Phi); DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu); DF.GetDrivingForce(Phi, Cx, Tx, dG); dG.Average(Phi, BC); Nuc.CheckNuclei(Phi, Sigma, dG, tStep); dG.MergePhaseFieldIncrements(Phi, Sigma, Mu); Phi.NormalizeIncrements(BC, dt); DF.Solve(Phi, Cx, Tx, BC, dt); Phi.MergeIncrements(BC, dt); Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt); }
  • 31. 31 Work Loop for(int tStep = OPSettings.tStart + 1; tStep < OPSettings.nSteps + 1; tStep++) { Nuc.GenerateNucleationSites(Phi, Tx); Nuc.PlantNuclei(Phi, tStep); Sigma.CalculateHex(Phi); Mu.CalculateHex(Phi, Tx); DF.SetPhaseFractions(Phi); DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu); DF.GetDrivingForce(Phi, Cx, Tx, dG); dG.Average(Phi, BC); Nuc.CheckNuclei(Phi, Sigma, dG, tStep); dG.MergePhaseFieldIncrements(Phi, Sigma, Mu); Phi.NormalizeIncrements(BC, dt); DF.Solve(Phi, Cx, Tx, BC, dt); Phi.MergeIncrements(BC, dt); Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt); } Generates nucleation sites with a random size distribution the first time this function is called.
  • 32. 32 Work Loop for(int tStep = OPSettings.tStart + 1; tStep < OPSettings.nSteps + 1; tStep++) { Nuc.GenerateNucleationSites(Phi, Tx); Nuc.PlantNuclei(Phi, tStep); Sigma.CalculateHex(Phi); Mu.CalculateHex(Phi, Tx); DF.SetPhaseFractions(Phi); DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu); DF.GetDrivingForce(Phi, Cx, Tx, dG); dG.Average(Phi, BC); Nuc.CheckNuclei(Phi, Sigma, dG, tStep); dG.MergePhaseFieldIncrements(Phi, Sigma, Mu); Phi.NormalizeIncrements(BC, dt); DF.Solve(Phi, Cx, Tx, BC, dt); Phi.MergeIncrements(BC, dt); Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt); } Plant nuclei at the generated sites. Add storage for a phase field with value zero.
  • 33. 33 Work Loop for(int tStep = OPSettings.tStart + 1; tStep < OPSettings.nSteps + 1; tStep++) { Nuc.GenerateNucleationSites(Phi, Tx); Nuc.PlantNuclei(Phi, tStep); Sigma.CalculateHex(Phi); Mu.CalculateHex(Phi, Tx); DF.SetPhaseFractions(Phi); DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu); DF.GetDrivingForce(Phi, Cx, Tx, dG); dG.Average(Phi, BC); Nuc.CheckNuclei(Phi, Sigma, dG, tStep); dG.MergePhaseFieldIncrements(Phi, Sigma, Mu); Phi.NormalizeIncrements(BC, dt); DF.Solve(Phi, Cx, Tx, BC, dt); Phi.MergeIncrements(BC, dt); Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt); } Calculate interface stiffness
  • 34. 34 Work Loop for(int tStep = OPSettings.tStart + 1; tStep < OPSettings.nSteps + 1; tStep++) { Nuc.GenerateNucleationSites(Phi, Tx); Nuc.PlantNuclei(Phi, tStep); Sigma.CalculateHex(Phi); Mu.CalculateHex(Phi, Tx); DF.SetPhaseFractions(Phi); DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu); DF.GetDrivingForce(Phi, Cx, Tx, dG); dG.Average(Phi, BC); dG.MergePhaseFieldIncrements(Phi, Sigma, Mu); Phi.NormalizeIncrements(BC, dt); DF.Solve(Phi, Cx, Tx, BC, dt); Phi.MergeIncrements(BC, dt); Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt); } Calculate interface mobility
  • 35. 35 Work Loop for(int tStep = OPSettings.tStart + 1; tStep < OPSettings.nSteps + 1; tStep++) { Nuc.GenerateNucleationSites(Phi, Tx); Nuc.PlantNuclei(Phi, tStep); Sigma.CalculateHex(Phi); Mu.CalculateHex(Phi, Tx); DF.SetPhaseFractions(Phi); DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu); DF.GetDrivingForce(Phi, Cx, Tx, dG); dG.Average(Phi, BC); dG.MergePhaseFieldIncrements(Phi, Sigma, Mu); Phi.NormalizeIncrements(BC, dt); DF.Solve(Phi, Cx, Tx, BC, dt); Phi.MergeIncrements(BC, dt); Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt); } Calculate the sum of phase fields belonging to the same thermodynamic phase in each grid point.
  • 36. 36 Work Loop for(int tStep = OPSettings.tStart + 1; tStep < OPSettings.nSteps + 1; tStep++) { Nuc.GenerateNucleationSites(Phi, Tx); Nuc.PlantNuclei(Phi, tStep); Sigma.CalculateHex(Phi); Mu.CalculateHex(Phi, Tx); DF.SetPhaseFractions(Phi); DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu); DF.GetDrivingForce(Phi, Cx, Tx, dG); dG.Average(Phi, BC); dG.MergePhaseFieldIncrements(Phi, Sigma, Mu); Phi.NormalizeIncrements(BC, dt); DF.Solve(Phi, Cx, Tx, BC, dt); Phi.MergeIncrements(BC, dt); Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt); } Calculate the double obstacle potential for αβ-interfaces
  • 37. 37 Work Loop for(int tStep = OPSettings.tStart + 1; tStep < OPSettings.nSteps + 1; tStep++) { Nuc.GenerateNucleationSites(Phi, Tx); Nuc.PlantNuclei(Phi, tStep); Sigma.CalculateHex(Phi); Mu.CalculateHex(Phi, Tx); DF.SetPhaseFractions(Phi); DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu); DF.GetDrivingForce(Phi, Cx, Tx, dG); dG.Average(Phi, BC); Nuc.CheckNuclei(Phi, Sigma, dG, tStep); dG.MergePhaseFieldIncrements(Phi, Sigma, Mu); Phi.NormalizeIncrements(BC, dt); DF.Solve(Phi, Cx, Tx, BC, dt); Phi.MergeIncrements(BC, dt); Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt); } Calculate driving force
  • 38. 38 Work Loop for(int tStep = OPSettings.tStart + 1; tStep < OPSettings.nSteps + 1; tStep++) { Nuc.GenerateNucleationSites(Phi, Tx); Nuc.PlantNuclei(Phi, tStep); Sigma.CalculateHex(Phi); Mu.CalculateHex(Phi, Tx); DF.SetPhaseFractions(Phi); DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu); DF.GetDrivingForce(Phi, Cx, Tx, dG); dG.Average(Phi, BC); Nuc.CheckNuclei(Phi, Sigma, dG, tStep); dG.MergePhaseFieldIncrements(Phi, Sigma, Mu); Phi.NormalizeIncrements(BC, dt); DF.Solve(Phi, Cx, Tx, BC, dt); Phi.MergeIncrements(BC, dt); Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt); } The correct phase field profile across the interface can only be obtained if the driving force is constant across the interface and varies only along the interface. Therefore we calculate an average driving force , that is constant along the normal direction of the interface.
  • 39. 39 Work Loop for(int tStep = OPSettings.tStart + 1; tStep < OPSettings.nSteps + 1; tStep++) { Nuc.GenerateNucleationSites(Phi, Tx); Nuc.PlantNuclei(Phi, tStep); Sigma.CalculateHex(Phi); Mu.CalculateHex(Phi, Tx); DF.SetPhaseFractions(Phi); DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu); DF.GetDrivingForce(Phi, Cx, Tx, dG); dG.Average(Phi, BC); dG.MergePhaseFieldIncrements(Phi, Sigma, Mu); Phi.NormalizeIncrements(BC, dt); DF.Solve(Phi, Cx, Tx, BC, dt); Phi.MergeIncrements(BC, dt); Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt)} The correct phase field profile across the interface can only be obtained if the driving force is constant across the interface and varies only along the interface. Therefore we calculate an average driving force , that is constant along the normal direction of the interface. The average is calculated in two steps with
  • 40. 40 Work Loop for(int tStep = OPSettings.tStart + 1; tStep < OPSettings.nSteps + 1; tStep++) { Nuc.GenerateNucleationSites(Phi, Tx); Nuc.PlantNuclei(Phi, tStep); Sigma.CalculateHex(Phi); Mu.CalculateHex(Phi, Tx); DF.SetPhaseFractions(Phi); DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu); DF.GetDrivingForce(Phi, Cx, Tx, dG); dG.Average(Phi, BC); Nuc.CheckNuclei(Phi, Sigma, dG, tStep); dG.MergePhaseFieldIncrements(Phi, Sigma, Mu); Phi.NormalizeIncrements(BC, dt); DF.Solve(Phi, Cx, Tx, BC, dt); Phi.MergeIncrements(BC, dt); Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt); } Check driving force of nuclei. Sucessfully planted nuclei are removed from the list of nucleation sites.
  • 41. 41 Work Loop for(int tStep = OPSettings.tStart + 1; tStep < OPSettings.nSteps + 1; tStep++) { Nuc.GenerateNucleationSites(Phi, Tx); Nuc.PlantNuclei(Phi, tStep); Sigma.CalculateHex(Phi); Mu.CalculateHex(Phi, Tx); DF.SetPhaseFractions(Phi); DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu); DF.GetDrivingForce(Phi, Cx, Tx, dG); dG.Average(Phi, BC); Nuc.CheckNuclei(Phi, Sigma, dG, tStep); dG.MergePhaseFieldIncrements(Phi, Sigma, Mu); Phi.NormalizeIncrements(BC, dt); DF.Solve(Phi, Cx, Tx, BC, dt); Phi.MergeIncrements(BC, dt); Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt); } Compute interface fields for the chemical driving force
  • 42. 42 Work Loop for(int tStep = OPSettings.tStart + 1; tStep < OPSettings.nSteps + 1; tStep++) { Nuc.GenerateNucleationSites(Phi, Tx); Nuc.PlantNuclei(Phi, tStep); Sigma.CalculateHex(Phi); Mu.CalculateHex(Phi, Tx); DF.SetPhaseFractions(Phi); DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu); DF.GetDrivingForce(Phi, Cx, Tx, dG); dG.Average(Phi, BC); Nuc.CheckNuclei(Phi, Sigma, dG, tStep); dG.MergePhaseFieldIncrements(Phi, Sigma, Mu); Phi.NormalizeIncrements(BC, dt); DF.Solve(Phi, Cx, Tx, BC, dt); Phi.MergeIncrements(BC, dt); Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt); } Limit interface fields , so that the phase fields stay within bounds [0,1].
  • 43. 43 Work Loop for(int tStep = OPSettings.tStart + 1; tStep < OPSettings.nSteps + 1; tStep++) { Nuc.GenerateNucleationSites(Phi, Tx); Nuc.PlantNuclei(Phi, tStep); Sigma.CalculateHex(Phi); Mu.CalculateHex(Phi, Tx); DF.SetPhaseFractions(Phi); DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu); DF.GetDrivingForce(Phi, Cx, Tx, dG); dG.Average(Phi, BC); Nuc.CheckNuclei(Phi, Sigma, dG, tStep); dG.MergePhaseFieldIncrements(Phi, Sigma, Mu); Phi.NormalizeIncrements(BC, dt); DF.Solve(Phi, Cx, Tx, BC, dt); Phi.MergeIncrements(BC, dt); Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt); } Solve diffusion equation for the phase concentrations
  • 44. 44 Work Loop for(int tStep = OPSettings.tStart + 1; tStep < OPSettings.nSteps + 1; tStep++) { Nuc.GenerateNucleationSites(Phi, Tx); Nuc.PlantNuclei(Phi, tStep); Sigma.CalculateHex(Phi); Mu.CalculateHex(Phi, Tx); DF.SetPhaseFractions(Phi); DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu); DF.GetDrivingForce(Phi, Cx, Tx, dG); dG.Average(Phi, BC); Nuc.CheckNuclei(Phi, Sigma, dG, tStep); dG.MergePhaseFieldIncrements(Phi, Sigma, Mu); Phi.NormalizeIncrements(BC, dt); DF.Solve(Phi, Cx, Tx, BC, dt); Phi.MergeIncrements(BC, dt); Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt); } Compute the phase field update
  • 45. 45 Work Loop for(int tStep = OPSettings.tStart + 1; tStep < OPSettings.nSteps + 1; tStep++) { Nuc.GenerateNucleationSites(Phi, Tx); Nuc.PlantNuclei(Phi, tStep); Sigma.CalculateHex(Phi); Mu.CalculateHex(Phi, Tx); DF.SetPhaseFractions(Phi); DO.CalculatePhaseFieldIncrements(Phi, Sigma, Mu); DF.GetDrivingForce(Phi, Cx, Tx, dG); dG.Average(Phi, BC); Nuc.CheckNuclei(Phi, Sigma, dG, tStep); dG.MergePhaseFieldIncrements(Phi, Sigma, Mu); Phi.NormalizeIncrements(BC, dt); DF.Solve(Phi, Cx, Tx, BC, dt); Phi.MergeIncrements(BC, dt); Tx.Set(BC, Phi, 6.2e8, 1.773e6, 0, dt); } Compute temperature update
  • 46. 46 OpenPhase Solutions GmbH • A company has been founded that offers support • Focused on industry • GUI is in development • Creation of ProjectInput.opi • Creation of the .cpp file • Sanity check on input values • GUI will be commercial software • OpenPhase will stay free Johannes Görler Matthias Stratmann
  • 48. 48 Parallelization Thread (OpenMP)  Simultaneous execution of sequences of instruction  Shared address space Process (MPI)  Instance of a program  Own address space  Message Passing All cores should be used efficiently
  • 49. 49 Parallelization  Active phase fields or  Dynamic storage for active phase field  Contributions to the evolution equation only by active phase fields  Locally and temporally different number of active phase fields  Number of operations in each grid point can be different and can change over time.
  • 50. 50 Parallelization • OpenPhase uses stencil operations • Domain decomposition to divide the work onto multiple processes
  • 51. 51 Parallelization Use a domain decomposition to divide the work onto multiple processes.
  • 52. 52 Parallelization The wide halo avoids communication at the expense of additional work. This is used to limit us to one communication step per time step.
  • 53. 53 Load-balancing by Graph-partitioning Over-decomposition  Division of the domain into many more sub-domains (blocks) than processes.  Assignment of these sub-domains to processes  Goal: minimize communication and load-imbalance.
  • 54. 54 Load-balancing by Graph-partitioning Assignment of sub- domains to processes.  Simultaneous minimization of imbalance and communication  Graph-partitioning problem with vertex weights  Coloring of the graph with minimal edge cut  Constrainted sum of the vertex weights with the same color Block ↔ Vertex Communication ↔ Edge Load ↔ Weight Problem: No accurate current polynomial algorithm
  • 55. 55 Load-balancing by Graph-partitioning Greedy Graph-Partitioner 1. Start with color n = 1 2. Choose an uncolored vertex that increases the edge cut the least 3. Color it with color n 4. If the sum of vertex weights with color n is larger than set n = n+1 5. If there are any uncolored vertices, go to 2
  • 56. 56 Load-balancing by Graph-partitioning Greedy Graph-Partitioner 1. Start with color n = 1 2. Choose an uncolored vertex that increases the edge cut the least 3. Color it with color n 4. If the sum of vertex weights with color n is larger than set n = n+1 5. If there are any uncolored vertices, go to 2
  • 57. 57 Load-balancing by Graph-partitioning Graph Partitioning  The Greedy Graph-Partitioner fulfills  Because the last vertex added to each color fulfills  Total work on process i.  Average work .  Maximum work among blocks. Reducing limits the maximum load-imbalance. This can be achieved by splitting blocks into smaller blocks.
  • 58. 58 Load-balancing by Graph-partitioning Splitting Blocks, however, creates additional work After splitting the most costly block the inequality becomes
  • 59. 59 Load-balancing by Graph-partitioning Repeated splitting of the largest block gives Allowing the same block to be split multiple times gives Problem: The cost of splitting is unknown.
  • 60. 60 Load-balancing by Graph-partitioning Problem: The cost of splitting is unknown.  Self-Profiling in order to approximate the cost.  Measure time for computations on each block.  Fit parameters in a cost function  that maps the number of phase fields in each grid point to the computation time.  This information is also used to determine the optimal cutting plane.
  • 65. 65 Load-balancing by Graph-partitioning Weak-Scaling Benchmark Pure MPI  96x48x48 grid points per core.  2 particles per core  Gaussian distribution
  • 66. 66 Load-balancing by Graph-partitioning Weak-Scaling Benchmark Hybrid MPI+OpenMP  96x48x48 grid points per core.  2 particles per core  Gaussian distribution
  • 67. 67 Load-balancing by Graph-partitioning Hybrid-Parallelism reduces the number of MPI-processes. The number of blocks is reduced, the blocks become larger. Less overhead is created by the wide halo. A large number of threads loses efficiency. Only one thread per process participates in communication. Threads created on different sockets can have slow memory access. The best performance was seen with 6 or 12 threads per process.
  • 68. 68 Load-balancing using Phase Field Load-balancing aims at simulatenous reduction of idle time and communication. Sub-domains need to have the same amount of work. Surface between sub-domains should be minimized. Idle time Communication With an appropriate driving force the multiphase field method can achieve this.
  • 69. 69 Load-balancing using Phase Field  Domain decompostion with one sub-domain per process .  Each process is associated with a phase field .  The associated sub-domain is determined by the phase field .  Balancing of the work between adjacent domains and by a driving force that drives the interface into the direction of the higher computational load.  An isotropic interface energy reduces the surface area between domains.
  • 70. 70 Load-balancing using Phase Field Application to the Phase Field Method  Two instances of phase field  Simulation  Load-balancing  Using Wide Halo
  • 71. 71 Load-balancing using Phase Field Application to the Phase Field Method  Two instances of phase field  Simulation  Load-balancing  Using Wide Halo  Both on the same rectangular sub- domain  Interior points of the sub-domains can overlap.
  • 72. 72 Load-balancing using Phase Field Comparison with the previous load- balancing scheme.
  • 73. 73 Load-balancing using Phase Field Convergence of load-balance  96 MPI processes  20% Tolerance
  • 74. 74 Load-balancing using Phase Field Convergence of load-balance  96 MPI processes  5% Tolerance
  • 75. 75 Load-balancing using Phase Field Application to the Phase Field Method  Two instances of phase field  Simulation  Load-balancing  Using Wide Halo  Both on the same rectangular sub- domain , in which is the majority phase.  Interior points of the sub-domains can overlap.
  • 76. 76 Load-balancing using Phase Field Applied to Molecular Dynamics  Cell-based molecular dynamics  Lennard-Jones potential  Start with a simple domain decomposition  Colors indicate processes  The phase fields are only updated with a probability of With the maximum load among processes 𝜔 𝑚𝑎𝑥, the number of processes 𝑁 𝑝 and the average time for load-balancing 𝑇𝐿𝐵.
  • 78. 78 Two Spheres Move Over Periodic Boundary
  • 80. 80 Summary  OpenPhase is a flexible multi-phase-field framework, that can handle an arbitrary number of phase fields for a variety of applications  MPI and OpenMP parallelization allow an efficient usage of computational resources.
  • 81. 81 Summary  OpenPhase is a flexible multi-phase-field framework, that can handle an arbitrary number of phase fields for a variety of applications  MPI and OpenMP parallelization allow an efficient usage of computational resources. Thank you!