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

Dem particle wall sliding velocity #896

Merged
merged 9 commits into from
Oct 2, 2023

Conversation

blaisb
Copy link
Contributor

@blaisb blaisb commented Oct 1, 2023

Description of the problem

  • The calculation of the translational velocity on rotating walls was calculated inadequately #896: The velocity of rotating boundary conditions (e.g. boundaries of the mesh) was calculated inadequately in the case where the normal vector of the wall was aligned with the rotation axis. The whole calculation procedure was slightly messed up and only worked for cylinders.

Description of the solution

  • This has been fixed and made general by using the vector from the contact point to the center of rotation. A new parameter has been added for this purpose.

How Has This Been Tested?

  • All test pass and give adequate results
  • A new application test has been added to test this exact feature

Documentation

  • Documentation of the point on the axis has been updated

Future changes

  • I will continue to refactor the entire DEM particle-wall aspect to make it cleaner and more streamlined

@blaisb blaisb requested a review from OGaboriault October 1, 2023 03:58
Copy link
Collaborator

@OGaboriault OGaboriault left a comment

Choose a reason for hiding this comment

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

Good job on fixing this. Is was bothering me.

My only big comment is on vector_to_rotating_axis calculation.

@@ -28,6 +28,9 @@ In this subsection, the boundary conditions of the DEM simulation are defined. F
set rotational vector x = 1
set rotational vector y = 0
set rotational vector z = 0
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't we also just change the way we define the rotation the rotation vector in the to be the same as the point on rotation vector. I find the new way more elegant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The new way is more elegant, but i want to introduce the change progressively. First fix the bug, then refactor the parameters in another PR. I would like to remove all of the x, y , z parameters as individual and always use lists, but I would rather do this in another PR

source/dem/particle_wall_contact_force.cc Outdated Show resolved Hide resolved
vector_to_rotating_axis =
vector_to_rotating_axis -
(vector_to_rotating_axis * this->boundary_rotational_vector[boundary_id]) *
this->boundary_rotational_vector[boundary_id] /
Copy link
Collaborator

Choose a reason for hiding this comment

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

this->boundary_rotational_vector is not already a unit vector?

Copy link
Collaborator

Choose a reason for hiding this comment

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

we are using the double boundary_rotational_speed, so technically boundary_rotational_vector should be a unit vector. We should add a step when creating that container to make sure that we are storing unit vectors in it. This would save the extra division (and addition at the denominator).

Also, why are you using the norm_square?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am using the norm square because we do two scalar product. There is no garantee right now that the vector is a unit vector, (e.g. someone could write 1,1,1 and it should still work). We can refactor this, but this means changing what was the meaning of these parameters. I am all for this, but this should be done in another PR. This PR fixes the problem we had, it does not aim at refactoring the entire parameter structure.

dem_parameters.boundary_conditions.boundary_rotational_vector,
grid_radius,
dem_parameters);
ParticleWallLinearForce<dim> force_object(dem_parameters);
Copy link
Collaborator

Choose a reason for hiding this comment

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

LOL. Ok I see what you mean hahaha. This is really funny.

@blaisb blaisb force-pushed the dem_particle_wall_sliding_velocity branch from 6338bdb to 927717d Compare October 2, 2023 00:34
@blaisb blaisb merged commit 82a8a36 into master Oct 2, 2023
15 checks passed
@blaisb blaisb deleted the dem_particle_wall_sliding_velocity branch October 2, 2023 15:24
blaisb added a commit that referenced this pull request Oct 2, 2023
Description of the problem
The calculation of the translational velocity on rotating walls was calculated inadequately #896: The velocity of rotating boundary conditions (e.g. boundaries of the mesh) was calculated inadequately in the case where the normal vector of the wall was aligned with the rotation axis. The whole calculation procedure was slightly messed up and only worked for cylinders.

Description of the solution
This has been fixed and made general by using the vector from the contact point to the center of rotation. A new parameter has been added for this purpose.

How Has This Been Tested?
All test pass and give adequate results
A new application test has been added to test this exact feature

Documentation
Documentation of the point on the axis has been updated

