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

Isothermal compressible NS assembler #815

Merged
merged 23 commits into from
Jul 27, 2023

Conversation

AmishgaAlphonius
Copy link
Collaborator

@AmishgaAlphonius AmishgaAlphonius commented Jul 18, 2023

Description of the problem

  • When experimenting with the dam break with an obstacle example, it was noticed that the software performed poorly in mimicking the wave's natural shape after the impact. It was assumed that this is due to the lack of considering the air's natural compressibility.

Description of the solution

  • In an attempt to solve this issue, an isothermal compressible fluid dynamics Volume of Fluid (VOF) model will be implemented. In a previous PR, an isothermal ideal gas density model was implemented. As a second step, an isothermal compressible formulation of the Navier-Stokes (NS) equations is implemented. Only the continuity equation was adapted to take account of compressibility.

How Has This Been Tested?

  • Two tests were added:

  • applications_tests/gls_navier_stokes_2d/mms2d_isothermal_compressible_ns_gls.prm

  • applications_tests/gls_navier_stokes_3d/mms3d_isothermal_compressible_ns_gls.prm

  • The restart_01 unit test was updated so that the fluid's density model is set to constant so that it uses the incompressible NS assemblers:

  • /tests/solvers/restart_01.cc

Documentation

  • Documentation was updated

  • doc/source/parameters/cfd/physical_properties.rst

Future changes

  • Currently, in two phase flow simulations, the isothermal ideal gas density model can only be used in conjunction with the incompressible NS equations. However, it is meant to be used with the isothermal formulation of compressible NS equations to account for weakly compressible flows. In a future update, this change will be implemented.
  • At the moment, in the momentum equation, the\nabla \cdot (\nabla \mathbf{u})^T term is neglected, however this might be an inappropriate simplification, since in the compressible form, \nabla \mathbf{u} is not necessarily equal to 0. This will be investigated in a future PR and changes will be implemented if it is evaluated necessary.

Comments

  • Small corrections where made to the fluid dynamics theory:

  • doc/source/theory/fluid_dynamics/fem_formulation.rst

  • doc/source/theory/fluid_dynamics/navier-stokes.rst

  • doc/source/theory/fluid_dynamics/stabilization.rst

@AmishgaAlphonius AmishgaAlphonius requested review from blaisb and hepap July 18, 2023 20:07
@AmishgaAlphonius AmishgaAlphonius force-pushed the isothermal_compressible_NS_assembler branch from c941844 to 0ec7197 Compare July 18, 2023 20:11
@AmishgaAlphonius AmishgaAlphonius changed the title Isothermal compressible ns assembler Isothermal compressible NS assembler Jul 18, 2023
@AmishgaAlphonius AmishgaAlphonius force-pushed the isothermal_compressible_NS_assembler branch 2 times, most recently from 712e481 to cad9018 Compare July 19, 2023 11:26
@AmishgaAlphonius AmishgaAlphonius added WIP When a PR is open but not ready for review Ready for review and removed Ready for review WIP When a PR is open but not ready for review labels Jul 19, 2023
Copy link
Collaborator

@hepap hepap left a comment

Choose a reason for hiding this comment

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

I will finish tomorrow, I still have to check the isothermal_compressible_navier_stokes_assembler.cc

doc/source/theory/fluid_dynamics/stabilization.rst Outdated Show resolved Hide resolved
\\
& + \sum_{k} \int_{\Omega_k} \left( \partial_t u_k + u_l \partial_l u_k + \partial_k p - \nu \partial_l \partial_l u_k - f_k \right) \cdot \left(\tau_{GLS} \nu \partial_l \partial_l v_k \right) \mathrm{d}\Omega_k
& - \sum_{k} \int_{\Omega_k} \left( \partial_t u_k + u_l \partial_l u_k + \partial_k p - \nu \partial_l \partial_l u_k - f_k \right) \cdot \left(\tau_{GLS} \nu \partial_l \partial_l v_k \right) \mathrm{d}\Omega_k
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am not sure of the sign, but in Laura's proposal, it is +, and in lethe it seems to be -

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I based the modification on what was implemented in Lethe; I did ask @blaisb if it was supposed to be a minus, but I'll let him comment on it again here just to make sure that everything is good :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

As far as I know this should be a plus. I guess since it is implemented with a minus we should change the sign in the documentation for now. Let's discuss this afterwards with @blaisb.

