找回密码
 注册
查看: 2434|回复: 3

求助:IB-LBM中的插值问题

[复制链接]
发表于 2016-4-18 16:33:26 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
哪位前辈指点下,在IB-LBM中,对受力和速度使用两点插值,可是在一段程序中:
// Identify the lowest fluid lattice node in interpolation range.
                // 'Lowest' means: its x- and y-values are the smallest.
                // The other fluid nodes in range have coordinates
                // (x_int + 1, y_int), (x_int, y_int + 1), and (x_int + 1, y_int + 1).
                int x_int = (int)(particle.node[n].x - 0.5 + Nx) - Nx;
                int y_int = (int)(particle.node[n].y + 0.5);

                // Run over all neighboring fluid nodes.
                // In the case of the two-point interpolation, it is 2x2 fluid nodes.
                for (int X = x_int; X <= x_int + 1; ++X) {
                        for (int Y = y_int; Y <= y_int + 1; ++Y) {
                                // Compute distance between object node and fluid lattice node.
                                const double dist_x = particle.node[n].x - 0.5 - X;
                                const double dist_y = particle.node[n].y + 0.5 - Y;
为什么X方向要-0.5,Y方向要+0.5,不是直接向下取整就行了么?
 楼主| 发表于 2016-4-18 16:34:39 | 显示全部楼层
particle.node[n]是流体中粒子点,Nx,Ny是格子坐标
 楼主| 发表于 2016-4-18 16:34:56 | 显示全部楼层
particle.node[n]是流体中粒子点,Nx,Ny是格子坐标
发表于 2016-10-27 21:36:33 | 显示全部楼层
因为上下边界用的半反弹,左右边界用的周期
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表