Skip to content

Commit 26656da

Browse files
authored
Merge pull request #2124 from Zcaic/add-cst
Fix CST parameterization method
2 parents cac9492 + b0c5193 commit 26656da

6 files changed

Lines changed: 162 additions & 1 deletion

File tree

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ VivaanKhatri
137137
Wally Maier
138138
Y. Chandukrishna
139139
Zan Xu
140+
Zcaic
140141
aaronyicongfu
141142
aeroamit
142143
anilvar

Common/src/grid_movement/CSurfaceMovement.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,8 @@ vector<vector<su2double> > CSurfaceMovement::SetSurface_Deformation(CGeometry* g
556556

557557
else if ((config->GetDesign_Variable(0) == ROTATION) || (config->GetDesign_Variable(0) == TRANSLATION) ||
558558
(config->GetDesign_Variable(0) == SCALE) || (config->GetDesign_Variable(0) == HICKS_HENNE) ||
559-
(config->GetDesign_Variable(0) == SURFACE_BUMP) || (config->GetDesign_Variable(0) == ANGLE_OF_ATTACK)) {
559+
(config->GetDesign_Variable(0) == SURFACE_BUMP) || (config->GetDesign_Variable(0) == ANGLE_OF_ATTACK) ||
560+
(config->GetDesign_Variable(0) == CST)) {
560561
/*--- Apply rotation, displacement and stretching design variables (this
561562
should be done before the bump function design variables) ---*/
562563

@@ -586,6 +587,14 @@ vector<vector<su2double> > CSurfaceMovement::SetSurface_Deformation(CGeometry* g
586587

587588
/*--- Apply the design variables to the control point position ---*/
588589

590+
for (iDV = 0; iDV < config->GetnDV(); iDV++) {
591+
if (config ->GetDesign_Variable(iDV) == CST){
592+
SetCST(geometry,config,iDV,false);
593+
}
594+
}
595+
596+
/*--- Apply the design variables to the control point position ---*/
597+
589598
for (iDV = 0; iDV < config->GetnDV(); iDV++) {
590599
switch (config->GetDesign_Variable(iDV)) {
591600
case SURFACE_BUMP:
267 KB
Loading
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
run ```SU2_DEF naca0012.cfg``` or ```mpiexec -n 4 SU2_DEF naca0012.cfg``` <br>
2+
the **CST** deformation result as below: <br>
3+
![cst result](Mesh%20Deformation%20Comparison.png "mesh")
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
% -------------------- BOUNDARY CONDITION DEFINITION --------------------------%
2+
%
3+
% Euler wall boundary marker(s) (NONE = no marker)
4+
% Implementation identical to MARKER_SYM.
5+
MARKER_EULER= ( airfoil )
6+
% Far-field boundary marker(s) (NONE = no marker)
7+
MARKER_FAR= ( farfield )
8+
9+
10+
11+
% ----------------------- GEOMETRY EVALUATION PARAMETERS ----------------------%
12+
%
13+
% Marker(s) of the surface where geometrical based function will be evaluated
14+
GEO_MARKER= ( airfoil )
15+
%
16+
% Description of the geometry to be analyzed (AIRFOIL, WING)
17+
GEO_DESCRIPTION= AIRFOIL
18+
%
19+
% Coordinate of the stations to be analyzed
20+
% GEO_LOCATION_STATIONS= (0.0, 0.5, 1.0)
21+
%
22+
% Geometrical bounds (Y coordinate) for the wing geometry analysis or
23+
% fuselage evaluation (X coordinate)
24+
% GEO_BOUNDS= (1.5, 3.5)
25+
%
26+
% Plot loads and Cp distributions on each airfoil section
27+
GEO_PLOT_STATIONS= NO
28+
%
29+
% Number of section cuts to make when calculating wing geometry
30+
GEO_NUMBER_STATIONS= 25
31+
%
32+
% Geometrical evaluation mode (FUNCTION, GRADIENT)
33+
GEO_MODE= FUNCTION
34+
35+
% ----------------------- DESIGN VARIABLE PARAMETERS --------------------------%
36+
%
37+
% Kind of deformation (NO_DEFORMATION, SCALE_GRID, TRANSLATE_GRID, ROTATE_GRID,
38+
% FFD_SETTING, FFD_NACELLE,
39+
% FFD_CONTROL_POINT, FFD_CAMBER, FFD_THICKNESS, FFD_TWIST
40+
% FFD_CONTROL_POINT_2D, FFD_CAMBER_2D, FFD_THICKNESS_2D,
41+
% HICKS_HENNE, SURFACE_BUMP, SURFACE_FILE)
42+
DV_KIND= CST,CST
43+
%
44+
% Marker of the surface in which we are going apply the shape deformation
45+
DV_MARKER= ( airfoil )
46+
%
47+
% Parameters of the shape deformation
48+
% - NO_DEFORMATION ( 1.0 )
49+
% - TRANSLATE_GRID ( x_Disp, y_Disp, z_Disp ), as a unit vector
50+
% - ROTATE_GRID ( x_Orig, y_Orig, z_Orig, x_End, y_End, z_End ) axis, DV_VALUE in deg.
51+
% - SCALE_GRID ( 1.0 )
52+
% - ANGLE_OF_ATTACK ( 1.0 )
53+
% - FFD_SETTING ( 1.0 )
54+
% - FFD_CONTROL_POINT ( FFD_BoxTag, i_Ind, j_Ind, k_Ind, x_Disp, y_Disp, z_Disp )
55+
% - FFD_NACELLE ( FFD_BoxTag, rho_Ind, theta_Ind, phi_Ind, rho_Disp, phi_Disp )
56+
% - FFD_GULL ( FFD_BoxTag, j_Ind )
57+
% - FFD_ANGLE_OF_ATTACK ( FFD_BoxTag, 1.0 )
58+
% - FFD_CAMBER ( FFD_BoxTag, i_Ind, j_Ind )
59+
% - FFD_THICKNESS ( FFD_BoxTag, i_Ind, j_Ind )
60+
% - FFD_TWIST ( FFD_BoxTag, j_Ind, x_Orig, y_Orig, z_Orig, x_End, y_End, z_End )
61+
% - FFD_CONTROL_POINT_2D ( FFD_BoxTag, i_Ind, j_Ind, x_Disp, y_Disp )
62+
% - FFD_CAMBER_2D ( FFD_BoxTag, i_Ind )
63+
% - FFD_THICKNESS_2D ( FFD_BoxTag, i_Ind )
64+
% - HICKS_HENNE ( Lower Surface (0)/Upper Surface (1)/Only one Surface (2), x_Loc )
65+
% - SURFACE_BUMP ( x_Start, x_End, x_Loc )
66+
DV_PARAM= (0, 5, 7);(1, 5, 10)
67+
%
68+
% Value of the shape deformation
69+
DV_VALUE= -0.5,0.5
70+
71+
% ------------------------- INPUT/OUTPUT FILE INFORMATION --------------------------%
72+
%
73+
DEFORM_CONSOLE_OUTPUT= YES
74+
%
75+
% Mesh input file
76+
MESH_FILENAME= ../naca0012/mesh_NACA0012_inv.su2
77+
%
78+
% Mesh input file format (SU2, CGNS)
79+
MESH_FORMAT= SU2
80+
%
81+
% Mesh output file
82+
MESH_OUT_FILENAME= mesh_out.su2
83+
%
84+
% Restart flow input file
85+
SOLUTION_FILENAME= solution_flow.dat
86+
%
87+
% Restart adjoint input file
88+
SOLUTION_ADJ_FILENAME= solution_adj.dat
89+
%
90+
% Output tabular file format (TECPLOT, CSV)
91+
TABULAR_FORMAT= CSV
92+
%
93+
% Files to output
94+
% Possible formats : (TECPLOT_ASCII, TECPLOT, SURFACE_TECPLOT_ASCII,
95+
% SURFACE_TECPLOT, CSV, SURFACE_CSV, PARAVIEW_ASCII, PARAVIEW_LEGACY, SURFACE_PARAVIEW_ASCII,
96+
% SURFACE_PARAVIEW_LEGACY, PARAVIEW, SURFACE_PARAVIEW, RESTART_ASCII, RESTART, CGNS, SURFACE_CGNS, STL_ASCII, STL_BINARY)
97+
% default : (RESTART, PARAVIEW, SURFACE_PARAVIEW)
98+
OUTPUT_FILES= (RESTART, PARAVIEW_MULTIBLOCK)
99+
%
100+
% Output file convergence history (w/o extension)
101+
CONV_FILENAME= history
102+
%
103+
% Output file with the forces breakdown
104+
BREAKDOWN_FILENAME= forces_breakdown.dat
105+
%
106+
% Output file restart flow
107+
RESTART_FILENAME= restart_flow.dat
108+
%
109+
% Output file restart adjoint
110+
RESTART_ADJ_FILENAME= restart_adj.dat
111+
%
112+
% Output file flow (w/o extension) variables
113+
VOLUME_FILENAME= flow
114+
%
115+
% Output file adjoint (w/o extension) variables
116+
VOLUME_ADJ_FILENAME= adjoint
117+
%
118+
% Output Objective function
119+
VALUE_OBJFUNC_FILENAME= of_eval.dat
120+
%
121+
% Output objective function gradient (using continuous adjoint)
122+
GRAD_OBJFUNC_FILENAME= of_grad.dat
123+
%
124+
% Output file surface flow coefficient (w/o extension)
125+
SURFACE_FILENAME= surface_flow
126+
%
127+
% Output file surface adjoint coefficient (w/o extension)
128+
SURFACE_ADJ_FILENAME= surface_adjoint
129+
%
130+
% Read binary restart files (YES, NO)
131+
READ_BINARY_RESTART= YES
132+
%
133+
% Reorient elements based on potential negative volumes (YES/NO)
134+
REORIENT_ELEMENTS= YES
135+
%

TestCases/parallel_regression.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1771,6 +1771,19 @@ def main():
17711771
pass_list.append(sphere_ffd_def_bspline.run_def())
17721772
test_list.append(sphere_ffd_def_bspline)
17731773

1774+
# Inviscid NACA0012 (triangles)
1775+
naca0012_cst = TestCase('naca0012_cst')
1776+
naca0012_cst.cfg_dir = "deformation/cst"
1777+
naca0012_cst.cfg_file = "naca0012.cfg"
1778+
naca0012_cst.test_iter = 10
1779+
naca0012_cst.test_vals = [0.000385514] #residual
1780+
naca0012_cst.command = TestCase.Command("mpirun -n 2", "SU2_DEF")
1781+
naca0012_cst.timeout = 1600
1782+
naca0012_cst.tol = 1e-8
1783+
1784+
pass_list.append(naca0012_cst.run_def())
1785+
test_list.append(naca0012_cst)
1786+
17741787
# 2D FD streamwise periodic cht, avg temp obj func
17751788
fd_sp_pinArray_cht_2d_dp_hf = TestCase('fd_sp_pinArray_cht_2d_dp_hf')
17761789
fd_sp_pinArray_cht_2d_dp_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d"

0 commit comments

Comments
 (0)