← Back to team overview

yade-users team mailing list archive

Re: [Question #683336]: Yade-OpenFoam-coupling delete the particles outside the fluid cells

 

Question #683336 on Yade changed:
https://answers.launchpad.net/yade/+question/683336

    Status: Open => Answered

Deepak proposed the following answer:
Hello,

Modifications in the source code have been made to insert/delete bodies. You can clone this branch[1] and verify it. 
I would suggest to make the following changes in your Yade script : 

In function  deletePar(self):

  def deletePar(self):
    print("******YADE-ITER = " + str(O.iter) +" **********")
    ids = fluidCoupling.getIdList() # get the ids of bodies in existing coupling
    for b in ids:
      if O.bodies[b].state.pos[0]>0.02:
        print('delete id '+str(b))
        O.bodies.erase(b)
        fluidCoupling.eraseId(b);  # erase a specific id from the coupling

This function is called in O.engines as :

    O.engines=[    O.engines=[
  ForceResetter(),
  InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=1.2, label="bols"),Bo1_Facet_Aabb()], allowBiggerThanPeriod=True),
  InteractionLoop(
    [Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=1.2, label="ig2s"),Ig2_Facet_Sphere_ScGeom()],
    [Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=1)],
        [Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(recordCracks=True,label='lawFunctor')]
  ),
  GlobalStiffnessTimeStepper(timestepSafetyCoefficient=0.7, label = "ts"),
  PyRunner(command='sim.deletePar()',iterPeriod=10, label='checkPar'),
        fluidCoupling, #to be called after timestepper
        PyRunner(command='sim.printMessage()', iterPeriod= 1000, label='outputMessage'),
  newton,
        
        VTKRecorder(fileName='yadep/3d-vtk-',recorders=['spheres','colors'],iterPeriod=1000)
    ]

To use these options (at present/immediately) you will have to clone the
Yade repository and  switch to branch : FoamCouplingOptions[1] and
compile  also pull the latest updates from Yade-OpenFOAM-coupling
repository[2],  (git pull origin, followed by Allwmake)

[1]  https://gitlab.com/yade-dev/trunk/tree/FoamCouplingOptions 
[2] https://github.com/dpkn31/Yade-OpenFOAM-coupling

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.