!*YAPFI macro
!*-----------
SET_NUMBER_OF_THREADS
32!Number of threads /1/

RANDOM_NUMBER_SETTINGS
y!Use a single seed for the pseudorandom number generator /NO/
2!Enter integer seed (1 digit) (<0 for internal vector) /1/


PRE_PROCESSOR


DIFFUSION_COUPLE
y!Use the diffusion couple feature /NO/


SPREAD_PHASES
y!Use the SPREAD_PHASES feature /NO/
!*This feature will maximize the spread of the grains
!*of different phases
!*DIFFUSION_COUPLE feature enabled
!*Enter data for both sides of diffusion couple
2!Enter the nr of phases on the left hand side
2!Enter the nr of phases on the right hand side
!*Enter left hand side phase fractions
0.68074264!Phase fraction of phase #1
0.31925736!Phase fraction of phase #2
!*Enter right hand side phase fractions
0.26545561!Phase fraction of phase #1
0.73454439!Phase fraction of phase #2


VORONOI_STRUCTURE
!*DIFFUSION_COUPLE feature of VORONOI_STRUCTURE enabled
!*Data for left hand side of diffusion couple
64!Nr of Voronoi seeds (>1)
2!Dimensionality (1-3)
128!Number of grid points
128!Number of grid points
!Domain width [a.u.] /1.0000000/
!Domain width [a.u.] /1.0000000/
1!Random coordinates of seeds (=1), or manually entered (=2)
n!Periodic boundary
n!Periodic boundary
n!Varying growth rate of seeds
0.06!Minimum radial distance between seeds (>=0)
!*Output format options:
!*1.Suitable for GRAIN_GROWTH_MODEL
!*2.Suitable for PHI_SWITCHING
2!Select output option
!Output file name (leave blank to keep structure in memory)
!*Data for right hand side of diffusion couple
64!Nr of Voronoi seeds (>1)
!*The nr of grid points must be the same in dimensions 2-3
!*for both sides of diffusion couple
128!Number of grid points
!*The domain size must be the same in dimensions 2-3
!*for both sides of diffusion couple
!Domain width [a.u.] /1.0000000/
1!Random coordinates of seeds (=1), or manually entered (=2)
n!Periodic boundary
n!Periodic boundary
n!Varying growth rate of seeds
0.06!Minimum radial distance between seeds (>=0)
!*Necessary nr of phase-field variables is approximately 11-12
!*Note, though, that some additional phase-field variables might be needed
!*Phase/grain data for the left hand side of diffusion couple:
!*Phase #1 has 44 grains
!*Phase #2 has 20 grains
!*Phase/grain data for the right hand side of diffusion couple:
!*Phase #1 has 17 grains
!*Phase #2 has 47 grains

RETURN

MANDATORY_DATA
fecrni_bcc_fcc_demo.GES5!GES file / ANALYTICAL [<analytic init file>]
1373!(Initial) Temperature [K] /1000.0000/
!Pressure [Pa] /100000.00/
!Element CR substitutional /YES/
!Element FE substitutional /YES/
!Element NI substitutional /YES/
!Initially homogeneous composition /YES/
0.3!Initial mole fraction of element CR
0.3!Initial mole fraction of element FE
0.4!Initial mole fraction of element NI
!*Enter state of phases, 1:Entered, 2: Suspended
!State of phase (BCC_A2) /1/
!State of phase (FCC_A1) /1/
2!Dimensionality /1/
256!Nr of grid points in dimension #1 /10/
128!Nr of grid points in dimension #2 /10/
2560e-6!Domain width [m] in dimension #1 /1.0000000/
1280e-6!Domain width [m] in dimension #2 /1.0000000/
!Periodic boundary in dimension #1 /NO/
!Periodic boundary in dimension #2 /NO/
!*Grid type. 1:Linear, 2:Geometric, 3: Double geometric, 4: Read from file
!Grid type in dimension #1 /1/
!Grid type in dimension #2 /1/
!*Info: Initial time is always zero
7.2e5!Simulation time [s] /1.0000000/
!Maximum timestep [s] /0.10000000/
!Minimum timestep [s] /0.10000000E-09/
!Initial timestep [s] /0.10000000E-09/
!Save interval /1/
3600!Minimum elapsed time between saves [f(time)], [s] /1.0/


