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
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