cmat default model linear method deform emod 1.0e9 kratio 1.0 type ball-facet
cmat default model linear method deform emod 1.0e9 kratio 1.0 type ball-ball
[emod000=1e9] [kratio=1.0] [pb_modules=1e9] [pb_kratio=1.0] [ten_=13e6] [coh_=50e6] [pb_fa=30] [fric=0.3] contact model linearpbond range contact type ball-ball
contact method deform emod [emod000] krat [kratio] range contact type ball-ball;emod 0.9e9 krat 2.5
contact method pb_deform emod [pb_modules] krat [kratio] range contact type ball-ball;pb_deform emod 4.5e9 krat 2.5
contact property pb_ten [ten_] pb_coh [coh_] pb_fa [pb_fa] range contact type ball-ball
contact property dp_nratio 0.5 dp_sratio 0.0 range contact type ball-ball
contact property fric [fric] range contact type ball-ball
contact method bond gap 0.5e-4 range contact type ball-ball
[nnnflag111=0 [nnnflag222=0] define compute_elastic_modulus axial_strain_wall1=math.abs(axial_strain_wall) if axial_strain_wall1>1.5e-3 then if nnnflag111 = 0 then strain1=axial_strain_wall1 stress1=math.abs(peak_stress) nnnflag111=1 endif endif if axial_strain_wall1>2e-3 then if nnnflag222 =0 then strain2=axial_strain_wall1 stress2=math.abs(peak_stress) nnnflag222=1 compute_elastic_modulus=(stress2-stress1)/(strain2-strain1) command set fish callback 9 remove @compute_elastic_modulus endcommand endif endif end set fish callback 9 @compute_elastic_modulus
cyc 1000
SET @peak_fraction = 0.8
solve fishhalt @loadhalt_wall list @peak_stress list @compute_elastic_modulus
else if mode = 2 then ; failed in shear crack_shear_num+=1 failforce= entries(3) if failforce<pb_cohesion then dfn_label = dfn_label + '_shear_t' crack_shearT_num+=1 else dfn_label = dfn_label + '_shear_c' crack_shearC_num+=1 endif endif global dfn = dfn.find(dfn_label) if dfn = null then dfn = dfn.add(0,dfn_label) endif local fnew = dfn.addfracture(dfn,arg) if mode =1 then crack_tension_length+= dfn.fracture.len(fnew) endif if mode =2 then crack_shear_length+= dfn.fracture.len(fnew) endif crack_length+=dfn.fracture.len(fnew) dfn.fracture.prop(fnew,'age') = mech.age dfn.fracture.extra(fnew,1) = bp1 dfn.fracture.extra(fnew,2) = bp2 crack_accum += 1 if crack_accum > 25 if frag_time < mech.age frag_time = mech.age crack_accum = 0 command fragment compute endcommand getfragInfo ; go through and update the fracture positions loop for (local i = 0, i < 2, i = i + 1) local name = 'crack_tension' if i = 1 name = 'crack_shear' endif dfn = dfn.find(name) if dfn # null loop foreach local frac dfn.fracturelist(dfn) local ball1 = dfn.fracture.extra(frac,1) local ball2 = dfn.fracture.extra(frac,2) if ball1 # null if ball2 # null local len = dfn.fracture.len(frac)/2.0 local pos = (ball.pos(ball1)+ball.pos(ball2))/2.0 if comp.x(pos)-len > xmin if comp.x(pos)+len < xmax if comp.y(pos)-len > ymin if comp.y(pos)+len < ymax dfn.fracture.pos(frac) = pos endif endif endif endif endif endif endloop endif endloop endif endif end
define track_init command dfn delete ball result clear fragment clear fragment register ball-ball fragment compute endcommand ; activate fishcalls command set fish callback bond_break remove @add_crack set fish callback bond_break @add_crack endcommand ; reset global variables global crack_accum = 0 global crack_num = 0 global crack_tension_num=0 global crack_shear_num=0 global crack_shearT_num=0 global crack_shearC_num=0 global crack_tension_length=0 global crack_shear_length=0 global crack_length=0 global fragNum=0 global max_frage_vol=1 global jiaojiepohuaineng=0 global track_time0 = mech.age global frag_time = mech.age global xmin = domain.min.x() global ymin = domain.min.y() global xmax = domain.max.x() global ymax = domain.max.y() ; command ; history id 50 @crack_num ; history id 51 @crack_tension_num ; history id 52 @crack_shear_num ; history id 53 @crack_length ; history id 54 @crack_tension_length ; history id 55 @crack_shear_length ; history id 56 @fragNum ; history id 57 @max_frage_vol ; history id 58 @jiaojiepohuaineng ; history id 59 @crack_shearT_num ; history id 60 @crack_shearC_num ; endcommand
end
def getfragInfo local frag1 = fragment.find(1) local catalognow=fragment.catalog.num(mech.age) fragNum=fragment.num(catalognow) max_frage_vol = fragment.vol(frag1,catalognow) / fragment.vol(frag1,1) end
; fname: ss_wall.fis ; ; Fish functions to record stress and strain in wall-loaded core samples ;======================================================================== def setup_wall ; ; Find the walls and get initial sample dimensions ; global wp_top = wall.find(1) ; assume wall 1 is the top wall global wp_bottom = wall.find(2) ; assume wall 2 is the bottom wall global vertical_direction = global.dim global sample_height = wall.pos(wp_top,vertical_direction) - wall.pos(wp_bottom,vertical_direction) ; assume x and y are approximately the same in 3D local xmin = 1.0e12 local xmax = -1.0e12 loop foreach bp ball.list local ball_xmin = ball.pos.x(bp) - ball.radius(bp) xmin = math.min(xmin,ball_xmin) local ball_xmax = ball.pos.x(bp) + ball.radius(bp) xmax = math.max(xmax,ball_xmax) end_loop local diameter_ = xmax - xmin if global.dim = 2 global cross_sectional_area = diameter_ else ; assume cylindrical sample in 3D cross_sectional_area = math.pi*0.25*diameter_*diameter_ end_if end ======================================================== def axial_stress_wall ; ; Compute axial stress (positive tension) using walls ; ; Assumes global variables sample_height and sample_width have been set ; local force1 = -wall.force.contact(wp_top,vertical_direction) local force2 = wall.force.contact(wp_bottom,vertical_direction) axial_stress_wall = 0.5*(force1+force2)/cross_sectional_area end ======================================================== def axial_strain_wall ; ; Compute axial strain (positive tension) using walls ; ; Assumes global variable sample_width has been set ; axial_strain_wall = 2.0*wall.disp(wp_top,vertical_direction)/sample_height end ========================================================== def loadhalt_wall ; ; Function used to stop a test when axial stress decreases to some fraction of the peak ; Assumes axial_stress_wall is a function that returns axial stress ; ; INPUT: peak_fraction - fraction of peak stress that dictates the stopping of the test ; (global float) ; loadhalt_wall = 0 local abs_stress = math.abs(axial_stress_wall) global peak_stress = math.max(abs_stress,peak_stress) if abs_stress < peak_stress*peak_fraction loadhalt_wall = 1 end_if end ;============================================================================== ; eof: ss_wall.fis
; fname: ss_gage.fis ; ; Fish functions to record strain using gage balls ======================================================== def setup_gage ; ; Find gage particles to record axial strain when there are no walls ; and set initial sample height ;
global vertical_direction = global.dim ; assume x and y are approximately the same in 3D local bottom_ = 1.0e12 local top_ = -1.0e12 loop foreach bp ball.list top_ = math.max(ball.pos(bp,vertical_direction),top_) bottom_ = math.min(ball.pos(bp,vertical_direction),bottom_) end_loop if global.dim = 2 local top_loc = vector(0.0,top_) local bottom_loc = vector(0.0,bottom_) else top_loc = vector(0.0,0.0,top_) bottom_loc = vector(0.0,0.0,bottom_) end_if global gage_top = ball.near(top_loc) global gage_bottom = ball.near(bottom_loc) global sample_height = ball.pos(gage_top,vertical_direction) - ball.pos(gage_bottom,vertical_direction) end ======================================================== def axial_strain_gage ; ; Compute axial strain using gage balls (positive tension) ; ; Assumes global variables gage_top, gage_bottom and sample_height have been set ; axial_strain_gage = (ball.disp(gage_top,vertical_direction) - ball.disp(gage_bottom,vertical_direction))/sample_height end ========================================================== def loadhalt_meas ; ; Function used to stop a test when axial stress decreases to some fraction of the peak ; Assumes measurement circle 1 is installed ; ; INPUT: peak_fraction - fraction of peak stress that dictates the stopping of the test ; (global float) ; loadhalt_meas = 0 local mp = measure.find(1) local abs_stress = math.abs(meas.stress(mp,global.dim,global.dim)) global peak_stress = math.max(abs_stress,peak_stress) if abs_stress < peak_stress*peak_fraction loadhalt_meas = 1 end_if end ;============================================================================== ; eof: ss_gage.fis