1
$\begingroup$

I have very recently come to LB methods, and, after some reading, have implemented a little 2D code of my own. It uses some of the most basic assumptions :

  • D2Q9 lattice
  • BGK collision operator
  • Zou-He on all boundary conditions (prescribed ux and uy at inlet, prescribed rho and uy at outlet, prescribed ux and uy on top and bottom walls (no-slip condition))

I am computing the flow around custom shapes for Reynolds flow in the range 100-500 maximum (sorry, the gif is a bit short, but Stackoverflow limits size):

enter image description here

My question is the following : what causes the initial "shocks" that can be seen in the first steps of the resolution ? I suppose it is due to a mismatch in the initial conditions, I have been looking for quite some time for that specific answer, but was unable to find anything relevant.

Edit :

Initial conditions are :

  • U is a Poiseuille flow everywhere, except in the obstacle where it is 0
  • rho is 1 everywhere
  • the distribution is the equilibrium distribution obtained from these macroscopic states

Thank you in advance !

$\endgroup$
0

1 Answer 1

2
$\begingroup$

The waves you see look consistent with the flow adjusting from the (unphysical) initial conditions to the physical equations as the simulation starts. You haven't found anything about it because, well, we basically just ignore it and never report/talk about it when we discuss the results.

The trick to all simulations is to A) run long enough that you can get information from the simulation that is not corrupted by your choice of initial conditions and B) choose your initial conditions reasonably so your code doesn't crash, take forever to flush out the effect of initial conditions, or move the results into a different solution space. The last one is really tricky because, in general, we cannot guarantee there is a single, unique solution for problems like this. So the choice of initial conditions could kick the solution into some other state that isn't the one you want.

Anyway, I'd say those waves don't really matter. You can make sure of this by changing your initialization to something else (maybe 0 velocity everywhere except a small region near the inflow, for example) and see if you end up at the same answer at the end -- you should end up with the same drag coefficient and shedding frequency, for example.

The final tip -- if you are doing a simulation where the transient behavior is what you want (rather than some time-averaged, or some state after the initial transients can leave the domain), then you need to be extremely careful in setting up the initial conditions. There isn't a general way to do this and it will be case specific. But the importance of the initial conditions makes transient problems much harder to study!

$\endgroup$
5
  • $\begingroup$ Thank you for this answer. By chance, would you have references discussing the "good way" (if there is no unique way) of defining the initial conditions ? $\endgroup$ Jan 23, 2020 at 5:11
  • $\begingroup$ @Scrimbibete I don't... my experience is usually to do problems where it doesn't matter because we run them for a long time. The few problems I have done where the transients are essential -- for example, detonation of an explosive and the propagation of the blastwave into the air -- we would have to use a separate code to find the 1D detonation wave profile and then use that to initialize a spherical profile in our actual full domain. Similar techniques when I run flame simulations -- generate a 1D flame with another code, somehow project all variables from that into my real domain. $\endgroup$
    – tpg2114
    Jan 23, 2020 at 5:18
  • $\begingroup$ And the other way to do it is to pick a reasonable initial condition, run it and get you answer. Then slightly change the initial conditions, run, analyze... and repeat a lot. Then you can put uncertainty estimates (error bars) on your solution as a function of the initial conditions. This can be done for some problems that are affordable to run, but not things that take months/years and many thousands of processors per realization. So it really is problem dependent on the best way to handle things. $\endgroup$
    – tpg2114
    Jan 23, 2020 at 5:21
  • $\begingroup$ Thank you for these informations ! $\endgroup$ Jan 23, 2020 at 5:22
  • $\begingroup$ @Scrimbibete No problem -- welcome to Physics.SE! $\endgroup$
    – tpg2114
    Jan 23, 2020 at 5:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.