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

Implementation of Standard k-ε Turbulence Model within ESPH #724

Merged
merged 39 commits into from
Jan 30, 2025

Conversation

Yashmandaokar
Copy link
Contributor

@Yashmandaokar Yashmandaokar commented Jan 16, 2025

This pull request introduces the implementation of the standard k-ε turbulence model with the standard wall function in the ESPH framework. The implementation is verified against a 2D turbulent channel flow case at a Reynolds number of 20,000. Additionally, the PR ensures naming consistency by renaming a test case.

  1. Standard k-ε Turbulence Model Implementation:
    The standard k-ε transport equations are implemented along with a standard wall function for turbulence modeling.

Files: turbulence_model.h, turbulence_model.cpp, and turbulence_model.hpp:

  • Definition and implementation of k-ε transport equations.
  • Implementation of the standard wall function, wall-adjacent cell identification.
  1. HLLC Riemann Solver for Turbulence Variables:
    Extends the Eulerian HLLC Riemann solver to handle the advection terms for turbulence variables (k and ε).

Files: extended_eulerian_riemann_solver.h and extended_eulerian_riemann_solver.cpp:

  • Extends the HLLC Riemann solver to compute interface states for TKE and dissipation variables.
  1. Turbulence Forces for RANS Momentum Equation:
    Implements the turbulence forces necessary for the RANS momentum equation:
  • TKE Gradient Force.
  • Turbulent Viscous Force.

Files: rans_turbulence_dynamics.h and rans_turbulence_dynamics.hpp:

  • Implements turbulence force calculations for incompressible/weakly compressible flows.
  1. Test Case: test_2d_FVM_turbulent_channelflow:
    The test_2d_FVM_turbulent_channelflow test case is developed to verify the turbulence model implementation:

Verification Details:

  • Reynolds number: 20,000.
  • Verification against Fluent results.
  1. Updates to the test_3d_incompressible_channel_flow case:
  • Naming Consistency: The test case test_3d_incompressible_channel_flow is renamed to test_3d_FVM_incompressible_channel_flow to align with the naming conventions for FVM test cases.
  • Rearrangement: To avoid double registration of the variables, some part of the code is rearranged
  • Initialization: Mass and momentum variables initializaton is added, which results in reduction in simulation time.

copilot generated summary:

This pull request includes several changes to improve the fluid dynamics simulations and refactor the test files for better organization and functionality. The changes focus on adding turbulence models, refactoring test files, and minor code cleanups.

Improvements to fluid dynamics simulations:

Refactoring and renaming test files:

Minor code cleanups:

@Yashmandaokar
Copy link
Contributor Author

@FengWang3119 Could you please review this pull request when you have a chance? Thank you!

@Yashmandaokar
Copy link
Contributor Author

Hello @FengWang3119 and @yyc84

I’m facing issues with the CI tests:
test_2d_FVM_turbulent_channelflow: All tests fail due to a timeout error. The channel is long, requiring a longer duration to complete. I know I am not allowed to modify the ci.yml file. What other options do I have to pass the test?

test_2d_mixed_poiseuille_flow: Fails only on Windows. It works fine on other platforms. Any idea why?

Your guidance would be greatly appreciated!

@FengWang3119
Copy link
Collaborator

Hello @FengWang3119 and @yyc84

I’m facing issues with the CI tests: test_2d_FVM_turbulent_channelflow: All tests fail due to a timeout error. The channel is long, requiring a longer duration to complete. I know I am not allowed to modify the ci.yml file. What other options do I have to pass the test?

test_2d_mixed_poiseuille_flow: Fails only on Windows. It works fine on other platforms. Any idea why?

Your guidance would be greatly appreciated!

Is is possible to shorten the channel length?

@Yashmandaokar
Copy link
Contributor Author

Hello @FengWang3119 and @yyc84
I’m facing issues with the CI tests: test_2d_FVM_turbulent_channelflow: All tests fail due to a timeout error. The channel is long, requiring a longer duration to complete. I know I am not allowed to modify the ci.yml file. What other options do I have to pass the test?
test_2d_mixed_poiseuille_flow: Fails only on Windows. It works fine on other platforms. Any idea why?
Your guidance would be greatly appreciated!

Is is possible to shorten the channel length?

YES, it is possible but will require lot of rework. I will first try reducing the simulation time and increasing the CFL number from 0.6 to 1.0. Thanks for your input.
Do you have any clue why the second case: test_2d_mixed_poiseuille_flow is falling only on windows?

@Yashmandaokar
Copy link
Contributor Author

Dear Professor @Xiangyu-Hu

The test case test_2d_FVM_turbulent_channelflow is failing because of timeout. The channel is long in order to achieve fully developed turbulence (also becasue: periodic boundary conditions are unavailable in the FVM framework), hence the simulation time is also long.

Could you please advice me, how to solve the timeout issue?

@Xiangyu-Hu
Copy link
Owner

@Yashmandaokar It seems that there is some incompatibility to the macOS system. You can try to compile the code using clang compiler in Linux to have a check first. If it also gives the same problem, you can debug the code and find the bug.

@Xiangyu-Hu
Copy link
Owner

Xiangyu-Hu commented Jan 22, 2025

