|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
格子玻尔兹曼方法的边界条件处理实例
//##############################################################################
//
// Zou and He Velocity BCs at inflow, x=1, and outflow, x=LX.
//
for( y = 1; y<=LY; y++)
{
// Inflow:
x=1;
rho_i = ( ftemp[y][x][9]
+ ftemp[y][x][2]
+ ftemp[y][x][4]
+ 2.*( ftemp[y][x][3]
+ ftemp[y][x][6]
+ ftemp[y][x][7]) ) / ( 1. - u_xin);
ftemp[y][x][1] = ftemp[y][x][3] + 2./3.*rho_i*u_xin;
ftemp[y][x][5] = ftemp[y][x][7]
+ 1./2.*( ftemp[y][x][4]-ftemp[y][x][2])
+ rho_i/6.*u_xin;
ftemp[y][x][8] = ftemp[y][x][6]
+ 1./2.*( ftemp[y][x][2]-ftemp[y][x][4])
+ rho_i/6.*u_xin;
// Outflow:
x=LX;
rho_o = ( ftemp[y][x][9]
+ ftemp[y][x][2]
+ ftemp[y][x][4]
+ 2.*( ftemp[y][x][1]
+ ftemp[y][x][5]
+ ftemp[y][x][8]) ) /( u_xout + 1.);
ftemp[y][x][3] = ftemp[y][x][1] - 2./3.*rho_o*u_xout;
ftemp[y][x][7] = ftemp[y][x][5]
+ 1./2.*( ftemp[y][x][2]-ftemp[y][x][4])
- rho_o/6.*u_xout;
ftemp[y][x][6] = ftemp[y][x][8]
+ 1./2.*( ftemp[y][x][4]-ftemp[y][x][2])
- rho_o/6.*u_xout;
} /* for( y = 1; y<=LY; y++) */
//##############################################################################
//
// Zou and He Pressure/Density BCs at inflow, x=1, and outflow, x=LX.
//
for( y = 1;y <= LY;y++)
{
// Inflow:
x=1;
u_x = 1. - ( ftemp[y][x][9]
+ ftemp[y][x][2]
+ ftemp[y][x][4]
+ 2.*( ftemp[y][x][3]
+ ftemp[y][x][6]
+ ftemp[y][x][7]) ) / ( rho_in);
ftemp[y][x][1] = ftemp[y][x][3] + 2./3.*(rho_in)*u_x;
ftemp[y][x][5] = ftemp[y][x][7]
- 1./2.*( ftemp[y][x][2] - ftemp[y][x][4])
+ ( rho_in)/6.*u_x;
ftemp[y][x][8] = ftemp[y][x][6]
+ 1./2.*( ftemp[y][x][2]-ftemp[y][x][4])
+ rho_in/6.*u_x;
// Outflow:
x=LX;
u_x = -1. + ( ftemp[y][x][9]
+ ftemp[y][x][2]
+ ftemp[y][x][4]
+
2.*( ftemp[y][x][1]
+ ftemp[y][x][5]
+ ftemp[y][x][8]) ) / ( rho_out);
ftemp[y][x][3] = ftemp[y][x][1] - 2./3.*rho_out*u_x;
ftemp[y][x][7] = ftemp[y][x][5]
- 1./2.*( ftemp[y][x][4] - ftemp[y][x][2])
- rho_out*u_x*1./6.;
ftemp[y][x][6] = ftemp[y][x][8]
+ 1./2.*( ftemp[y][x][4] - ftemp[y][x][2])
- rho_out*u_x*1./6.;
} /* for( y = 1;y <= LY;y++) */
|
|