I am currently simulating an external 2D flow around a square cylinder for Re=100 in order to study the vortex shedding frequency. Although I’ve already tried to adjust the Relaxation Time and resolution according to literature, the simulation apparently tends do diverge, as it is possible to see in this drag plot (https://imgur.com/a/jw70DOD). I am using the AnalyticalConst2D<> functor to set the inlet velocity and setPeriodicity to define simmetry in the upper and lower boundaries.
The code is basically the cylinder2d example with the obstacle and inlet boundary conditions modified.
I’d appreciate if someone could give me some insights of what else I could do to improve stability.
I would recommend you to use slip boundaries for the upper and lower wall, because you want to set a symmetry boundary condition. Furthermore you must ensure that your domain is large enough to diminish the boundary influence on the results.