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

Add 3D motion of non spherical objects #979

Merged
merged 80 commits into from
Feb 7, 2024
Merged

Add 3D motion of non spherical objects #979

merged 80 commits into from
Feb 7, 2024

Conversation

Luckabarbeau
Copy link
Collaborator

Description of the problem

  • This PR aims to add support for the coupled angular motion of any 3D object. This includes the coupling with the fluid and the DEM interaction between these objects. The following elements are added: integration of the Euler angles in the DEM and in the CFD coupling, relevant parameters for the inertia and volume of the objects, A function to evaluate the distance between the two objects using the intersection of their level-set and their bounding box, a set of three boolean parameters that aimed at limiting the number of call to the DEM calculation.
  • While implementing these features, two bugs were found: A bug that affected the evaluation of the force when two particles were in contact. This bug was changing the force evaluation on a particle depending on the number of processors that were used. This bug comes from overconstrained cells (cells with all their DOF imposed by boundary conditions were poorly treated in the force evaluation). This modification changed the results of a few tests where contact played a role. However, the solution's behavior does not change significantly, and new results still agree well with previous results for cases with particle contact. The modification to the function generate_cut_cell_map and force_evaluation only addresses this bug.
    Another bug for the evaluation of the gradient of superquadric was found. The gradient had a sign error if evaluated inside of the particle. The evaluation of the supequadric was also optimized by avoiding overshoot.
  • The new inertia required a modification of the load particle from the file option. To add the possibility of defining the inertia matrix in the load particle from the file option, we modified the syntax to be semicolon-separated instead of space-separated and added the volume variable.

Description of the solution

  • Add support for integrating the Euler angle in the coupling formulation and in the DEM. Move all the DEM calculations for contact force in the ib_particle_dem to take the contact point into account correctly and simplify the code.
  • Add the new function in the shape classes called distance_to_shape. This function looks for the minimum of the level set defined by the intersection of two shapes. Using this minimum, we can evaluate the overlap of the two shapes. This function combines a Cartesian search with a gradient direction search and a numerical gradient descent.

How Has This Been Tested?

  • A new test was added that modeled two ellipsoids in contact with each other and a wall.
  • All previous tests were verified, and an investigation was performed when the results were modified (e.g., pp_contact_test).
  • Previous examples were tested and run successfully.
  • A modified example was performed to test multiple superquadric shapes (64).

Documentation

  • The documentation was updated to reflect the new options and add some tips on using the new feature.

Future changes

  • This feature version remains experimental, and more tests and validation should be performed. An example with a validation case should be added.

@blaisb
Copy link
Contributor

blaisb commented Jan 5, 2024

You'll need to rebase, No hurry though

Copy link
Contributor

@blaisb blaisb left a comment

Choose a reason for hiding this comment

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

First batch of comments, will continue most likely early next week :)

Copy link
Collaborator

@oguevremont oguevremont left a comment

Choose a reason for hiding this comment

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

Nice PR! The comments I have so far. I still have some files to review

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.

Still not finish, on last file to review

Copy link
Collaborator

@voferreira voferreira left a comment

Choose a reason for hiding this comment

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

First batch of suggestions.

Copy link
Contributor

@blaisb blaisb left a comment

Choose a reason for hiding this comment

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

Other bunch of comments. I only have 3 files left. Most likely tomorrow morning

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.

First batch finish. Good work


Tensor<1, 3> point_to_particle_vector =
particle_position_3d - point_on_boundary_3d;
Tensor<1, 3> normal =
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same think here, I would add comments about who is i and who is j

Copy link
Collaborator

@voferreira voferreira left a comment

Choose a reason for hiding this comment

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

Second small batch

Copy link
Collaborator

@voferreira voferreira left a comment

Choose a reason for hiding this comment

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

One more batch of comments.

@blaisb blaisb requested a review from OGaboriault January 15, 2024 01:12
Copy link
Contributor

@blaisb blaisb left a comment

Choose a reason for hiding this comment

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

