Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Common/include/basic_types/ad_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -937,9 +937,10 @@ void Finalize();

/*--- If we compile under OSX we have to overload some of the operators for
* complex numbers to avoid the use of the standard operators
* (they use a lot of functions that are only defined for doubles) ---*/
* (they use a lot of functions that are only defined for doubles).
* The MSVC STL needs the same overloads when su2double is an AD type. ---*/

#ifdef __APPLE__
#if defined(__APPLE__) || (defined(_MSC_VER) && (defined(CODI_REVERSE_TYPE) || defined(CODI_FORWARD_TYPE)))

namespace std {

Expand Down
8 changes: 4 additions & 4 deletions SU2_CFD/src/output/CFlowCompOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -792,13 +792,13 @@ void CFlowCompOutput::WriteTurboSpanwisePerformance(su2vector<std::shared_ptr<CT
}
file.width(30); file << BladePerf->GetInletState().GetVelocityValue()*config[ZONE_0]->GetVelocity_Ref();
// This captures NaNs
if(std::isnan(BladePerf->GetInletState().GetAbsFlowAngle())){
if(std::isnan(SU2_TYPE::GetValue(BladePerf->GetInletState().GetAbsFlowAngle()))){
file.width(30); file << "0.0000";
}
else {
file.width(30); file << BladePerf->GetInletState().GetAbsFlowAngle()*180.0/PI_NUMBER;
}
if(std::isnan(BladePerf->GetInletState().GetFlowAngle())){
if(std::isnan(SU2_TYPE::GetValue(BladePerf->GetInletState().GetFlowAngle()))){
file.width(30); file << "0.0000";
}
else{
Expand Down Expand Up @@ -855,13 +855,13 @@ void CFlowCompOutput::WriteTurboSpanwisePerformance(su2vector<std::shared_ptr<CT
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(std::isnan(BladePerf->GetInletState().GetAbsFlowAngle())){
if(std::isnan(SU2_TYPE::GetValue(BladePerf->GetOutletState().GetAbsFlowAngle()))){
file.width(30); file << "0.0000";
}
else {
file.width(30); file << BladePerf->GetOutletState().GetAbsFlowAngle()*180.0/PI_NUMBER;
}
if(std::isnan(BladePerf->GetInletState().GetAbsFlowAngle())){
if(std::isnan(SU2_TYPE::GetValue(BladePerf->GetOutletState().GetFlowAngle()))){
file.width(30); file << "0.0000";
}
else{
Expand Down
4 changes: 2 additions & 2 deletions SU2_CFD/src/solvers/CEulerSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9724,7 +9724,7 @@ void CEulerSolver::TurboAverageProcess(CSolver **solver, CGeometry *geometry, CC
for (auto iDim = 2; iDim < nDim +1;iDim++)
avgVelocity[iDim-1] = AverageFlux[iMarker][iSpan][iDim] / AverageFlux[iMarker][iSpan][0];

if (std::isnan(avgDensity) || std::isnan(avgPressure) || avgPressure < 0.0 || avgDensity < 0.0 ){
if (std::isnan(SU2_TYPE::GetValue(avgDensity)) || std::isnan(SU2_TYPE::GetValue(avgPressure)) || avgPressure < 0.0 || avgDensity < 0.0 ){
val_init_pressure = TotalAreaPressure / TotalArea;
MixedOut_Average (config, val_init_pressure, AverageFlux[iMarker][iSpan], AverageTurboNormal, avgPressure, avgDensity);
avgVelocity[0] = ( AverageFlux[iMarker][iSpan][1] - avgPressure) / AverageFlux[iMarker][iSpan][0];
Expand Down Expand Up @@ -9764,7 +9764,7 @@ void CEulerSolver::TurboAverageProcess(CSolver **solver, CGeometry *geometry, CC
AverageRelTangVelocity[iMarker][iSpan] = avgRelTangVel;

/* --- check if averaged quantities are correct otherwise reset the old quantities ---*/
const bool nanSolution = (std::isnan(AverageDensity[iMarker][iSpan]) || std::isnan(AveragePressure[iMarker][iSpan]));
const bool nanSolution = (std::isnan(SU2_TYPE::GetValue(AverageDensity[iMarker][iSpan])) || std::isnan(SU2_TYPE::GetValue(AveragePressure[iMarker][iSpan])));
const bool negSolution = (AverageDensity[iMarker][iSpan] < 0.0 || AveragePressure[iMarker][iSpan] < 0.0);
if (nanSolution || negSolution){
if (nanSolution)
Expand Down