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] Update turbo interfaces #2209

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

Conversation

joshkellyjak
Copy link
Contributor

Proposed Changes

Update to the interface initialisation to enable both mixing plane and sliding interfaces within the same turbomachinery simulation. Addition of mass flow outlet to Giles BC.

Related Work

This issue solves a problem reported by a number of users, when simulating radial turbomachinery cases a second-order accurate solution cannot be achieved in some cases when using mixing plane interfaces. This is due to circumfrential averaging in regions where the flow exhibits large circumfrential nonuniformity and/or interspace gaps between adjacent blade-rows/zones small. This issue has been reported by @LorenzoFabris, in a presentation at the SU2 Conference 2022 "Performance Analysis and Shape Optimization of a Radial Compressor with the Open-Source Software SU2" and by myself.

Mass flow outlet included in the PR as requested by users.

TBC:
-Update APU Turbocharger test case and regression test to include this feature, add diffuser and converge 2nd order.

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 interfaces [Draft] Update turbo interfaces Feb 13, 2024
@joshkellyjak joshkellyjak changed the title [Draft] Update turbo interfaces [WIP] Update turbo interfaces Feb 13, 2024
@joshkellyjak joshkellyjak self-assigned this Feb 13, 2024
Comment on lines 6544 to 6552

/* --- Compute avg characteristic jump --- */
if (nDim == 2){
c_avg[3] = -2.0*(AveragePressure[val_marker][nSpanWiseSections]-Pressure_e);
}
else
{
c_avg[4] = -2.0*(AveragePressure[val_marker][nSpanWiseSections]-Pressure_e);
}
Copy link
Member

Choose a reason for hiding this comment

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

Is the index of c_avg associated with pressure? If so we should use prim_idx.Pressure()

Suggested change
/* --- Compute avg characteristic jump --- */
if (nDim == 2){
c_avg[3] = -2.0*(AveragePressure[val_marker][nSpanWiseSections]-Pressure_e);
}
else
{
c_avg[4] = -2.0*(AveragePressure[val_marker][nSpanWiseSections]-Pressure_e);
}
/*--- Compute avg characteristic jump ---*/
c_avg[nDim + 1] = -2.0*(AveragePressure[val_marker][nSpanWiseSections]-Pressure_e);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Index of c_avg is associated with the type of wave and the travel direction across the boundary (downstream index 1-3, upstream index 4)

Comment on lines +1202 to +1204
//inline su2double GetAverageMassFlowRate(unsigned short valMarker) const final {
// return AverageMassFlowRate[valMarker];
//}

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
@@ -138,6 +138,7 @@ class CEulerSolver : public CFVMFlowSolverBase<CEulerVariable, ENUM_REGIME::COMP
su2activematrix ExtAverageNu;
su2activematrix ExtAverageKine;
su2activematrix ExtAverageOmega;
vector<su2double> AverageMassFlowRate;
Copy link
Member

Choose a reason for hiding this comment

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

Could this be an array or su2vector?

* \param[in] val_marker - bound marker
* \return Value of the mass flow rate on the surface <i>val_marker</i>
*/
//inline su2double GetAverageMassFlowRate(unsigned short valMarker) const final {
Copy link
Member

Choose a reason for hiding this comment

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

Don't forget to remove the commented method

* \param[in] val_marker - boundary marker
* \return Value of the mass flow rate on the surface <i>val_marker</i>
*/
inline virtual su2double GetAverageMassFlowRate(unsigned short valMarker) const {return 0.0; }
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
inline virtual su2double GetAverageMassFlowRate(unsigned short valMarker) const {return 0.0; }
inline virtual su2double GetTargetMassFlowRate(unsigned short valMarker) const {return 0.0; }

{
c_avg[4] = -2.0*(AveragePressure[val_marker][iSpan]-Pressure_e);
}
c_avg[nDim + 1] = -2.0*(AveragePressure[val_marker][iSpan]-Pressure_e);
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
c_avg[nDim + 1] = -2.0*(AveragePressure[val_marker][iSpan]-Pressure_e);
c_avg[nDim + 1] = 2.0*(Pressure_e-AveragePressure[val_marker][iSpan]);

auto const MassFlowRate_e = config->GetGiles_Var1(Marker_Tag);
auto const relFacMassFlowRate = config->GetGiles_Var2(Marker_Tag);

Pressure_e = AveragePressure[val_marker][nSpanWiseSections]+relFacMassFlowRate*(AverageMassFlowRate[val_marker]-MassFlowRate_e);
Copy link
Member

Choose a reason for hiding this comment

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

Maybe try this in order to keep the units more consistent here.

Suggested change
Pressure_e = AveragePressure[val_marker][nSpanWiseSections]+relFacMassFlowRate*(AverageMassFlowRate[val_marker]-MassFlowRate_e);
Pressure_e = AveragePressure[val_marker][nSpanWiseSections]+relFacMassFlowRate*GetFluidModel()->GetdPdrho_e()*(AverageMassFlowRate[val_marker]-MassFlowRate_e);

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