External Moving Object using MPI
Hi There,
I'm trying to model a soil-wheel interaction using MPI. Originally, my DEM model consisted of a larger of highly irregular-shaped clump particles but since YADE MPI has not been designed for clumps, I decided to run the same problem with spherical particles from those clumps. I have set up the model and it started working but no collision occurs between my external moving object which is a facet wheel and the underlying spheres. This is a two-phase problem where the wheel first penetrates into the soil and then starts rotating in the longitudinal direction where the position of the zero point is continually updated.
Here is my code missing the DEM geometry (which is imported).
As most MPI exampmples in YADE deal with gravity deposition only, I'm wondering if it is possible to model soil-tool interactions like the one I have here.
1- Am I missing something regarding collision establishment?
2- Do I need any adjustments for the rank of my facet wheel to enable collision and getting forces on the wheel?
Thanks so much
from yade import pack, export
from yade import pack, plot
from yade import ymport
import sys
import os
import os.path
import numpy
import math
import os
from yade import mpy as mp
from yade import timing
NSTEPS=100 #turn it >0 to see time iterations, else only initilization
numThreads = 9 # number of threads to be spawned, (in interactive mode).
#######
### INPUT PARAMETERS ###
#######
## Wheel PROPERTIES
rmean=5.
widthWheel=0.00125
Wheel_R=0.0025
Wheel_Additiona
##WHELL MOVEMENT
slidingratio=0.3
velocity=0.1 #m/s THAT SHOULD BE 0.01 m/s
angularVelocity
gravityAcc=-9.81
deposFricDegree = 28.5 # INITIAL CONTACT FRICTION FOR SAMPLE PREPARATION
normalDamp=0.7 # NUMERICAL DAMPING
shearDamp=0.7
youngSoil=0.7e8# CONTACT STIFFNESS FOR SOIL
youngContainer=
poissonSoil=0.3 # POISSION'S RATIO FOR SOIL
poissionContain
densSoil=2650 # DENSITY FOR SOIL
densContainer=7850 # DENSITY FOR CONTAINER
numDamp=0.4
binSize=0.4*Wheel_R
activeDistance=0.01
iniDistanceWhee
differenceWCent
initialPenetera
iniWheelDisfrom
#######
### DDEFINING VARIABLES AND MATERIALS ###
#######
SoilId=
O.materials.
ContainerId=
O.materials.
#######
##### CREATING GEOMETRIES #####
#######
## IMPORTING THE ALREADY COMPACTED BIN
O.bodies.
minX=min(
maxX=max(
minY=min(
maxY=max(
minZ=min(
maxZ=max(
print ("minX:
mn,mx=Vector3(
## CREATE WALLS AROUND THE PACKING
walls=aabbWalls
wallIds=
for b in O.bodies:
if b.state.
O.bodies.
widthWheel=
XcenterofWheel = widthWheel/2+minX
YcenterofWheel = Wheel_R+
ZcenterofWheel = iniDistanceWhee
Wheel1 = geom.facetCylin
O.bodies.
idsr = [w.id for w in Wheel1]
facets = [b for b in O.bodies if isinstance(
for b in facets:
O.forces.
#######
### DEFiniNG ENGINES ###
#######
O.engines=[
ForceResetter(),
InsertionSortCo
InteractionLoop(
[Ig2_Sphere_
[Ip2_FrictMat_
[Law2_ScGeom_
),
## WE WILL USE THE GLOBAL STIFFNESS OF EACH BODY TO DETERMINE AN OPTIMAL TIMESTEP (SEE HTTPS:/
#GlobalStiffnes
CombinedKinemat
RotationEngine(
NewtonIntegrato
VTKRecorder(
PyRunner(
PyRunner(
PyRunner(
]
O.dt = 1e-7
collider.verletDist = 0.05*rmean
# get TranslationEngine and RotationEngine from CombinedKinemat
transEngine, rotEngine = combEngine.comb[0], combEngine.comb[1]
def WheelPenetration():
transEngine.
rotEngine.
timing.reset()
t=time.time()
print(
if (rotEngine.
print(
checker.
def WheelRolling():
transEngine.
transEngine.
rotEngine.
rotEngine.
print(
if rotEngine.
print("ROLLING PERFORMED")
O.pause()
def history():
global Fx,Fy,Fz,Dx,Dy,Dz
Fx=0
Fy=0
Fz=0
for b in facets:
Fx+
Fy+
Fz+
Dx=rotEngine.
Dy=rotEngine.
Dz=rotEngine.
yade.
## In that case we can still save the data to a text file at the the end of the simulation, with:
plot.
## declare what is to plot. "None" is for separating y and y2 axis
plot.plots=
plot.plot()
######### RUN ##########
# customize mpy
mp.ERASE_
mp.DOMAIN_
#mp.mpirun(NSTEPS) #passive mode run
mp.MERGE_
mp.mpirun(
mp.mergeScene() #merge scene after run.
if mp.rank == 0: O.save(
#demonstrate getting stuff from workers, here we get kinetic energy from worker subdomains,notice that the master (mp.rank = 0), uses the sendCommand to tell workers to compute kineticEnergy.
if mp.rank==0:
print("kinetic energy from workers: "+str(mp.
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Nima Goudarzi for more information if necessary.