Monday, December 15, 2008

FYP

so, the model is ready.
Gotta find out how to set the initial velocity and figure out the effects on the steel plate and aggregates inside. Wondering why I can't make the colors for each part different. hmmm....

Enough for today.

So, this is the FISH code for PFC2D
new

def setup
;--- input data ---
n_stiff = 1e8 ; normal contact stiffness
s_stiff = 1e8 ; shear contact stiffness
width = 10 ; width of box
height = 5 ; height of box
poros = 0.12 ; porosity
rat = 1.2 ; ratio of largest to smallest radii
;--- derived data ---
mult_0 = 1.5 ; initial radius multiplication factor
mult_a = 0 ; storage for l.h. radius multiplier
mult_b = 0 ; storage for r.h. radius multiplier
id1 = 0 ; storage for initial ID number
id2 = 0 ; storage for final ID number
end

set random

set disk on
setup
wall id 1 ks=s_stiff kn=n_stiff nodes (0,0) (width,0)
wall id 2 ks=s_stiff kn=n_stiff nodes (width,0) (width, height)
wall id 3 ks=s_stiff kn=n_stiff nodes (width, height) (0,height)
wall id 4 ks=s_stiff kn=n_stiff nodes (0,height) (0,0)
wall id 5 ks=s_stiff kn=n_stiff nodes (9,0) (9,height)

def regular
xc=x0
yc=y0
rc=radius
idc=id_start
r2 = 2*radius
yinc=radius*2

loop row (1,n_row)
loop col (1,n_col)
command
ball id = idc x=xc y=yc rad=rc
end_command
idc= idc+1
xc=xc+r2
end_loop
yc=yc+yinc
xc=x0
end_loop
end

def make_block
tot_vol = (x2-x1)*(y2-y1)
num = id2-id1+1
n0 = 1-(1-poros)/mult_0^2
r0 = sqrt (tot_vol*(1-n0)/(pi*num))
rlo = 2 * r0/(1+rat)
rhi = rat*rlo

command
gen id=id1, id2 rad=rlo,rhi x=x1,x2 y=y1,y2
prop dens=1000 ks=s_stiff kn=n_stiff range id=id1,id2
end_command

get_poros
mult = sqrt((1-poros)/(1-pmeas))
end

def get_poros
sum=0
bp=ball_head
loop while bp # null
if b_id(bp) >=id1 then
if b_id(bp) <= id2 then
sum = sum + pi*b_rad(bp)^2
end_if
end_if
bp=b_next(bp)
end_loop
pmeas = 1-sum/tot_vol
end

def final_poros
tot_vol = width*height
id1 = 1
id2 = 1200
get_poros
final_poros= pmeas
end

set x1=0.0 x2=9 y1=0 y2=5 id1=1 id2=50
make_block
set mult_a=mult
ini rad mul=mult_a c_index 0 range id 1,50
cycle 1000
prop fric 0.2
cycle 500

set echo off
set x0=9.1 y0=0.1 radius = 0.1
set id_start=1000 n_col=5 n_row=25
regular
set echo on

set x0=10.05 y0=2.35 radius = 0.05
set id_start=2000 n_col=5 n_row=2
regular
property density 2000 kn 1e8 ks 1e8

del wall 5

plot add ball lgreen lred
plot add wall black
plot show


No comments: