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

New turbo ouputs #2011

Merged
merged 67 commits into from
Feb 7, 2024
Merged

New turbo ouputs #2011

merged 67 commits into from
Feb 7, 2024

Conversation

joshkellyjak
Copy link
Contributor

Proposed Changes

Implemented updated turboperformance methods and adds improved history ouput of turboperformance variables to match screen output

Related Work

Follows on from removal of legacy output - #2003

Implements improved turboperformance calculations used in feature_turbomachinery_restruct_singlezone - #1316

PR Checklist

  • 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.

@pr-triage pr-triage bot added the PR: draft label Apr 14, 2023
@joshkellyjak joshkellyjak changed the title [WIP] New turbo ouputs New turbo ouputs Apr 14, 2023
@pcarruscag pcarruscag changed the title New turbo ouputs [WIP] New turbo ouputs Apr 14, 2023
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

CodeQL found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.

SU2_CFD/include/iteration/CFluidIteration.hpp Outdated Show resolved Hide resolved
SU2_CFD/include/iteration/CTurboIteration.hpp Outdated Show resolved Hide resolved
SU2_CFD/include/output/COutput.hpp Outdated Show resolved Hide resolved
SU2_CFD/include/output/CTurboOutput.hpp Outdated Show resolved Hide resolved
SU2_CFD/include/output/CTurboOutput.hpp Outdated Show resolved Hide resolved
SU2_CFD/src/iteration/CFluidIteration.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/iteration/CFluidIteration.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/output/CFlowCompOutput.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/output/CFlowCompOutput.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/output/COutput.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.

Code looks good, just trying to trim down the interface if possible

Common/src/CConfig.cpp Show resolved Hide resolved
SU2_CFD/include/output/CFlowCompOutput.hpp Show resolved Hide resolved
SU2_CFD/include/output/CTurboOutput.hpp Outdated Show resolved Hide resolved
SU2_CFD/include/iteration/CIteration.hpp Outdated Show resolved Hide resolved
SU2_CFD/src/drivers/CMultizoneDriver.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/drivers/CMultizoneDriver.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/output/CTurboOutput.cpp Fixed Show fixed Hide fixed
SU2_CFD/src/output/CTurboOutput.cpp Fixed Show fixed Hide fixed
SU2_CFD/src/output/CTurboOutput.cpp Fixed Show fixed Hide fixed
SU2_CFD/src/output/CFlowCompOutput.cpp Fixed Show fixed Hide fixed
SU2_CFD/src/output/CFlowCompOutput.cpp Fixed Show fixed Hide fixed
SU2_CFD/include/output/CTurboOutput.hpp Fixed Show fixed Hide fixed
SU2_CFD/include/output/CTurboOutput.hpp Fixed Show fixed Hide fixed
SU2_CFD/include/output/CTurboOutput.hpp Fixed Show fixed Hide fixed
SU2_CFD/src/output/CFlowCompOutput.cpp Fixed Show fixed Hide fixed
SU2_CFD/include/output/CTurboOutput.hpp Fixed Show fixed Hide fixed
Comment on lines 623 to 868
file.width(30); file << "\"Relative Flow Angle[deg]\"";
file << endl;


for(iSpan = 0; iSpan < config[val_iZone]->GetnSpanWiseSections(); iSpan++){
const auto& BladePerf = BladePerformance.at(val_iZone).at(iSpan);

file.width(30); file << SpanWiseValuesIn[iSpan];
file.width(15); file << iSpan;
for (iDim = 0; iDim < geometry->GetnDim(); iDim++){
file.width(30); file << BladePerf->GetInletState().GetMach()[iDim];
}
file.width(30); file << BladePerf->GetInletState().GetMachValue();
for (iDim = 0; iDim < geometry->GetnDim(); iDim++){
file.width(30); file << BladePerf->GetInletState().GetVelocity()[iDim]*config[ZONE_0]->GetVelocity_Ref();
}
file.width(30); file << BladePerf->GetInletState().GetVelocityValue()*config[ZONE_0]->GetVelocity_Ref();
// This captures NaNs
if(isnan(BladePerf->GetInletState().GetAbsFlowAngle())){
file.width(30); file << "0.0000";
}
else {
file.width(30); file << BladePerf->GetInletState().GetAbsFlowAngle()*180.0/PI_NUMBER;
}
if(isnan(BladePerf->GetInletState().GetFlowAngle())){
file.width(30); file << "0.0000";
}
else{
file.width(30); file << BladePerf->GetInletState().GetFlowAngle()*180.0/PI_NUMBER;
}
file << endl;
}