@Yashmandaokar I also have no clue on what makes the fsi2 fail, but it is not a issue of your pull request. It is a long time mystery (it happens occasionally) which we need to wait a long time so that the reason shows up.

@Xiangyu-Hu
Copy link
Owner

Hello @FengWang3119 and @yyc84

I’m facing issues with the CI tests: test_2d_FVM_turbulent_channelflow: All tests fail due to a timeout error. The channel is long, requiring a longer duration to complete. I know I am not allowed to modify the ci.yml file. What other options do I have to pass the test?

test_2d_mixed_poiseuille_flow: Fails only on Windows. It works fine on other platforms. Any idea why?

Your guidance would be greatly appreciated!

I am not expecting that a 2d test case requires more than 1000s. How many cells have you used in this case?

@Yashmandaokar
Copy link
Contributor Author

Yashmandaokar commented Jan 22, 2025

Hello @FengWang3119 and @yyc84
I’m facing issues with the CI tests: test_2d_FVM_turbulent_channelflow: All tests fail due to a timeout error. The channel is long, requiring a longer duration to complete. I know I am not allowed to modify the ci.yml file. What other options do I have to pass the test?
test_2d_mixed_poiseuille_flow: Fails only on Windows. It works fine on other platforms. Any idea why?
Your guidance would be greatly appreciated!

I am not expecting that a 2d test case requires more than 1000s. How many cells have you used in this case?

The case has 55322 cells. It is a long channel length 120 m heigth 2 m. The channel is long in order to achieve fully developed turbulence (also becasue: periodic boundary conditions are unavailable in the FVM framework). Also the simulation time is 140 sec in order to reach steady state. Should I make the mesh coarse?

@Xiangyu-Hu
Copy link
Owner

Hello @FengWang3119 and @yyc84
I’m facing issues with the CI tests: test_2d_FVM_turbulent_channelflow: All tests fail due to a timeout error. The channel is long, requiring a longer duration to complete. I know I am not allowed to modify the ci.yml file. What other options do I have to pass the test?
test_2d_mixed_poiseuille_flow: Fails only on Windows. It works fine on other platforms. Any idea why?
Your guidance would be greatly appreciated!

I am not expecting that a 2d test case requires more than 1000s. How many cells have you used in this case?

The case has 55322 cells. It is a long channel length 120 m heigth 2 m. The channel is long in order to achieve fully developed turbulence (also becasue: periodic boundary conditions are unavailable in the FVM framework). Also the simulation time is 140 sec in order to reach steady state. Should I make the mesh coarse?

@Yashmandaokar It is also not meaning full to use 60 time of the height as the length.
@FengWang3119 Hi, Feng, do we really need such long channel?

@FengWang3119
Copy link
Collaborator

Hello @FengWang3119 and @yyc84
I’m facing issues with the CI tests: test_2d_FVM_turbulent_channelflow: All tests fail due to a timeout error. The channel is long, requiring a longer duration to complete. I know I am not allowed to modify the ci.yml file. What other options do I have to pass the test?
test_2d_mixed_poiseuille_flow: Fails only on Windows. It works fine on other platforms. Any idea why?
Your guidance would be greatly appreciated!

I am not expecting that a 2d test case requires more than 1000s. How many cells have you used in this case?

The case has 55322 cells. It is a long channel length 120 m heigth 2 m. The channel is long in order to achieve fully developed turbulence (also becasue: periodic boundary conditions are unavailable in the FVM framework). Also the simulation time is 140 sec in order to reach steady state. Should I make the mesh coarse?

@Yashmandaokar It is also not meaning full to use 60 time of the height as the length. @FengWang3119 Hi, Feng, do we really need such long channel?

For the freestream inlet conditions, the length seems tobe neccessary for the turbulent kinetic energy to achieve fully-developed acoording to the FVM result.
But if impose the inlet data from the fully-developed result, 15 time is OK.
I remembered I told Yash before, but it seems there is difficulty for the implementation.

@Yashmandaokar
Copy link
Contributor Author

At the early stage, my focus was on reducing complexity, as the code was already encountering several other issues. I did not anticipate that a 15-minute simulation would pose a problem—apologies for that oversight. However, I can now look into shortening the channel length (to 15 times of height) and implementing a fully developed velocity profile at the inlet, if that would be an acceptable approach. Should I proceed with this approch @Xiangyu-Hu and @FengWang3119 ?

@FengWang3119
Copy link
Collaborator

At the early stage, my focus was on reducing complexity, as the code was already encountering several other issues. I did not anticipate that a 15-minute simulation would pose a problem—apologies for that oversight. However, I can now look into shortening the channel length (to 15 times of height) and implementing a fully developed velocity profile at the inlet, if that would be an acceptable approach. Should I proceed with this approch @Xiangyu-Hu and @FengWang3119 ?

Sure, it seems to be the only way to resolve this issue.

@Yashmandaokar Yashmandaokar marked this pull request as draft January 23, 2025 09:36
@Yashmandaokar Yashmandaokar marked this pull request as ready for review January 26, 2025 10:10
Apply fully developed turbulence profiles at inlet in order to reduce the channel length.
@Xiangyu-Hu Xiangyu-Hu merged commit 4934037 into Xiangyu-Hu:master Jan 30, 2025
7 checks passed
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