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

Update turbo ramps #2419

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from
Open

Update turbo ramps #2419

wants to merge 11 commits into from

Conversation

joshkellyjak
Copy link
Contributor

Proposed Changes

The turbomachinery ramps were missing the option to ramp the translation rate in 2D and the ability to ramp the outlet mass flow, these have been added and the function has been made more general to accomodate these additions. It should be much easier to add ramps in the future.

Related Work

N/A

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.

@joshkellyjak joshkellyjak changed the title Update turbo ramps [WIP] Update turbo ramps Jan 13, 2025
@joshkellyjak joshkellyjak changed the title [WIP] Update turbo ramps Update turbo ramps Jan 16, 2025
SU2_CFD/src/iteration/CTurboIteration.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/iteration/CTurboIteration.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/iteration/CTurboIteration.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/iteration/CTurboIteration.cpp Outdated Show resolved Hide resolved
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.

Nice, just some minor stuff and it's good to go.

@@ -96,6 +96,7 @@ Johannes Blühdorn
JonathanSmith1936
Joseph Signorelli
Josy P. Pullockara
Joshua A. Kelly
Copy link
Member

Choose a reason for hiding this comment

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

H is before Y

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Spelling my own name is a challenge on occasion

Comment on lines +6094 to +6099
/*!
* \brief Get the final translation velocity of the mesh in the y-direction
* \return Velocity of the mesh in the y-direction
*/
su2double GetFinalTranslation_Rate_Y() const { return FinalTranslation_Rate_Y;}

Copy link
Member

Choose a reason for hiding this comment

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

Can this be removed now? And maybe some of the older functions to set/get Z rotation?

@@ -1886,6 +1886,17 @@ enum TURBO_MARKER_TYPE{
OUTFLOW = 2 /*!< \brief flag for outflow marker for compute turboperformance. */
};

enum TURBO_RAMP_TYPE{
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
enum TURBO_RAMP_TYPE{
enum class TURBO_RAMP_TYPE{

Comment on lines +1890 to +1891
GRID = 1, /*!< \brief flag for rotational/translational ramps */
BOUNDARY = 2 /*!< \brief flag for pressure/mass flow ramps*/
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
GRID = 1, /*!< \brief flag for rotational/translational ramps */
BOUNDARY = 2 /*!< \brief flag for pressure/mass flow ramps*/
GRID, /*!< \brief flag for rotational/translational ramps */
BOUNDARY /*!< \brief flag for pressure/mass flow ramps*/

enum TURBO_RAMP_COEFF{
INITIAL_VALUE = 0, /*!< \brief intial value of the ramp */
UPDATE_FREQ = 1, /*<! \brief update frequency of the ramp */
FINAL_ITER = 2 /*<! \brief final iteration of the ramp */
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
FINAL_ITER = 2 /*<! \brief final iteration of the ramp */
FINAL_ITER = 2 /*<! \brief final iteration of the ramp */

BOUNDARY = 2 /*!< \brief flag for pressure/mass flow ramps*/
};

enum TURBO_RAMP_COEFF{
Copy link
Member

Choose a reason for hiding this comment

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

Document that these are used to access the entries in the coefficient ramps and thus are numbered in a particular way.

@@ -4355,25 +4355,55 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
nSpan_iZones = new unsigned short[nZone];
}

/*--- Interface for handling turbo ramps ---*/
if(GetGrid_Movement() && RampMotionFrame && !DiscreteAdjoint){
Copy link
Member

Choose a reason for hiding this comment

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

Consistency please

Suggested change
if(GetGrid_Movement() && RampMotionFrame && !DiscreteAdjoint){
if (GetGrid_Movement() && RampMotionFrame && !DiscreteAdjoint) {


if(RampOutlet && !DiscreteAdjoint) {
for (iMarker = 0; iMarker < nMarker_Giles; iMarker++){
if (Kind_Data_Giles[iMarker] == STATIC_PRESSURE || Kind_Data_Giles[iMarker] == STATIC_PRESSURE_1D || Kind_Data_Giles[iMarker] == RADIAL_EQUILIBRIUM )
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (Kind_Data_Giles[iMarker] == STATIC_PRESSURE || Kind_Data_Giles[iMarker] == STATIC_PRESSURE_1D || Kind_Data_Giles[iMarker] == RADIAL_EQUILIBRIUM )
switch (Kind_Data_Giles[iMarker]) {

Comment on lines +84 to +85
const long unsigned rampFreq = SU2_TYPE::Int(config->GetRamp_Coeff(ramp_flag, TURBO_RAMP_COEFF::UPDATE_FREQ));
const long unsigned finalRamp_Iter = SU2_TYPE::Int(config->GetRamp_Coeff(ramp_flag, TURBO_RAMP_COEFF::FINAL_ITER));
Copy link
Member

Choose a reason for hiding this comment

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

Any reason why you can't auto these?

Suggested change
const long unsigned rampFreq = SU2_TYPE::Int(config->GetRamp_Coeff(ramp_flag, TURBO_RAMP_COEFF::UPDATE_FREQ));
const long unsigned finalRamp_Iter = SU2_TYPE::Int(config->GetRamp_Coeff(ramp_flag, TURBO_RAMP_COEFF::FINAL_ITER));
const unsigned long rampFreq = SU2_TYPE::Int(config->GetRamp_Coeff(ramp_flag, TURBO_RAMP_COEFF::UPDATE_FREQ));
const unsigned long finalRamp_Iter = SU2_TYPE::Int(config->GetRamp_Coeff(ramp_flag, TURBO_RAMP_COEFF::FINAL_ITER));

Comment on lines -1632 to -1635
/*!\brief RAMP_OUTLET_PRESSURE\n DESCRIPTION: option to ramp up or down the rotating frame velocity value*/
addBoolOption("RAMP_OUTLET_PRESSURE", RampOutletPressure, false);
rampOutPres_coeff[0] = 100000.0; rampOutPres_coeff[1] = 1.0; rampOutPres_coeff[2] = 1000.0;
/*!\brief RAMP_OUTLET_PRESSURE_COEFF \n DESCRIPTION: the 1st coeff is the staring outlet pressure,
Copy link
Member

Choose a reason for hiding this comment

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

Add entries to the deprecated options so that users with old configs are pointed to the new option.

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.

2 participants