Skip to content

Commit 4492229

Browse files
committed
redundant operations
1 parent 371d912 commit 4492229

1 file changed

Lines changed: 9 additions & 28 deletions

File tree

SU2_CFD/src/solvers/CEulerSolver.cpp

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4316,39 +4316,21 @@ void CEulerSolver::SetFarfield_AoA(CGeometry *geometry, CSolver **solver_contain
43164316

43174317
AoA *= PI_NUMBER/180.0;
43184318

4319-
/*--- Update the freestream velocity vector at the farfield ---*/
4319+
/*--- Update the freestream velocity vector at the farfield
4320+
* Compute the new freestream velocity with the updated AoA,
4321+
* "Velocity_Inf" is shared with config... ---*/
43204322

4321-
su2double Vel_Infty[MAXNDIM]={0.0};
4322-
4323-
for (auto iDim = 0u; iDim < nDim; iDim++)
4324-
Vel_Infty[iDim] = GetVelocity_Inf(iDim);
4325-
4326-
const su2double Vel_Infty_Mag = GeometryToolbox::Norm(int(MAXNDIM), Vel_Infty);
4327-
4328-
/*--- Compute the new freestream velocity with the updated AoA ---*/
4323+
const su2double Vel_Infty_Mag = GeometryToolbox::Norm(nDim, Velocity_Inf);
43294324

43304325
if (nDim == 2) {
4331-
Vel_Infty[0] = cos(AoA)*Vel_Infty_Mag;
4332-
Vel_Infty[1] = sin(AoA)*Vel_Infty_Mag;
4326+
Velocity_Inf[0] = cos(AoA)*Vel_Infty_Mag;
4327+
Velocity_Inf[1] = sin(AoA)*Vel_Infty_Mag;
43334328
}
43344329
else {
4335-
Vel_Infty[0] = cos(AoA)*cos(AoS)*Vel_Infty_Mag;
4336-
Vel_Infty[1] = sin(AoS)*Vel_Infty_Mag;
4337-
Vel_Infty[2] = sin(AoA)*cos(AoS)*Vel_Infty_Mag;
4330+
Velocity_Inf[0] = cos(AoA)*cos(AoS)*Vel_Infty_Mag;
4331+
Velocity_Inf[1] = sin(AoS)*Vel_Infty_Mag;
4332+
Velocity_Inf[2] = sin(AoA)*cos(AoS)*Vel_Infty_Mag;
43384333
}
4339-
4340-
/*--- Store the new freestream velocity vector for the next iteration ---*/
4341-
4342-
for (auto iDim = 0u; iDim < nDim; iDim++)
4343-
Velocity_Inf[iDim] = Vel_Infty[iDim];
4344-
4345-
/*--- Only the fine mesh stores the updated values for velocity in config ---*/
4346-
4347-
if (iMesh == MESH_0) {
4348-
for (auto iDim = 0u; iDim < nDim; iDim++)
4349-
config->SetVelocity_FreeStreamND(Vel_Infty[iDim], iDim);
4350-
}
4351-
43524334
}
43534335
}
43544336

@@ -4441,7 +4423,6 @@ bool CEulerSolver::FixedCL_Convergence(CConfig* config, bool convergence) {
44414423
if (convergence && (curr_iter - Iter_Update_AoA) > config->GetStartConv_Iter())
44424424
End_AoA_FD = true;
44434425

4444-
44454426
/* --- If Finite Difference mode is ending, reset AoA and calculate Coefficient Gradients --- */
44464427

44474428
if (End_AoA_FD){

0 commit comments

Comments
 (0)