Skip to content

Commit 2259d67

Browse files
committed
- Implemented style suggestions from CodeFactor, no functional change
- Removed commented out code / warning messages w.r.t 2D gusts only
1 parent 1c1cfff commit 2259d67

2 files changed

Lines changed: 17 additions & 22 deletions

File tree

SU2_CFD/src/iteration/CFluidIteration.cpp

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -318,12 +318,7 @@ void CFluidIteration::SetWind_GustField(CConfig* config, CGeometry** geometry, C
318318
// derivatives needed for the source term are calculated when applicable. If the gust derivatives are zero the source
319319
// term is also zero. The source term itself is implemented in the class CSourceWindGust
320320

321-
unsigned short iDim, nDim = geometry[MESH_0]->GetnDim(); // We assume nDim = 2
322-
// if (nDim != 2) {
323-
// if (rank == MASTER_NODE) {
324-
// cout << endl << "WARNING - Wind Gust capability is only verified for 2 dimensional simulations." << endl;
325-
// }
326-
// }
321+
unsigned short iDim, nDim = geometry[MESH_0]->GetnDim();
327322

328323
/*--- Gust Parameters from config ---*/
329324
unsigned short Gust_Type = config->GetGust_Type();
@@ -477,16 +472,16 @@ void CFluidIteration::SetWind_GustField(CConfig* config, CGeometry** geometry, C
477472
}
478473

479474
/*--- Set the Wind Gust, Wind Gust Derivatives and the Grid Velocities ---*/
480-
if (nDim = 2) {
481-
GustDer[0] = dgust_dx;
482-
GustDer[1] = dgust_dy;
483-
GustDer[2] = dgust_dt;
475+
if (nDim == 2) {
476+
GustDer[0] = dgust_dx;
477+
GustDer[1] = dgust_dy;
478+
GustDer[2] = dgust_dt;
484479
}
485480
else {
486-
GustDer[0] = dgust_dx;
487-
GustDer[1] = dgust_dy;
488-
GustDer[2] = dgust_dz;
489-
GustDer[3] = dgust_dt;
481+
GustDer[0] = dgust_dx;
482+
GustDer[1] = dgust_dy;
483+
GustDer[2] = dgust_dz;
484+
GustDer[3] = dgust_dt;
490485
}
491486
// I think we don't need to set any source terms because they depend on the derivatives, which are zero in all cases from above.
492487
solver[iMGlevel][FLOW_SOL]->GetNodes()->SetWindGust(iPoint, Gust);

SU2_CFD/src/numerics/flow/flow_sources.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -783,14 +783,14 @@ CNumerics::ResidualType<> CSourceWindGust::ComputeResidual(const CConfig* config
783783
residual[2] = smy*Volume;
784784
//residual[3] = smz*Volume;
785785
residual[3] = se*Volume;
786-
} else {
787-
// SU2_MPI::Error("You should only be in the gust source term in two dimensions", CURRENT_FUNCTION);
788-
residual[0] = 0.0;
789-
residual[1] = 0.0;
790-
residual[2] = 0.0;
791-
residual[3] = 0.0;
792-
residual[4] = 0.0;
793-
}
786+
}
787+
else {
788+
residual[0] = 0.0;
789+
residual[1] = 0.0;
790+
residual[2] = 0.0;
791+
residual[3] = 0.0;
792+
residual[4] = 0.0;
793+
}
794794

795795
/*--- For now the source term Jacobian is just set to zero ---*/
796796
//bool implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT);

0 commit comments

Comments
 (0)