@@ -640,15 +640,14 @@ vector<vector<su2double> > CSurfaceMovement::SetSurface_Deformation(CGeometry* g
640
640
break ;
641
641
}
642
642
}
643
-
643
+
644
644
/* --- HICKS_HENNE_CAMBER design variable ---*/
645
-
645
+
646
646
if (config->GetDesign_Variable (0 ) == HICKS_HENNE_CAMBER) {
647
647
SetHicksHenneCamber (geometry, config);
648
648
}
649
649
}
650
650
651
-
652
651
/* --- NACA_4Digits design variable ---*/
653
652
654
653
else if (config->GetDesign_Variable (0 ) == NACA_4DIGITS) {
@@ -673,8 +672,6 @@ vector<vector<su2double> > CSurfaceMovement::SetSurface_Deformation(CGeometry* g
673
672
if (rank == MASTER_NODE) cout << " No surface deformation (setting FFD)." << endl;
674
673
}
675
674
676
-
677
-
678
675
/* --- Scale, Translate, and Rotate will be done with rigid mesh transforms. ---*/
679
676
680
677
else if ((config->GetDesign_Variable (0 ) == ROTATION) || (config->GetDesign_Variable (0 ) == TRANSLATION) ||
@@ -2770,8 +2767,6 @@ void CSurfaceMovement::SetHicksHenne(CGeometry* boundary, CConfig* config, unsig
2770
2767
}
2771
2768
}
2772
2769
2773
-
2774
-
2775
2770
#ifdef HAVE_MPI
2776
2771
2777
2772
int iProcessor, nProcessor = size;
@@ -3711,8 +3706,8 @@ void CSurfaceMovement::SetHicksHenneCamber(CGeometry* boundary, CConfig* config)
3711
3706
unsigned long iVertex;
3712
3707
unsigned short iMarker, nDV_Camber = 0 ;
3713
3708
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;
3716
3711
vector<su2double> positions, values, X_Coord_upper, Y_Coord_upper, X_Coord_lower, Y_Coord_lower;
3717
3712
3718
3713
// --- 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)
3728
3723
values.resize (nDV_Camber);
3729
3724
3730
3725
/* --- 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++) {
3732
3727
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 ---*/
3734
3730
values[counter] = config->GetDV_Value (iDV); /* --- Value of the deformation ---*/
3735
3731
counter++;
3736
3732
}
3737
3733
}
3738
3734
3739
-
3740
-
3741
3735
/* --- Compute the angle of attack, Leading-edge (LP) and Trailing-edge (TP) point.
3742
3736
We do this for upper and lower surface separately to detect blunt trailing edges ---*/
3743
3737
@@ -3750,7 +3744,7 @@ void CSurfaceMovement::SetHicksHenneCamber(CGeometry* boundary, CConfig* config)
3750
3744
USTPCoord[1 ] = CoordTrans[1 ];
3751
3745
for (iVertex = 1 ; iVertex < boundary->nVertex [iMarker]; iVertex++) {
3752
3746
CoordTrans = boundary->vertex [iMarker][iVertex]->GetCoord ();
3753
- NormalTrans = boundary->vertex [iMarker][0 ]->GetNormal ();
3747
+ NormalTrans = boundary->vertex [iMarker][0 ]->GetNormal ();
3754
3748
if ((CoordTrans[0 ] > TPCoord[0 ]) && (abs (NormalTrans[1 ]) > abs (NormalTrans[0 ]))) {
3755
3749
if (NormalTrans[1 ] >= 0.0 ) {
3756
3750
USTPCoord[0 ] = CoordTrans[0 ];
@@ -3785,37 +3779,37 @@ void CSurfaceMovement::SetHicksHenneCamber(CGeometry* boundary, CConfig* config)
3785
3779
LPCoord[1 ] = CoordTrans[1 ];
3786
3780
}
3787
3781
}
3788
- }
3782
+ }
3789
3783
}
3790
-
3784
+
3791
3785
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 ---*/
3794
3789
for (iMarker = 0 ; iMarker < config->GetnMarker_All (); iMarker++) {
3795
3790
for (iVertex = 0 ; iVertex < boundary->nVertex [iMarker]; iVertex++) {
3796
3791
if (config->GetMarker_All_DV (iMarker) == YES) {
3797
3792
CoordTrans = boundary->vertex [iMarker][iVertex]->GetCoord ();
3798
3793
NormalTrans = boundary->vertex [iMarker][iVertex]->GetNormal ();
3799
-
3794
+
3800
3795
ValCos = cos (AoA * PI_NUMBER / 180.0 );
3801
- ValSin = sin (AoA * PI_NUMBER / 180.0 );
3796
+ ValSin = sin (AoA * PI_NUMBER / 180.0 );
3802
3797
3803
3798
/* --- Transform the coordinates ---*/
3804
3799
Coord[0 ] = (CoordTrans[0 ] - LPCoord[0 ]) * ValCos - (CoordTrans[1 ] - LPCoord[1 ]) * ValSin;
3805
3800
Coord[0 ] = max (0.0 , Coord[0 ]); // Coord x should be always positive
3806
3801
Coord[1 ] = (CoordTrans[1 ] - LPCoord[1 ]) * ValCos + (CoordTrans[0 ] - LPCoord[0 ]) * ValSin;
3807
3802
3808
3803
/* --- Special case: surface point is part of trailing edge ---*/
3809
- if (Coord[0 ] > 0.99 ) {
3804
+ if (Coord[0 ] > 0.99 ) {
3810
3805
continue ;
3811
- }
3806
+ }
3812
3807
3813
3808
/* --- Compute the Hicks-Henne bumps ---*/
3814
3809
fk = 0.0 ;
3815
3810
for (unsigned short iDV = 0 ; iDV < nDV_Camber; iDV++) {
3816
3811
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];
3819
3813
}
3820
3814
VarCoord[1 ] = fk;
3821
3815
}
0 commit comments