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

[WIP] Supersonic inlet profile #1652

Draft
wants to merge 23 commits into
base: develop
Choose a base branch
from

Conversation

eskimmel
Copy link

@eskimmel eskimmel commented Jun 1, 2022

Proposed Changes

Give a brief overview of your contribution here in a few sentences.
This is a draft pull request for the implementation of a supersonic inlet profile feature. So far, the only changes made have been in CEulerSolver.cpp, where the uniform temperature, pressure, and velocity at the inlet for a supersonic inlet BC have been replaced with vertex values (please verify I did this correctly).

Related Work

Resolve any issues (bug fix or feature request), note any related PRs, or mention interactions with the work of others, if any.
I have been in communication with @bigfooted regarding the first steps for this implementation. I created a feature request for this on 5/25/2022.

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.

@pr-triage pr-triage bot added the PR: draft label Jun 1, 2022
@pcarruscag pcarruscag changed the title Feature supersonicinletprofile [WIP] Supersonic inlet profile Jun 1, 2022
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.

Actually this is more involved than I thought.
If you can attend the developer meeting next Tuesday at 10am Pacific time (https://meet.jit.si/SU2_DevMeeting) I can try to give directions.
Otherwise I suggest that you avoid intersections between supersonic inlets and walls.

@@ -2524,6 +2524,7 @@ void CEulerSolver::GetPower_Properties(CGeometry *geometry, CConfig *config, uns
su2double *Inlet_XCG = new su2double [config->GetnMarker_All()]();
su2double *Inlet_YCG = new su2double [config->GetnMarker_All()]();
su2double *Inlet_ZCG = new su2double [config->GetnMarker_All()]();
su2double *Inlet_Velocity = new su2double [config->GetnMarker_All()]();
Copy link
Member

@pcarruscag pcarruscag Jun 4, 2022

Choose a reason for hiding this comment

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

This function does not need to be modified.

Copy link
Author

Choose a reason for hiding this comment

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

I'll attend the meeting. Upon thinking about it more, I think I will be breaking my inlet into two domains, one that uses the subsonic inlet feature (directly above the wall) and one that would use the new supersonic inlet feature (above the subsonic region). That way, the supersonic inlet profile will not be meeting the no-slip wall and contain subsonic flow.

@eskimmel
Copy link
Author

eskimmel commented Jun 9, 2022

I just committed a second round of changes that I would appreciate some feedback on. Compilation is successful with these changes, however, upon testing, I receive the following message:

Error in "void CConfig::SetConfig_Parsing(std::istream&)":

Line 271 SPECIFIED_SUPERSONIC_INLET_PROFILE: invalid option name. Check current SU2 options in config_template.cfg.
Did you mean SPECIFIED_INLET_PROFILE?
Line 274 SUPERSONIC_INLET_FILENAME: invalid option name. Check current SU2 options in config_template.cfg.
Did you mean INLET_FILENAME?

I had already adjusted CConfig.cpp to include supersonic inlet profile inputs, but apparently I am not implementing everything I need to. I'm unsure where else I would need to make changes. Any suggestions?

@bigfooted
Copy link
Contributor

Hi! For some reason the files that you edited are not in the directories that they belong in, but are residing in the main SU2 directory. You have to move each of the files to the correct directory.

@eskimmel
Copy link
Author

eskimmel commented Jun 9, 2022

Whoops, thanks for letting me know! I'll fix that shortly.

@bigfooted
Copy link
Contributor

OK, great.
In the mean time, some changes were made to CEulerSolver.cpp by @pcarruscag , which is why it now says that there is a merge conflict here. You'll have to put these changes into your CEulerSolver.cpp to get rid of this conflict.

@eskimmel
Copy link
Author

Upon implementing these changes, the compilation of the code failed due to multiple variables receiving conflicting declarations. After using just the variables @pcarruscag made and re-compiling, I receive multiple errors regarding the assignment of read-only variables, so I had to remove the "const" before a few lines to allow for compilation. Is this alright?

Also, any ideas about why SPECIFIED_SUPERSONIC_INLET_PROFILE is not being accepted as an option even though it's defined in CConfig.cpp?

@pcarruscag
Copy link
Member

Why did you introduce supersonic-specific options? The inlet file allows specifying profiles for all markers, and a marker will not have 2 boundary conditions. From what I saw we just need to interpret the values in a different way.

@eskimmel
Copy link
Author

eskimmel commented Jun 13, 2022

I introduced supersonic specific options because, from my understanding, anything written in INLET_FILENAME in the .cfg file will be treated as a subsonic inlet, even if the marker tag is assigned to a supersonic inlet (including both profiles in the same inlet file results in immediate divergence). I wanted the static temperature, static pressure, and velocity vector to be read into SU2 for the supersonic profile and the total temperature, total pressure, and unit flow vector to be read for the subsonic profile. I figured that placing these different values in different files would be the easiest way to circumvent the issue stated above.

@pcarruscag
Copy link
Member

I see, that should not be necessary because internally we can check that the marker is supersonic instead of subsonic and give the values a different interpretation.
The incompressible solver does this when the inlet type is changed from total conditions to velocity inlet.

@@ -1015,6 +1015,40 @@ su2double CTurbSSTSolver::GetInletAtVertex(su2double *val_inlet,
}
}

} else if (val_kind_marker == SUPERSONIC_INLET) {

unsigned short tke_position = nDim+2+nDim;
Copy link
Contributor

Choose a reason for hiding this comment

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

I would try to avoid these declarations (ndim+ndim). It may be a bit selfish of me here, but this wont work for NEMO or INC. Im not sure the incompressible solver could be used here.

It may be beneficial to add to the variable index (CIndices)?

@@ -9427,3 +9437,4 @@ void CEulerSolver::GatherInOutAverageValues(CConfig *config, CGeometry *geometry
}
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

Comment on lines +7009 to +7011
Velocity2 = 0.0;
for (iDim = 0; iDim < nDim; iDim++)
Velocity2 += Velocity[iDim]*Velocity[iDim];
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Velocity2 = 0.0;
for (iDim = 0; iDim < nDim; iDim++)
Velocity2 += Velocity[iDim]*Velocity[iDim];
Velocity2 = GeometryToolbox::SquaredNorm(nDim, Velocity);

@stale
Copy link

stale bot commented Sep 21, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still a relevant issue please comment on it to restart the discussion. Thank you for your contributions.

@stale stale bot added the stale label Sep 21, 2022
@stale stale bot closed this Nov 1, 2022
@bigfooted bigfooted reopened this May 7, 2024
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.

None yet

4 participants