generate solver for u in uEquation and v in vEquation and w in wEquation and p in pEquation with { solver_maxNumIts = 20 solver_targetResReduction = 1e-30 solver_absResThreshold = 1e-10 solver_smoother_jacobiType = false solver_smoother_numPre = 3 solver_smoother_numPost = 3 solver_smoother_damping = 1 solver_smoother_coloring = "red-black" // "9-way" solver_cgs = "BiCGStab" solver_cgs_maxNumIts = 12800 solver_cgs_targetResReduction = 1e-3 solver_cgs_absResThreshold = 1e-12 solver_cgs_restart = true solver_cgs_restartAfter = 128 solver_useFAS = true solver_silent = true } modifiers { prepend to 'cycle' @finest { startTimer ( 'cycle' ) totalNumCycles += 1 } append to 'cycle' @finest { stopTimer ( 'cycle' ) } append to 'solver' @finest { if ( gen_curRes != gen_curRes || gen_curRes > 1.0E-10 ) { curTime -= dt dt /= 2 curTime += dt print ( "Error detected after", gen_curIt, "steps, residual is", gen_curRes, "- reducing time step size to", dt, "and trying again with adapted time", curTime ) u = uOld v = vOld w = wOld p = pOld gen_solve ( ) } else { print ( " Residual at", curTime, "after", gen_curIt, "iterations is", gen_curRes, ", was initially" , gen_initRes ) } } } Function Advance@all { uOld = u vOld = v wOld = w pOld = p }