Future changes
I will continue to refactor the entire DEM particle-wall aspect to make it cleaner and more streamlined

Co-authored-by: OGaboriault <[email protected]>
blaisb pushed a commit that referenced this pull request Nov 1, 2023
#Description of the problem

This is a follow up to Dem particle wall sliding velocity #896
The rotational vector for the rotational boundary condition in the lethe-particles solver is now define with one line in the parameters file.
We make sure that the rotational vector is a unit vector. This way, we save the norm_square calculation, the addition and the division when computing the vector_to_rotating_axis variable. (Simply cleaner in my opinion)
We throw an error is the vector is defined as the null vector which wasn't the case previously.
How Has This Been Tested?
All test pass.
Throw error works
Documentation
The set rotation vector line in the documentation and examples were updated.
Future changes
The translation speed should be define as such in the parameter file
Comments
None
M-Badri pushed a commit to M-Badri/lethe that referenced this pull request Sep 29, 2024
Description of the problem
The calculation of the translational velocity on rotating walls was calculated inadequately chaos-polymtl#896: The velocity of rotating boundary conditions (e.g. boundaries of the mesh) was calculated inadequately in the case where the normal vector of the wall was aligned with the rotation axis. The whole calculation procedure was slightly messed up and only worked for cylinders.

Description of the solution
This has been fixed and made general by using the vector from the contact point to the center of rotation. A new parameter has been added for this purpose.

How Has This Been Tested?
All test pass and give adequate results
A new application test has been added to test this exact feature

Documentation
Documentation of the point on the axis has been updated

Future changes
I will continue to refactor the entire DEM particle-wall aspect to make it cleaner and more streamlined

Co-authored-by: OGaboriault <[email protected]>
Former-commit-id: 82a8a36
M-Badri pushed a commit to M-Badri/lethe that referenced this pull request Sep 29, 2024
#Description of the problem

This is a follow up to Dem particle wall sliding velocity chaos-polymtl#896
The rotational vector for the rotational boundary condition in the lethe-particles solver is now define with one line in the parameters file.
We make sure that the rotational vector is a unit vector. This way, we save the norm_square calculation, the addition and the division when computing the vector_to_rotating_axis variable. (Simply cleaner in my opinion)
We throw an error is the vector is defined as the null vector which wasn't the case previously.
How Has This Been Tested?
All test pass.
Throw error works
Documentation
The set rotation vector line in the documentation and examples were updated.
Future changes
The translation speed should be define as such in the parameter file
Comments
None


Former-commit-id: f7f4cc8
blaisb added a commit that referenced this pull request Sep 30, 2024
Description of the problem
The calculation of the translational velocity on rotating walls was calculated inadequately #896: The velocity of rotating boundary conditions (e.g. boundaries of the mesh) was calculated inadequately in the case where the normal vector of the wall was aligned with the rotation axis. The whole calculation procedure was slightly messed up and only worked for cylinders.

Description of the solution
This has been fixed and made general by using the vector from the contact point to the center of rotation. A new parameter has been added for this purpose.

How Has This Been Tested?
All test pass and give adequate results
A new application test has been added to test this exact feature

Documentation
Documentation of the point on the axis has been updated

Future changes
I will continue to refactor the entire DEM particle-wall aspect to make it cleaner and more streamlined

Co-authored-by: OGaboriault <[email protected]>
Former-commit-id: 82a8a36
blaisb pushed a commit that referenced this pull request Sep 30, 2024
#Description of the problem

This is a follow up to Dem particle wall sliding velocity #896
The rotational vector for the rotational boundary condition in the lethe-particles solver is now define with one line in the parameters file.
We make sure that the rotational vector is a unit vector. This way, we save the norm_square calculation, the addition and the division when computing the vector_to_rotating_axis variable. (Simply cleaner in my opinion)
We throw an error is the vector is defined as the null vector which wasn't the case previously.
How Has This Been Tested?
All test pass.
Throw error works
Documentation
The set rotation vector line in the documentation and examples were updated.
Future changes
The translation speed should be define as such in the parameter file
Comments
None


Former-commit-id: f7f4cc8
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

Successfully merging this pull request may close these issues.

2 participants