Zone import ‘chengxiaojie.f3grid’ ;导入模型网格
zone face skin
fish define sigmav ;自定义函数进行二次计算
local sum = 0.
loop foreach local jc gp.list
if gp.isgroup(jc,'Bottom') then
sum = sum - gp.force.unbal.y(jc)
endif
endloop
sigmav = sum / 3
end
@sigmav
; 决定是否停止计算的函数,一旦(0 0 0)点的y方向位移大于0.00035m,则表示true
;继续循环,若小于等于这个值,就会停止计算。
fish define Cheng
global Xiao = gp.near(0,0,0)
Cheng = gp.disp.y(xiao) > 3.5e-4
end
fish define QQ
loop local cxj (0,90,5) ;0°开始每次循环加5,一直循环到90度
command ;fish内嵌Flac3D内部指令
zone delete ; 删除模型网格
Zone import ‘chengxiaojie.f3grid’ ;重新生成模型网格
zone cmodel assign ubiquitous-joint ; 本构模型(遍布节理模型)和参数赋值
zone property bulk 1.e8 shea 7.e7 cohesion 2.e3
zone property friction 40. dilation 0. tension 2400.
zone property dip @cxj dip-direction 0. joint-cohesion 1.e3
zone property joint-friction 30. joint-dilation 0. ...
joint-tension 2000.
;施加边界条件,施服应力
zone face apply velocity-normal -5e-7 servo ...
ratio local minimum 1e-4 range group 'Top' or 'Bottom'
; 设置目标循环停止条件
model solve fish-halt @Cheng
; 添加结果到table表
table 'result' add (@cxj,@sigmav)
end_command
end_loop
end
; Run all 18 cases 90/5=18
@QQ
二、fish-halt s关键字的作用:The FISH function s is called during every cycle to determine whether cycling should continue. If s returns false, cycling continues; otherwise, cycling terminates.案例中的Cheng这个字符串(自定义函数名字)要是满足if条件,就是true,要是不满足就是false,停止计算。
四:版权声明,转载或者引用请标注本链接出处,因为太多人找,放互联网给方便大家使用,版权为Flac3D6.0系列教程内容节选,若有错误,恳请指出。