@@ -640,15 +640,14 @@ vector<vector<su2double> > CSurfaceMovement::SetSurface_Deformation(CGeometry* g
640640 break ;
641641 }
642642 }
643-
643+
644644 /* --- HICKS_HENNE_CAMBER design variable ---*/
645-
645+
646646 if (config->GetDesign_Variable (0 ) == HICKS_HENNE_CAMBER) {
647647 SetHicksHenneCamber (geometry, config);
648648 }
649649 }
650650
651-
652651 /* --- NACA_4Digits design variable ---*/
653652
654653 else if (config->GetDesign_Variable (0 ) == NACA_4DIGITS) {
@@ -673,8 +672,6 @@ vector<vector<su2double> > CSurfaceMovement::SetSurface_Deformation(CGeometry* g
673672 if (rank == MASTER_NODE) cout << " No surface deformation (setting FFD)." << endl;
674673 }
675674
676-
677-
678675 /* --- Scale, Translate, and Rotate will be done with rigid mesh transforms. ---*/
679676
680677 else if ((config->GetDesign_Variable (0 ) == ROTATION) || (config->GetDesign_Variable (0 ) == TRANSLATION) ||
@@ -2770,8 +2767,6 @@ void CSurfaceMovement::SetHicksHenne(CGeometry* boundary, CConfig* config, unsig
27702767 }
27712768 }
27722769
2773-
2774-
27752770#ifdef HAVE_MPI
27762771
27772772 int iProcessor, nProcessor = size;
@@ -3711,8 +3706,8 @@ void CSurfaceMovement::SetHicksHenneCamber(CGeometry* boundary, CConfig* config)
37113706 unsigned long iVertex;
37123707 unsigned short iMarker, nDV_Camber = 0 ;
37133708 su2double VarCoord[3 ] = {0.0 , 0.0 , 0.0 }, VarCoordTrans[3 ] = {0.0 , 0.0 , 0.0 }, *CoordTrans, *NormalTrans, ek, fk,
3714- Coord[3 ] = {0.0 , 0.0 , 0.0 }, TPCoord[2 ] = {0.0 , 0.0 }, LPCoord[2 ] = {0.0 , 0.0 },
3715- USTPCoord[ 2 ] = { 0.0 , 0.0 }, LSTPCoord[2 ] = {0.0 , 0.0 }, Distance, Chord, AoA, ValCos, ValSin;
3709+ Coord[3 ] = {0.0 , 0.0 , 0.0 }, TPCoord[2 ] = {0.0 , 0.0 }, LPCoord[2 ] = {0.0 , 0.0 }, USTPCoord[ 2 ] = { 0.0 , 0.0 },
3710+ LSTPCoord[2 ] = {0.0 , 0.0 }, Distance, Chord, AoA, ValCos, ValSin;
37163711 vector<su2double> positions, values, X_Coord_upper, Y_Coord_upper, X_Coord_lower, Y_Coord_lower;
37173712
37183713 // --- Check if the type of design variables is only HICKS_HENNE_CAMBER ---// // TODO: Extend to CAMBER + THICKNESS
@@ -3728,16 +3723,15 @@ void CSurfaceMovement::SetHicksHenneCamber(CGeometry* boundary, CConfig* config)
37283723 values.resize (nDV_Camber);
37293724
37303725 /* --- Collect the values of the Hicks-Henne camber design variables ---*/
3731- for (unsigned short iDV = 0 , counter = 0 ; iDV < config->GetnDV (); iDV++){
3726+ for (unsigned short iDV = 0 , counter = 0 ; iDV < config->GetnDV (); iDV++) {
37323727 if (config->GetDesign_Variable (iDV) == HICKS_HENNE_CAMBER) {
3733- positions[counter] = config->GetParamDV (iDV, 0 ); /* --- Position of the camber point as a fraction of the chord ---*/
3728+ positions[counter] =
3729+ config->GetParamDV (iDV, 0 ); /* --- Position of the camber point as a fraction of the chord ---*/
37343730 values[counter] = config->GetDV_Value (iDV); /* --- Value of the deformation ---*/
37353731 counter++;
37363732 }
37373733 }
37383734
3739-
3740-
37413735 /* --- Compute the angle of attack, Leading-edge (LP) and Trailing-edge (TP) point.
37423736 We do this for upper and lower surface separately to detect blunt trailing edges ---*/
37433737
@@ -3750,7 +3744,7 @@ void CSurfaceMovement::SetHicksHenneCamber(CGeometry* boundary, CConfig* config)
37503744 USTPCoord[1 ] = CoordTrans[1 ];
37513745 for (iVertex = 1 ; iVertex < boundary->nVertex [iMarker]; iVertex++) {
37523746 CoordTrans = boundary->vertex [iMarker][iVertex]->GetCoord ();
3753- NormalTrans = boundary->vertex [iMarker][0 ]->GetNormal ();
3747+ NormalTrans = boundary->vertex [iMarker][0 ]->GetNormal ();
37543748 if ((CoordTrans[0 ] > TPCoord[0 ]) && (abs (NormalTrans[1 ]) > abs (NormalTrans[0 ]))) {
37553749 if (NormalTrans[1 ] >= 0.0 ) {
37563750 USTPCoord[0 ] = CoordTrans[0 ];
@@ -3785,37 +3779,37 @@ void CSurfaceMovement::SetHicksHenneCamber(CGeometry* boundary, CConfig* config)
37853779 LPCoord[1 ] = CoordTrans[1 ];
37863780 }
37873781 }
3788- }
3782+ }
37893783 }
3790-
3784+
37913785 AoA = atan ((LPCoord[1 ] - TPCoord[1 ]) / (TPCoord[0 ] - LPCoord[0 ])) * 180 / PI_NUMBER;
3792-
3793- /* --- Apply deformation based on the camberline Hicks-Henne deformation and the existing airfoil thickness distribution ---*/
3786+
3787+ /* --- Apply deformation based on the camberline Hicks-Henne deformation and the existing airfoil thickness
3788+ * distribution ---*/
37943789 for (iMarker = 0 ; iMarker < config->GetnMarker_All (); iMarker++) {
37953790 for (iVertex = 0 ; iVertex < boundary->nVertex [iMarker]; iVertex++) {
37963791 if (config->GetMarker_All_DV (iMarker) == YES) {
37973792 CoordTrans = boundary->vertex [iMarker][iVertex]->GetCoord ();
37983793 NormalTrans = boundary->vertex [iMarker][iVertex]->GetNormal ();
3799-
3794+
38003795 ValCos = cos (AoA * PI_NUMBER / 180.0 );
3801- ValSin = sin (AoA * PI_NUMBER / 180.0 );
3796+ ValSin = sin (AoA * PI_NUMBER / 180.0 );
38023797
38033798 /* --- Transform the coordinates ---*/
38043799 Coord[0 ] = (CoordTrans[0 ] - LPCoord[0 ]) * ValCos - (CoordTrans[1 ] - LPCoord[1 ]) * ValSin;
38053800 Coord[0 ] = max (0.0 , Coord[0 ]); // Coord x should be always positive
38063801 Coord[1 ] = (CoordTrans[1 ] - LPCoord[1 ]) * ValCos + (CoordTrans[0 ] - LPCoord[0 ]) * ValSin;
38073802
38083803 /* --- Special case: surface point is part of trailing edge ---*/
3809- if (Coord[0 ] > 0.99 ) {
3804+ if (Coord[0 ] > 0.99 ) {
38103805 continue ;
3811- }
3806+ }
38123807
38133808 /* --- Compute the Hicks-Henne bumps ---*/
38143809 fk = 0.0 ;
38153810 for (unsigned short iDV = 0 ; iDV < nDV_Camber; iDV++) {
38163811 ek = log10 (0.5 ) / log10 (positions[iDV]);
3817- if (Coord[0 ] > 10 * EPS)
3818- fk += pow (sin (PI_NUMBER * pow (Coord[0 ], ek)), 3 ) * values[iDV];
3812+ if (Coord[0 ] > 10 * EPS) fk += pow (sin (PI_NUMBER * pow (Coord[0 ], ek)), 3 ) * values[iDV];
38193813 }
38203814 VarCoord[1 ] = fk;
38213815 }
0 commit comments