file.close();

/*--- Writing Span wise outflow thermodynamic quantities. ---*/
spanwise_performance_filename = "TURBOMACHINERY/outflow_spanwise_kinematic_values.dat";
if (nZone > 1){
unsigned short lastindex = spanwise_performance_filename.find_last_of(".");
spanwise_performance_filename = spanwise_performance_filename.substr(0, lastindex);
SPRINTF (buffer, "_%d.dat", SU2_TYPE::Int(val_iZone));
spanwise_performance_filename.append(string(buffer));
}

file.open (spanwise_performance_filename.data(), ios::out | ios::trunc);
file.setf(ios::scientific);
file.precision(12);

file << "TITLE = \"Outflow Span-wise Kinematic Values. iOuterIter = " << iExtIter << " \"" << endl;
file << "VARIABLES =" << endl;

file.width(30); file << "\"SpanWise Value[m]\"";
file.width(15); file << "\"iSpan\"";
file.width(30); file << "\"Normal Mach[-]\"";
file.width(30); file << "\"Tangential Mach[-]\"";
if (geometry->GetnDim() == 3) {
file.width(30); file << "\"3rd Component Mach[-]\"";
};
file.width(30); file << "\"Mach Module[-]\"";
file.width(30); file << "\"Normal Velocity[m/s]\"";
file.width(30); file << "\"Tangential Velocity[m/s]\"";
if (geometry->GetnDim() == 3) {
file.width(30); file << "\"3rd Component Velocity[m/s]\"";
};
file.width(30); file << "\"Velocity Module[m/s]\"";
file.width(30); file << "\"Absolute Flow Angle[deg]\"";
file.width(30); file << "\"Relative Flow Angle[deg]\"";
file << endl;


for(iSpan = 0; iSpan < config[val_iZone]->GetnSpanWiseSections(); iSpan++){
const auto& BladePerf = BladePerformance.at(val_iZone).at(iSpan);

file.width(30); file << SpanWiseValuesOut[iSpan];
file.width(15); file << iSpan;
for (iDim = 0; iDim < geometry->GetnDim(); iDim++){
file.width(30); file << BladePerf->GetOutletState().GetMach()[iDim];
}
file.width(30); file << BladePerf->GetInletState().GetMachValue();
for (iDim = 0; iDim < geometry->GetnDim(); iDim++){
file.width(30); file << BladePerf->GetOutletState().GetVelocity()[iDim]*config[ZONE_0]->GetVelocity_Ref();
}
file.width(30); file << BladePerf->GetInletState().GetVelocityValue()*config[ZONE_0]->GetVelocity_Ref();
if(isnan(BladePerf->GetInletState().GetAbsFlowAngle())){
file.width(30); file << "0.0000";
}
else {
file.width(30); file << BladePerf->GetOutletState().GetAbsFlowAngle()*180.0/PI_NUMBER;
}
if(isnan(BladePerf->GetInletState().GetAbsFlowAngle())){
file.width(30); file << "0.0000";
}
else{
file.width(30); file << BladePerf->GetOutletState().GetFlowAngle()*180.0/PI_NUMBER;
}
file << endl;
}

file.close();
}

Check notice

Code scanning / CodeQL

Block with too many statements Note

Block with too many statements (4 complex statements in the block).
Common/include/option_structure.hpp Show resolved Hide resolved
TestCases/serial_regression.py Outdated Show resolved Hide resolved
TestCases/parallel_regression.py Outdated Show resolved Hide resolved
SU2_CFD/src/output/CFlowCompOutput.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/output/CFlowCompOutput.cpp Show resolved Hide resolved
SU2_CFD/src/drivers/CMultizoneDriver.cpp Outdated Show resolved Hide resolved
SU2_CFD/include/output/CTurboOutput.hpp Outdated Show resolved Hide resolved
SU2_CFD/include/output/CTurboOutput.hpp Outdated Show resolved Hide resolved
SU2_CFD/include/output/CTurboOutput.hpp Outdated Show resolved Hide resolved
SU2_CFD/include/iteration/CIteration.hpp Outdated Show resolved Hide resolved
@joshkellyjak joshkellyjak merged commit e554994 into develop Feb 7, 2024
30 of 31 checks passed
@joshkellyjak joshkellyjak deleted the new_turbo_outputs branch February 7, 2024 15:14
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.

5 participants