-
Notifications
You must be signed in to change notification settings - Fork 26
Stability of simulations
When you see error messages like maxiter reached in saturation_adjustment or DomainError, it usually means the simulation becomes unstable. While there is no general solution, here are a few things you could try:
-
Reduce timestep
Some of the jobs may be close to the unstable regime. You can change the timestep by changing
dtin the config file. It is usually ok if the simulation becomes stable when timestep is decreased by less than 20%. It would be good to investigate further if you need a larger decrease in dt. -
Increase or decrease hyperdiffusion
Hyperdiffusion damps oscillations at small scales. Increasing hyperdiffusion may be helpful if you see grid imprinting in the state variables. However, hyperdiffusion can create spurious extrema. Decreasing hyperdiffusion may be helpful if you see spurious extrema in your tracer field.
You can change hyperdiffusion by changing
vorticity_hyperdiffusion_coefficient,divergence_damping_factor, andscalar_hyperdiffusion_coefficientin the config file. It is common to havevorticity_hyperdiffusion_coefficient * divergence_damping_factor = scalar_hyperdiffusion_coefficient, withdivergence_damping_factorgreater than or equal to 1. Try to keep both coefficients smaller than 6. You can also change the hyperdiffusivity directly insrc/prognostic_equations/hyperdiffusion.jlfor testing if you want to change it for certain tracers. -
Increase the strength of the Rayleigh sponge
Rayleigh sponge damps vertical velocity to 0 in the top model layers. Increasing its strength may be helpful if the instability comes from the top, which is usually the case if
ρin the input tosaturation_adjustmentis smaller than 0.1. You can change the strength of the damping by changingalpha_rayleigh_win the parameter file. There is no constraint on how large the number can be, but 10 is pretty large.