Non homogeneous boundary and initial conditions

  1. BDF methods are only A-stable up to order 2, so you may have problems like this if the system has complex unstable eigenvalues. Try restricting the order to 2. Also, note that implicit methods are highly dissipative, so large time steps will dampen spurious as well as physical instabilities.

  2. Hard to comment here without more detail about absolute problem size and machine architecture. Are you using a direct or iterative linear solver?

Sounds like you’re making progress. Good luck!

Thanks for the reply,
Sorry that I didn’t give details,

  1. I ran the same code with bdf 3 twice in different time steps, one for 0.25, the other for 0.5, and the result shows that they are end in a different state. Is the results from larger time steps credible?
  2. I know little about the preconditioners, so I use the default "-pc_type lu -ksp_type preonly", and I think it is a direct solver. For the medium mesh, there are 16500 vertices, and I solve NSE and heat equation with 6 processes.The refined mesh is about 10 times larger, and I thought 64 maybe appropriate, but it became much slower.
    image
    image
  1. Larger timesteps are more dissipative but less accurate. I am not sure how you normalized time in your code, but I suspect both 0.25 and 0.5 are both much too large, assuming a typical reference scale. In most cases for incompressible flow with dimensionless t=D/U~1, 0.01 is a good order of magnitude guess for a reasonable time step.

  2. Direct methods are a fine first step, but you are probably getting slammed by communication overhead on a mesh this size with that many procs. Try staying in the 4-16 processor range until you optimize your solver with iterative methods.

Thank you for the comments.

  1. I use the free-fall velocity U=\sqrt{g\beta (T-T_0)L} and L/U for time, the maximum velocity in the recent trials is about 6.6e-2, L=1, and D/U\approx15, so 0.15 is a proper dt? The results with dt=0.5 finally shift to the state just like the other, but too much later, I observed the shift just before, and it seems not as a stable state as dt=0.25.

  2. I have no idea about iterative solvers. Which iterative solver is suitable for NSE? Could you recommend an example about iterative methods?

I am sorry, but these are questions that I cannot answer without a lot more information. Are you using a second-order bdf now? It is better to get the right answer at excessive computational expense than to get the wrong answer cheaply. When in doubt, make the time-step small.

If you do not know much about iterative solvers, then stick with direct solvers for now.

Sorry I did not express my problem very well. In general, for D/U =15, is dt=0.1 enough with bdf 2? If so, I will stick to it.

I can not say based only on the generic information you’ve shared.

Okay, so what information should I add?