|
发表于 2005-9-28 10:00:38
|
显示全部楼层
[求助]为什么我用LBM算出来的速度那么小?
[这个贴子最后由lien在 2005/09/28 10:05am 第 1 次编辑]
下面引用由didu在 2005/09/27 11:22pm 发表的内容:
Your code is not very readable. The steps in the time loop are
1. collision
2. streaming (propagation)
3. update boundary condition
4. calculate velocity and density didu,你好,我没有把全部的源代码写入文档,我采用的是c++语言。整个流程的确就是跟你说的步骤一样,我这里只是把各个功能函数描述了一下。
我的collision和steaming写在一个函数里面,就是updateLBE(),相应的代码就是:
m_df1[il][in] = m_df0[il][ilink] - rtao * ( m_df0[il][ilink] - calEq(m_v[0][ilink], m_v[1][ilink], m_v[2][ilink], m_den[ilink], il) );
这句话实现了f(x+ei,t+1) = f(x,t) - 1/tao * [f(x,t)-f^eq],
至于update boundary,我这里对5个固体边界面,采用bounce back方法,
// bounce back the fraction value to the opposite direction
// m_df1[il][in] = m_df0[ill][in]; // ill 为il的反方向
还有calculate velocity and density,就是我这里的updateVelDen(...)函数。
|
|