ESTIMATE_SURFACE_ENERGY
35e-6!Enter desired interface width [m]
10!Enter interfacial energy [J/m^2]
!Numerically estimate obtained surface energy during simulation /NO/


PHASE_FIELD_DATA
!Use phase-field variables /YES/
16!Total nr of phase-field variables /2/
!File containing initial phase-field variable values
!*Associate phases with phase-field variables
!*The association may be preceded with REPEAT[(n)]
!*Phase indices:
!*1:BCC_A2
!*2:FCC_A1
repeat(8) 1!Index of associated phase of phase-field variable # 1
repeat(8) 2!Index of associated phase of phase-field variable #11
!*Enter g_1
!*Shorthand notations:
!*gs11=\sum_\alpha G_{m\alpha}(\phi_\alpha^3(10-15\phi_\alpha+6\phi_\alpha^2))/
!*\sum_\alpha\Phi_alpha^3(10-15\Phi_\alpha+6\Phi_alpha^2)
!*where \Phi_alpha=\sum_{i\in\alpha}\phi_i
!*gs12=\sum_iG_{mi}\phi_i
!*variable GXX correspond to Gm of phase
kks!Gm expression for g_1
!*Enter g_2
!*Shorthand notations:
!*gs21=8\sum_i\phi_i^2(1-\phi_i)^2
!*gs22=0.626\sum_i(\frac{\tanh(2)^2-1}{\tanh(2)^2}\log[1-\tanh(2)^2(2\phi_i-1)^2]-(2\phi_i-1)^2)
!*gs23=10.67(0.25-0.5\sum\phi_i^2+0.25(\sum\phi_i^2)^2+0.5\sum_i\sum_{j>i}\phi_i^2\phi_j^2
!*keyword SYMMETRIC may precede the expression for g_2
symmetric 2.142857*gs23!Gm expression for g_2
!*Enter epsilon_ij expressions (<=0 is enforced)
!*Enter REPEAT[(n)] before the expression to repeat it
repeat 1.3125e-9!E0102
(100*15e-17)/35e-6**2!Enter phase-field mobility expression





NUMERICAL_SETTINGS
!Degree of implicity /1.0000000/
!Relative error tolerance /0.50000000E-01/
!Absolute error tolerance /0.10000000E-07/
!Jacobian perturbation parameter /0.10000000E-02/
!Clean Jacobian /NO/
!Minimum mole fraction /0.10000000E-14/
!Minimum mobility /0.10000000E-39/
!Maximum temperature /6000.0000/
!Maximum timestep change factor /2.0000000/
!Enforce a maximum \Delta T per time-step /NO/
!Temporally piece-wise locally constant coefficients /YES/
y!Enable linearized time-steps /NO/
y!Assume a maximum width of interfaces /NO/
17.5e-6!Enter width of interface as real value (>0.0) or nr of grid points (3,5,7,..)
!Set non-active phase-field variables away from interfaces to zero /YES/



PHI_SWITCHING
y!Automatic switching of phase-field variables /NO/
128!Max nr of grains (including nucleation) (>0)
!*Options for assigning initial grain numbers of grid points:
!*1.Read for each grid point from file
!*2.Read for each grid point from memory
!*3.Assign by initial phase-field variable
2!Enter option for assigning initial grain numbers /2/
!*Phase sets:
!*1.BCC_A2
!*2.FCC_A1
!*Options for assigning phase sets to grains:
!*1.Read for each grain from file
!*2.Enter for each grain interactively
!*3.Assign by initial phase-field variable
!*(require that option #3 was chosen for initial grain numbers)
2!Enter option for assigning phase sets to grains
!*Optionally, enter REPEAT[(n)] before the phase set
repeat(44) 1!Phase set of grain #1
repeat(20) 2!Phase set of grain #3
repeat(17) 1!Phase set of grain #5
repeat(47) 2!Phase set of grain #7
y!Set composition of grains /NO/
!*Options for setting initial composition of grains:
!*1.Read for each grain from file
!*2.Enter interactively
2!Enter option for setting initial composition of grains
!*For each grain, give the mole fractions of all elements,
!*in alphabetical order.
!*Optionally, enter REPEAT[(n)] before the 1st mole fraction of a grain
!*Enter composition of grain #1
repeat(44) 0.28057753!Mole fraction of element CR (optional REPEAT[(n)])
          0.66671911!Mole fraction of element FE (will be REPEATed)
          5.2703358E-2!Mole fraction of element NI (will be REPEATed)
!*Enter composition of grain #3
repeat(20) 0.20743969!Mole fraction of element CR (optional REPEAT[(n)])
          0.70225123!Mole fraction of element FE (will be REPEATed)
          9.0309079E-2!Mole fraction of element NI (will be REPEATed)
!*Enter composition of grain #5
repeat(17) 0.59719833!Mole fraction of element CR (optional REPEAT[(n)])
          0.27056562!Mole fraction of element FE (will be REPEATed)
          0.13223605!Mole fraction of element NI (will be REPEATed)
!*Enter composition of grain #7
repeat(47) 0.36020507!Mole fraction of element CR (optional REPEAT[(n)])
          0.31249404!Mole fraction of element FE (will be REPEATed)
          0.3273009!Mole fraction of element NI (will be REPEATed)


ADAPTIVE_MESHING
y!Use adaptive meshing /NO/
!Initial allocation factor (>=1) /1.0000000/
!Adapt mesh based on composition gradients /YES/
!Max composition Delta for CR /0.10000000/
!Min composition Delta for CR /0.10000000E-01/
!Max composition Delta for FE /0.10000000/
!Min composition Delta for FE /0.10000000E-01/
!Max composition Delta for NI /0.10000000/
!Min composition Delta for NI /0.10000000E-01/
!Adapt mesh based on phase-field variable gradients /YES/
!Max phase-field variable Delta /0.10000000/
!Min phase-field variable Delta /0.10000000E-01/
n!Adapt mesh based on temperature gradients /YES/
2!Domain size integer aspect ratio, 1st spatial dimension
1!Domain size integer aspect ratio, 2nd spatial dimension
1!Input integer (1) or real valued (2) parameters /1/
8!Initial depth (>0)
5!Minimum depth (>0)
9!Maximum depth (>0)
!Refine interfaces to maximum fineness (only for phase-field, done gradually) FEATURE CURRENTLY DISABLED /NO/
y!Base interval to adapt mesh on cumulative change /NO/
n!Use cumulative change of mole-fractions
y!Use cumulative change of phase-field variables
0.3!Maximum cumulative change of phase-field variables




SOLVER
!*Solvers:
!*1.Jacobian solver
!*2.Implicit solver
2!Choose solver /1/

MATRIX_SOLVER
!*Matrix solvers
!*1.QMR
!*2.BiConjugate Gradient
!*3.PARDISO
1!Matrix solver /1/

SET_SCREEN_OUTPUT
1!Screen output. 1=Normal, 2=Minimal, 3=Less than minimal, 4=Almost nothing /2/


SAVE_SETTINGS
!Filename prefix /yapfisim/
!*Possible additional properties to be saved:
!*1.Gm
!*2.\varepsilon_{ij} (only for phase-field)
!*3.d\phi_i/dt (only for phase-field)
!*4.dg_{12}/d\phi_i (only for phase-field)
!*5.dg_\nabla/d\phi_i (only for phase-field)
!*6.\nabla\xi_i (only for phase-field)
!*7.active \phi (only for phase-field)
!*8.g_1 (only for phase-field)
!*9.g_2 (only for phase-field)
!*10.\sum\nabla\phi_i\sum\nabla\phi_j\varepsilon_{ij} (only for phase-field)
!*11.\sum\nabla c_i\sum\nabla c_j\kappa_{ij} (only if gradient energy contribution)
!*12.User defined functions
!*13.\sum\phi_i^2(1-\phi_i)^2
!*14.Save coordinates and variable values only in csv-like separate file
y!Add additional properties to be saved /NO/
13!Enter code for additional save property (-1*code to cancel, zero to exit)
0!Enter code for additional save property (-1*code to cancel, zero to exit)


KKS_SETTINGS
!*Note: KKS enabled by entering function g_1=kks under PHASE_FIELD_DATA
y!Enter a_\alpha/\beta parameters manually /NO/
!*For the equilibrium between BCC_A2 and FCC_A1
600!Enter expression for parameter a for BCC_A2
600!Enter expression for parameter a for FCC_A1

