1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
LBM笔记

Study notes for Lattice Boltzmann MethodD2Q9 lattice and velocities[1]The macroscopic fluid density:where f is the single-particle distribution function.The macroscopic velocity:The macroscopic pressure:Unit conversion[2]Single Relaxation Time BGK[1]Streaming and collision: is the streaming part is the collision termThe D2Q9 equilibrium distributionfunction is defined aswhere the weights are 4/9 for the rest particles (a = 0), 1/9 for a = 1, 2,3, 4, and 1/36 for a = 5, 6, 7, 8, and c is the basic speed on the lattice (1 in the simplest implementation). Note that if the macroscopic velocityu = 0, the equilibrium are simply the weights times the fluid density.The other form is[3]Whereand Coding for BGKmacroscopic fluid density and velocity:// Computing macroscopic density, rho, and velocity, u=(ux,uy).for( j=0; jLY; j++){for( i=0; iLX; i++){u_x[j][i] = 0.0;u_y[j][i] = 0.0;rho[j][i] = 0.0;if( !is_solid_node[j][i]){for( a=0; a9; a++){rho[j][i] += f[j][i][a];u_x[j][i] += ex[a]*f[j][i][a];u_y[j][i] += ey[a]*f[j][i][a];} u_x[j][i] /= rho[j][i];u_y[j][i] /= rho[j][i];}}}Streaming:// Streaming step.for( j=0; jLY; j++){jn = (j0 )?(j-1):(LY-1)jp = (jLY-1)?(j+1):(0 )for( i=0; iLX; i++){if( !is_interior_solid_node[j][i]){in = (i0 )?(i-1):(LX-1)ip = (iLX-1)?(i+1):(0 )ftemp[j ][i ][0] = f[j][i][0];ftemp[j ][ip][1] = f[j][i][1];ftemp[jp][i ][2] = f[j][i][2];ftemp[j ][in][3] = f[j][i][3];ftemp[jn][i ][4] = f[j][i][4];ftemp[jp][ip][5] = f[j][i][5];ftemp[jp][in][6] = f[j][i][6];ftemp[jn][in][7] = f[j][i][7];ftemp[jn][ip][8] = f[j][i][8];}}}Equilibrium Distribution Function:// Compute the equilibrium distribution function, feq.f1=3.;f2=9./2.;f3=3./2.;for( j=0; jLY; j++){for( i=0; iLX; i++){if( !is_solid_node[j][i]){rt0 = (4./9. )*rhoij;rt1 = (1./9. )*rhoij;rt2 = (1./36.)*rhoij;ueqxij = uxij;ueqyij = uyij;uxsq = ueqxij * ueqxij;uysq = ueqyij * ueqyij;uxuy5 = uxeqij + uyeqij;uxuy6 = -uxeqij + uyeqij;uxuy7 = -uxeqij + -uyeqij;uxuy8 = uxeqij + -uyeqij;usq = uxsq + uysq;feq

文档评论(0)

shuwkb + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档