Kratos icon indicating copy to clipboard operation
Kratos copied to clipboard

[Fluid] MPC-based slip condition

Open rubenzorrilla opened this issue 3 years ago • 12 comments

📝 Description This PR adds support for MPC-based slip boundary conditions. In front of what we did so far to apply the slip BC (by rotating the system of equations) this has the advantage of correctly computing the reactions from the RHS. On top of this, it can be somehow understood as a generalization of the multi-freedom technique we are using.

Right now both options are available, but in the long term I think that this is the way we should go. The blocker for this is the MPI implementation of the MPCs.

In a nutshell the changes are:

  • Creation of a static method to generate the slip BC MPCs in the FluidAuxiliaryUtilities.
  • Change the FluidDynamicsApplication custom schemes to make the rotation optional
  • Add support to the Python solvers. Note that this is done by calling the Initialize method of the base fluid_solver.py (so far it used to throw an error).

🆕 Changelog

  • Support for MPC-based slip conditions

rubenzorrilla avatar Nov 22 '21 15:11 rubenzorrilla

I just wanted to add,

The rotation based slip conditions are now used in adjoint formulations, and MPC are not yer supported by adjoint formulations.

sunethwarna avatar Nov 23 '21 11:11 sunethwarna

Good to see this ! One small comment. This condition cannot be used in MPI as constraints are not yet treated in MPI.

adityaghantasala avatar Nov 23 '21 11:11 adityaghantasala

Good to see this ! One small comment. This condition cannot be used in MPI as constraints are not yet treated in MPI.

Right now both options are available, but in the long term I think that this is the way we should go. The blocker for this is the MPI implementation of the MPCs.

See my comment in the PR description. It would be very good to get rid of the rotation (at least in the standard non-adjoint cases). Is this in our short-term ToDo list @adityaghantasala ?

rubenzorrilla avatar Nov 23 '21 11:11 rubenzorrilla

I did a test with almost 1M elements and the build takes around

  • 3.3-3.4 seconds for the rotation-based slip condition
  • 3.2-3.3 seconds for the new mpc-based slip condition

Having said this, I think we shouldn't be worried about the performance so we can safely merge this.

rubenzorrilla avatar Dec 10 '21 14:12 rubenzorrilla

el timing del build incluye la aplicación de los constraints?

Riccardo

On Fri, Dec 10, 2021 at 3:45 PM Rubén Zorrilla @.***> wrote:

I did a test with almost 1M elements and the build takes around

  • 3.3-3.4 seconds for the rotation-based slip condition
  • 3.2-3.3 seconds for the new mpc-based slip condition

Having said this, I think we shouldn't be worried about the performance so we can safely merge this.

— You are receiving this because your review was requested. Reply to this email directly, view it on GitHub https://github.com/KratosMultiphysics/Kratos/pull/9380#issuecomment-991031755, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5PWENKXMMSUUV2STI5F73UQIHAZANCNFSM5IRJRLSQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

RiccardoRossi avatar Dec 10 '21 14:12 RiccardoRossi

el timing del build incluye la aplicación de los constraints? Riccardo On Fri, Dec 10, 2021 at 3:45 PM Rubén Zorrilla @.***> wrote: I did a test with almost 1M elements and the build takes around - 3.3-3.4 seconds for the rotation-based slip condition - 3.2-3.3 seconds for the new mpc-based slip condition Having said this, I think we shouldn't be worried about the performance so we can safely merge this. — You are receiving this because your review was requested. Reply to this email directly, view it on GitHub <#9380 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5PWENKXMMSUUV2STI5F73UQIHAZANCNFSM5IRJRLSQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

I've just realized that the build time doesn't take into account the constraints... I think this is a minor issue we should correct in our B&S. I'd repeat the test again. Thanks for pointing it out.

rubenzorrilla avatar Dec 10 '21 15:12 rubenzorrilla

I did a test with almost 1M elements and the build takes around

* 3.3-3.4 seconds for the rotation-based slip condition

* 3.2-3.3 seconds for the new mpc-based slip condition

Having said this, I think we shouldn't be worried about the performance so we can safely merge this.

The correct times are:

  • 3.3-3.4 seconds for the rotation-based slip condition
  • 4.3-4.4 seconds (3.2-3.3 seconds for the build + 1.1 seconds to apply the constraints) for the new mpc-based slip condition

rubenzorrilla avatar Dec 10 '21 15:12 rubenzorrilla

@RiccardoRossi shall we merge it?

rubenzorrilla avatar Dec 22 '21 15:12 rubenzorrilla

@RiccardoRossi what do we do with this?

rubenzorrilla avatar Feb 09 '22 11:02 rubenzorrilla

i think it is interesting to have it as option, on particular as it can be used together with the structure

On Wed, Feb 9, 2022, 12:36 Rubén Zorrilla @.***> wrote:

@RiccardoRossi https://github.com/RiccardoRossi what do we do with this?

— Reply to this email directly, view it on GitHub https://github.com/KratosMultiphysics/Kratos/pull/9380#issuecomment-1033666030, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5PWEMTUC3X4D6CEAVY5OLU2JGSZANCNFSM5IRJRLSQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

RiccardoRossi avatar Feb 09 '22 18:02 RiccardoRossi

i think it is interesting to have it as option, on particular as it can be used together with the structure On Wed, Feb 9, 2022, 12:36 Rubén Zorrilla @.> wrote: @RiccardoRossi https://github.com/RiccardoRossi what do we do with this? — Reply to this email directly, view it on GitHub <#9380 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5PWEMTUC3X4D6CEAVY5OLU2JGSZANCNFSM5IRJRLSQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.Message ID: @.>

What you mean? To impose slip BCs in structural mechanics problems? If this is your aim, we should move some of the implementations to the core.

Maybe we can merge it as it is and upgrade it in a future PR.

rubenzorrilla avatar Feb 09 '22 18:02 rubenzorrilla

I think I already talked about this with @rubenzorrilla in private, but just as a comment in case it is interesting for someone: We used to have many problems imposing slip conditions in the corners with the current approach. What really worked very well for us finally was to integrate the velocity by parts in the mass equation, so slip boundary conditions are then imposed as natural boundary conditions, then you see corners behaving really well.

ddiezrod avatar Feb 10 '22 08:02 ddiezrod