- 积分
- 0
- 注册时间
- 2005-6-16
- 仿真币
-
- 最后登录
- 1970-1-1
|
发表于 2007-11-7 13:51:28
|
显示全部楼层
来自 台湾
由Hopper_1.dat修改
new
set gen_error off
set random
DEF create_hopper
h_height = 0.60
h_upp_width = 0.80
h_bot_width = 0.01
h_init_depth = 0.10
wall_kn = 1.0e9
wall_ks = 1.0e9
wall_fric = 0.0
h_height_balls = h_height - h_init_depth
; make gate wall
pt1x = - h_bot_width * 0.5
pt1y = - h_bot_width * 0.5
pt1z = 0.0
pt2x = h_bot_width * 0.5
pt2y = - h_bot_width * 0.5
pt2z = 0.0
pt3x = h_bot_width * 0.5
pt3y = h_bot_width * 0.5
pt3z = 0.0
pt4x = - h_bot_width * 0.5
pt4y = h_bot_width * 0.5
pt4z = 0.0
command
wall id=1 kn=wall_kn ks=wall_ks face (pt1x,pt1y,pt1z) &
(pt2x,pt2y,pt2z) (pt3x,pt3y,pt3z) (pt4x,pt4y,pt4z)
end_command
; make servo cotrolled wall
pt1x = - h_upp_width * 0.5
pt1y = - h_upp_width * 0.5
pt1z = h_height_balls
pt2x = - h_upp_width * 0.5
pt2y = h_upp_width * 0.5
pt2z = h_height_balls
pt3x = h_upp_width * 0.5
pt3y = h_upp_width * 0.5
pt3z = h_height_balls
pt4x = h_upp_width * 0.5
pt4y = - h_upp_width * 0.5
pt4z = h_height_balls
command
wall id=2 kn=wall_kn ks=wall_ks face (pt1x,pt1y,pt1z) &
(pt2x,pt2y,pt2z) (pt3x,pt3y,pt3z) (pt4x,pt4y,pt4z)
end_command
; make confined wall : cone
pt1_rad = h_bot_width * 0.5
pt2_rad = h_upp_width * 0.5
command
wall id=3 type cylinder end1 (0.0 0.0 0.0) end2 (0.0 0.0 h_height) &
rad (pt1_rad pt2_rad) kn=wall_kn ks=wall_ks
end_command
; compute volume enclosed by the walls
_tmp_extz = h_bot_width*h_height/(h_upp_width-h_bot_width) ; 0.2
_tmpz = h_height_balls
_tmpr = 0.5*(h_upp_width-h_bot_width)/h_height*_tmpz+0.5*h_bot_width
_tmp1 = _tmpr*_tmpr*(h_height_balls+_tmp_extz)
_tmpz = 0.0
_tmpr = 0.5*(h_upp_width-h_bot_width)/h_height*_tmpz+0.5*h_bot_width
_tmp2 = _tmpr*_tmpr*_tmp_extz
tot_vol = pi * (_tmp1-_tmp2) / 3.0
END
DEF create_balls
; set balls variables
ball_kn = 1.0e8
ball_ks = 1.0e8
ball_dens = 2000.0
ball_fric = 0.0
r_lo = 0.02
r_hi = 0.02
poros = 0.20
; variables needed to target porosity
r_aver = 0.5 * (r_lo + r_hi)
num = int(3.0 * tot_vol * (1 - poros) / (4.0 * pi * r_aver^3.0 ))
; variables related to the generation process
_start_id = 1
_end_id = _start_id + num - 1
_xmax = 0.5 * h_upp_width
_xmin = -0.5 * h_upp_width
_ymax = 0.5 * h_upp_width
_ymin = -0.5 * h_upp_width
_zmax = h_height - h_init_depth
_zmin = 0.0
command
gen id _start_id _end_id rad r_lo r_hi x _xmin _xmax y _ymin _ymax &
z _zmin _zmax FILTER filter_for_ball_creation
group gr_particles range id _start_id _end_id
prop kn ball_kn ks ball_ks dens ball_dens range group gr_particles
end_command
get_porosity
mult = ((1.0-poros)/(1.0-pmeas))^(1.0/3.0)
command
ini rad mul mult range group gr_particles
cycle 300
endcommand
END
DEF get_porosity
sum = 0.0
bp = ball_head
loop while bp # null
if b_id(bp) >= _start_id then
sum = sum + 4.0/3.0 * pi * b_rad(bp)^3.0
endif
bp = b_next(bp)
end_loop
pmeas = 1.0 - sum / tot_vol
END
DEF filter_for_ball_creation
_brad = fc_arg(0)
_xpos = fc_arg(1)
_ypos = fc_arg(2)
_zpos = fc_arg(3)
_rxy = sqrt(_xpos*_xpos+_ypos*_ypos)
_rlim = 0.5 * _zpos + 0.05 ;這行是關鍵
if (_rxy+_brad) <= _rlim
_skip = 0
else
_skip = 1
end_if
filter_for_ball_creation = _skip
END
DEF set_up_layers
bp = ball_head
loop while bp # null
_bid = b_id(bp)
_bzpos = b_z(bp)
_bcol = int( _bzpos / (h_height_balls/_layers) ) + 1
b_color(bp) = _bcol
bp = b_next(bp)
end_loop
END
DEF set_init_time
init_time = time
END
;
; create plot
title ’Granular flow from a hopper’
plot create hopper_model
plot set center 0.0 0.0 3.0e-1
plot set rot 20.0 0.0 340.0
plot set dist 2.873e+0
plot set back white
plot add wall wireframe on
plot add ball yellow lblue lred lgreen
plot add axes black
;
create_hopper
create_balls
SET grav 0.0 0.0 -9.81
solve
set_init_time
set _layers = 1
set_up_layers
亂改以上參數
關鍵行也要修改喔否則ball會跑出去
自己試試 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
×
评分
-
1
查看全部评分
-
|