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

116 rigid body rod contact #117

Conversation

armantekinalp
Copy link
Contributor

Fixes #116

Previous implementation of rigid cylinder rod contact was not taking into account torques generated on cylinder due to contact. This PR changes the previous implementation to incorporate torques generated by contact forces that are applied away from the cg of cylinder.

In order to validate implementation a new example simulation called rod_cylinder_parallel_contact.py is added where parallel rod and cylinder contact and exchange momentum. Simulation results are given below, where rod_one is a Cosserat Rod , rod_two is rigid cylinder.

rod_rigid_velocity

Blue rod is Cosserat Rod, Orange rod is Rigid Cylinder.

2D_xz_rod_cylinder_contact.mp4

This commit fixes the rod-cylinder contact by adding torques due to the
contact force on cylidner. Previously, we were only dealing with forces
acting on cylinders however any contact force acting away from the cg
will create torque.
@armantekinalp armantekinalp added the bug Something isn't working label Jun 24, 2022
@armantekinalp armantekinalp added this to the Version 0.2.4 milestone Jun 24, 2022
@armantekinalp armantekinalp requested a review from bhosale2 June 24, 2022 04:55
@armantekinalp armantekinalp self-assigned this Jun 24, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jun 24, 2022

Codecov Report

Merging #117 (a1c7d53) into update-0.2.4 (2997d10) will decrease coverage by 0.22%.
The diff coverage is 47.91%.

@@               Coverage Diff                @@
##           update-0.2.4     #117      +/-   ##
================================================
- Coverage         87.09%   86.87%   -0.23%     
================================================
  Files                40       40              
  Lines              2534     2567      +33     
  Branches            343      345       +2     
================================================
+ Hits               2207     2230      +23     
- Misses              305      315      +10     
  Partials             22       22              
Impacted Files Coverage Δ
elastica/joint.py 22.80% <0.00%> (-0.83%) ⬇️
elastica/external_forces.py 96.22% <100.00%> (+1.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4ecd851...a1c7d53. Read the comment docs.

Copy link
Collaborator

@bhosale2 bhosale2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. But to show torques are acting, shouldn't we show an example where there is an inclined collision, and then rotation happens? What if the inclination angle is provided as a parameter to be set in the example case?

@armantekinalp
Copy link
Contributor Author

I will add one more example, where cylinder rotates after collision.

@bhosale2
Copy link
Collaborator

@armantekinalp after you add the variable-angle collision case, no need to re-request, you can merge directly.

@bhosale2 bhosale2 linked an issue Jun 24, 2022 that may be closed by this pull request
@armantekinalp
Copy link
Contributor Author

Inclined rod - cylinder contact
rod_rigid_velocity

2D_xz_rod_cylinder_contact.mp4

@armantekinalp armantekinalp merged commit 60bae63 into GazzolaLab:update-0.2.4 Jul 2, 2022
@armantekinalp armantekinalp deleted the 116_rigid_body_rod_contact branch July 2, 2022 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rigid body - rod contact torque
3 participants