Skip to content

[WIP] Implementation of Amplification Factor Transport(AFT) 2019b tranistion model#2422

Open
sun5k wants to merge 13 commits intosu2code:developfrom
sun5k:feature_AFT_2019_Model
Open

[WIP] Implementation of Amplification Factor Transport(AFT) 2019b tranistion model#2422
sun5k wants to merge 13 commits intosu2code:developfrom
sun5k:feature_AFT_2019_Model

Conversation

@sun5k
Copy link
Contributor

@sun5k sun5k commented Jan 15, 2025

Proposed Changes

Hi, all.

This PR is for implementing well known subsonic transition model (SA-AFT2019b).

Coder's SA-AFT2019b model is composed of the amplification factor and the logarithmic intermittency transport equation as shown below.
image

Current State

The primary implementation of the model has been completed and is now in the validation. The validation problems are refer : https://doi.org/10.2514/6.2023-3530 and https://doi.org/10.2514/6.2019-0039.

The transition onset location and the amplification factor field are slightly different. I'm still debugging and checking various things.

Validation Problem of Current State

Firstly, I'm trying the validation problem for 2-D problems (flat plate and NLF-0416 airfoil).
The current results are shown below.

S&K Flat plate from https://doi.org/10.2514/6.2023-3530

image

NLF-0416 airfoil from https://doi.org/10.2514/6.2023-3530
image

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 --warnlevel=3 when using meson).
  • My contribution is commented and consistent with SU2 style (https://su2code.github.io/docs_v7/Style-Guide/).
  • I used the pre-commit hook to prevent dirty commits and used pre-commit run --all to format old commits.
  • 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.

break;

case TURB_TRANS_MODEL::AFT:
//nodes -> SetAFT_Wonder_Func(iPoint, HL, H12, dNdRet, Ret0, D_H12, l_H12, m_H12, kv, Rev, Rev0, F_growth, F_crit, PAF, Pg, Dg);

Check notice

Code scanning / CodeQL

Commented-out code

This comment appears to contain commented-out code.
AFT2017b
Test_Strain
Copy link
Member

@pcarruscag pcarruscag left a comment

Choose a reason for hiding this comment

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

Thanks 👍 Looks good but we can re-use a lot of code from the LM solver and see the question about the aux var gradient which looks suspicious.

Comment on lines +255 to +263
switch (config->GetKind_Gradient_Method()) {
case GREEN_GAUSS:
SetAuxVar_Gradient_GG(geometry, config);
break;
case WEIGHTED_LEAST_SQUARES:
SetAuxVar_Gradient_LS(geometry, config);
default:
break;
}
Copy link
Member

Choose a reason for hiding this comment

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

Why are you computing the AuxVarGradient after you use it above instead of before?

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 wanted to discuss this with someone.

On the SA-AFT2019b model, HL is defined as follows :

image

where, d is the distance from the wall.

The AuxVar[0] is for the d and AuxVarGradient[0] is for the image. So, the d and image are the constant value when the geometry and mesh are not deformed.

And, the Auxvar[1] is for the image and AuxVarGradient[1] is for the image.

The velocity values change with each iteration. So, the Auxvar[1] and it's gradient must be redefined and calculated each iteration. Therefore, I decided to do the gradient calculation in the Postprocessing.

On second thought, the Auxvar assign in "trans_sources.hpp", or would you have any other ideas?

Copy link
Member

Choose a reason for hiding this comment

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

In the paper it is mentioned that grad d is the wall-normal unit vector, don't we have that stored already? I remember seeing it in another PR, maybe it was not merged yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the paper it is mentioned that grad d is the wall-normal unit vector, don't we have that stored already? I remember seeing it in another PR, maybe it was not merged yet.

OK. I'll try to find it. :D

Copy link
Member

Choose a reason for hiding this comment

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

I think it is in the simplified 2015 PR

Copy link
Contributor

@rois1995 rois1995 Mar 4, 2025

Choose a reason for hiding this comment

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

If I understood correctly then yes, it is in the simplified transition model PR #1901. The branch is still under development (currently working on the validation on T3 series flat plates and Eppler airfoil) but that part has already been implemented and verified.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rois1995

Hi, if I understood correctly, the modifications in #1901 were introduced to obtain the unit normal vector at nodes. Is that right?

Commit:
b1edf61

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, it sets at each point in the mesh the wall normal of the associated point on a viscous surface.

Comment on lines +203 to +204
su2double Temp3 = flowNodes->GetVelocity(iPoint, 0) * nodes->GetAuxVarGradient(iPoint, 0, 0);
su2double Temp4 = flowNodes->GetVelocity(iPoint, 1) * nodes->GetAuxVarGradient(iPoint, 0, 1);
Copy link
Member

Choose a reason for hiding this comment

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

Add some documentation please, if the initial aux var grad is 0 then you set the aux var to 0, then its gradient is 0 and this remains 0 forever? Looks like a bug.


/*-- destruction term of Intermeittency(Gamma) --*/
const su2double Dg = c_2 * Density_i * VorticityMag * F_turb * (c_3 * exp(lnIntermittency) - 1.0);
nodes -> SetAFT_Wonder_Func(iPoint, HL, H12, dNdRet, Ret0, D_H12, l_H12, m_H12, kv, Rev, Rev0, F_growth, F_crit, PAF, Pg, Dg);
Copy link
Member

Choose a reason for hiding this comment

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

This is a lot of memory and these variables are only used for post processing (output) right?
If so these can be computed in the output class when setting the output values.
That saves doing this work every iteration and storing all these variables.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your advise.
Current class, this function is for debugging. Later, I'll change to compute in the output class.

@sun5k
Copy link
Contributor Author

sun5k commented Jan 31, 2025

Thanks 👍 Looks good but we can re-use a lot of code from the LM solver and see the question about the aux var gradient which looks suspicious.

Thank you for comment @pcarruscag. I'll try to address each of your comments one by one.

For now, the SA-AFT2017b model is for testing purposes, so I'll delete the relevant parts.

case TURB_MODEL::NONE: SU2_MPI::Error("No turbulence model has been selected but AFT transition model is active.", CURRENT_FUNCTION); break;
case TURB_MODEL::SST: SU2_MPI::Error("k-w SST turbulence model has been selected but AFT transition model is active.", CURRENT_FUNCTION); break;
}
cout << "-2017b" << endl; break;

Check warning

Code scanning / CodeQL

Dead code due to goto or break statement

This statement makes [if (...) ...](1) unreachable.
case TURB_MODEL::NONE: SU2_MPI::Error("No turbulence model has been selected but AFT transition model is active.", CURRENT_FUNCTION); break;
case TURB_MODEL::SST: SU2_MPI::Error("k-w SST turbulence model has been selected but AFT transition model is active.", CURRENT_FUNCTION); break;
}
cout << "-2017b" << endl; break;

Check warning

Code scanning / CodeQL

Dead code due to goto or break statement

This statement makes [if (...) ...](1) unreachable.
@sun5k
Copy link
Contributor Author

sun5k commented May 20, 2025

The original plan was to finish it before the new version (v8.2.0) was released, but I was busy and couldn't manage it. Now that I have some spare time, I'll start working on it again next week!

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.

4 participants