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

Bas-Cakmakcioglu (BC) Transition Model #326

Merged
merged 27 commits into from
Dec 21, 2016
Merged

Bas-Cakmakcioglu (BC) Transition Model #326

merged 27 commits into from
Dec 21, 2016

Conversation

sametcaka
Copy link
Contributor

An algebraic transition model that relies on local information, herein named as BC model, is added. The model uses Spalart-Allmaras model as the baseline model. BC model does not solve for any transport equations as in LM model, but instead, it uses the already transported S-A variable, nu_t. The model achieves its purpose by modifying the production term of the S-A.

IMPORTANT: A research paper is written about our model, and submitted to ASME Journal of Fluids Engineering, and currently it is under review. If you need detailed information regarding to the model, please contact me from [email protected]

Under the TestCases folder, I have added three test cases. Feel free to test the transition model for your own test cases. I also have T106 turbine cascade test case with successful results, and I can share it with you if requested. Please do not hesitate to contact me if you have more test cases (especially 3-D transition cases) that you would like me to solve. I would be more than happy to hear back your comments/suggestions.

Sincerely,
Samet C. Cakmakcioglu

New option for ENUM_TRANS_MODEL (BC = 2) for Bas-Cakmakcioglu Model (Line 640-648)
nu_tilde_Inf and nu_tilde_Engine variables are modified for Bas-Cakmakcioglu transition model.
BC Model added to CSourcePieceWise_TurbSA::ComputeResidual.

IMPORTANT NOTE *********
A research paper is written and currently under review by the ASME Journal of Fluids Engineering.
******************************
The idea behind the creation of BC model:

" Earlier, Menter et al.’s 2-equation “engineering transition model” (gamma-ReThetat model) had set the pace in CFD design and prediction codes mostly used in industrial turbomachinery flows. This successful model was followed by some other two- and three-equation models in the literature that further strengthen Menter et al’s approach. Yet, it was noticed by Menter and by some authors, including our group, that the second equation (Re_Thetat) is rather redundant, and the 2-equation model could be reduced back into a 1-equation model (gamma-model). Thus, Menter et al. produced their 1-equation model (gamma-intermittency) without sacrificing accuracy, but with increased efficiency. 

Having our research group’s strong ties with industrial design applications, further simplification would have appeared quite a possibility to devise an algebraic (or a zero-equation) model that only solves for an intermittency function (gamma). This observation would be supported by the fact that while turbulent production and diffusion mechanisms are already represented by the underlying turbulence model (herein the Spalart-Allmaras model), why one choose to fabricate two more extra transition equations? Since the so-called engineering transition models all use the same experimental correlation between the so-called vorticity Reynolds number and momentum thickness Reynolds number, as long as this correlation is maintained, algebraic model should also succeed. Evidently, this observation and the attendant approach in the paper have led to some remarkably good results especially for airfoils at low Reynolds numbers. As a result, we would like propose our much simplified algebraic engineering transition model approach to industrial CFD design applications community."

Some Test Cases for BC Model including grid files, configuration files are included under the TEST_CASES folder. 

Please contact me if you have any questions/ideas/comments about our model. Also, if you have any test case you have (especially 3-D), I would be more than happy to assist you solving it. Feel free to use this model in your applications, and please cite us in your work. 

Sincerely,
Samet Cakmakcioglu (e-mail: [email protected])
These folders include grid files and configuration files for various BC transition test cases.
Copy link
Member

@talbring talbring left a comment

Choose a reason for hiding this comment

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

Hi Samet,

thank you for this contribution. Below you find some comments on your implementation from my side. Can you maybe give us some results (maybe add a picture here that compares your results with experimental data ) so that we get an impression of your method.

We also need a regression test for that. I think we can simply take one of your test cases for that. If you need any help with this, please let us know.

Thanks !

