Skip to content

Commit

Permalink
fix unused variables/parameters in OpenfastFSI
Browse files Browse the repository at this point in the history
  • Loading branch information
tasmith4 committed Aug 26, 2024
1 parent fa04d36 commit e31b9bb
Showing 1 changed file with 29 additions and 31 deletions.
60 changes: 29 additions & 31 deletions src/aero/fsi/OpenfastFSI.C
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,8 @@ OpenfastFSI::bcast_turbine_params(int iTurb)
tDoubleParams[3 + i] = fsiTurbineData_[iTurb]->params_.TurbineHubPos[i];
}
}
int iError =
MPI_Bcast(tIntParams.data(), 7, MPI_INT, turbProc, bulk_->parallel());
iError =
MPI_Bcast(tDoubleParams.data(), 6, MPI_DOUBLE, turbProc, bulk_->parallel());
MPI_Bcast(tIntParams.data(), 7, MPI_INT, turbProc, bulk_->parallel());
MPI_Bcast(tDoubleParams.data(), 6, MPI_DOUBLE, turbProc, bulk_->parallel());

if (bulk_->parallel_rank() != turbProc) {
fsiTurbineData_[iTurb]->params_.TurbID = tIntParams[0];
Expand Down Expand Up @@ -351,25 +349,25 @@ OpenfastFSI::compute_mapping()
FAST.getBladeChord(fsiTurbineData_[i]->brFSIdata_.bld_chord.data(), i);
}

int iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.twr_ref_pos.data(),
(fsiTurbineData_[i]->params_.nBRfsiPtsTwr) * 6, MPI_DOUBLE, turbProc,
bulk_->parallel());
int nTotBldNodes = fsiTurbineData_[i]->params_.nTotBRfsiPtsBlade;
int nBlades = fsiTurbineData_[i]->params_.numBlades;
iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.bld_ref_pos.data(), nTotBldNodes * 6,
MPI_DOUBLE, turbProc, bulk_->parallel());
iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.bld_root_ref_pos.data(), nBlades * 6,
MPI_DOUBLE, turbProc, bulk_->parallel());
iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.hub_ref_pos.data(), 6, MPI_DOUBLE,
turbProc, bulk_->parallel());
iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.nac_ref_pos.data(), 6, MPI_DOUBLE,
turbProc, bulk_->parallel());
iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.bld_rloc.data(), nTotBldNodes,
MPI_DOUBLE, turbProc, bulk_->parallel());
// No need to bcast chord
Expand Down Expand Up @@ -397,7 +395,7 @@ OpenfastFSI::predict_struct_timestep(const double curTime)
}

void
OpenfastFSI::advance_struct_timestep(const double curTime)
OpenfastFSI::advance_struct_timestep(const double /* curTime */)
{

timer_start(openFastTimer_);
Expand All @@ -414,7 +412,7 @@ OpenfastFSI::advance_struct_timestep(const double curTime)
}

