找回密码
 注册
Simdroid-非首页
查看: 312|回复: 11

[建模专区] 求助:PFC3D中如何循环删除指定区域的小球

[复制链接]
发表于 2012-9-11 14:06:28 | 显示全部楼层 |阅读模式 来自 广东深圳
本帖最后由 civilchenxi 于 2012-9-11 14:07 编辑

求助:PFC3D中,在重力作用下小球不断运动到某一区域,如何循环删除这一区域的小球,使得上面的小球不断下落?
发表于 2012-9-11 22:47:24 | 显示全部楼层 来自 美国
Simdroid开发平台
试一下这个:
;y as vertical direction
set y_bottom=..
def del_b
   bp = ball_head
  loop while bp # null
    bpnext = b_next(bp)
    y_pos = b_rad(bp)+b_y(bp)
    if y_pos<y_bottom then
      oo = b_delete(bp)
    end_if
    bp = bpnext
  end_loop
end

set fishcall  1 del_b


Good luck!  
回复 不支持

使用道具 举报

 楼主| 发表于 2012-9-12 08:39:17 | 显示全部楼层 来自 广东深圳
本帖最后由 civilchenxi 于 2012-9-12 09:27 编辑
rock_cumt 发表于 2012-9-11 22:47
试一下这个:
;y as vertical direction
set y_bottom=..

我x与z方向也要限制,就是当小球自由下落到某长方体区域时,循环删除这一区域的小球
回复 不支持

使用道具 举报

发表于 2012-9-12 09:23:56 | 显示全部楼层 来自 美国
定义区域
range name void_area x= (x1, x2) y= (y1, y2) 三维可以加上 z= (z1,z2)
循环删除
  bp = ball_head
  loop while bp # null
    bpnext = b_next(bp)
    if inrange( 'void_area', bp ) = 1 then
      oo = b_delete(bp)
    end_if
    bp = bpnext
  end_loop
回复 不支持

使用道具 举报

 楼主| 发表于 2012-9-12 09:29:36 | 显示全部楼层 来自 广东深圳
rock_cumt 发表于 2012-9-12 09:23
定义区域
range name void_area x= (x1, x2) y= (y1, y2) 三维可以加上 z= (z1,z2)
循环删除

谢谢无私的帮助,我试试
回复 不支持

使用道具 举报

 楼主| 发表于 2012-9-14 11:03:33 | 显示全部楼层 来自 广东深圳
本帖最后由 civilchenxi 于 2012-9-14 15:19 编辑
rock_cumt 发表于 2012-9-12 09:23
定义区域
range name void_area x= (x1, x2) y= (y1, y2) 三维可以加上 z= (z1,z2)
循环删除

res dan.save
group rock range x 0 8 y 0 15 z 30 50
group ore range x 0 8 y 0 15 z 0 30
delet wall 13
delet wall 17
def del_b
command
  cyc 500
  delete ball range hole2
  delete ball range hole3
endcommand
end
del_b
删除wall 13 17 ,循环cyc500后,小球在自重下落入hole2与3,给定判断条件(hole2与hole3中rock与ore的个数比满足一定条件)若不满足删除hole2与3中的小球后再回到 cyc500,若满足则停止运行,不知如何实现?
回复 不支持

使用道具 举报

 楼主| 发表于 2012-9-14 20:38:16 | 显示全部楼层 来自 广东深圳
请教,求助
回复 不支持

使用道具 举报

发表于 2012-9-14 20:59:04 | 显示全部楼层 来自 美国
def _cyc
    nstp = nstp + 1
    if nstp = 500 then
       判断条件
          满足{
                 command
                     delete ball range hole2
                     delete ball range hole3
                     pau
                 command
                }
        不满足{
              nstp = 0
        }
    endif
endif
end
这个过程的思路是每500判断一次,如果满足条件,运算暂定,否则进入下一个500步的循环
                 
回复 不支持

使用道具 举报

 楼主| 发表于 2012-9-14 21:04:04 | 显示全部楼层 来自 广东深圳
本帖最后由 civilchenxi 于 2012-9-14 21:16 编辑
rock_cumt 发表于 2012-9-14 20:59
def _cyc
    nstp = nstp + 1
    if nstp = 500 then

您好,谢谢您的解答。一个区域(hole2或3)中如何统计两种不同小球的个数呢。group rock
group ore
回复 不支持

使用道具 举报

发表于 2012-9-14 21:30:37 | 显示全部楼层 来自 美国
本帖最后由 rock_cumt 于 2012-9-14 21:31 编辑

set ball extra 1
def set_extra
  bp = ball_head
  loop while bp # null
    bz = b_z(bp)
    if bz >=30 then
      b_extra(bp,1) =1 ;rock
   else
     b_extra(bp,1)=0; ore
   endif
  bp=b_next(bp)
endloop
end

def count
  bp = ball_head
  loop while bp # null
     ;if ball in hole2
        if (b_extra(bp,1) = 1 then
            h21 = h21 +1  ;for rock
       else h22 = h22 +1 ;for ore
   if ball in hole3
     ...........
  endloop
end

note: set fishcall should set after "res dan.sav"
then followed by @set_extra
function @counter can be invoke in @_cyc
For details, you should fix it yourself
good luck
回复 不支持

使用道具 举报

 楼主| 发表于 2012-9-14 21:39:43 | 显示全部楼层 来自 广东深圳
rock_cumt 发表于 2012-9-14 21:30
set ball extra 1
def set_extra
  bp = ball_head

有点思路了,谢谢了
回复 不支持

使用道具 举报

发表于 2024-5-16 15:37:59 | 显示全部楼层 来自 湖南湘潭
请问还在研究pfc吗
回复 不支持

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-6-17 05:28 , Processed in 0.034934 second(s), 11 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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