Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added mass with fixed body in system crashes simulation #25

Open
zur-quin opened this issue May 24, 2023 · 0 comments
Open

Added mass with fixed body in system crashes simulation #25

zur-quin opened this issue May 24, 2023 · 0 comments

Comments

@zur-quin
Copy link
Collaborator

In situations where one body in the chrono system is fixed in place, Project Chrono removes its mass/inertia matrix from the system's mass/inertia matrix. This does not cause problems when applying forces to the fixed body, but does cause problems when the added mass matrix is larger than the system mass matrix.
There is a current (yet messy) solution: say the fixed body in the system is called body1. Then instead of fixing body1 in place, create a new extra ChBody called floor. Fix floor and link it to body1. Now, since body1 isn't fixed, its mass matrix is part of the system mass matrix and since floor is fixed, chrono removes its mass matrix from the system. Then added mass can be added as normal. This is the current method of fixing bodies in demo_oswec_decay and demo_f3of_DT3. See excerpt from oswec below:

   // define the base's initial conditions
    system.Add(base_body);
    base_body->SetPos(ChVector<>(0, 0, -10.9));
    base_body->SetMass(999);
    base_body->SetInertiaXX(ChVector<>(1, 1, 1));

    // create ground
    auto ground = chrono_types::make_shared<ChBody>();
    system.AddBody(ground);
    ground->SetPos(ChVector<>(0, 0, -10.9));
    ground->SetBodyFixed(true);
    ground->SetCollide(false);
    // fix base to ground with special constraint (don't use setfixed() because of mass matrix)
    auto anchor = chrono_types::make_shared<ChLinkMateGeneric>();
    anchor->Initialize(base_body, ground, false, base_body->GetVisualModelFrame(), base_body->GetVisualModelFrame());
    system.Add(anchor);
    anchor->SetConstrainedCoords(true, true, true, true, true, true);  // x, y, z, Rx, Ry, Rz

This issue can be resolved when the above code is replaced with

   // define the plate's initial conditions
    system.Add(base_body);
    base_body->SetNameString("body2");
    base_body->SetPos(ChVector<>(0, 0, -10.9));
    base_body->SetMass(999);
    base_body->SetInertiaXX(ChVector<>(1, 1, 1));
    base_body->SetBodyFixed(true);

and the demo runs, producing correct results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant