-
Notifications
You must be signed in to change notification settings - Fork 843
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
New turbo ouputs #2011
Conversation
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.
CodeQL found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.
…to new_turbo_outputs
…to new_turbo_outputs
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.
Code looks good, just trying to trim down the interface if possible
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
…to new_turbo_outputs
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
pre-commit run --all
to format old commits.