案例模型为20*20*20的立方体,分组情况见图1。首先对整个模型施加初始孔压1e3,保存结果为a.f3sav,孔压云图见图2;然后将a组的孔压归零,b组孔压固定为1e3,保存结果为b.f3sav,孔压云图见图3。案例演示的目的是得到结果a减去结果b的孔隙压力差云图,结果见图4。
;建立模型并储存结果文件
model new
zone create brick size 20 20 20 group 'a'
zone group 'b' range position-x 5 15 position-z 5 15
zone gridpoint initialize pore-pressure 1e3
model save 'a'
zone gridpoint initialize pore-pressure 0 range group 'a'
model save 'b'
;设置文件读写参数&获取数组所需size
model restore 'a.f3sav'
fish def setup
io_read = 0
io_write = 1
io_ascii = 1
arr_size = gp.num
end
@setup
;提取结果a中的孔隙压力值并写出到文件
fish def pp_out
array id1(arr_size)
array pp1(arr_size)
n = 0
loop foreach gp1 gp.list
n = n+1
gp.id(gp1) =
gp.pp(gp1) =
endloop
status = file.open('id_list',io_write,io_acsii)
status = file.write(id1,string(arr_size))
status = file.close
status = file.open('pp_list',io_write,io_acsii)
status = file.write(pp1,string(arr_size))
status = file.close
end
@pp_out
;设置文件读写参数&获取数组所需size
model restore 'b.f3sav'
fish def setup
io_read = 0
io_write = 1
io_ascii = 1
arr_size = gp.num
end
@setup
;读取结果a的孔隙压力值并与结果b的孔隙压力值相减
fish def pp_minus
array id(arr_size)
array pp(arr_size)
status = file.open('id_list',io_read,io_acsii)
status = file.read(id,arr_size)
status = file.close
status = file.open('pp_list',io_read,io_acsii)
status = file.read(pp,arr_size)
status = file.close
loop i(1,arr_size)
gp = gp.find(id(i))
pp(i) - gp.pp(gp) =
endloop
end
@pp_minus
model save 'c'