# Temperature¶

If latent heat is used in a MICRESS® simulation, there is an additional source of numerical instabilities, which is not covered by the automatic time stepping criteria. If the interface mobility of a growing phase is too high and the time step is too long, the latent heat release in one time step can be so high, that the driving force created from the corresponding temperature change is also high. This would cause an even bigger (opposite) release of heat in the next time step. This behaviour is difficult to predict, because it depends not only on the thermodynamics of the system, but also on the amount of interface in the calculation domain and on the diffusion coefficients.

Consequently, there is no systematic way to prevent that, other than reducing the time step manually if necessary. This can be done by a proper specification of the time input data, e.g.

```
...
automatic_limited
constant
1.E-7 1.E-5 0.95 0.95
...
```

The first two parameters are the minimal and maximal allowed time step, the third and last parameter are pre-factors to the phase-field and the segregation criteria; a default value here is 0.9. Note that not all of the four parameters need to be specified. The second value in this case would be used to decrease manually the time step to a numerically stable value. The first parameter is typically used for other purposes (e.g. if in a single cell numerical problems would cause extremely low time step values, which would practically stop the simulation).

Before limiting the time step value, one should check whether the correct resolution and interface mobility values are used and whether the latent heat parameter is reasonable.

If latent heat is used in a 2-D MICRESS® simulation, a 2-D correction may be necessary, depending on the symmetry of the simulation domain. If all three spatial directions are equivalent like in equiaxed solidification, the 2-D shape corresponds to a projection of the 2-D structure to the 2-D plane. As a consequence, there is a systematic error of the 2-D phase fraction of the primary phase, leading to a corresponding error for the release of latent heat. By use of the keyword `lat_heat_3d`

, a correction may be possible, depending on the situation. There are two different situations:

If, e.g. for a growing equiaxed dendrite, the solutal diffusion fields do not touch the calculation domain boundaries (initial stage of growth), then growth in the third direction (perpendicular to the 2-D plane) can be considered as independent of growth in the 2-D plane. In this case, a geometric correction of the fraction of the primary phase is possible:

Here, f_\alpha is the fraction of a growing phase, and f_\text{matrix} is the fraction of the (vanishing) matrix phase.

If the solutal diffusion fields already touch the boundaries of the simulation domain or diffusion fields of other dendrites, growth in the three dimensions is no longer independent, and mass balance has to be considered. In this case, the 2-D fractions are correct and need no transformation.

Thus, one would need a 2-D correction in the initial stage of solidification (e.g. for heterogeneous nucleation using the seed density model, where these corrections are essential!), but switch it off at a later stage. The critical fraction is used for this purpose

f_\text{crit} is the critical fraction of the matrix phase at which the solutal diffusion fields substantially touch each other or the domain boundary.

This part of the matrix phase is regarded as an inert phase with respect to the correction of the phase fractions. Therefore, it is subtracted from the matrix phase fraction. When f_\text{matrix} comes close to f_\text{crit}, the correction is automatically switched off smoothly. Unfortunately, f_\text{crit}, has to be estimated by the user, which results in an additional 'fiddle' parameter.