Dear all,
I’m a physics PhD student, working on a problem that requires a flow field as input, and so far our idea is to get this flow field by simulating it using LBM. To get acquainted with the method, I equipped myself with the C sample code from the website (Big Thank You, Jonas), the Shen/Doolen review, Jonas’ thesis (I really don’t get the regularized part yet :D) and ’ book… and while I understand a lot more than before now, there are still a quite a few places where I’m either not sure if I got the information right or still totally clueless. So, I thought I just write down what my problem is and what I tried to understand it so far, and if anyone has the time to give me some pointers it’ll be most appreciated.
Generally, we need the flow through a device that consist of a huge - basically ‘infinite’ - array of microscopic obstacles. Dimensions will be in the thousands of obstacles in both dimensions, so we plan to basically simulate one obstacle with periodic BCs only. Flow through the device will be driven by a pressure gradient over the entire device, so we’d expect to have a similar pressure gradient over our cell, too. Hence, we’d sort of have to merge the pressure gradient with periodic boundary conditions. So, first question - I read here in the forum Timm writing that “pressure gradient is the same as body force”. Now I’ve no idea what exactly a “body force” is, but Sukop talks on page 54 about implementing “forces”, such as gravity, as drivers for flows. Now I understand the concept for gravity, so my question: 1) Is this what Timm meant with “body force”? And directly, 2) is this indeed the same? Especially, a force like gravity would act on every liquid molecule (or, in LBM, node), while the pressure gradient is only defined over the entire length of the device - I’d expect that at least under some geometries some parts of the system would be less affected under by the pressure flow than under gravity.
Ok, onwards to playing around with the code: Jonas’ code implements all sorts of BCs, but actually uses a Poiseuille velocity condition at the inlet and a pressure BC on the outlet, which - as far as I understand it - has varying pressure in order to eliminate the pressure gradient. ( another question, but not really important: 3) I reckon this “zero gradient” corresponds to having the cylinder ending in some huge “reservoir”. Now, if I have two such reservoirs – how would I use two zero gradients of different value??)
Now, my first idea was to implement just a constant pressure BC at the inlet and an equivalent constant pressure condition at the outlet, to get an idea how such a pressure gradient works anyway. Well, that sort of blew up in my face :), I changed the output to rho and it looked as if the sound waves coming from the pressure were resonating till pressure somewhere exceeded 1.2, which seems to be the point where the Taylor expansion is breaking down. So, 4) what would be the standard approach to implement a pressure gradient?
Anyway, since this is not what I wanted to have anyway, I thought I just take periodic BCs, but with a prefactor:
for (iY=1; iY<=ly; ++iY) {
lat[1][iY].fPop[1] = lat[lx+1][iY].fPop[1]*presGrad;
lat[1][iY].fPop[5] = lat[lx+1][iY].fPop[5]*presGrad;
lat[1][iY].fPop[8] = lat[lx+1][iY].fPop[8]*presGrad;
lat[lx][iY].fPop[3] = lat[0][iY].fPop[3]/presGrad;
lat[lx][iY].fPop[6] = lat[0][iY].fPop[6]/presGrad;
lat[lx][iY].fPop[7] = lat[0][iY].fPop[7]/presGrad;
}
I’ve set presGrad to 1.01 so far. Since this will generate a net flow to the right, I’m also re-normalising the flows such that I always have the same amount of ‘fluid’ in the system. I was under the impression that this was necessary in order to keep rho close to 1 for numeric stability, however after reading the forum I’m not too sure anymore?
This generally seems to work o.k. for a while, and I get the Poisseuille flow and the fluctuations behind the obstacle, but after a while it blows up – pressure at the obstacle increases further and further and then explodes quickly after it reaches 1.1. So my last question for now would be, 5) has anyone done this so far, and if so, are there any example codes/guidelines/suggestions available?
OK, thanks everyone for reading, I appreciate any input. Can be very short, i.e. “read this paper” or “can be done with the C++ lib by using xyz” will suffice.
Thanks a lot,
Oliver