Numerical parameters
Posted: Mon Jun 23, 2008 8:19 am
If someone wants to set up a new simulation with MICRESS, one of the typical problems is to find appropriate parameters. In addition to physical parameters there is a set of numerical parameters which strongly affect the numerical stability of a MICRESS simulation.
How to detect instabilities? In the worst case you can get a hard crash. If you run a Thermo-Calc coupled simulation it is most probable that the thermodynamic subroutines give errors or warnings due to unphysical variables which are created by instabilities. So there is normally no chance not to detect instabilities! Without coupling to thermodynamic data you can detect instabilities via "chess pattern" formation in the .conc or .driv output, by spreading of the interface reagion (.intf output) to values much bigger than the specified interface thickness, or by extreme slowing down of the simulation (check CPU time in the .TabL output).
The most critical parameters for numerical stability are the grid resolution and the interface mobility. Generally the grid resolution must be high enough to resolve the diffusion profiles, which are related to the diffusion coefficients and the growth velocity of the interface, and the curvature of the finest microstructures which are expected to form. On the other hand the interface mobility must be high enough to allow diffusion-controlled growth without slowing down the interface kinetically.
This in principle would mean, that using very high resolution and high interface mobilities would automatically result in stable simulations.Indeed this is true in most cases, but it is not practicable because it results in extremely high calculation times! For example, increasing grid resolution by a factor of 2 in a 2-dimensional simulation will result in a factor of 4 (8 for 3D) for the simulation time, if the simulation is limited by interface related load (high proportion of interface in the calculation domain), or by a factor of 16 (32 for 3D), if diffusion is time-limiting! Increasing the interface mobility proprotionally reduced the phase-field time step and thus increases the simulation time.
General advices for finding proper numerical parameters are the following:
- Try to use the smallest size of the simulation area which still represents your problem. After finding suitable parameters you can apply them to bigger domains or more complex problems.
- Reduce the problem to only one interface between two phases. Optimizing different phase interaction at a time will produce confusion!
- Use the automatic time stepping option to get rid of the time-step as an additional numerical parameter.
- Don't use physical parameters for optimizing numerical stability! If you do not know all of them make guesses and stick to them, until later by comparison of stable simulations to experimental data you can calibrate them.
Depending on whether you need quantitative or just qualitative results, and whether you can afford the high resolution you would need for complete resolution of the microstructure and the diffusion profiles, from my experience there are mainly three approaches:
a) Qualitative work:
Choose a resolution for which you have the feeling that you can afford (in terms of calculation time). Start with a guessed mobility value. If the simulation is crashing or shows instabilities, lower the mobility value until you get a stable run. Look at the .driv output to see whether the movement of the interface is strongly slowed down by the choice of your mobility ( http://board.micress.de/viewtopic.php?f=18&t=25 )! If that is the case, the grid resolution is not fine enough! Try again with a smaller value. On the other hand, if the simulation is running properly with your first guess of the mobility and resolution value, try to reduce the mobiltiy or increase grid spacing to make your simulation even faster.
b) Full resolution of the microstructure and diffusion profiles:
If you want to be sure that the choice of the grid resolution and interface mobility does not affect the results of your simulation, you need to quantitatively check the growth velocity of the interface. This can be easily done by plotting one of the phase fractions vs. time (.TabF output) or the temperature vs. time (.TabL), if you use release of latent heat. Then you can quantitatively check the growth kinetics for different parameter settings.
The way to proceed is the follwing: Start from a given grid resolution and systematically modify the interface mobility. You will experience that growth kinetics will get faster on increasing the interface mobility, as long as you are in the range of too low mobilities. If you further increase the interface mobility depending on the grid spacing you will get the following behaviour:
i) too big grid spacing: The growth rate of the interface will further increase until you end up in numerical instabilities
ii) grid spacing is small enough: The growth rate will reach a plateau and remain constant even for higher interface mobility values.
Once you observe such a plateau you can be sure that (at least from numerical reasons and assuming diffusion-limited growth!) your results are quantitative. Unfortunately there are only few cases where you can afford to solve your problem completely with that high resolution. In most cases you have to proceed to c).
c) Quantitative work without fully resolving microstructure and diffusion profiles
A way to get the right kinetics even if you cannot afford the high resolution you would need for fully resolving the microstructure and diffusion profiles is to use the interface mobility to calibrate the growth kinetics. This necessarily means that you need to know the exact kinetics for your process either from experiments or by getting it from a high resolution simulation via method b), using the smallest possible calculation domain which still represents your simulation problem.
Calibration is just done by variation of the interface mobility for the given (to big) value of the grid spacing and comparing (via .TabL or .TabF output) to the reference simulation (or experiment). This is not always possible if the morphology of the low-resolution simulation is very different to the real one. Then you should try to use additionally the averaging of the driving force across the interface to better match morphology ans such the kinetic transient of your interface growth. For this reason you can adjust the averaging length of the driving force seperately for each phase interaction. By this way in many cases you are able to perform low-resolution simulation without getting all microstructure details but with the appropriate growth kinetics.
As you see it is quite a bit of work to perform quantitative simulations with MICRESS, if there is no access to infinite computational power or if the problem is not extremely simple. But keep in mind that in many cases you may be just interested in knowing how a system reacts on changes of a physical parameter, or due to the lack of physical parameters you anyway need to calibrate your simulation to experimental results. Then it is often not necessary to perform a perfect adjustment of the transformation kinetics to get a valuable insight into the problem by simulation.
This methods an the approach to quantitative simulation is based on my personal experience and opinion. Other people involved in phase-field simulations may have different ideas. I would like to read your comments on that!
Bernd
---
original message from Bernd
How to detect instabilities? In the worst case you can get a hard crash. If you run a Thermo-Calc coupled simulation it is most probable that the thermodynamic subroutines give errors or warnings due to unphysical variables which are created by instabilities. So there is normally no chance not to detect instabilities! Without coupling to thermodynamic data you can detect instabilities via "chess pattern" formation in the .conc or .driv output, by spreading of the interface reagion (.intf output) to values much bigger than the specified interface thickness, or by extreme slowing down of the simulation (check CPU time in the .TabL output).
The most critical parameters for numerical stability are the grid resolution and the interface mobility. Generally the grid resolution must be high enough to resolve the diffusion profiles, which are related to the diffusion coefficients and the growth velocity of the interface, and the curvature of the finest microstructures which are expected to form. On the other hand the interface mobility must be high enough to allow diffusion-controlled growth without slowing down the interface kinetically.
This in principle would mean, that using very high resolution and high interface mobilities would automatically result in stable simulations.Indeed this is true in most cases, but it is not practicable because it results in extremely high calculation times! For example, increasing grid resolution by a factor of 2 in a 2-dimensional simulation will result in a factor of 4 (8 for 3D) for the simulation time, if the simulation is limited by interface related load (high proportion of interface in the calculation domain), or by a factor of 16 (32 for 3D), if diffusion is time-limiting! Increasing the interface mobility proprotionally reduced the phase-field time step and thus increases the simulation time.
General advices for finding proper numerical parameters are the following:
- Try to use the smallest size of the simulation area which still represents your problem. After finding suitable parameters you can apply them to bigger domains or more complex problems.
- Reduce the problem to only one interface between two phases. Optimizing different phase interaction at a time will produce confusion!
- Use the automatic time stepping option to get rid of the time-step as an additional numerical parameter.
- Don't use physical parameters for optimizing numerical stability! If you do not know all of them make guesses and stick to them, until later by comparison of stable simulations to experimental data you can calibrate them.
Depending on whether you need quantitative or just qualitative results, and whether you can afford the high resolution you would need for complete resolution of the microstructure and the diffusion profiles, from my experience there are mainly three approaches:
a) Qualitative work:
Choose a resolution for which you have the feeling that you can afford (in terms of calculation time). Start with a guessed mobility value. If the simulation is crashing or shows instabilities, lower the mobility value until you get a stable run. Look at the .driv output to see whether the movement of the interface is strongly slowed down by the choice of your mobility ( http://board.micress.de/viewtopic.php?f=18&t=25 )! If that is the case, the grid resolution is not fine enough! Try again with a smaller value. On the other hand, if the simulation is running properly with your first guess of the mobility and resolution value, try to reduce the mobiltiy or increase grid spacing to make your simulation even faster.
b) Full resolution of the microstructure and diffusion profiles:
If you want to be sure that the choice of the grid resolution and interface mobility does not affect the results of your simulation, you need to quantitatively check the growth velocity of the interface. This can be easily done by plotting one of the phase fractions vs. time (.TabF output) or the temperature vs. time (.TabL), if you use release of latent heat. Then you can quantitatively check the growth kinetics for different parameter settings.
The way to proceed is the follwing: Start from a given grid resolution and systematically modify the interface mobility. You will experience that growth kinetics will get faster on increasing the interface mobility, as long as you are in the range of too low mobilities. If you further increase the interface mobility depending on the grid spacing you will get the following behaviour:
i) too big grid spacing: The growth rate of the interface will further increase until you end up in numerical instabilities
ii) grid spacing is small enough: The growth rate will reach a plateau and remain constant even for higher interface mobility values.
Once you observe such a plateau you can be sure that (at least from numerical reasons and assuming diffusion-limited growth!) your results are quantitative. Unfortunately there are only few cases where you can afford to solve your problem completely with that high resolution. In most cases you have to proceed to c).
c) Quantitative work without fully resolving microstructure and diffusion profiles
A way to get the right kinetics even if you cannot afford the high resolution you would need for fully resolving the microstructure and diffusion profiles is to use the interface mobility to calibrate the growth kinetics. This necessarily means that you need to know the exact kinetics for your process either from experiments or by getting it from a high resolution simulation via method b), using the smallest possible calculation domain which still represents your simulation problem.
Calibration is just done by variation of the interface mobility for the given (to big) value of the grid spacing and comparing (via .TabL or .TabF output) to the reference simulation (or experiment). This is not always possible if the morphology of the low-resolution simulation is very different to the real one. Then you should try to use additionally the averaging of the driving force across the interface to better match morphology ans such the kinetic transient of your interface growth. For this reason you can adjust the averaging length of the driving force seperately for each phase interaction. By this way in many cases you are able to perform low-resolution simulation without getting all microstructure details but with the appropriate growth kinetics.
As you see it is quite a bit of work to perform quantitative simulations with MICRESS, if there is no access to infinite computational power or if the problem is not extremely simple. But keep in mind that in many cases you may be just interested in knowing how a system reacts on changes of a physical parameter, or due to the lack of physical parameters you anyway need to calibrate your simulation to experimental results. Then it is often not necessary to perform a perfect adjustment of the transformation kinetics to get a valuable insight into the problem by simulation.
This methods an the approach to quantitative simulation is based on my personal experience and opinion. Other people involved in phase-field simulations may have different ideas. I would like to read your comments on that!
Bernd
---
original message from Bernd