Skip to content

[WIP] Develop for Langtry and Menter transition model.#1592

Merged
sun5k merged 0 commit intosu2code:developfrom
sun5k:develop
Aug 18, 2022
Merged

[WIP] Develop for Langtry and Menter transition model.#1592
sun5k merged 0 commit intosu2code:developfrom
sun5k:develop

Conversation

@sun5k
Copy link
Contributor

@sun5k sun5k commented Apr 5, 2022

Proposed Changes

Give a brief overview of your contribution here in a few sentences.

Hi, all.

This PR is resuming the #1496. I'm not familiar with the git, so the branch is unfortunately disconnected.

Now working on

Langtry and Menter model

Current State

Code is well running. But, the result is not satisfactory. 😂
The LM(Langtry and Menter) model implemented to Su2 is under debugging compared to the results of Fluent's LM model.

Transition onset is located upward then Fluent result. But, the good news is that when the correlations are set fixed value, the transition onset location is similar to the Fluent result.

PR Checklist

Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (try with the '-Wall -Wextra -Wno-unused-parameter -Wno-empty-body' compiler flags, or simply --warnlevel=2 when using meson).
  • My contribution is commented and consistent with SU2 style.
  • I have added a test case that demonstrates my contribution, if necessary.
  • I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp) , if necessary.

@pcarruscag
Copy link
Member

Hi @sun5k the SST version implemented in fluent is not the same as we have, maybe that's where the difference comes from.

@sun5k
Copy link
Contributor Author

sun5k commented Apr 17, 2022

Hello.

Here is sharing the status of debugging the LM model.

T3A flat plate case :
image

NASA 2DZP Mach number 0.2 case :

image

The after transition process, I think the difference in the skin friction coefficient comes from using a different k-w SST model.

NASA 2DZPG Mach number 2.0 case :
image

The subsonic flat plate is in good agreement. But, in the supersonic case result, it seems to need debugging.

@pcarruscag
Copy link
Member

Hi @sun5k, that looks promising 👍
It would be nice if you could attend the developer meetings and tell us about your plans regarding the integration of this feature.
Every Wednesday at 3pm UK, 4pm CET, https://meet.jit.si/SU2_DevMeeting
There are folks working on implementing SST-2003m, this could be a better comparison with fluent.

@pcarruscag
Copy link
Member

Now that you have running examples it would be extremely important to add them as regressions tests, so that you can ensure that changes coming from develop do not break the code.
Please turn on the GitHub notifications because it seems you have missed quite a few of the comments on your pull requests...

@sun5k
Copy link
Contributor Author

sun5k commented Apr 17, 2022

Hi @pcarruscag

Thank you for the invitation to the meeting. Unfortunately, this week I have a domestic conference. I think I'll have to promise next(not a next week).

@rois1995
Copy link
Contributor

Hi @sun5k ,

I am also working on the implementation of this transition model within SU2.

In order to verify the code, I am running simulations on the E387 profile (taken from DOI:10.1177/0954406217743537) and on the Flat Plate test cases (taken from DOI: 10.2514/1.42362).

While for the E387 profile the results are similar (although not really convincing yet), for the flat plate (NASA 2DZP) the transition occurs right at the leading edge. Could you please share the config files that you have used?

I also noted a couple of inaccuracies within your implementation (by inspection of the "Files changed" section), maybe we can have a talk to discuss about it.

Thank you in advance.
Best regards,
Andrea

