Skip to content

Commit 8fc25db

Browse files
authored
FIX: handle zero dynamic pressure in reference value calculation (#2666)
1 parent bf255b7 commit 8fc25db

3 files changed

Lines changed: 15 additions & 0 deletions

File tree

SU2_CFD/src/solvers/CEulerSolver.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,6 +1445,11 @@ void CEulerSolver::SetReferenceValues(const CConfig& config) {
14451445
}
14461446

14471447
DynamicPressureRef = 0.5 * Density_Inf * RefVel2;
1448+
1449+
if (DynamicPressureRef < EPS) {
1450+
DynamicPressureRef = 1.0;
1451+
}
1452+
14481453
AeroCoeffForceRef = DynamicPressureRef * config.GetRefArea();
14491454

14501455
}

SU2_CFD/src/solvers/CIncEulerSolver.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,11 @@ void CIncEulerSolver::SetReferenceValues(const CConfig& config) {
945945
}
946946

947947
DynamicPressureRef = 0.5 * RefDensity * RefVel2;
948+
949+
if (DynamicPressureRef < EPS) {
950+
DynamicPressureRef = 1.0;
951+
}
952+
948953
AeroCoeffForceRef = DynamicPressureRef * config.GetRefArea();
949954

950955
}

SU2_CFD/src/solvers/CNEMOEulerSolver.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,6 +1387,11 @@ void CNEMOEulerSolver::SetNondimensionalization(CConfig *config, unsigned short
13871387
void CNEMOEulerSolver::SetReferenceValues(const CConfig& config) {
13881388

13891389
DynamicPressureRef = 0.5 * Density_Inf * GeometryToolbox::SquaredNorm(nDim, Velocity_Inf);
1390+
1391+
if (DynamicPressureRef < EPS) {
1392+
DynamicPressureRef = 1.0;
1393+
}
1394+
13901395
AeroCoeffForceRef = DynamicPressureRef * config.GetRefArea();
13911396

13921397
}

0 commit comments

Comments
 (0)