Skip to content

Commit 3463cd2

Browse files
committed
Added HICKS_HENNE_CAMBER as design parameter option for 2D Airfoil; Thickness distribution is kept accoring to provided reference geometry.
1 parent 5627e49 commit 3463cd2

File tree

8 files changed

+174
-6
lines changed

8 files changed

+174
-6
lines changed

Common/include/geometry/CPhysicalGeometry.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -620,15 +620,15 @@ class CPhysicalGeometry final : public CGeometry {
620620

621621
/*!
622622
* \brief Compute the maximum thickness of an airfoil.
623-
* \return Maximum thickness at a particular seccion.
623+
* \return Maximum thickness at a particular section.
624624
*/
625625
su2double Compute_MaxThickness(su2double* Plane_P0, su2double* Plane_Normal, CConfig* config,
626626
vector<su2double>& Xcoord_Airfoil, vector<su2double>& Ycoord_Airfoil,
627627
vector<su2double>& Zcoord_Airfoil) override;
628628

629629
/*!
630630
* \brief Compute the twist of an airfoil.
631-
* \return Twist at a particular seccion.
631+
* \return Twist at a particular section.
632632
*/
633633
su2double Compute_Twist(su2double* Plane_P0, su2double* Plane_Normal, vector<su2double>& Xcoord_Airfoil,
634634
vector<su2double>& Ycoord_Airfoil, vector<su2double>& Zcoord_Airfoil) override;
@@ -708,7 +708,7 @@ class CPhysicalGeometry final : public CGeometry {
708708

709709
/*!
710710
* \brief Compute the dihedral of a wing.
711-
* \return Dihedral at a particular seccion.
711+
* \return Dihedral at a particular section.
712712
*/
713713
su2double Compute_Dihedral(su2double* LeadingEdge_im1, su2double* TrailingEdge_im1, su2double* LeadingEdge_i,
714714
su2double* TrailingEdge_i) override;

Common/include/grid_movement/CSurfaceMovement.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ class CSurfaceMovement : public CGridMovement {
9595
*/
9696
void SetCST(CGeometry* boundary, CConfig* config, unsigned short iDV, bool ResetDef);
9797

98+
/*!
99+
* \brief Set a Hicks-Henne deformation bump function on the camberline of an airfoil.
100+
* \param[in] boundary - Geometry of the boundary.
101+
* \param[in] config - Definition of the particular problem.
102+
*/
103+
void SetHicksHenneCamber(CGeometry* boundary, CConfig* config);
104+
98105
/*!
99106
* \brief Set a NACA 4 digits airfoil family for airfoil deformation.
100107
* \param[in] boundary - Geometry of the boundary.

Common/include/option_structure.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2287,6 +2287,7 @@ enum ENUM_PARAM {
22872287
CST = 34, /*!< \brief CST method with Kulfan parameters for airfoil deformation. */
22882288
SURFACE_BUMP = 35, /*!< \brief Surfacebump function for flat surfaces deformation. */
22892289
SURFACE_FILE = 36, /*!< \brief Nodal coordinates for surface set using a file (external parameterization). */
2290+
HICKS_HENNE_CAMBER = 37, /*!< \brief Hicks-Henne bump function for camber line deformation. */
22902291
DV_EFIELD = 40, /*!< \brief Electric field in deformable membranes. */
22912292
DV_YOUNG = 41,
22922293
DV_POISSON = 42,
@@ -2304,6 +2305,7 @@ static const MapType<std::string, ENUM_PARAM> Param_Map = {
23042305
MakePair("FFD_CAMBER_2D", FFD_CAMBER_2D)
23052306
MakePair("FFD_THICKNESS_2D", FFD_THICKNESS_2D)
23062307
MakePair("HICKS_HENNE", HICKS_HENNE)
2308+
MakePair("HICKS_HENNE_CAMBER", HICKS_HENNE_CAMBER)
23072309
MakePair("SURFACE_BUMP", SURFACE_BUMP)
23082310
MakePair("ANGLE_OF_ATTACK", ANGLE_OF_ATTACK)
23092311
MakePair("NACA_4DIGITS", NACA_4DIGITS)

Common/include/option_structure.inl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
* License along with SU2. If not, see <http://www.gnu.org/licenses/>.
2727
*/
2828

29+
#include "option_structure.hpp"
2930
#include "parallelization/mpi_structure.hpp"
3031
using namespace std;
3132

@@ -570,6 +571,9 @@ class COptionDVParam : public COptionBase {
570571
case HICKS_HENNE:
571572
nParamDV[iDV] = 2;
572573
break;
574+
case HICKS_HENNE_CAMBER:
575+
nParamDV[iDV] = 1;
576+
break;
573577
case SURFACE_BUMP:
574578
nParamDV[iDV] = 3;
575579
break;

Common/src/CConfig.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2358,6 +2358,7 @@ void CConfig::SetConfig_Options() {
23582358
- FFD_CAMBER_2D ( FFDBox ID, i_Ind )
23592359
- FFD_THICKNESS_2D ( FFDBox ID, i_Ind )
23602360
- HICKS_HENNE ( Lower Surface (0)/Upper Surface (1)/Only one Surface (2), x_Loc )
2361+
- HICKS_HENNE_CAMBER ( x_Loc )
23612362
- SURFACE_BUMP ( x_start, x_end, x_Loc )
23622363
- CST ( Lower Surface (0)/Upper Surface (1), Kulfan parameter number, Total number of Kulfan parameters for surface )
23632364
- NACA_4DIGITS ( 1st digit, 2nd digit, 3rd and 4th digit )
@@ -6654,6 +6655,7 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) {
66546655
case FFD_CAMBER_2D: cout << "FFD 2D (camber) <-> "; break;
66556656
case FFD_THICKNESS_2D: cout << "FFD 2D (thickness) <-> "; break;
66566657
case HICKS_HENNE: cout << "Hicks Henne <-> " ; break;
6658+
case HICKS_HENNE_CAMBER: cout << "Hicks Henne (camber) <-> " ; break;
66576659
case SURFACE_BUMP: cout << "Surface bump <-> " ; break;
66586660
case ANGLE_OF_ATTACK: cout << "Angle of attack <-> " ; break;
66596661
case CST: cout << "Kulfan parameter number (CST) <-> " ; break;
@@ -6689,7 +6691,8 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) {
66896691
if ((Design_Variable[iDV] == NO_DEFORMATION) ||
66906692
(Design_Variable[iDV] == FFD_SETTING) ||
66916693
(Design_Variable[iDV] == SCALE) ) nParamDV = 0;
6692-
if (Design_Variable[iDV] == ANGLE_OF_ATTACK) nParamDV = 1;
6694+
if ((Design_Variable[iDV] == ANGLE_OF_ATTACK) ||
6695+
(Design_Variable[iDV] == HICKS_HENNE_CAMBER)) nParamDV = 1;
66936696
if ((Design_Variable[iDV] == FFD_CAMBER_2D) ||
66946697
(Design_Variable[iDV] == FFD_THICKNESS_2D) ||
66956698
(Design_Variable[iDV] == HICKS_HENNE) ||

Common/src/grid_movement/CSurfaceMovement.cpp

Lines changed: 139 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
*/
2727

2828
#include "../../include/grid_movement/CSurfaceMovement.hpp"
29+
#include <iostream>
2930
#include "../../include/toolboxes/C1DInterpolation.hpp"
3031
#include "../../include/toolboxes/geometry_toolbox.hpp"
3132

@@ -584,7 +585,7 @@ vector<vector<su2double> > CSurfaceMovement::SetSurface_Deformation(CGeometry* g
584585
else if ((config->GetDesign_Variable(0) == ROTATION) || (config->GetDesign_Variable(0) == TRANSLATION) ||
585586
(config->GetDesign_Variable(0) == SCALE) || (config->GetDesign_Variable(0) == HICKS_HENNE) ||
586587
(config->GetDesign_Variable(0) == SURFACE_BUMP) || (config->GetDesign_Variable(0) == ANGLE_OF_ATTACK) ||
587-
(config->GetDesign_Variable(0) == CST)) {
588+
(config->GetDesign_Variable(0) == CST) || (config->GetDesign_Variable(0) == HICKS_HENNE_CAMBER)) {
588589
/*--- Apply rotation, displacement and stretching design variables (this
589590
should be done before the bump function design variables) ---*/
590591

@@ -639,9 +640,15 @@ vector<vector<su2double> > CSurfaceMovement::SetSurface_Deformation(CGeometry* g
639640
break;
640641
}
641642
}
642-
643+
644+
/*--- HICKS_HENNE_CAMBER design variable ---*/
645+
646+
if (config->GetDesign_Variable(0) == HICKS_HENNE_CAMBER) {
647+
SetHicksHenneCamber(geometry, config);
648+
}
643649
}
644650

651+
645652
/*--- NACA_4Digits design variable ---*/
646653

647654
else if (config->GetDesign_Variable(0) == NACA_4DIGITS) {
@@ -666,6 +673,8 @@ vector<vector<su2double> > CSurfaceMovement::SetSurface_Deformation(CGeometry* g
666673
if (rank == MASTER_NODE) cout << "No surface deformation (setting FFD)." << endl;
667674
}
668675

676+
677+
669678
/*--- Scale, Translate, and Rotate will be done with rigid mesh transforms. ---*/
670679

671680
else if ((config->GetDesign_Variable(0) == ROTATION) || (config->GetDesign_Variable(0) == TRANSLATION) ||
@@ -2761,6 +2770,8 @@ void CSurfaceMovement::SetHicksHenne(CGeometry* boundary, CConfig* config, unsig
27612770
}
27622771
}
27632772

2773+
2774+
27642775
#ifdef HAVE_MPI
27652776

27662777
int iProcessor, nProcessor = size;
@@ -3696,6 +3707,132 @@ void CSurfaceMovement::SetExternal_Deformation(CGeometry* geometry, CConfig* con
36963707
}
36973708
}
36983709

3710+
void CSurfaceMovement::SetHicksHenneCamber(CGeometry* boundary, CConfig* config) {
3711+
unsigned long iVertex;
3712+
unsigned short iMarker, nDV_Camber = 0;
3713+
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;
3716+
vector<su2double> positions, values, X_Coord_upper, Y_Coord_upper, X_Coord_lower, Y_Coord_lower;
3717+
3718+
// --- Check if the type of design variables is only HICKS_HENNE_CAMBER ---// // TODO: Extend to CAMBER + THICKNESS
3719+
for (unsigned short iDV = 0; iDV < config->GetnDV(); iDV++)
3720+
if (config->GetDesign_Variable(iDV) != HICKS_HENNE_CAMBER) {
3721+
cout << "'HicksHenneCamber' can not be combined with other design variables.";
3722+
cin.get();
3723+
} else {
3724+
nDV_Camber++;
3725+
}
3726+
3727+
positions.resize(nDV_Camber);
3728+
values.resize(nDV_Camber);
3729+
3730+
/*--- Collect the values of the Hicks-Henne camber design variables ---*/
3731+
for (unsigned short iDV = 0, counter = 0; iDV < config->GetnDV(); iDV++){
3732+
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 ---*/
3734+
values[counter] = config->GetDV_Value(iDV); /*--- Value of the deformation ---*/
3735+
counter++;
3736+
}
3737+
}
3738+
3739+
3740+
3741+
/*--- Compute the angle of attack, Leading-edge (LP) and Trailing-edge (TP) point.
3742+
We do this for upper and lower surface separately to detect blunt trailing edges ---*/
3743+
3744+
for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) {
3745+
if (config->GetMarker_All_DV(iMarker) == YES) {
3746+
CoordTrans = boundary->vertex[iMarker][0]->GetCoord();
3747+
LSTPCoord[0] = CoordTrans[0];
3748+
LSTPCoord[1] = CoordTrans[1];
3749+
USTPCoord[0] = CoordTrans[0];
3750+
USTPCoord[1] = CoordTrans[1];
3751+
for (iVertex = 1; iVertex < boundary->nVertex[iMarker]; iVertex++) {
3752+
CoordTrans = boundary->vertex[iMarker][iVertex]->GetCoord();
3753+
NormalTrans = boundary->vertex[iMarker][0]->GetNormal();
3754+
if ((CoordTrans[0] > TPCoord[0]) && (abs(NormalTrans[1]) > abs(NormalTrans[0]))) {
3755+
if (NormalTrans[1] >= 0.0) {
3756+
USTPCoord[0] = CoordTrans[0];
3757+
USTPCoord[1] = CoordTrans[1];
3758+
} else {
3759+
LSTPCoord[0] = CoordTrans[0];
3760+
LSTPCoord[1] = CoordTrans[1];
3761+
}
3762+
}
3763+
}
3764+
}
3765+
}
3766+
3767+
/*--- Correct the TP coordinates if the trailing edge is blunt ---*/
3768+
if ((USTPCoord[0] != LSTPCoord[0]) || (USTPCoord[1] != LSTPCoord[1])) {
3769+
TPCoord[0] = (USTPCoord[0] + LSTPCoord[0]) / 2.0;
3770+
TPCoord[1] = (USTPCoord[1] + LSTPCoord[1]) / 2.0;
3771+
} else {
3772+
TPCoord[0] = USTPCoord[0];
3773+
TPCoord[1] = USTPCoord[1];
3774+
}
3775+
3776+
Chord = 0.0;
3777+
for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) {
3778+
if (config->GetMarker_All_DV(iMarker) == YES) {
3779+
for (iVertex = 0; iVertex < boundary->nVertex[iMarker]; iVertex++) {
3780+
CoordTrans = boundary->vertex[iMarker][iVertex]->GetCoord();
3781+
Distance = sqrt(pow(CoordTrans[0] - TPCoord[0], 2.0) + pow(CoordTrans[1] - TPCoord[1], 2.0));
3782+
if (Chord < Distance) {
3783+
Chord = Distance;
3784+
LPCoord[0] = CoordTrans[0];
3785+
LPCoord[1] = CoordTrans[1];
3786+
}
3787+
}
3788+
}
3789+
}
3790+
3791+
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 ---*/
3794+
for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) {
3795+
for (iVertex = 0; iVertex < boundary->nVertex[iMarker]; iVertex++) {
3796+
if (config->GetMarker_All_DV(iMarker) == YES) {
3797+
CoordTrans = boundary->vertex[iMarker][iVertex]->GetCoord();
3798+
NormalTrans = boundary->vertex[iMarker][iVertex]->GetNormal();
3799+
3800+
ValCos = cos(AoA * PI_NUMBER / 180.0);
3801+
ValSin = sin(AoA * PI_NUMBER / 180.0);
3802+
3803+
/*--- Transform the coordinates ---*/
3804+
Coord[0] = (CoordTrans[0] - LPCoord[0]) * ValCos - (CoordTrans[1] - LPCoord[1]) * ValSin;
3805+
Coord[0] = max(0.0, Coord[0]); // Coord x should be always positive
3806+
Coord[1] = (CoordTrans[1] - LPCoord[1]) * ValCos + (CoordTrans[0] - LPCoord[0]) * ValSin;
3807+
3808+
/*--- Special case: surface point is part of trailing edge ---*/
3809+
if (Coord[0] > 0.99) {
3810+
continue;
3811+
}
3812+
3813+
/*--- Compute the Hicks-Henne bumps ---*/
3814+
fk = 0.0;
3815+
for (unsigned short iDV = 0; iDV < nDV_Camber; iDV++) {
3816+
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];
3819+
}
3820+
VarCoord[1] = fk;
3821+
}
3822+
3823+
/*--- Apply the transformation to the coordinate variation ---*/
3824+
3825+
ValCos = cos(-AoA * PI_NUMBER / 180.0);
3826+
ValSin = sin(-AoA * PI_NUMBER / 180.0);
3827+
3828+
VarCoordTrans[0] = VarCoord[0] * ValCos - VarCoord[1] * ValSin;
3829+
VarCoordTrans[1] = VarCoord[1] * ValCos + VarCoord[0] * ValSin;
3830+
3831+
boundary->vertex[iMarker][iVertex]->SetVarCoord(VarCoordTrans);
3832+
}
3833+
}
3834+
}
3835+
36993836
void CSurfaceMovement::SetNACA_4Digits(CGeometry* boundary, CConfig* config) {
37003837
unsigned long iVertex;
37013838
unsigned short iMarker;

SU2_DEF/src/drivers/CDiscAdjDeformationDriver.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,10 @@ void CDiscAdjDeformationDriver::SetProjection_FD(CGeometry* geometry, CConfig* c
563563
surface_movement->SetRotation(geometry, config, iDV, true);
564564
}
565565

566+
else if (config->GetDesign_Variable(iDV) == HICKS_HENNE_CAMBER) {
567+
surface_movement->SetHicksHenneCamber(geometry, config);
568+
}
569+
566570
/*--- NACA_4Digits design variable. ---*/
567571

568572
else if (config->GetDesign_Variable(iDV) == NACA_4DIGITS) {

SU2_GEO/src/SU2_GEO.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,17 @@ int main(int argc, char* argv[]) {
934934
surface_movement->SetRotation(geometry_container[ZONE_0], config_container[ZONE_0], iDV, true);
935935
}
936936

937+
/*--- HICKS_HENNE_CAMBER design variable ---*/
938+
939+
else if (config_container[ZONE_0]->GetDesign_Variable(iDV) == HICKS_HENNE_CAMBER) {
940+
if (rank == MASTER_NODE) {
941+
cout << endl << "Design variable number " << iDV << "." << endl;
942+
cout << "Perform 2D deformation of the surface." << endl;
943+
}
944+
MoveSurface = true;
945+
surface_movement->SetHicksHenneCamber(geometry_container[ZONE_0], config_container[ZONE_0]);
946+
}
947+
937948
/*--- NACA_4Digits design variable ---*/
938949

939950
else if (config_container[ZONE_0]->GetDesign_Variable(iDV) == NACA_4DIGITS) {

0 commit comments

Comments
 (0)