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

[FluidDynamicsApplication] Two-fluid Navier-Stokes formulation with fractional splitting approach #12960

Merged
merged 15 commits into from
Jan 7, 2025

Conversation

uxuech
Copy link
Contributor

@uxuech uxuech commented Dec 19, 2024

📝 Description

This PR implements a Two-fluid Navier-Stokes formulation using the fractional splitting approach.
The momentum conservation equation has been split into two parts.
The first part solves a pure convection problem for a vector field, in this case, the fractional velocity, where the convection velocity is the vector field itself.
The second part solves the remaining terms of the momentum conservation equation, adding those terms with opposite signs to the ones included in the first part of the problem. This ensures that, in the continuum, the combination of both problems results in the original momentum conservation equation.

Additionally, the approach to mass conservation has been slightly modified. The original two-fluid Navier-Stokes elements include a mass source term that is added to cut elements. Now, the mass source term added to the cut elements differs depending on whether the cut part of the element is water or air.

🆕 Changelog

This translates into the implementation of two new symbolic elements with their corresponding templates and data containers, as well as the unit tests for the elements.

  • vectorial convection fractional element.
  • two fluid navier stokes fractional element.

@uxuech uxuech requested a review from a team as a code owner December 19, 2024 10:56
@loumalouomega loumalouomega changed the title Two-fluid Navier-Stokes formulation with fractional splitting approach [FluidDynamicsApplication] Two-fluid Navier-Stokes formulation with fractional splitting approach Dec 19, 2024
@loumalouomega
Copy link
Member

@uxuech take a look at the Linux compilation erros, a priori easy to fix:

In file included from /__w/Kratos/Kratos/applications/FluidDynamicsApplication/fluid_dynamics_application.cpp:28,
                 from /__w/Kratos/Kratos/build/Custom/applications/FluidDynamicsApplication/CMakeFiles/KratosFluidDynamicsCore.dir/Unity/unity_2_cxx.cxx:47:
/__w/Kratos/Kratos/applications/FluidDynamicsApplication/fluid_dynamics_application.h: In constructor 'Kratos::KratosFluidDynamicsApplication::KratosFluidDynamicsApplication()':
/__w/Kratos/Kratos/applications/FluidDynamicsApplication/fluid_dynamics_application.h:465:96: error: 'Kratos::KratosFluidDynamicsApplication::mVectorialConvectionFractionalElement2D3N' will be initialized after [-Werror=reorder]
     const VectorialConvectionFractionalElement<VectorialConvectionFractionalElementData<2, 3>> mVectorialConvectionFractionalElement2D3N;
                                                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/__w/Kratos/Kratos/applications/FluidDynamicsApplication/fluid_dynamics_application.h:464:96: error:   'const Kratos::VectorialConvectionFractionalElement<Kratos::VectorialConvectionFractionalElementData<3, 4> > Kratos::KratosFluidDynamicsApplication::mVectorialConvectionFractionalElement3D4N' [-Werror=reorder]
     const VectorialConvectionFractionalElement<VectorialConvectionFractionalElementData<3, 4>> mVectorialConvectionFractionalElement3D4N;
                                                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /__w/Kratos/Kratos/build/Custom/applications/FluidDynamicsApplication/CMakeFiles/KratosFluidDynamicsCore.dir/Unity/unity_2_cxx.cxx:47:
/__w/Kratos/Kratos/applications/FluidDynamicsApplication/fluid_dynamics_application.cpp:39:1: error:   when initialized here [-Werror=reorder]
 KratosFluidDynamicsApplication::KratosFluidDynamicsApplication():
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /__w/Kratos/Kratos/applications/FluidDynamicsApplication/fluid_dynamics_application.cpp:28,
                 from /__w/Kratos/Kratos/build/Custom/applications/FluidDynamicsApplication/CMakeFiles/KratosFluidDynamicsCore.dir/Unity/unity_2_cxx.cxx:47:
/__w/Kratos/Kratos/applications/FluidDynamicsApplication/fluid_dynamics_application.h:464:96: error: 'Kratos::KratosFluidDynamicsApplication::mVectorialConvectionFractionalElement3D4N' will be initialized after [-Werror=reorder]
     const VectorialConvectionFractionalElement<VectorialConvectionFractionalElementData<3, 4>> mVectorialConvectionFractionalElement3D4N;
                                                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/__w/Kratos/Kratos/applications/FluidDynamicsApplication/fluid_dynamics_application.h:462:84: error:   'const Kratos::TwoFluidNavierStokesFractional<Kratos::TwoFluidNavierStokesFractionalData<2, 3> > Kratos::KratosFluidDynamicsApplication::mTwoFluidNavierStokesFractional2D3N' [-Werror=reorder]
     const TwoFluidNavierStokesFractional<TwoFluidNavierStokesFractionalData<2, 3>> mTwoFluidNavierStokesFractional2D3N;
                                                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /__w/Kratos/Kratos/build/Custom/applications/FluidDynamicsApplication/CMakeFiles/KratosFluidDynamicsCore.dir/Unity/unity_2_cxx.cxx:47:
/__w/Kratos/Kratos/applications/FluidDynamicsApplication/fluid_dynamics_application.cpp:39:1: error:   when initialized here [-Werror=reorder]

Copy link
Member

@rubenzorrilla rubenzorrilla left a comment

Choose a reason for hiding this comment

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

There are minor things to be corrected before merging. Note that most of my suggestions apply to many places. Please take them into account in all of them.

@uxuech
Copy link
Contributor Author

uxuech commented Dec 30, 2024

I have reviewed everything, and I think that all suggestions and corrections have been done. Please let me know if there's anything else to modify. Thank you! @rubenzorrilla

Copy link
Member

@rubenzorrilla rubenzorrilla left a comment

Choose a reason for hiding this comment

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

Ready to go 🚀

@uxuech uxuech merged commit 7e4c67e into master Jan 7, 2025
11 checks passed
@uxuech uxuech deleted the two_fluid_fractional_navier_stokes branch January 7, 2025 15:09
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.

3 participants