Other batch of comments. I will continue this week. This is a chunky PR to review really...

Copy link
Collaborator

@PierreLaurentinCS PierreLaurentinCS left a comment

Choose a reason for hiding this comment

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

I'm arriving after the war, mostly typos and some questions about the implementation.

* The ``enable lubrication force`` parameter enables or disables the use of lubrication forces. This parameter must be set to ``false`` when using non-newtonian fluid.
* The ``explicit contact impulsion`` parameter enables or disables the use of explicit contact impulsion evaluation in the resolution of the coupling of the particle. When it is set to true, this parameter results in the code only performing the DEM calculation once per CFD time step and using the resulting contact impulsion to evaluate all the other Newton's iterations. This reduces the number of times the DEM calculation is made. However, since the position is still implicitly evaluated in the absence of contact, the cut cell mapping must be performed at each Newton iteration.

* The ``explicit position integration`` parameter enables or disables the use of explicit position integration in the resolution of the coupling of the particles. When it is set to true, this parameter results in the code only performing the DEM calculation once and using the resulting position and orientation to evaluate all the other Newton's iterations. This reduces the number of times the cut cell mapping must be performed and the number of call to the DEM calculations. However, this can affect the stability of the scheme.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* The ``explicit position integration`` parameter enables or disables the use of explicit position integration in the resolution of the coupling of the particles. When it is set to true, this parameter results in the code only performing the DEM calculation once and using the resulting position and orientation to evaluate all the other Newton's iterations. This reduces the number of times the cut cell mapping must be performed and the number of call to the DEM calculations. However, this can affect the stability of the scheme.
* The ``explicit position integration`` parameter enables or disables the use of explicit position integration in the resolution of the coupling of the particles. When it is set to true, this parameter results in the code only performing the DEM calculation once and using the resulting position and orientation to evaluate all the other Newton's iterations. This reduces the number of times the cut cell mapping must be performed and the number of calls to the DEM calculations. However, this can affect the stability of the scheme.

* @brief
* initialised the particle
*
* @brief This class defines values related to a particle used in the sharp interface IB. Each particle defined will have these value used in the solver.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* @brief This class defines values related to a particle used in the sharp interface IB. Each particle defined will have these value used in the solver.
* @brief This class defines values related to a particle used in the sharp interface IB. Each particle defined will have these values used in the solver.

@Luckabarbeau
Copy link
Collaborator Author

I think this PR is now ready to merge.

@blaisb blaisb merged commit 72412e7 into master Feb 7, 2024
8 checks passed
@blaisb blaisb deleted the angular_motion_sharp branch February 7, 2024 15:43
M-Badri pushed a commit to M-Badri/lethe that referenced this pull request Sep 29, 2024
Description of the problem
This PR aims to add support for the coupled angular motion of any 3D object. This includes the coupling with the fluid and the DEM interaction between these objects. The following elements are added: integration of the Euler angles in the DEM and in the CFD coupling, relevant parameters for the inertia and volume of the objects, A function to evaluate the distance between the two objects using the intersection of their level-set and their bounding box, a set of three boolean parameters that aimed at limiting the number of call to the DEM calculation.
While implementing these features, two bugs were found: A bug that affected the evaluation of the force when two particles were in contact. This bug was changing the force evaluation on a particle depending on the number of processors that were used. This bug comes from overconstrained cells (cells with all their DOF imposed by boundary conditions were poorly treated in the force evaluation). This modification changed the results of a few tests where contact played a role. However, the solution's behavior does not change significantly, and new results still agree well with previous results for cases with particle contact. The modification to the function generate_cut_cell_map and force_evaluation only addresses this bug.
Another bug for the evaluation of the gradient of superquadric was found. The gradient had a sign error if evaluated inside of the particle. The evaluation of the supequadric was also optimized by avoiding overshoot.
The new inertia required a modification of the load particle from the file option. To add the possibility of defining the inertia matrix in the load particle from the file option, we modified the syntax to be semicolon-separated instead of space-separated and added the volume variable.
Description of the solution
Add support for integrating the Euler angle in the coupling formulation and in the DEM. Move all the DEM calculations for contact force in the ib_particle_dem to take the contact point into account correctly and simplify the code.
Add the new function in the shape classes called distance_to_shape. This function looks for the minimum of the level set defined by the intersection of two shapes. Using this minimum, we can evaluate the overlap of the two shapes. This function combines a Cartesian search with a gradient direction search and a numerical gradient descent.
How Has This Been Tested?
A new test was added that modeled two ellipsoids in contact with each other and a wall.
All previous tests were verified, and an investigation was performed when the results were modified (e.g., pp_contact_test).
Previous examples were tested and run successfully.
A modified example was performed to test multiple superquadric shapes (64).
Documentation
The documentation was updated to reflect the new options and add some tips on using the new feature.
Future changes
This feature version remains experimental, and more tests and validation should be performed. An example with a validation case should be added.