@@ -534,6 +534,14 @@ void CSourcePieceWise_TurbSA::ComputeResidual(su2double *val_residual, su2double
// AD::SetPreaccIn(TurbVar_i[0]);
// AD::SetPreaccIn(TurbVar_Grad_i[0], nDim);
// AD::SetPreaccIn(Volume); AD::SetPreaccIn(dist_i);

//Added by Cakmakcioglu, for BC Transition Model 10/30/2106
Copy link
Member

Choose a reason for hiding this comment

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

We will certainly acknowledge your contribution at the correct place, so I dont think that these comments are necessary (same holds for all the other comments). You could add your name to the header of the file or in solver_structure.hpp in the comment for the SA solver.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Dr. Albring, thank you very much for your feedback. This is certainly my bad, as I have no previous experience with github, and did not know that you can see my changes that easily! This is why I have added these comment lines, thought that it would be helpful for others to keep track of the additions that I made. I apologize for that. I certainly know that you always appreciate all the contributions to the code.
The comment lines are deleted.

Copy link
Member

Choose a reason for hiding this comment

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

No problem. But you can imagine if everybody does this, then the files quickly get flooded by comments :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

indeed :)

/*--- Factor_nu_Inf in [3.0, 5.0] ---*/

Factor_nu_Inf = config->GetNuFactor_FreeStream();
nu_tilde_Inf = Factor_nu_Inf*Viscosity_Inf/Density_Inf;
if (transition) {
nu_tilde_Inf = 0.005*Factor_nu_Inf*Viscosity_Inf/Density_Inf; //Modified for BC transition model. Cakmakcioglu 10/30/2016
Copy link
Member

Choose a reason for hiding this comment

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

Please correctly align the code here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

corrected, thank you.

@@ -0,0 +1,58 @@
VARIABLES = Rex Cf
Copy link
Member

Choose a reason for hiding this comment

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

All files that are not config files (like experimental data, mesh files etc) should be moved to the TestCases repository.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Under TestCases folder, I tried to create a sub folder named transition_test_cases. These files along with configuration files and grid files are all seems to be under the transition_test_cases folder. If it is wrong way, would you please help me on this? Thanks.

Copy link
Member

Choose a reason for hiding this comment

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

There is a separate repository for the test case files. I can move the files there tmrw.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That would be great! thank you for helping me on this matter.

% Specify turbulent model (NONE, SA, SA_NEG, SST)
KIND_TURB_MODEL= SA
KIND_TRANS_MODEL= BC
%FREESTREAM_INTERMITTENCY = 0.9
Copy link
Member

Choose a reason for hiding this comment

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

Maybe remove these commented lines.

%
% Specify turbulent model (NONE, SA, SA_NEG, SST)
KIND_TURB_MODEL= SA
KIND_TRANS_MODEL= BC
Copy link
Member

Choose a reason for hiding this comment

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

Add a comment here for this option.

@@ -534,6 +534,14 @@ void CSourcePieceWise_TurbSA::ComputeResidual(su2double *val_residual, su2double
// AD::SetPreaccIn(TurbVar_i[0]);
// AD::SetPreaccIn(TurbVar_Grad_i[0], nDim);
// AD::SetPreaccIn(Volume); AD::SetPreaccIn(dist_i);

//Added by Cakmakcioglu, for BC Transition Model 10/30/2106
bool transition = (config->GetKind_Trans_Model() == BC);
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add this variable as a field to the numerics class and set it in the constructor (then it is consistent).

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 fact, I am a beginner C++ user, so I am not sure if I understood this correctly.
I have defined "transition" in numerics_structure.hpp, and changed this part of the code as needed. Hope this it what you meant.

@sametcaka
Copy link
Contributor Author

Dear all,
I have added a pdf file here that includes some test case results obtained with our BC transition model. These zero pressure gradient and variable pressure gradient flat plate test cases are very popular for model validation. I have also included Eppler E387 airfoil results. I would appreciate if you have any 3-D test case and share it with me.
Looking forward to hear your feedback.
Sincerely,
Samet

BC_model_TestCaseResults.pdf

@economon
Copy link
Member

Samet,

Great to hear from you again. Thanks for submitting your work! Did you ever have a chance to try the NREL Phase VI wind turbine blade? This could be a good 3D test case, and I believe we have a grid or two lying around...

Tom

@sametcaka
Copy link
Contributor Author

Hello Dr. Economon,
I have been busy for some time, and just had chance to submit my transition model here on GitHub.

Before starting the NREL case, I decided to check the caradonna_tung test case to see how to set grid movement configurations etc.. Although I have successfully run the case with euler equations, I could not do so with the navier-stokes equations as the case stopped running with error "Convective scheme not implemented (turbulent)". This is why I could not solve the NREL test case. If I am missing something, would you please help me on the issue?

Samet

@talbring
Copy link
Member

Thanks for fixing these things and the attached pdf. The results look great !

In case you have some parameters that you might want to have as an config option, feel free to add them or just let us know.

@sametcaka
Copy link
Contributor Author

Dr. Albring, our model do not require any other config option for now. If needed in the future, I would definitely ask you some help. Thank you for your reviews. Please let me know if any other things need to be fixed.
Samet

@@ -526,7 +526,9 @@ CSourcePieceWise_TurbSA::CSourcePieceWise_TurbSA(unsigned short val_nDim, unsign
CSourcePieceWise_TurbSA::~CSourcePieceWise_TurbSA(void) { }

void CSourcePieceWise_TurbSA::ComputeResidual(su2double *val_residual, su2double **val_Jacobian_i, su2double **val_Jacobian_j, CConfig *config) {


transition = (config->GetKind_Trans_Model() == BC);
Copy link
Member

Choose a reason for hiding this comment

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

Just move this to the routine CSourcePieceWise_TurbSA::CSourcePieceWise_TurbSA(...) and then its fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

right, will do it this evening.

@talbring
Copy link
Member

talbring commented Nov 1, 2016

Samet,

the error you get for the caradonna tung case is probably because the definition of the numerical scheme for the turbulence model is missing in the config file. Just copy it from another case.

@sametcaka
Copy link
Contributor Author

well, that is the thing that I was missing! thank you for bringing that into my attention Dr. Albring. now i can simulate the NREL wind turbine case with my model as soon as i have an appropriate geometry (if you have it and can share, i would give it a try in the evening when i get home).
Samet

@sametcaka
Copy link
Contributor Author

Dr. Albring,
I have one more issue.
The gamma_BC is a variable in my model that is computed in every cell, and its value is in between 0 and 1 (so that it controls production term on/off in that cell). I would like to write gamma_BC variable to a tecplot output file in order to see the laminar and turbulent regions. However, as a beginner level C++ user, I really couldn't figure out how the output routines work. Would you please help me on this? Is it a complicated work?

@economon
Copy link
Member

economon commented Nov 1, 2016

Samet,

I can help you with the NREL case and the output.

We are in the middle of rewriting those routines, so it will be very easy to register and output new variables to the viz. files soon (another week or less).

Tom

@talbring
Copy link
Member

talbring commented Nov 1, 2016

I added the necessary files (the exp. data and the .su2 files) to the TestCases repository, so you can remove them from here. And please rename the folder to "transition". Thanks!

@sametcaka
Copy link
Contributor Author

Dr. Economon,
If you could send me the NREL VI geometry (maybe via e-mail) in any format that Pointwise can read, that would be great! I can begin working on it as soon as possible.

Samet

@economon
Copy link
Member

economon commented Nov 4, 2016

I'll do you one better. Here is a mesh and config file for the NREL Phase VI: http://stanford.edu/~economon/dropbox/nrel.tgz.

It's been a while since I have run that to convergence, so it may need some tweaking. Give it a try and let me know. It's ~3 million grid nodes, so you'll likely need a few cores...

@sametcaka
Copy link
Contributor Author

Thank you very much Dr. Economon, I really appreciate that. Now I will play around with it, and will let you know about the progress.

@sametcaka
Copy link
Contributor Author

Dr. Economon,
I have completed the NREL Phase VI turbine runs, and attached the results here. I can also send you the tecplot output files if you would like to see some other data.
Samet

BC_Transition_NREL_PhaseVI.pdf

@economon
Copy link
Member

Thanks for putting those results together, Samet. For more comparisons, you might also check out the paper by Langtry, et al., "Predicting 2D Airfoil and 3D Wind Turbine Rotor Performance using a Transition Model for General CFD Codes" that contains this exact case. Another interesting paper is Potsdam, "Unstructured Mesh CFD Aerodynamic Analysis of the NREL Phase VI Rotor." We can also look at the surface streamlines to compare with some of the results in these papers.

@sametcaka
Copy link
Contributor Author

Dr. Economon,
As far as I understand, in order to create skin friction lines (or surface streamlines), shear stress components are needed. In the tecplot outputs, I do not have these. So I could not figure out how to do that yet.
Also, I have read many studies abouth the NREL test case, and unfortunately the experimental data does not include skin friction measurements. In addition, the skin friction line plots in these studies seem to have inconsistencies compared to eachother.

@sametcaka
Copy link
Contributor Author

Dr. Economon,
It turns out that the latest version of the SU2 prints the outputs that I needed (Cfx Cfy and Cfz). So, I created the surface streamlines, along with pressure coefficient distributions for comparison, and you can find it in the attached document . There are also some results from other studies in the literature in the attached document.
It seems to me that, the NREL case may not be the best case for validating our model. Comparing the results in the literature, none of the surface streamlines agree well with eachother. In the absence of experimental data, it is difficult to tell which one is more reasonable. I would be happy if you would also comment on these results.
Also, I wonder what the next step is. Is there anything else that you require us to do before merging the model into the master code? I think if the transition model was released officially, the community may apply the transition model to different test cases that we may not heard of or the proprietary ones.

Samet
BC_Transition_NREL_PhaseVI.pdf

@hlkline
Copy link
Member

hlkline commented Nov 28, 2016

Just checking: @talbring were your requested changes addressed?
Otherwise, LGTM

@talbring
Copy link
Member

talbring commented Dec 1, 2016

Sorry for the delay. I am fine with the changes! I dont know if @economon has some comments on the results. But I agree with Samet, that we can also let the community apply this to other test cases!

@economon
Copy link
Member

economon commented Dec 5, 2016

I agree that we should get this in soon and allow others to give it a try.

I have just one more request, Samet: in order to protect your nice contribution to the code, it is best to have at least one of the test cases connected to our regression test system. That way, we will be alerted right away if a future commit affects the correctness of your model.

Can you please add at least one of the cases to the regression suite? This is done by adding the case(s) to the serial_regression.py and parallel_regression.py files. I think that it is fairly straightforward to add one by pattern-matching the existing cases, but please let me know if you have trouble.

@sametcaka
Copy link
Contributor Author

Dr. Economon,

I have tried to add Schubauer-Klebanoff natural transition case for regression tests as you requested.
In my forked code under develop branch, I have the .cfg file in "Schubauer_Klebanoff" folder under "TestCases/transition" folder, so the config file directory should be correctly set. However, about a month ago, Dr. Albring moved grid.su2 file somewhere else that I could not locate now, so I am not sure how the regression test code will locate the grid file :) Just in case, I am attaching the grid file that I used for regression test.

Should there be any problem, please let me know.
grid.zip

@sametcaka
Copy link
Contributor Author

By the way, I can fork the TestCases repo and commit the grid files etc myself, if it would be much better. Please let me know.

@economon
Copy link
Member

economon commented Dec 8, 2016

Yep, please do the latter. You can find the test case repo here: https://github.com/su2code/TestCases. Note that, by construction, it has the same directory structure as the TestCases/ directory under the SU2 repo.

If you submit a pull request there to the develop branch with your new grid(s), we can merge it in right away.

@sametcaka
Copy link
Contributor Author

Dr. Economon,
I have added the necessary files to the develop branch of TestCases repo and created a pull request.

@economon
Copy link
Member

Great. Sorry for the delay. Just merged those in under the TestCases repo, so let's rerun the tests here and see if everything passes, ok? I'll restart it now.

@sametcaka
Copy link
Contributor Author

sametcaka commented Dec 15, 2016

No problem at all, Dr. Economon. Now everything seems good, and it is ready to merge. Hope it would be useful to the community. Thank you and Dr. Albring for your support!

@economon
Copy link
Member

Thanks again for all of your hard work and integration, Samet. This is a very nice contribution to the open source community. Merging now.

@economon economon merged commit 6f6927f into su2code:develop Dec 21, 2016
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.

4 participants