include/solvers/navier_stokes_scratch_data.h Outdated Show resolved Hide resolved
@PierreLaurentinCS PierreLaurentinCS self-requested a review July 19, 2023 22:34
@AmishgaAlphonius AmishgaAlphonius force-pushed the isothermal_compressible_NS_assembler branch from 07c55ef to b5f92b6 Compare July 20, 2023 11:11
@AmishgaAlphonius AmishgaAlphonius changed the title Isothermal compressible NS assembler Isothermal compressible NS assembler [WIP] Jul 20, 2023
@AmishgaAlphonius AmishgaAlphonius changed the title Isothermal compressible NS assembler [WIP] Isothermal compressible NS assembler Jul 20, 2023
@AmishgaAlphonius AmishgaAlphonius added Ready for review and removed WIP When a PR is open but not ready for review labels Jul 20, 2023
Copy link
Collaborator

@hepap hepap left a comment

Choose a reason for hiding this comment

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

I checked everything now! I don't have more comment at the moment, but I will redo the weak formualtion (just to be sure I understand well hehe :D)

@AmishgaAlphonius AmishgaAlphonius force-pushed the isothermal_compressible_NS_assembler branch from 7534662 to 9604b31 Compare July 21, 2023 17:09
@AmishgaAlphonius AmishgaAlphonius force-pushed the isothermal_compressible_NS_assembler branch from 69c7197 to adfa444 Compare July 24, 2023 12:54
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.

Excellent work, I have got nothing to say except for some typos

@AmishgaAlphonius AmishgaAlphonius force-pushed the isothermal_compressible_NS_assembler branch from 2a5152c to a8c660f Compare July 24, 2023 15:22
@AmishgaAlphonius AmishgaAlphonius force-pushed the isothermal_compressible_NS_assembler branch from a8c660f to 209fd95 Compare July 24, 2023 21:07
Copy link
Collaborator

@lpsaavedra lpsaavedra 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! Looking forward to the next PR related to this solver.



In Lethe, instead of solving for pressure directly, we solve for a reduced pressure :math:`p^*=\frac{p}{\rho}`. This has two advantages, first the scaling of the pressure is more adequate with respect to that of the velocity and, secondly, for single phase simulations, this means that we require a single physical property: the kinematic viscosity. Consequently, unless specified otherwise, you should assume that pressure actually refers to the reduced pressure :math:`p^*`. Although it may seem confusing at first, this is standard in incompressible fluid dynamics.
In Lethe, instead of solving for pressure directly, we solve for a reduced pressure :math:`p=\frac{p^*}{\rho}`. This has two advantages, first the scaling of the pressure is more adequate with respect to that of the velocity and, secondly, for single phase simulations, this means that we require a single physical property: the kinematic viscosity. Consequently, unless specified otherwise, you should assume that pressure actually refers to the reduced pressure :math:`p`. Although it may seem confusing at first, this is standard in incompressible fluid dynamics.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am not sure about this change of notation here, since in literature the reduced pressure is always noted as p*.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is in fact confusing, I'll add a note to specify that this choice was made to lighten the writing in the documentation :)

doc/source/theory/fluid_dynamics/stabilization.rst Outdated Show resolved Hide resolved
\\
& + \sum_{k} \int_{\Omega_k} \left( \partial_t u_k + u_l \partial_l u_k + \partial_k p - \nu \partial_l \partial_l u_k - f_k \right) \cdot \left(\tau_{GLS} \nu \partial_l \partial_l v_k \right) \mathrm{d}\Omega_k
& - \sum_{k} \int_{\Omega_k} \left( \partial_t u_k + u_l \partial_l u_k + \partial_k p - \nu \partial_l \partial_l u_k - f_k \right) \cdot \left(\tau_{GLS} \nu \partial_l \partial_l v_k \right) \mathrm{d}\Omega_k
Copy link
Collaborator

Choose a reason for hiding this comment

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

As far as I know this should be a plus. I guess since it is implemented with a minus we should change the sign in the documentation for now. Let's discuss this afterwards with @blaisb.

@AmishgaAlphonius AmishgaAlphonius force-pushed the isothermal_compressible_NS_assembler branch from 8053009 to 1afb412 Compare July 25, 2023 20:49
@AmishgaAlphonius AmishgaAlphonius force-pushed the isothermal_compressible_NS_assembler branch from 4dcd573 to 1aaeec5 Compare July 26, 2023 16:11
@AmishgaAlphonius AmishgaAlphonius force-pushed the isothermal_compressible_NS_assembler branch from 1aaeec5 to db2cd26 Compare July 26, 2023 16:16
@lpsaavedra lpsaavedra merged commit 73a4237 into master Jul 27, 2023
@AmishgaAlphonius AmishgaAlphonius deleted the isothermal_compressible_NS_assembler branch July 27, 2023 15:30
@AmishgaAlphonius AmishgaAlphonius self-assigned this Aug 1, 2023
M-Badri pushed a commit to M-Badri/lethe that referenced this pull request Sep 29, 2024
Description of the problem

    When experimenting with the dam break with an obstacle example, it was noticed that the software performed poorly in mimicking the wave's natural shape after the impact. It was assumed that this is due to the lack of considering the air's natural compressibility.