void
OpenfastFSI::send_loads(const double curTime)
OpenfastFSI::send_loads(const double /* curTime */)
{

int nTurbinesGlob = FAST.get_nTurbinesGlob();
Expand All @@ -426,7 +424,7 @@ OpenfastFSI::send_loads(const double curTime)

int nTotBldNodes = fsiTurbineData_[i]->params_.nTotBRfsiPtsBlade;
if (bulk_->parallel_rank() == turbProc) {
int iError = MPI_Reduce(
MPI_Reduce(
MPI_IN_PLACE, fsiTurbineData_[i]->brFSIdata_.twr_ld.data(),
(fsiTurbineData_[i]->params_.nBRfsiPtsTwr) * 6, MPI_DOUBLE, MPI_SUM,
turbProc, bulk_->parallel());
Expand All @@ -435,7 +433,7 @@ OpenfastFSI::send_loads(const double curTime)
fsiTurbineData_[i]->brFSIdata_.twr_ld[k];
FAST.setTowerForces(fsiTurbineData_[i]->brFSIdata_.twr_ld, i);

iError = MPI_Reduce(
MPI_Reduce(
MPI_IN_PLACE, fsiTurbineData_[i]->brFSIdata_.bld_ld.data(),
nTotBldNodes * 6, MPI_DOUBLE, MPI_SUM, turbProc, bulk_->parallel());
for (int k = 0; k < nTotBldNodes * 6; k++)
Expand All @@ -445,11 +443,11 @@ OpenfastFSI::send_loads(const double curTime)
FAST.setBladeForces(fsiTurbineData_[i]->brFSIdata_.bld_ld, i);

} else {
int iError = MPI_Reduce(
MPI_Reduce(
fsiTurbineData_[i]->brFSIdata_.twr_ld.data(), NULL,
(fsiTurbineData_[i]->params_.nBRfsiPtsTwr) * 6, MPI_DOUBLE, MPI_SUM,
turbProc, bulk_->parallel());
iError = MPI_Reduce(
MPI_Reduce(
fsiTurbineData_[i]->brFSIdata_.bld_ld.data(), NULL,
(nTotBldNodes) * 6, MPI_DOUBLE, MPI_SUM, turbProc, bulk_->parallel());
}
Expand All @@ -458,7 +456,7 @@ OpenfastFSI::send_loads(const double curTime)
}

void
OpenfastFSI::get_displacements(double current_time)
OpenfastFSI::get_displacements(double /* current_time */)
{

int nTurbinesGlob = FAST.get_nTurbinesGlob();
Expand All @@ -484,38 +482,38 @@ OpenfastFSI::get_displacements(double current_time)
fsiTurbineData_[i]->brFSIdata_.nac_vel.data(), i);
}

int iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.twr_def.data(),
(fsiTurbineData_[i]->params_.nBRfsiPtsTwr) * 6, MPI_DOUBLE, turbProc,
bulk_->parallel());
int numBlades = fsiTurbineData_[i]->params_.numBlades;
int nTotBldNodes = fsiTurbineData_[i]->params_.nTotBRfsiPtsBlade;
iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.bld_def.data(), nTotBldNodes * 6,
MPI_DOUBLE, turbProc, bulk_->parallel());
iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.bld_root_def.data(), numBlades * 6,
MPI_DOUBLE, turbProc, bulk_->parallel());
iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.bld_pitch.data(), numBlades, MPI_DOUBLE,
turbProc, bulk_->parallel());
iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.hub_def.data(), 6, MPI_DOUBLE, turbProc,
bulk_->parallel());
iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.nac_def.data(), 6, MPI_DOUBLE, turbProc,
bulk_->parallel());
iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.twr_vel.data(),
(fsiTurbineData_[i]->params_.nBRfsiPtsTwr) * 6, MPI_DOUBLE, turbProc,
bulk_->parallel());
iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.bld_vel.data(), nTotBldNodes * 6,
MPI_DOUBLE, turbProc, bulk_->parallel());
iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.hub_vel.data(), 6, MPI_DOUBLE, turbProc,
bulk_->parallel());
iError = MPI_Bcast(
MPI_Bcast(
fsiTurbineData_[i]->brFSIdata_.nac_vel.data(), 6, MPI_DOUBLE, turbProc,
bulk_->parallel());

Expand Down Expand Up @@ -651,19 +649,19 @@ OpenfastFSI::map_loads(const int tStep, const double curTime)
fsiTurbineData_[i]->mapLoads();
int nTotBldNodes = fsiTurbineData_[i]->params_.nTotBRfsiPtsBlade;
if (bulk_->parallel_rank() == turbProc) {
int iError = MPI_Reduce(
MPI_Reduce(
MPI_IN_PLACE, fsiTurbineData_[i]->brFSIdata_.twr_ld.data(),
(fsiTurbineData_[i]->params_.nBRfsiPtsTwr) * 6, MPI_DOUBLE, MPI_SUM,
turbProc, bulk_->parallel());
iError = MPI_Reduce(
MPI_Reduce(
MPI_IN_PLACE, fsiTurbineData_[i]->brFSIdata_.bld_ld.data(),
nTotBldNodes * 6, MPI_DOUBLE, MPI_SUM, turbProc, bulk_->parallel());
} else {
int iError = MPI_Reduce(
MPI_Reduce(
fsiTurbineData_[i]->brFSIdata_.twr_ld.data(), NULL,
(fsiTurbineData_[i]->params_.nBRfsiPtsTwr) * 6, MPI_DOUBLE, MPI_SUM,
turbProc, bulk_->parallel());
iError = MPI_Reduce(
MPI_Reduce(
fsiTurbineData_[i]->brFSIdata_.bld_ld.data(), NULL,
(nTotBldNodes) * 6, MPI_DOUBLE, MPI_SUM, turbProc, bulk_->parallel());
}
Expand Down

0 comments on commit e31b9bb

Please sign in to comment.