-
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
Update turbo ramps #2419
base: develop
Are you sure you want to change the base?
Update turbo ramps #2419
Changes from all commits
2b74501
e7cb52b
f4b65fc
5c40247
6d4fa45
03aefd6
12d2bc0
543e062
583f249
92cf538
56f7c8a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1067,12 +1067,19 @@ class CConfig { | |
unsigned short *nSpan_iZones; /*!< \brief number of span-wise sections for each zones */ | ||
bool turbMixingPlane; /*!< \brief option for turbulent mixingplane */ | ||
bool SpatialFourier; /*!< \brief option for computing the fourier transforms for subsonic non-reflecting BC. */ | ||
bool RampRotatingFrame; /*!< \brief option for ramping up or down the Rotating Frame values */ | ||
bool RampOutletPressure; /*!< \brief option for ramping up or down the outlet pressure */ | ||
bool RampMotionFrame; /*!< \brief option for ramping up or down the motion Frame values */ | ||
bool RampOutlet; /*!< \brief option for ramping up or down the outlet values */ | ||
bool RampRotatingFrame; /*!< \brief option for ramping up or down the motion Frame values */ | ||
bool RampTranslationFrame; /*!< \brief option for ramping up or down the outlet values */ | ||
bool RampOutletMassFlow; /*!< \brief option for ramping up or down the motion Frame values */ | ||
bool RampOutletPressure; /*!< \brief option for ramping up or down the outlet values */ | ||
su2double AverageMachLimit; /*!< \brief option for turbulent mixingplane */ | ||
su2double FinalRotation_Rate_Z; /*!< \brief Final rotation rate Z if Ramp rotating frame is activated. */ | ||
su2double FinalTranslation_Rate_Y; /*!< \brief Final translation rate Y if Ramp translation frame is activated. */ | ||
su2double FinalOutletPressure; /*!< \brief Final outlet pressure if Ramp outlet pressure is activated. */ | ||
su2double FinalOutletMassFlow; /*!< \brief Final outlet mass flow rate if Ramp outlet mass flow rate is activated */ | ||
su2double MonitorOutletPressure; /*!< \brief Monitor outlet pressure if Ramp outlet pressure is activated. */ | ||
su2double MonitorOutletMassFlow; /*!< \brief Monitor outlet mass flow rate if ramp outlet mass flow rate is activated. */ | ||
array<su2double, N_POLY_COEFFS> cp_polycoeffs{{0.0}}; /*!< \brief Array for specific heat polynomial coefficients. */ | ||
array<su2double, N_POLY_COEFFS> mu_polycoeffs{{0.0}}; /*!< \brief Array for viscosity polynomial coefficients. */ | ||
array<su2double, N_POLY_COEFFS> kt_polycoeffs{{0.0}}; /*!< \brief Array for thermal conductivity polynomial coefficients. */ | ||
|
@@ -1121,8 +1128,8 @@ class CConfig { | |
jst_coeff[2], /*!< \brief artificial dissipation (flow) array for the COption class. */ | ||
ffd_coeff[3], /*!< \brief artificial dissipation (flow) array for the COption class. */ | ||
mixedout_coeff[3], /*!< \brief default mixedout algorithm coefficients for the COption class. */ | ||
rampRotFrame_coeff[3], /*!< \brief ramp rotating frame coefficients for the COption class. */ | ||
rampOutPres_coeff[3], /*!< \brief ramp outlet pressure coefficients for the COption class. */ | ||
rampMotionFrame_coeff[3], /*!< \brief ramp motion frame coefficients for the COption class. */ | ||
rampOutlet_coeff[3], /*!< \brief ramp outlet value coefficients for the COption class. */ | ||
jst_adj_coeff[2], /*!< \brief artificial dissipation (adjoint) array for the COption class. */ | ||
mesh_box_length[3], /*!< \brief mesh box length for the COption class. */ | ||
mesh_box_offset[3], /*!< \brief mesh box offset for the COption class. */ | ||
|
@@ -5158,45 +5165,46 @@ class CConfig { | |
void SetKind_PerformanceAverageProcess(unsigned short new_AverageProcess) { Kind_PerformanceAverageProcess = new_AverageProcess; } | ||
|
||
/*! | ||
* \brief Get coeff for Rotating Frame Ramp. | ||
* \return coeff Ramp Rotating Frame. | ||
* \brief Get Motion Frame Ramp option. | ||
* \return Ramp Motion Frame option. | ||
*/ | ||
su2double GetRampRotatingFrame_Coeff(unsigned short iCoeff) const { return rampRotFrame_coeff[iCoeff];} | ||
bool GetRampMotionFrame(void) const { return RampMotionFrame; } | ||
|
||
/*! | ||
* \brief Get Rotating Frame Ramp option. | ||
* \return Ramp Rotating Frame option. | ||
*/ | ||
bool GetRampRotatingFrame(void) const { return RampRotatingFrame;} | ||
|
||
/*! | ||
* \brief Get coeff for Outlet Pressure Ramp. | ||
* \return coeff Ramp Outlet Pressure. | ||
*/ | ||
su2double GetRampOutletPressure_Coeff(unsigned short iCoeff) const { return rampOutPres_coeff[iCoeff];} | ||
* \brief Get coeff for ramping the frame of motion (translation/rotation) [TURBO ONLY] | ||
* \return coeff Ramp for frame of motion | ||
*/ | ||
su2double GetRampMotionFrame_Coeff(unsigned short iCoeff) const { return rampMotionFrame_coeff[iCoeff];} | ||
|
||
/*! | ||
* \brief Get final Outlet Pressure value for the ramp. | ||
* \return final Outlet Pressure value. | ||
* \brief Get outflow ramp option. | ||
* \return Ramp outflow option. | ||
*/ | ||
su2double GetFinalOutletPressure(void) const { return FinalOutletPressure; } | ||
bool GetRampOutflow(void) const { return RampOutlet; } | ||
|
||
/*! | ||
* \brief Get final Outlet Pressure value for the ramp. | ||
* \return Monitor Outlet Pressure value. | ||
*/ | ||
su2double GetMonitorOutletPressure(void) const { return MonitorOutletPressure; } | ||
* \brief Get coeff for ramping the Giles boundary outflow (pressure/mass flow) [TURBO ONLY] | ||
* \return coeff Ramp for Giles outflow | ||
*/ | ||
su2double GetRampOutflow_Coeff(unsigned short iCoeff) const { return rampOutlet_coeff[iCoeff]; } | ||
|
||
/*! | ||
* \brief Set Monitor Outlet Pressure value for the ramp. | ||
*/ | ||
void SetMonitorOutletPressure(su2double newMonPres) { MonitorOutletPressure = newMonPres;} | ||
* \brief General interface for accessing ramp coefficient information | ||
* \return coeff for ramps | ||
*/ | ||
su2double GetRamp_Coeff(TURBO_RAMP_TYPE ramp_flag, TURBO_RAMP_COEFF val_coeff) { | ||
if (ramp_flag == TURBO_RAMP_TYPE::GRID) return rampMotionFrame_coeff[val_coeff]; | ||
else if (ramp_flag == TURBO_RAMP_TYPE::BOUNDARY) return rampOutlet_coeff[val_coeff]; | ||
else return 0; | ||
}; | ||
|
||
/*! | ||
* \brief Get Outlet Pressure Ramp option. | ||
* \return Ramp Outlet pressure option. | ||
* \brief Generic interface for setting monitor outlet values for the ramp. | ||
*/ | ||
bool GetRampOutletPressure(void) const { return RampOutletPressure;} | ||
void SetMonitorValue(su2double newMon_val) { | ||
if (RampOutletPressure) MonitorOutletPressure = newMon_val; | ||
else if (RampOutletMassFlow) MonitorOutletMassFlow = newMon_val; | ||
} | ||
|
||
/*! | ||
* \brief Get mixedout coefficients. | ||
|
@@ -6055,6 +6063,16 @@ class CConfig { | |
*/ | ||
void SetRotation_Rate(unsigned short iDim, su2double val) { Rotation_Rate[iDim] = val;} | ||
|
||
/*! | ||
* \brief General interface for setting the rate of motion in grid ramps | ||
* \param[in] ramp_flag - flag for type of ramp | ||
* \param[in] val - new value of rate of motion | ||
*/ | ||
void SetRate(su2double val) { | ||
if (RampRotatingFrame) Rotation_Rate[2] = val; | ||
else if (RampTranslationFrame) Translation_Rate[1] = val; | ||
}; | ||
|
||
/*! | ||
* \brief Get the rotation rate of the marker. | ||
* \param[in] iMarkerMoving - Index of the moving marker (as specified in Marker_Moving) | ||
|
@@ -6073,6 +6091,12 @@ class CConfig { | |
MarkerRotation_Rate[3 * iMarkerMoving + iDim] = val; | ||
} | ||
|
||
/*! | ||
* \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;} | ||
|
||
Comment on lines
+6094
to
+6099
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? |
||
/*! | ||
* \brief Get the pitching rate of the mesh. | ||
* \param[in] iDim - spatial component | ||
|
@@ -6160,6 +6184,14 @@ class CConfig { | |
*/ | ||
void SetRotation_Rate_Z(su2double newRotation_Rate_Z); | ||
|
||
su2double GetFinalValue(TURBO_RAMP_TYPE ramp_flag) { | ||
if (ramp_flag == TURBO_RAMP_TYPE::GRID && RampRotatingFrame) return FinalRotation_Rate_Z; | ||
else if (ramp_flag == TURBO_RAMP_TYPE::GRID && RampTranslationFrame) return FinalTranslation_Rate_Y; | ||
else if (ramp_flag == TURBO_RAMP_TYPE::BOUNDARY && RampOutletPressure) return FinalOutletPressure; | ||
else if (ramp_flag == TURBO_RAMP_TYPE::BOUNDARY && RampOutletMassFlow) return FinalOutletMassFlow; | ||
else return 0.0; | ||
}; | ||
|
||
/*! | ||
* \brief Get the Harmonic Balance frequency pointer. | ||
* \return Harmonic Balance Frequency pointer. | ||
|
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -1886,6 +1886,17 @@ enum TURBO_MARKER_TYPE{ | |||||||||
OUTFLOW = 2 /*!< \brief flag for outflow marker for compute turboperformance. */ | ||||||||||
}; | ||||||||||
|
||||||||||
enum TURBO_RAMP_TYPE{ | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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*/ | ||||||||||
Comment on lines
+1890
to
+1891
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
}; | ||||||||||
|
||||||||||
enum TURBO_RAMP_COEFF{ | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||||||||||
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 */ | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
}; | ||||||||||
|
||||||||||
/*! | ||||||||||
* \brief Types inlet boundary treatments | ||||||||||
*/ | ||||||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -1621,20 +1621,20 @@ void CConfig::SetConfig_Options() { | |||||
* the 2nd coefficient is the tolerance for the Newton method, 3rd coefficient is the maximum number of | ||||||
* iteration for the Newton Method.*/ | ||||||
addDoubleArrayOption("MIXEDOUT_COEFF", 3, mixedout_coeff); | ||||||
/*!\brief RAMP_ROTATING_FRAME\n DESCRIPTION: option to ramp up or down the rotating frame velocity value*/ | ||||||
addBoolOption("RAMP_ROTATING_FRAME", RampRotatingFrame, false); | ||||||
rampRotFrame_coeff[0] = 0; rampRotFrame_coeff[1] = 1.0; rampRotFrame_coeff[2] = 1000.0; | ||||||
/*!\brief RAMP_ROTATING_FRAME_COEFF \n DESCRIPTION: the 1st coeff is the staring velocity, | ||||||
* the 2nd coeff is the number of iterations for the update, 3rd is the number of iteration */ | ||||||
addDoubleArrayOption("RAMP_ROTATING_FRAME_COEFF", 3, rampRotFrame_coeff); | ||||||
/*!\brief RAMP_MOTION_FRAME\n DESCRIPTION: option to ramp up or down the frame of motion velocity value*/ | ||||||
addBoolOption("RAMP_MOTION_FRAME", RampMotionFrame, false); | ||||||
rampMotionFrame_coeff[0] = 100.0; rampMotionFrame_coeff[1] = 1.0; rampMotionFrame_coeff[2] = 1000.0; | ||||||
/*!\brief RAMP_MOTION_FRAME_COEFF \n DESCRIPTION: the 1st coeff is the staring outlet value, | ||||||
* the 2nd coeff is the number of iterations for the update, 3rd is the number of total iteration till reaching the final outlet pressure value */ | ||||||
addDoubleArrayOption("RAMP_MOTION_FRAME_COEFF", 3, rampMotionFrame_coeff); | ||||||
/* DESCRIPTION: AVERAGE_MACH_LIMIT is a limit value for average procedure based on the mass flux. */ | ||||||
addDoubleOption("AVERAGE_MACH_LIMIT", AverageMachLimit, 0.03); | ||||||
/*!\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, | ||||||
Comment on lines
-1632
to
-1635
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||||||
/*!\brief RAMP_OUTLET\n DESCRIPTION: option to ramp up or down the Giles outlet value*/ | ||||||
addBoolOption("RAMP_OUTLET", RampOutlet, false); | ||||||
rampOutlet_coeff[0] = 100000.0; rampOutlet_coeff[1] = 1.0; rampOutlet_coeff[2] = 1000.0; | ||||||
/*!\brief RAMP_OUTLET_COEFF \n DESCRIPTION: the 1st coeff is the staring outlet value, | ||||||
* the 2nd coeff is the number of iterations for the update, 3rd is the number of total iteration till reaching the final outlet pressure value */ | ||||||
addDoubleArrayOption("RAMP_OUTLET_PRESSURE_COEFF", 3, rampOutPres_coeff); | ||||||
addDoubleArrayOption("RAMP_OUTLET_COEFF", 3, rampOutlet_coeff); | ||||||
/*!\brief MARKER_MIXINGPLANE \n DESCRIPTION: Identify the boundaries in which the mixing plane is applied. \ingroup Config*/ | ||||||
addStringListOption("MARKER_MIXINGPLANE_INTERFACE", nMarker_MixingPlaneInterface, Marker_MixingPlaneInterface); | ||||||
/*!\brief TURBULENT_MIXINGPLANE \n DESCRIPTION: Activate mixing plane also for turbulent quantities \ingroup Config*/ | ||||||
|
@@ -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){ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consistency please
Suggested change
|
||||||
if (Kind_GridMovement == ENUM_GRIDMOVEMENT::ROTATING_FRAME) RampRotatingFrame = true; | ||||||
else if (Kind_GridMovement == ENUM_GRIDMOVEMENT::STEADY_TRANSLATION) RampTranslationFrame = true; | ||||||
} | ||||||
|
||||||
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 ) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
RampOutletPressure = true; | ||||||
else if (Kind_Data_Giles[iMarker] == MASS_FLOW_OUTLET) RampOutletMassFlow = true; | ||||||
} | ||||||
} | ||||||
|
||||||
/*--- Set number of TurboPerformance markers ---*/ | ||||||
if(GetGrid_Movement() && RampRotatingFrame && !DiscreteAdjoint){ | ||||||
FinalRotation_Rate_Z = Rotation_Rate[2]; | ||||||
if(abs(FinalRotation_Rate_Z) > 0.0){ | ||||||
Rotation_Rate[2] = rampRotFrame_coeff[0]; | ||||||
Rotation_Rate[2] = rampMotionFrame_coeff[TURBO_RAMP_COEFF::INITIAL_VALUE]; | ||||||
} | ||||||
} | ||||||
|
||||||
if(GetGrid_Movement() && RampTranslationFrame && !DiscreteAdjoint){ | ||||||
FinalTranslation_Rate_Y = Translation_Rate[1]; | ||||||
if(abs(FinalTranslation_Rate_Y) > 0.0){ | ||||||
Translation_Rate[1] = rampMotionFrame_coeff[TURBO_RAMP_COEFF::INITIAL_VALUE]; | ||||||
} | ||||||
} | ||||||
|
||||||
if(RampOutletPressure && !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 ){ | ||||||
FinalOutletPressure = Giles_Var1[iMarker]; | ||||||
Giles_Var1[iMarker] = rampOutPres_coeff[0]; | ||||||
Giles_Var1[iMarker] = rampOutlet_coeff[TURBO_RAMP_COEFF::INITIAL_VALUE]; | ||||||
} | ||||||
} | ||||||
for (iMarker = 0; iMarker < nMarker_Riemann; iMarker++){ | ||||||
if (Kind_Data_Riemann[iMarker] == STATIC_PRESSURE || Kind_Data_Riemann[iMarker] == RADIAL_EQUILIBRIUM){ | ||||||
FinalOutletPressure = Riemann_Var1[iMarker]; | ||||||
Riemann_Var1[iMarker] = rampOutPres_coeff[0]; | ||||||
Riemann_Var1[iMarker] = rampOutlet_coeff[TURBO_RAMP_COEFF::INITIAL_VALUE]; | ||||||
} | ||||||
} | ||||||
} | ||||||
|
||||||
if(RampOutletMassFlow && !DiscreteAdjoint){ | ||||||
for (iMarker = 0; iMarker < nMarker_Giles; iMarker++){ | ||||||
if (Kind_Data_Giles[iMarker] == MASS_FLOW_OUTLET){ | ||||||
FinalOutletMassFlow = Giles_Var1[iMarker]; | ||||||
Giles_Var1[iMarker] = rampOutlet_coeff[TURBO_RAMP_COEFF::INITIAL_VALUE]; | ||||||
} | ||||||
} | ||||||
} | ||||||
|
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.
H is before Y
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.
Spelling my own name is a challenge on occasion