Description of the solution

    In an attempt to solve this issue, an isothermal compressible fluid dynamics Volume of Fluid (VOF) model will be implemented. In a previous PR, an isothermal ideal gas density model was implemented. As a second step, an isothermal compressible formulation of the Navier-Stokes (NS) equations is implemented. Only the continuity equation was adapted to take account of compressibility.

How Has This Been Tested?

    Two tests were added:
applications_tests/gls_navier_stokes_2d/mms2d_isothermal_compressible_ns_gls.prm
applications_tests/gls_navier_stokes_3d/mms3d_isothermal_compressible_ns_gls.prm
The restart_01 unit test was updated so that the fluid's density model is set to constant so that it uses the incompressible NS assemblers:
    /tests/solvers/restart_01.cc

Documentation
Documentation was updated:
doc/source/parameters/cfd/physical_properties.rst

Future changes
 Currently, in two phase flow simulations, the isothermal ideal gas density model can only be used in conjunction with the incompressible NS equations. However, it is meant to be used with the isothermal formulation of compressible NS equations to account for weakly compressible flows. In a future update, this change will be implemented.
    At the moment, in the momentum equation, the\nabla \cdot (\nabla \mathbf{u})^T term is neglected, however this might be an inappropriate simplification, since in the compressible form, \nabla \mathbf{u} is not necessarily equal to 0. This will be investigated in a future PR and changes will be implemented if it is evaluated necessary.

Comments
Small corrections where made to the fluid dynamics theory:
doc/source/theory/fluid_dynamics/fem_formulation.rst
doc/source/theory/fluid_dynamics/navier-stokes.rst
doc/source/theory/fluid_dynamics/stabilization.rst

---------

Co-authored-by: hepap <[email protected]>
Co-authored-by: PierreLaurentinCS <[email protected]>
Former-commit-id: 73a4237
blaisb pushed a commit that referenced this pull request Sep 30, 2024
Description of the problem

    When experimenting with the dam break with an obstacle example, it was noticed that the software performed poorly in mimicking the wave's natural shape after the impact. It was assumed that this is due to the lack of considering the air's natural compressibility.

Description of the solution

    In an attempt to solve this issue, an isothermal compressible fluid dynamics Volume of Fluid (VOF) model will be implemented. In a previous PR, an isothermal ideal gas density model was implemented. As a second step, an isothermal compressible formulation of the Navier-Stokes (NS) equations is implemented. Only the continuity equation was adapted to take account of compressibility.

How Has This Been Tested?

    Two tests were added:
applications_tests/gls_navier_stokes_2d/mms2d_isothermal_compressible_ns_gls.prm
applications_tests/gls_navier_stokes_3d/mms3d_isothermal_compressible_ns_gls.prm
The restart_01 unit test was updated so that the fluid's density model is set to constant so that it uses the incompressible NS assemblers:
    /tests/solvers/restart_01.cc

Documentation
Documentation was updated:
doc/source/parameters/cfd/physical_properties.rst

Future changes
 Currently, in two phase flow simulations, the isothermal ideal gas density model can only be used in conjunction with the incompressible NS equations. However, it is meant to be used with the isothermal formulation of compressible NS equations to account for weakly compressible flows. In a future update, this change will be implemented.
    At the moment, in the momentum equation, the\nabla \cdot (\nabla \mathbf{u})^T term is neglected, however this might be an inappropriate simplification, since in the compressible form, \nabla \mathbf{u} is not necessarily equal to 0. This will be investigated in a future PR and changes will be implemented if it is evaluated necessary.

Comments
Small corrections where made to the fluid dynamics theory:
doc/source/theory/fluid_dynamics/fem_formulation.rst
doc/source/theory/fluid_dynamics/navier-stokes.rst
doc/source/theory/fluid_dynamics/stabilization.rst

---------

Co-authored-by: hepap <[email protected]>
Co-authored-by: PierreLaurentinCS <[email protected]>
Former-commit-id: 73a4237
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants