Any method about accelerating flowengine simulation
Hi,
I tried the failure process of triaxial compression under fluid-solid coupling. I previously carried out triaxial compression without flowengine, and the calculation speed was about 80 step/s(
However,when I added flowengine for coupling, I found that the calculation speed was too slow (20/s). Since the previous triaxial compression simulation was already slow, I think I can't have more particles (8K at present), so it is not applicable to the GPU acceleration recommended on the yade website.
I have attached my code below. Is there anyway I can make it run faster?
#######
from yade import pack, ymport, plot, utils, export, timing
young=66.2e9
poisson=0.522
name='cylinder'
preStress=-30e6
strainRate = -0.1
OUT=str(
nw=24
nh=15
rParticle=
bcCoeff = 5
width = 0.025
height = 0.05
mnx=-0.011871843
mny=-0.0118675
mnz=0.000724838
mxx=0.011855783
mxy=0.011865682
mxz=0.049744924
Sy=2e6
O.materials.
O.materials.
O.materials.
mn,mx=Vector3(
walls=aabbWalls
wallIds=
bottom,
radius=0.0125
sp=pack.
pred=pack.
sp=pack.
spheres=
bot = [O.bodies[s] for s in spheres if O.bodies[
top = [O.bodies[s] for s in spheres if O.bodies[
vel = strainRate*
for s in bot:
s.shape.color = (1,0,0)
s.state.
s.state.vel = (0,0,-vel)
for s in top:
s.shape.color = Vector3(0,1,0)
s.state.
s.state.vel = (0,0,vel)
facets = []
rCyl2 = .5*width / cos(pi/float(nw))
for r in range(nw):
for h in range(nh):
v1 = Vector3( rCyl2*cos(
v2 = Vector3( rCyl2*cos(
v3 = Vector3( rCyl2*cos(
v4 = Vector3( rCyl2*cos(
f1 = facet((
f2 = facet((
facets.
O.bodies.
mass = O.bodies[
for f in facets:
f.state.mass = mass
f.state.
def addForces():
for f in facets:
n = f.shape.normal
a = f.shape.area
O.forces.
def stopIfDamaged(
extremum = max(abs(s) for s in plot.data['s'])
s = abs(plot.
e = abs(plot.
if O.iter < 1000 or e < maxEps:
return
if abs(s)/
print('Simulation finished')
print('Max stress and strain:
O.pause()
O.dt=.5*
newton=
O.engines=[
ForceResetter(),
InsertionSortC
InteractionLoop(
[Ig2_
[Ip2_
[Law2_
),
PyRunner(
FlowEngine(
newton,
PyRunner(
PyRunner(
]
def plotAddData():
f1 = sum(O.forces.
f2 = sum(O.forces.
f = .5*(f2-f1)
s = f/(pi*.
e = (top[0]
plot.addData(
i = O.iter,
s = -s,
e = -e,
)
plot.saveDataT
O.step()
ss2sc.interacti
is2aabb.
flow.debug=False
flow.permeabili
flow.fluidBulkM
flow.useSolver=4
flow.permeabili
flow.viscosity= 0.001
flow.decoupleForces = False
flow.boundaryUs
flow.bndCondIsP
flow.bndCondVal
flow.bndCondIsT
flow.thermalEng
flow.thermalBnd
flow.dead=0
flow.emulateAct
#######
numPoints = 100
xs = np.linspace(
ys = np.linspace(
zs = np.linspace(
cellsHit = [] #create array
cylcenterx=
cylcentery=
for x,y,z in itertools.
cellId = flow.getCell(x,y,z) #getCell return cell id for a point position xyz
if cellId in cellsHit: continue #this prevents counting a cell multiple times
if np.sqrt(
cellsHit.
for i in cellsHit:
flow.blockCell
flow.setCellPr
O.run(1,1)
flow.meshUpdate
flow.defToleran
plot.plots = { 'e':('s',), 'elateral':('s'),}
plot.plot()
O.run()
#######
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Robert Caulk
- Solved:
- Last query:
- Last reply:
This question was reopened
- by Ziyu Wang