GS did not converge in 20k iterations

Asked by Chu

Hello,
I used PeriodicFlowEngine to simulate Fluid-Structure Interaction, but I get ERROR :GS did not converge in 20k iterations (maybe because the reference pressure is 0?).I always faild to use PeriodicFlowEngine.I think I used PeriodicFlowEngine incorrectly.
Thanks for your any suggestion.
#################MWE######################
O.periodic=True
O.cell.setBox(1,1,1)

from yade import pack

num_spheres=1000# number of spheres
young=1e6
compFricDegree = 3 # initial contact friction during the confining phase
finalFricDegree = 30 # contact friction during the deviatoric loading
mn,mx=Vector3(0,0,0),Vector3(1,1,1) # corners of the initial packing

O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=radians(compFricDegree),density=2600,label='spheres'))
#O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=0,density=0,label='walls'))
#walls=aabbWalls([mn,mx],thickness=0,material='walls')
#wallIds=O.bodies.append(walls)

sp=pack.SpherePack()
sp.makeCloud(mn,mx,-1,0.3333,num_spheres,True, 0.95,seed=1) #"seed" make the "random" generation always the same
sp.toSimulation(material='spheres')

triax=PeriTriaxController(
        dynCell=True,
        mass=.2,
        maxUnbalanced=0.001,
        relStressTol=0.02,
        goal=[-1e4,-1e4,-1e4],
        stressMask=7,
        globUpdate=5,
        maxStrainRate=[1.,1.,1.],
        label='triax')

newton=NewtonIntegrator(damping=0.2)

O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()],allowBiggerThanPeriod=True),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],
  [Ip2_FrictMat_FrictMat_FrictPhys()],
  [Law2_ScGeom_FrictPhys_CundallStrack()],label="iloop"
 ),
 PeriodicFlowEngine(dead=1,label="flow"),#introduced as a dead engine for the moment, see 2nd section
 GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
 triax,
 newton
]

while 1:
  O.run(1000, True)
  unb=unbalancedForce()
  if unb<0.001 :
    break

setContactFriction(radians(finalFricDegree))

## ______________ Oedometer section _________________

#B. Activate flow engine and set boundary conditions in order to get permeability
flow.dead=0
flow.defTolerance=0.3
flow.meshUpdateInterval=200
flow.permeabilityFactor=1
flow.viscosity=10
flow.bndCondIsPressure=[0,0,1,1,0,0]
flow.bndCondValue=[0,0,1000,0,0,0]
flow.boundaryUseMaxMin=[0,0,0,0,0,0]
O.dt=0.1e-3
O.dynDt=False

O.engines=O.engines+[PyRunner(command='flow.saveVtk()',iterPeriod=1)]
O.run(1,1)
Qin = flow.getBoundaryFlux(2)
Qout = flow.getBoundaryFlux(3)
permeability = abs(Qin)/1.e-4 #size is one, we compute K=V/∇H
print "Qin=",Qin," Qout=",Qout," permeability=",permeability

#C. now the oedometer test, drained at the top, impermeable at the bottom plate
flow.updateTriangulation=True #force remeshing to reflect new BC immediately
newton.damping=0
####################

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:
Revision history for this message
Robert Caulk (rcaulk) said :
#1

Hello,

Use flow.useSolver=3 or 4. We need to change the default solver from 0.

Thanks,

Robert

Revision history for this message
Chu (chu-1) said :
#2

Hello Robert,
I used flow.useSolver=3 , but I got error :
yade compiled without CHOLMOD, FlowEngine.useSolver=3>0 not supported
CHOLMOD error: invalid xtype. file: ../Cholesky/cholmod_analyze.c line: 431
CHOLMOD error: argument missing. file: ../Cholesky/cholmod_factorize.c line: 121

I use Ubuntu 18.04.2 LTS ,Yade 2018.02b,installed by apt-get.But the oedometer.py downloaded from Gitlab run well.

Revision history for this message
Chu (chu-1) said :
#3

BTW,I noticed that flow.useSolver=3 means Gauss-Seidel,and flow.useSolver=4 for CHOLMOD .Will they get different results?Or CHOLMOD is faster than Gauss-Seidel?

Revision history for this message
Robert Caulk (rcaulk) said :
#4

Please copy and paste your CMAKE output here please, it seems you compiled without LINSOLV, which means you probably did not install the necessary LINSOLV dependencies (libmetis, libcholmod, libsuitesparse etc).

useSolver=3 and use solver 4 both use the same direct method (cholesky) within CHOLMOD. The difference is that useSolver=3 uses the eigen interface to the suitesparse library while useSolver 4 uses suitesparse directly. useSolver=4 seems to work with multithreaded CPU so it should be faster.

Revision history for this message
Chu (chu-1) said :
#5

Thanks for Robert.
>Please copy and paste your CMAKE output here please

I installed Yade 2018.02b by package on Ubuntu 18.04.2 LTS. I didn't compile source code , so there is no CMAKE. Maybe I should compile source code?
But,why the oedometer.py[1] runs well? It use flow.useSolver=3.

>useSolver=3 and use solver 4 both use the same direct method (cholesky) within CHOLMOD

Yes ,you are right.I apologize for my mistake.Acturally , what I'd like to know is the difference between flow.useSolver=0(Gauss-Seidel) and flow.useSolver=3(cholesky).

Thanks for any suggestion.

https://gitlab.com/yade-dev/trunk/blob/2018.02/examples/FluidCouplingPFV/oedometer.py

Revision history for this message
Chu (chu-1) said :
#6

I noticed that flow.useSolver=3 in FlowEngine runs well , but error in PeriodicFlowEngine.

Revision history for this message
Robert Caulk (rcaulk) said :
#7

This appears to be an issue in the source code, I am fixing it now.

Revision history for this message
Best Robert Caulk (rcaulk) said :
#8

It will be some time before it makes it to the packaged version, but you can follow progress here [1].

[1]https://gitlab.com/yade-dev/trunk/merge_requests/162

Revision history for this message
Chu (chu-1) said :
#9

Thanks Robert Caulk, that solved my question.