-
Notifications
You must be signed in to change notification settings - Fork 847
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
Fixes to inlet files #1427
Fixes to inlet files #1427
Conversation
So problem was a classic mismatch between what iMarkers are loop over in the function that sets sth and the other that writes sth. At one point there is an alphabetical sort of marker tags which destroys the order given by the config which implicitly can be used to stay consistent. The sort was removed and during template inlet writing the same iMarker loop is used to be consistent with the value preparation.
|
||
sort(profileTags.begin(), profileTags.end()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so this destroys the order that was always given implicitly by the loop:
for (unsigned short iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) {
if (config->GetMarker_All_KindBC(iMarker) == markerType) {
That loop is consequently used during the template writing as well
Add necessary functions. Add template output. Make BC_Inlet use the correct container which stores the inlet values. In the process a little bug was fixed for multiple inlets that will be fixed in PR #1427.
👍 for doing it in BC_Inlet |
The example_inlet_file.dat is always written with dimensional values. For all variables. The values are therefore also read dimesnional and stay dimensional right until they are used in BC_INLET. That is now consistent between mean flow and turbulence.
/*--- Non-dimensionalize Inlet_TurbVars if Inlet-Files are used. ---*/ | ||
su2double Inlet_Vars[MAXNVAR]; | ||
Inlet_Vars[0] = Inlet_TurbVars[val_marker][iVertex][0]; | ||
Inlet_Vars[1] = Inlet_TurbVars[val_marker][iVertex][1]; | ||
if (config->GetInlet_Profile_From_File()) { | ||
Inlet_Vars[0] *= 1 / (config->GetVelocity_Ref() * config->GetVelocity_Ref()); | ||
Inlet_Vars[1] *= config->GetViscosity_Ref() / (config->GetDensity_Ref() * config->GetVelocity_Ref() * config->GetVelocity_Ref()); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok now this works but maybe it is not the most performant or elegant solution.
The test I made is to write the example_inlet (by not having an inlet in the first place) and run a simulation with that. Then take the same config without inlet file and run another simulation --> These two simulation should be identical. For SA, the diff between the history files is empty and for SST I see differences in the 9th digit (the last in that case) popping up after 150 iterations which then accumulate in the residual. I would guess these are floating point errors but the analytical computation is the same.
From my perspective this is finished. As mentioned above I will add a testcase with Mean-flow+SST+2Species for 2 inlets over at #1388 once this is merged. |
This pull request fixes 1 alert when merging f6bd942 into ccc1c6e - view on LGTM.com fixed alerts:
|
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
This pull request fixes 1 alert when merging e242f47 into ccc1c6e - view on LGTM.com fixed alerts:
|
Hi all,
I noticed problems when using multiple inlet files: At the template values were mixed between the inlets because there is a (in my eyes) superfluous
sort
done. So the problem is just with the template-writing and would not happen if alphabetical and nMarker_all order between the inlet marker_tags were identical. This PR fixes this, at least for the tests I did over at #1388 where I will also add a inc+turb+2species-with-2-inlets reg test (and hopefully also non-dimensional).Inlet file non-dimensionalization: The inlet file writes dimensional values for the mean flow, and the values that are read are non-dimensionalized in the BC_Inlet routine itself -> I personally find this approach quite good, but I dont believe the SA+SST are adhering to that. See also this cfd-online issue. I will try to fix this here as well.
by multiplying with length_Ref/VelocityRef (which would fit with Feng Liu) orby multiplying with ViscRef/(rhoRef*VelocityRef^2)Any info on this is appreciated.
My approach would be non-dimensionalize in the BC_Inlet routine for Turb as well to stay consistent with the mean flow, For the mean flow it has to be done like that because the meaning of the values is determined in the inlet routine. Otherwise one could do all that consistently a bit earlier.
I have to remember to add a little hint to the laminar step tutorial to state that the inlet file should be dimensional
Related Work
#516 initial implementation
PR Checklist