Skip to content

Commit eb8a6ec

Browse files
committed
Restore 2D gusts
1 parent 4ca5281 commit eb8a6ec

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

SU2_CFD/src/iteration/CFluidIteration.cpp

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,8 @@ void CFluidIteration::SetWind_GustField(CConfig* config, CGeometry** geometry, C
364364
su2double loc_x = (xbegin + L + Uinf * (Physical_t - tbegin));
365365
if (rank == MASTER_NODE) cout << " Location_x = " << loc_x << endl;
366366

367-
GustDer = new su2double[4];
368-
for (unsigned short i = 0; i < 4; i++) {
367+
GustDer = new su2double[nDim+1];
368+
for (unsigned short i = 0; i < nDim+1; i++) {
369369
GustDer[i] = 0.0;
370370
}
371371

@@ -477,11 +477,17 @@ void CFluidIteration::SetWind_GustField(CConfig* config, CGeometry** geometry, C
477477
}
478478

479479
/*--- Set the Wind Gust, Wind Gust Derivatives and the Grid Velocities ---*/
480-
481-
GustDer[0] = dgust_dx;
482-
GustDer[1] = dgust_dy;
483-
GustDer[2] = dgust_dz;
484-
GustDer[3] = dgust_dt;
480+
if (nDim = 2) {
481+
GustDer[0] = dgust_dx;
482+
GustDer[1] = dgust_dy;
483+
GustDer[2] = dgust_dt;
484+
}
485+
else {
486+
GustDer[0] = dgust_dx;
487+
GustDer[1] = dgust_dy;
488+
GustDer[2] = dgust_dz;
489+
GustDer[3] = dgust_dt;
490+
}
485491
// 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.
486492
solver[iMGlevel][FLOW_SOL]->GetNodes()->SetWindGust(iPoint, Gust);
487493
solver[iMGlevel][FLOW_SOL]->GetNodes()->SetWindGustDer(iPoint, GustDer);

0 commit comments

Comments
 (0)