Hello,
I’m working on a soil model in FLAC3D and would like to apply periodic boundary conditions to simulate a repeating unit cell.
The goal is to simulate a repeating soil domain, where opposite boundaries act as if connected — so that displacements and forces are equal and consistent across them.
Could anyone share guidance, examples, or recommended FISH routines for setting up periodic boundaries properly in FLAC3D (7)?
Thank you in advance.
Hi Ahmed,
I’m using FLAC2D at the moment, and I’ve written a small code to apply periodic boundary conditions in 2D. Maybe it could help you if you adapt it to FLAC3D. Here’s the code:
fish define PeriodicBC(gPnt,gpGroup,gpSlot)
global M_xMin, M_xMax, _Attach_List
global ModelSize = M_xMax-M_xMin
if gp.isgroup(gPnt,gpGroup,gpSlot)
local pos1 = gp.pos(gPnt)
local pos2 = pos1 + vector(ModelSize,0)
local id1 = gp.id(gp.near(pos1))
local id2 = gp.id(gp.near(pos2))
command
zone attach gridpointid [id2] to-gridpointid [id1]
endcommand
endif
end
zone gridpoint group ‘bound=left’ range p-x [M_xMin] tol 1e-3
zone gridpoint group ‘bound=right’ range p-x [M_xMax] tol 1e-3
[PeriodicBC(::gp.list,‘left’,‘bound’)]
Thank you very much, i used the following code and it succeded in attaching the gridpoints:
fish define attach_x_periodic
; Attach gridpoints from xmin to corresponding xmax positions
local gp, x0, x1, pos_target, gp_target, id1, id2
loop foreach gp gp.list
x0 = 0.0
x1 = 1.7
if math.abs(gp.pos.x(gp) - x0) < 1e-5 then
pos_target = vector(x1, gp.pos.y(gp), gp.pos.z(gp))
gp_target = gp.near(pos_target)
id1 = gp.id(gp)
id2 = gp.id(gp_target)
command
zone attach gridpointid [id1] to-gridpointid [id2] snap off
endcommand
endif
endloop
end
[attach_x_periodic]
fish define attach_y_periodic_no_corners
local gp, y0, y1, pos_target, gp_target, id1, id2
y0 = 0.0 ; ymin
y1 = 1.7 ; ymax
loop foreach gp gp.list
if math.abs(gp.pos.y(gp) - y0) < 1e-5 then
if math.abs(gp.pos.x(gp) - 0.0) > 1e-5 then
if math.abs(gp.pos.x(gp) - 1.7) > 1e-5 then
pos_target = vector(gp.pos.x(gp), y1, gp.pos.z(gp))
gp_target = gp.near(pos_target)
id1 = gp.id(gp)
id2 = gp.id(gp_target)
command
zone attach gridpointid [id1] to-gridpointid [id2] snap off
endcommand
endif
endif
endif
endloop
end
[attach_y_periodic_no_corners]
But now i have another problem, I had static boundaries before attachments, when I try to remove them and do model solve, it does not converge.