@@ -0,0 +1,90 @@
/*!
* \file turb_convection.hpp
Copy link
Contributor

Choose a reason for hiding this comment

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

These headers can be updated.


if(TURB_TRANS_MODEL::LM == config->GetKind_Trans_Model()) {
auto* transNodes = su2staticcast_p<CFlowVariable*>(solver_container[TRANS_SOL]->GetNodes());
numerics-> SetIntermittencyEff(transNodes->GetIntermittencyEff(iPoint), 0.0);
Copy link

@RichRoos RichRoos Apr 26, 2022

Choose a reason for hiding this comment

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

I got an mallo'c error here. Fixed by directly using "solver_container[TRANS_SOL]->GetNodes->GetIntermittencyEff(iPoint)". This also happens in trans_sources.hpp. Is this a helpful comment or probably a problem on my end?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, @RichRoos
Thank you for your careful code review. 👍

"numerics-> SetIntermittencyEff(transNodes->GetIntermittencyEff(iPoint), 0.0)" and trans_sources.hpp don't make a any problem in my code debugging environment. So, I can't guess what happened with your code reviewing.

I try to change the code which you recommended, like "numerics-> SetIntermittencyEff(solver_container[TRANS_SOL]->GetNodes->GetIntermittencyEff(Point), 0.0);"

ReThetaT_Inf = (1173.51-589.428*Intensity+0.2196/(Intensity*Intensity)) * f_lambda;
}
else {
ReThetaT_Inf = (1173.51-589.428*Intensity+0.2196/(0.27*0.27))*f_lambda;

Choose a reason for hiding this comment

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

For consistency: does this have to be 0.027*0.027 as this forces the minimum value of the Intensity of 0.027?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, there shouldn't be any f_lambda multiplication for the freestream conditions.

Choose a reason for hiding this comment

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

It is indeed not necessary, but the lambda is set to zero, which makes the f_lambda zero. So the result is the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The answer for the first comment @RichRoos

Yes, you are right. The LM model must retain local turbulence intensity over 0.027% for numerical robustness.
See the below figure (https://turbmodels.larc.nasa.gov/langtrymenter_4eqn.html)
image

The answer to the second and third comments @RichRoos and @rois1995

Thank you for the good point out. The variable lambda and f_lambda don't have any role in that part. So, I eliminate the unused variables.


break;
case MAIN_SOLVER::INC_RANS:
solver[FLOW_SOL] = CreateSubSolver(SUB_SOLVER_TYPE::INC_NAVIER_STOKES, solver, geometry, config, iMGLevel);

Choose a reason for hiding this comment

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

Adding "solver[TRANS_SOL] = CreateSubSolver(SUB_SOLVER_TYPE::TRANSITION, solver, geometry, config, iMGLevel);" here for incompressible simulations.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know this but have not applicated the LM yet for an incompressible solver. I want to finish the LM model for the compressible solver first and start later for the incompressible solver.

Choose a reason for hiding this comment

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

Check, sounds like a good plan. I am running incompressible cases and I think you only need to add this line here to make them work, as the output etc already works (CIncomOutput is a child of CCompOutput to put it bluntly), so you could already fix it. But your method is of course completely fine, so I will leave it up to you :).

Copy link

@RichRoos RichRoos left a comment

Choose a reason for hiding this comment

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

First review comment :). These are a few points I noticed while looking through the code. Let me know whether this is the correct method or not and whether these are helpful.

@rois1995
Copy link
Contributor

Hi @sun5k,

I think that the restart of the solution is missing. Since for CTransLMSolver you have inherited the functions from CTurbSolver class, the restart is only applied to the turbulent solver. I solved this problem by creating another class called CTransSolver which is a copy of the CTurbSolver class but with a modified LoadRestart function. I guess that the function in the CTurbSolver class can be modified to take into account the transition solver. It depends if we want to divide the transition from the turbulence solver or not.

@sun5k
Copy link
Contributor Author

sun5k commented Apr 27, 2022

Hi @rois1995.

The LM model code under the development clearly has some problems. I've not finished yet all validation cases for commonly used. So, I can't help with the E387 profile problem. but, I think I can give some helpful comments.

Check the numerical scheme which you used. like Roe and L2Roe, AUSM and SLAU. In my case, I didn't think to use the low dissipation scheme because I thought the code was wrong.

I upload the configure file for the T3A flat plate case, which I used.

@sun5k
Copy link
Contributor Author

sun5k commented Jul 26, 2022

Hi guys~

Here is sharing the status of the LM model.

V&V cases: T3A, T3A-, NLF

Flow conditions are the reference from: https://doi.org/10.2514/6.2022-3679.

The grids of T3A and NLF cases are provided by TMW(Transition Model Workshop). And I made the grid of T3A- myself.

To validate the LM model, the simulation results of SU2 are compared with the results of Fluent19.0 with a similar numerical setting.

Here is the numerical scheme :

  Fluent SU2
Flux Roe-FDS L2ROE
Gradient Least Squares Cell Based WEIGHTED_LEAST_SQUARES
Spatial Discretization Flow Third-order MUSCL MUSCL_FLOW
Spatial Discretization Turbulence First-order Upwind MUSCL_NO
The CFL number is set constant value.

Some high-resolution grid-level results are missed because I don't have enough computational resources.
Here is Result

T3A :

image
image
image
image

T3A-:
The gird test result is not converged, but It's enough to compare the model.

image
image
image
image

NLF :
AoA 0 case is shown. In this case, the flow separation occurred on the upper surface. So, not fully converged, and I show only Fine level grid results according to the number of iterations.
image
Zoom to the separation region :
image

Now I'm testing on effect of the numerical schemes and other options like CONV_NUM_METHOD_FLOW, MUSCL_TURB, CFL, and CFL_ADAPT.

@pcarruscag
Copy link
Member

Results look good 👍
You should present this work at the SU2 conference https://su2code.github.io/ please submit a short abstract if you want to present.

@rois1995
Copy link
Contributor

Hi @sun5k, could you please add also the configuration files to reproduce these results? I would try to run these simulations too with my implementation of the transition model.

Thank you in advance!

@sun5k
Copy link
Contributor Author

sun5k commented Jul 28, 2022

Results look good 👍 You should present this work at the SU2 conference https://su2code.github.io/ please submit a short abstract if you want to present.
@pcarruscag Thank you for the suggestion.
I want to really participate in the SU2 conference, but I can't afford to make a presentation at the SU2 conference because I'm busy with my wedding and preparing for domestic conferences. Guess I'll have to look forward to participating in next year's SU2 conference.

@sun5k
Copy link
Contributor Author

sun5k commented Jul 28, 2022

Hi @sun5k, could you please add also the configuration files to reproduce these results? I would try to run these simulations too with my implementation of the transition model.

Thank you in advance!

Hi @rois1995 Of course!
However, I'm still under testing, so I can't guarantee the result if the numerical scheme or the other options are changed.
Which configuration file would you want?

By any chance, are you implementing or developing a transition model?
Can you tell me what model you are willing to use if it's a model implementation? My next goal is to implement the AFT model or the k-w-gamma model, but I'm trying to implement a k-w-gamma model because it seems like the AFT model is being implemented by the other developer.

@rois1995
Copy link
Contributor

Hi @sun5k, could you please add also the configuration files to reproduce these results? I would try to run these simulations too with my implementation of the transition model.
Thank you in advance!

Hi @rois1995 Of course! However, I'm still under testing, so I can't guarantee the result if the numerical scheme or the other options are changed. Which configuration file would you want?

By any chance, are you implementing or developing a transition model? Can you tell me what model you are willing to use if it's a model implementation? My next goal is to implement the AFT model or the k-w-gamma model, but I'm trying to implement a k-w-gamma model because it seems like the AFT model is being implemented by the other developer.

If you could send me the config files for the T3A, T3A- and NLF test cases it would be awesome!

I have implemented the same model as yours, the LM model, in parallel to you 'cause I needed it for some simulations. I also tried implementing the same version but related to the SA turbulence model, however it still is bothering me that I cannot seem to get good results on it.

If you want, I also tried the prolate spheroid test-case with good results. If you need I can give the configs and the meshes. The only thing about this test-case is that it is more related to the cross-flow transition, thus it needs to be implemented, which I think I'll do in these days.

I think that the k-w-gamma model is the way to go right after the implementation of the LM model since it has lots of equations in common. Do you think that you need another class for it or you will write on the same classes that you have already built (like the CTransLMSolver)?

@sun5k
Copy link
Contributor Author

sun5k commented Aug 2, 2022

Hi @sun5k, could you please add also the configuration files to reproduce these results? I would try to run these simulations too with my implementation of the transition model.
Thank you in advance!

Hi @rois1995 Of course! However, I'm still under testing, so I can't guarantee the result if the numerical scheme or the other options are changed. Which configuration file would you want?
By any chance, are you implementing or developing a transition model? Can you tell me what model you are willing to use if it's a model implementation? My next goal is to implement the AFT model or the k-w-gamma model, but I'm trying to implement a k-w-gamma model because it seems like the AFT model is being implemented by the other developer.

If you could send me the config files for the T3A, T3A- and NLF test cases it would be awesome!

I have implemented the same model as yours, the LM model, in parallel to you 'cause I needed it for some simulations. I also tried implementing the same version but related to the SA turbulence model, however it still is bothering me that I cannot seem to get good results on it.

If you want, I also tried the prolate spheroid test-case with good results. If you need I can give the configs and the meshes. The only thing about this test-case is that it is more related to the cross-flow transition, thus it needs to be implemented, which I think I'll do in these days.

I think that the k-w-gamma model is the way to go right after the implementation of the LM model since it has lots of equations in common. Do you think that you need another class for it or you will write on the same classes that you have already built (like the CTransLMSolver)?

The test case(T3A, T3A-, and NLF-0416) configuration files were uploaded to my git repository. Here is the link.

Suggestions for the prolate spheroid test-case is appreciated. However, my transition model is the LM-2009, and I have no plans for the 2015-LM model. Therefore, the cross-flow transition is left for future developers.

I think the CTransGammaSolver, CTransGSolver, or the other name of classes will be added for the k-w-gamma transition model. It's a vague idea, I haven't really thought about detail yet.

su2double F_onset1, F_onset2, F_onset3, F_onset;
su2double f_turb, Re_v, f_sub, r_omega;
su2double Pg, Dg, Pthetat;
su2double diverg;
Copy link
Contributor

Choose a reason for hiding this comment

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

Introduce these where they are used please.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is NASA turbulence modeling resources of LM model (TMR) SST-2003-LM2009

All variables are almost the same in Langtry's paper and dissertation.

F_onset1, F_onset2, Fonset3, and F_onset of line 105 is the transition onset function that triggers the transition.

f_turb is used to disable the destruction/relaminarization source outside of a laminar boundary layer or in the viscous sublayer and is defined as follows :
image

Re_v is vorticity Reynolds number :
image

f_sub is forcing F_length to always be equal to its maximum value (in this case 40.0) in the viscous sublayer :
image

r_omega is Reynolds number base on omega :
image

Pg, Dg, and Pthetat are production and destruction terms of each transport equation.

diverg is divergence of velocity.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I mean instead of mass declaring the variables at the top of a function, declare the variables when they are used ->

i.e. "su2double F_onset = ......"

Laminar_Viscosity_i = V_i[idx.LaminarViscosity()];
Eddy_Viscosity_i = V_i[idx.EddyViscosity()];

Tu = 100.0*sqrt( 2.0 * ScalarVar_i[0] / 3.0 ) / Velocity_Mag;
Copy link
Contributor

Choose a reason for hiding this comment

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

For example

Suggested change
Tu = 100.0*sqrt( 2.0 * ScalarVar_i[0] / 3.0 ) / Velocity_Mag;
su2double Tu = 100.0*sqrt( 2.0 * ScalarVar_i[0] / 3.0 ) / Velocity_Mag;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, now I understand what you mean. There is nothing special reason. It just habitually declared all the variables above. So I'll fix all the variables declared that same way.

@sun5k sun5k merged commit 745e5d9 into su2code:develop Aug 18, 2022
@sun5k sun5k deleted the develop branch August 18, 2022 08:20
@sun5k
Copy link
Contributor Author

sun5k commented Sep 5, 2022

"[WIP] Develop for Langtry and Menter transition model. #1592" was merged while trying to update my remote repository to v7.40. I'm not good at using GitHub, so I'm sorry for this situation.

My remote repository(forked) is not synchronized with v7.40, and I don't know what the problem is. So, I will delete the forked repository and fork it again to PR with the same name and content. Fortunately, the LM model updated to v7.40 obtained the same residuals and results as the previous v7.3.1.

@sun5k sun5k mentioned this pull request Sep 5, 2022
5 tasks
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.

6 participants