How to use interactionDetectionFactor(>1) to create distance interactions in Ig2_Sphere_Sphere_ScGeom?

Asked by weijie on 2021-04-11

Dear all,

I'm looking at ig2_ Sphere_ Sphere_ ScGeom.cpp,it is found that there is only one line of code[1] about the interactionDetectionFactor, and the variable penetrationDepthSq seems not to be used in later code.I want to know how distance interaction(when interactionDetectionFactor>1) is created in the code.

Thanks in advance.
Jie

[1] https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/dem/Ig2_Sphere_Sphere_ScGeom.cpp#L30

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jan Stránský
Solved:
Last query:
Last reply:
Best Jan Stránský (honzik) said : #1

Hello,

Ig2 is only one component in the interaction creation chain. Ig2_ Sphere_ Sphere_ ScGeom.interactionDetectionFactor "just" considers also "distant interactions".
The [1] check would return false (= no interaction) for the case of no overlap, but it does the computation and returns true (= interaction for further consideration) for interactionDetectionFactor>1.
It computes penetrationDepth [2] as
Real norm = normal.norm(); // distance of sphere centers
Real penetrationDepth = s1->radius + s2->radius - norm;
so for "distant interactions" i.geom.penetrationDepth is negative.

Then, also Ip2 and Law2 are evaluated.
E.g. for "classical" Law2_ScGeom_FrictPhys_CundallStrack, the interaction is deleted for the case of negative penetrationDepth [3] (i.e. "the Law2 functor in use permitting" in [4]).

cheers
Jan

[2] https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/dem/Ig2_Sphere_Sphere_ScGeom.cpp#L51
[3] https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/dem/ElasticContactLaw.cpp#L62
[4] https://yade-dem.org/doc/user.html#creating-interactions

weijie (amandajoe) said : #2

Hi Jan, and thank you again.

Can I think that when interactionDetectionFactor * (S1 - > radius + S2 - > radius) - norm>0, the [1] is to think that there is a distant interaction between two spheres, and ig2 will still calculate the pentrationDepth, but is negative value,and it will be used for the later calculation of IP2 and law2. Is it [1]line 29-33 that I need to do to create interactions for non-overlapping polyhedron -polyhedron and sphere-polyhedron,see[5]?

Best regards
Jie

[5]https://answers.launchpad.net/yade/+question/692003

Hi, I would say yes. It will calculate data needed for any functor coming later to the interaction later on.
What _will_ be done with it up to the Ip2/Law2 entirely. For most of them it would just do nothing (or even it will attempt to erase the interaction).
Please note that verletDist in the collider should be defined consistently with detectionFactor (verlet dist >= detection dist to not miss any interaction).

Bruno

Jan Stránský (honzik) said : #4

In general #2 is correct.
For polyhedron-polyhedron and polyhedron-sphere case, the situation is more complicated than sphere-sphere - e.g. how to enlarge the polyhedron? How to set stiffness of such distant interaction? etc etc.
cheers
Jan

weijie (amandajoe) said : #5

Thanks to Jan and Bruno,

>how to enlarge the polyhedron?

For polyhedron-polyhedron,I found that in Ig2_Polyhedra_Polyhedra_PolyhedraGeom[6]the rotation matrix is multiplied by interactionDetectionFactor to enlarge the two polyhedrons.This may be helpful in my case to enlarge between 2 polyhedrons.But for the interaction between sphere and polyhedron,how should I deal with it?

>How to set stiffness of such distant interaction?

For CPM,I found that Kn and KS are calculated in Law2_ScGeom_CpmPhys_Cpm[7].The values of kn and Ks depend on crosssection and reflength. For polyhedron - polyhedron, polyhedron - sphere, is their crosssection calculation still pi * Rmin ^ 2[8]? If so, is the value of radius should multiplied by interactiondetectionfactor?

Best regards
Jie

[6]https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/dem/Polyhedra_Ig2.cpp#L49
[7]https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/dem/ConcretePM.cpp#L343
[8]https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/dem/ConcretePM.cpp#L325

> their crosssection calculation still pi * Rmin ^ 2[8]? If so, is the value of radius should multiplied by interactiondetectionfactor?

I would say no interactiondetectionfactor must large enough to catch all meaningfull interactions. Beyond "enough", it is virtually arbitralily large (except for computational costs). So it would be weird to have mechanical quantities depend on it.

But at this point the question is more: which are you governing equations? "How to implement" can't be answered when equations are not clarified.
Bruno

Sorry for poor typing, here is the version with punctuation and less typos:

I would say no. interactiondetectionfactor must be large enough to catch all meaningfull interactions. Beyond "enough", it is virtually arbitrarilly large (except for computational costs). So it would be weird to have mechanical quantities depend on it.

Jan Stránský (honzik) said : #8

>>how to enlarge the polyhedron?
> For polyhedron-polyhedron,I found that in Ig2_Polyhedra_Polyhedra_PolyhedraGeom[6]the rotation matrix is multiplied by interactionDetectionFactor to enlarge the two polyhedrons.This may be helpful in my case to enlarge between 2 polyhedrons.But for the interaction between sphere and polyhedron,how should I deal with it

It is up to you and your needs :-)
For sphere, I think the only meaningful option is to simply enlarge its radius.
For polyhedrons, there more options:
- simply enlarge the polyhedron vertices from the polyhedron center
- wrap the polyhedron with "equidistant" surface, something like Minkowski sum
- surely other meaningful polyhedron enlargement exist
The proper choice depends on the problem.

>> How to set stiffness of such distant interaction?
> The values of kn and Ks depend on crosssection and reflength. For polyhedron - polyhedron, polyhedron - sphere, is their crosssection calculation still pi * Rmin ^ 2[8]? If so, is the value of radius should multiplied by interactiondetectionfactor?

I agree with Bruno that multiplication of these values by interactionDetectionFactor does not make much sense (although of course it can be used).

In general, the Rmin, cross-section and refLength may be used.
Rmin for polyhedron is currently a rough estimation (or even hack), it can be done in a more sophisticated way if needed - e.g. taking into account orientation of the interaction w.r.t polyhedron orientation.

Cheers
Jan

weijie (amandajoe) said : #9

Thanks to Jan and Bruno.

weijie (amandajoe) said : #10

Thanks Jan Stránský, that solved my question.