Co-authored-by: Pierre <[email protected]>
Co-authored-by: Bruno Blais <[email protected]>
Co-authored-by: Olivier Guévremont <[email protected]>
Co-authored-by: OGaboriault <[email protected]>
Co-authored-by: Victor Oliveira Ferreira <[email protected]>
Co-authored-by: PierreLaurentinCS <[email protected]>
Former-commit-id: 72412e7
blaisb added a commit that referenced this pull request Sep 30, 2024
Description of the problem
This PR aims to add support for the coupled angular motion of any 3D object. This includes the coupling with the fluid and the DEM interaction between these objects. The following elements are added: integration of the Euler angles in the DEM and in the CFD coupling, relevant parameters for the inertia and volume of the objects, A function to evaluate the distance between the two objects using the intersection of their level-set and their bounding box, a set of three boolean parameters that aimed at limiting the number of call to the DEM calculation.
While implementing these features, two bugs were found: A bug that affected the evaluation of the force when two particles were in contact. This bug was changing the force evaluation on a particle depending on the number of processors that were used. This bug comes from overconstrained cells (cells with all their DOF imposed by boundary conditions were poorly treated in the force evaluation). This modification changed the results of a few tests where contact played a role. However, the solution's behavior does not change significantly, and new results still agree well with previous results for cases with particle contact. The modification to the function generate_cut_cell_map and force_evaluation only addresses this bug.
Another bug for the evaluation of the gradient of superquadric was found. The gradient had a sign error if evaluated inside of the particle. The evaluation of the supequadric was also optimized by avoiding overshoot.
The new inertia required a modification of the load particle from the file option. To add the possibility of defining the inertia matrix in the load particle from the file option, we modified the syntax to be semicolon-separated instead of space-separated and added the volume variable.
Description of the solution
Add support for integrating the Euler angle in the coupling formulation and in the DEM. Move all the DEM calculations for contact force in the ib_particle_dem to take the contact point into account correctly and simplify the code.
Add the new function in the shape classes called distance_to_shape. This function looks for the minimum of the level set defined by the intersection of two shapes. Using this minimum, we can evaluate the overlap of the two shapes. This function combines a Cartesian search with a gradient direction search and a numerical gradient descent.
How Has This Been Tested?
A new test was added that modeled two ellipsoids in contact with each other and a wall.
All previous tests were verified, and an investigation was performed when the results were modified (e.g., pp_contact_test).
Previous examples were tested and run successfully.
A modified example was performed to test multiple superquadric shapes (64).
Documentation
The documentation was updated to reflect the new options and add some tips on using the new feature.
Future changes
This feature version remains experimental, and more tests and validation should be performed. An example with a validation case should be added.

Co-authored-by: Pierre <[email protected]>
Co-authored-by: Bruno Blais <[email protected]>
Co-authored-by: Olivier Guévremont <[email protected]>
Co-authored-by: OGaboriault <[email protected]>
Co-authored-by: Victor Oliveira Ferreira <[email protected]>
Co-authored-by: PierreLaurentinCS <[email protected]>
Former-commit-id: 72412e7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Enhancement New feature or request Ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants