Hi Dear All,

Can any body help me. I try to calculate the forces using the momentum exchange method for drag and lift. Once i run the code for Re=100 the drag value is very perfect but no data for lift. I used the D2Q9 model, can any body please tell me what’s wrong in the code for forces along y-direction. Any suggestions and corrections will be higly appreticated.

/* lattice direction

x y

{ 0 0 } rest

{ + 0 } dir 1

{ - 0 } dir 3

{ 0 + } dir 2

{ 0 - } dir 4

{ + + } dir 5

{ - - } dir 7

{ + - } dir 8

{ - + } dir 6

*/

The below is the code i write for calculating forces along x- and y-direction

// calculate force on body using the momentum exchange method

void force(int wall[NX][NY], int wb[NX][NY], double *fx, double *fy) // wb[NX][NY] for the surface of the cylinder and wall[NX][NY] for wall boundary

{

int i,j; *fx = 0.0; *fy = 0.0;

for(i=1;i<=NX-2;i++){ int ip = i+1; int im = i-1;

for(j=1;j<=NY-2;j++){ int jp = j+1; int jm = j-1; if(wb[i][j]==1){

*fx = fx - (f[im][j][3]+f[i][j][1]) (1-wall[im][j]) + (f[ip][j][1]+f[i][j][3])* (1-wall[ip][j]) - (f[im][jm][7]+f[i][j][5])*(1-wall[im][jm])

- (f[ip][jp][5]+f[i][j][7])
*(1-wall[ip][jp])+ (f[ip][jm][8]+f[i][j][6])*(1-wall[ip][jm])- (f[im][jp][6]+f[i][j][8])*(1-wall[im][jp]);

*fy = fy - (f[i][jm][4]+f[i][j][2])(1-wall[i][jm])+ (f[i][jp][2]+f[i][j][4])*(1-wall[i][jp])- (f[im][jm][7]+f[i][j][5])*(1-wall[im][jm])

- (f[ip][jp][5]+f[i][j][7])
*(1-wall[ip][jp]) - (f[ip][jm][8]+f[i][j][6])*(1-wall[ip][jm])+ (f[im][jp][6]+f[i][j][8])*(1-wall[im][jp]);

} } }}

Then i calculate the drag and lift

cdx = -fx/rho[2][(NY-1)/2]/u0/u0/radius;

cdy = -fy/rho[2][(NY-1)/2]/u0/u0/radius;

Thanks

Khan