← Back to team overview

yade-users team mailing list archive

Re: How to make an inclined wall? or cylindrical wall

 

so I have prepared for you everything you need to code a collision of a
sphere with a cyllinder. in the attachment you will find all the files.
you can copy them to latest svn trunk (overwriting existing files), then
compile and examine CylinderTest filegenerator.

You have three problems to solve:



1. yade-packages/yade-package-dem/src/PreProcessor/CylinderTest

inside there is a function createCylinder(), apart from changing
cylinder's position and orientation (which certainly you will do), you
also should calculate correct mass and inertia of the cylinder.
Currently there are formulas for sphere, which is of course totally
wrong.




2. yade-packages/yade-package-dem/src/Engine/EngineUnit/InteractingHollowCylinder2AABB

this function is crucial for correct detection of potential
interactions. You must write a correct formula that will calculate AABB
(Axis Aligned Bounding Box) from a hollow cylinder. In the graphical gui
you can click checkbox 'drawBoundingVolume' to examine the results of this function.

inside this file you have examples how it is done for a sphere and for a
box. Based on that you should write it for a cylinder.

currently it is calculating as if cylider was a sphere which is totally wrong.




3. yade-packages/yade-package-dem/src/Engine/EngineUnit/InteractingHollowCylinder2InteractingSphere4SpheresContactGeometry

finally the most important part: calculate SpheresContactGeometry from a
collision of a sphere with a cylinder. I've written a lenghty
explamantion inside this file, so you should look there.





Additional explanations:

4. when you will load scene.xml generated by CylinderTest, you must
click 'Fixed' in the 'Time Step' section. That is because the
timestepper choses timestep=0 seconds. I'm not sure now why exactly he
is doing that, we will find out later. To temporarily fix the problem
you can also comment a line 

rootBody->engines.push_back(sdecTimeStepper);

in CylinderTest.cpp, but finally that line should be uncommented, and
this problem should be fixed. Otherwise the simulation will go too slow
due to too small timestep, or will go wrong due to too big timestep.


5. I have enabled 'useSpheresAsGround' because the cylinder will not
interact with the box. It will just fall through, which is not what we
want, at all :) You can disable it, and watch the results. If you want a
collision between cylinder and a box, then you should write this class:

yade-packages/yade-package-dem/src/Engine/EngineUnit/InteractingHollowCylinder2InteractingBox4SpheresContactGeometry
                                                                               ^^^^^^^^^^^^^^
and appropriately register it inside CylinderTest.cpp, line 380.


6. when you run the simulation you will see a cylinder that is
overlapping with spheres. This is of course caused by the fact, that
currently cylinder behaves like a sphere ;) This will be fixed when you
solve problem 2 and problem 3 :)


7. if you want a collision between two cylinders then you should write this class:

yade-packages/yade-package-dem/src/Engine/EngineUnit/InteractingHollowCylinder2InteractingHollowCylinder4SpheresContactGeometry
                                                                               ^^^^^^^^^^^^^^^^^^^^^^^^^

8. cylinder here is a dynamic object, so it is moving. probably for your
triaxal test you want cylinder to be a non-moving thing. Or maybe you
will want to move it with a TranslationEngine (DeuxExMachina). to have a
non-moving cylinder you just assign isDynamic=false;

9. if for example you will want to modify the radius of a cylinder (to
compress spheres inside), you will have to write another DeuxExMachina,
that will modify the radius. it will be similar to TranslationEngine,
but instead of moving, it will modify the radius.


good luck, and I'm waiting for interesting questions!

-- 
Janek Kozicki                                                         |

Attachment: trunk-HollowCylinder.tar.gz
Description: Binary data


References