Problems about Chrono ChBody and ChCollisionModelParallel

71 views
Skip to first unread message

liugua...@gmail.com

unread,
Nov 8, 2017, 9:11:35 AM11/8/17
to ProjectChrono
Dear everyone,

Hi, I use Chrono to simulate the slope slide. But I encounter a problem.

I set 200000 sphere particles on the slope bed, and every particle has
volume about 0.5 m^3. And I set slope bed as a Chbody too. And slope
bed has volume about 167996 m^3.

Here is my code:
auto bin = std::make_shared<ChBody>(std::make_shared<ChCollisionModelParallel>());
bin->SetMass(mass);

I set that mass value is equal to volume and the simulate result is good.
The particles can't get through the slope bed.

But I set that mass value is equal to volume*density, for example density
=2800. The particles can get through the slope bed easily.

Even if I set that slope bed mass is very big and even 1e14. The particles
can get through the slope bed and the result shows that there is no
contact force between particles.

By the way, I use this kind of system: ChSystemParallelNSC msystem;

Thanks for your help!

Best Wishes,

Liu

Alessandro Tasora

unread,
Nov 8, 2017, 9:13:01 AM11/8/17
to projec...@googlegroups.com
hi Liu,

the problem is that probably you set a high mass, but you forgot to set
also a high inertia Ixx Iyy Izz. Use bin->SetInertia(...) for this.

Or just use the ChBodyEasySphere, that automatically computes both mass
& inertias from the desired density.

(If you mix very high masses with small Ixx Iyy Izz the solver will
have troubles like the one that you experienced).

regards

Alessandro Tasora

liugua...@gmail.com

unread,
Nov 8, 2017, 10:24:03 AM11/8/17
to ProjectChrono
Dear Alessandro,

I set the ChBodyEasySphere like this, but it has some error.
Do you know where is wrong?

auto ball = std::make_shared<ChBodyEasySphere>(std::make_shared<ChCollisionModelParallel>());

auto ballMat = std::make_shared<ChMaterialSurfaceNSC>();
ball->SetMaterialSurface(ballMat);

ball->SetIdentifier(ballId++);
ball->SetDensity(density);

ChVector<> pos(x, y, z);
ball->SetPos(pos);

ball->SetRot(ChQuaternion<>(1, 0, 0, 0));
ball->SetBodyFixed(false);
ball->SetCollide(true);

ball->GetCollisionModel()->ClearModel();
utils::AddSphereGeometry(ball.get(), r*1.0);
ball->GetCollisionModel()->BuildModel();
sys->AddBody(ball);

Do you have some example about how to use ChBodyEasySphere?

Best Wishes,
Liu


在 2017年11月8日星期三 UTC+8下午10:13:01,Alessandro Tasora写道:

Radu Serban

unread,
Nov 9, 2017, 11:30:51 AM11/9/17
to projec...@googlegroups.com

Hi Liu,

When you create a shared_ptr, you must pass the expected constructor arguments for that class.  Look at the definition of ChBodyEasySphere.  It requires the radius and density and, optionally, flags for collision and visualization, and the contact method to be used.  However, there is no way to specify a different collision system at construction, so it's not straightforward to use it within a Chrono::Parallel system.  There are ways to go around this, but they sort of defeat the purpose of the ChBodyEasy*** classes.  

We will look into fixing these issues with these ChBodyEasy*** classes.   In the meantime, I suggest you simply create a ChBody and set the sphere visualization and collision geometry manually.  Just make sure to also set the proper inertia.  In other words, something like this:

            ChVector<> inertia = (2.0 / 5.0) * mass * radius * radius * ChVector<>(1, 1, 1);

            auto ball = std::make_shared<ChBody>(std::make_shared<ChCollisionModelParallel>());
            ball->SetMaterialSurface(ballMat);

            ball->SetMass(mass);
            ball->SetInertiaXX(inertia);
            ball->SetPos(ChVector<>(x,y,z));


            ball->SetRot(ChQuaternion<>(1, 0, 0, 0));
            ball->SetBodyFixed(false);
            ball->SetCollide(true);

            ball->GetCollisionModel()->ClearModel();

            utils::AddSphereGeometry(ball.get(), radius);


            ball->GetCollisionModel()->BuildModel();

            sys->AddBody(ball);

Best,
Radu

Reply all
Reply to author
Forward
0 new messages