Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CST parameterization method #2124

Merged
merged 11 commits into from
Sep 23, 2023
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ VivaanKhatri
Wally Maier
Y. Chandukrishna
Zan Xu
Zcaic
aaronyicongfu
aeroamit
anilvar
Expand Down
11 changes: 10 additions & 1 deletion Common/src/grid_movement/CSurfaceMovement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,8 @@ vector<vector<su2double> > CSurfaceMovement::SetSurface_Deformation(CGeometry* g

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

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

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

for (iDV = 0; iDV < config->GetnDV(); iDV++) {
if (config ->GetDesign_Variable(iDV) == CST){
SetCST(geometry,config,iDV,false);
}
}

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

for (iDV = 0; iDV < config->GetnDV(); iDV++) {
switch (config->GetDesign_Variable(iDV)) {
case SURFACE_BUMP:
Expand Down
pcarruscag marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions TestCases/deformation/cst/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
run ```SU2_DEF naca0012.cfg``` or ```mpiexec -n 4 SU2_DEF naca0012.cfg``` <br>
the **CST** deformation result as below: <br>
![cst result](Mesh%20Deformation%20Comparison.png "mesh")
135 changes: 135 additions & 0 deletions TestCases/deformation/cst/naca0012.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
% -------------------- BOUNDARY CONDITION DEFINITION --------------------------%
%
% Euler wall boundary marker(s) (NONE = no marker)
% Implementation identical to MARKER_SYM.
MARKER_EULER= ( airfoil )
% Far-field boundary marker(s) (NONE = no marker)
MARKER_FAR= ( farfield )



% ----------------------- GEOMETRY EVALUATION PARAMETERS ----------------------%
%
% Marker(s) of the surface where geometrical based function will be evaluated
GEO_MARKER= ( airfoil )
%
% Description of the geometry to be analyzed (AIRFOIL, WING)
GEO_DESCRIPTION= AIRFOIL
%
% Coordinate of the stations to be analyzed
% GEO_LOCATION_STATIONS= (0.0, 0.5, 1.0)
%
% Geometrical bounds (Y coordinate) for the wing geometry analysis or
% fuselage evaluation (X coordinate)
% GEO_BOUNDS= (1.5, 3.5)
%
% Plot loads and Cp distributions on each airfoil section
GEO_PLOT_STATIONS= NO
%
% Number of section cuts to make when calculating wing geometry
GEO_NUMBER_STATIONS= 25
%
% Geometrical evaluation mode (FUNCTION, GRADIENT)
GEO_MODE= FUNCTION

% ----------------------- DESIGN VARIABLE PARAMETERS --------------------------%
%
% Kind of deformation (NO_DEFORMATION, SCALE_GRID, TRANSLATE_GRID, ROTATE_GRID,
% FFD_SETTING, FFD_NACELLE,
% FFD_CONTROL_POINT, FFD_CAMBER, FFD_THICKNESS, FFD_TWIST
% FFD_CONTROL_POINT_2D, FFD_CAMBER_2D, FFD_THICKNESS_2D,
% HICKS_HENNE, SURFACE_BUMP, SURFACE_FILE)
DV_KIND= CST,CST
%
% Marker of the surface in which we are going apply the shape deformation
DV_MARKER= ( airfoil )
%
% Parameters of the shape deformation
% - NO_DEFORMATION ( 1.0 )
% - TRANSLATE_GRID ( x_Disp, y_Disp, z_Disp ), as a unit vector
% - ROTATE_GRID ( x_Orig, y_Orig, z_Orig, x_End, y_End, z_End ) axis, DV_VALUE in deg.
% - SCALE_GRID ( 1.0 )
% - ANGLE_OF_ATTACK ( 1.0 )
% - FFD_SETTING ( 1.0 )
% - FFD_CONTROL_POINT ( FFD_BoxTag, i_Ind, j_Ind, k_Ind, x_Disp, y_Disp, z_Disp )
% - FFD_NACELLE ( FFD_BoxTag, rho_Ind, theta_Ind, phi_Ind, rho_Disp, phi_Disp )
% - FFD_GULL ( FFD_BoxTag, j_Ind )
% - FFD_ANGLE_OF_ATTACK ( FFD_BoxTag, 1.0 )
% - FFD_CAMBER ( FFD_BoxTag, i_Ind, j_Ind )
% - FFD_THICKNESS ( FFD_BoxTag, i_Ind, j_Ind )
% - FFD_TWIST ( FFD_BoxTag, j_Ind, x_Orig, y_Orig, z_Orig, x_End, y_End, z_End )
% - FFD_CONTROL_POINT_2D ( FFD_BoxTag, i_Ind, j_Ind, x_Disp, y_Disp )
% - FFD_CAMBER_2D ( FFD_BoxTag, i_Ind )
% - FFD_THICKNESS_2D ( FFD_BoxTag, i_Ind )
% - HICKS_HENNE ( Lower Surface (0)/Upper Surface (1)/Only one Surface (2), x_Loc )
% - SURFACE_BUMP ( x_Start, x_End, x_Loc )
DV_PARAM= (0, 5, 7);(1, 5, 10)
%
% Value of the shape deformation
DV_VALUE= -0.5,0.5

% ------------------------- INPUT/OUTPUT FILE INFORMATION --------------------------%
%
pcarruscag marked this conversation as resolved.
Show resolved Hide resolved
DEFORM_CONSOLE_OUTPUT= YES
%
% Mesh input file
MESH_FILENAME= ../naca0012/mesh_NACA0012_inv.su2
%
% Mesh input file format (SU2, CGNS)
MESH_FORMAT= SU2
%
% Mesh output file
MESH_OUT_FILENAME= mesh_out.su2
%
% Restart flow input file
SOLUTION_FILENAME= solution_flow.dat
%
% Restart adjoint input file
SOLUTION_ADJ_FILENAME= solution_adj.dat
%
% Output tabular file format (TECPLOT, CSV)
TABULAR_FORMAT= CSV
%
% Files to output
% Possible formats : (TECPLOT_ASCII, TECPLOT, SURFACE_TECPLOT_ASCII,
% SURFACE_TECPLOT, CSV, SURFACE_CSV, PARAVIEW_ASCII, PARAVIEW_LEGACY, SURFACE_PARAVIEW_ASCII,
% SURFACE_PARAVIEW_LEGACY, PARAVIEW, SURFACE_PARAVIEW, RESTART_ASCII, RESTART, CGNS, SURFACE_CGNS, STL_ASCII, STL_BINARY)
% default : (RESTART, PARAVIEW, SURFACE_PARAVIEW)
OUTPUT_FILES= (RESTART, PARAVIEW_MULTIBLOCK)
%
% Output file convergence history (w/o extension)
CONV_FILENAME= history
%
% Output file with the forces breakdown
BREAKDOWN_FILENAME= forces_breakdown.dat
%
% Output file restart flow
RESTART_FILENAME= restart_flow.dat
%
% Output file restart adjoint
RESTART_ADJ_FILENAME= restart_adj.dat
%
% Output file flow (w/o extension) variables
VOLUME_FILENAME= flow
%
% Output file adjoint (w/o extension) variables
VOLUME_ADJ_FILENAME= adjoint
%
% Output Objective function
VALUE_OBJFUNC_FILENAME= of_eval.dat
%
% Output objective function gradient (using continuous adjoint)
GRAD_OBJFUNC_FILENAME= of_grad.dat
%
% Output file surface flow coefficient (w/o extension)
SURFACE_FILENAME= surface_flow
%
% Output file surface adjoint coefficient (w/o extension)
SURFACE_ADJ_FILENAME= surface_adjoint
%
% Read binary restart files (YES, NO)
READ_BINARY_RESTART= YES
%
% Reorient elements based on potential negative volumes (YES/NO)
REORIENT_ELEMENTS= YES
%
13 changes: 13 additions & 0 deletions TestCases/parallel_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -1771,6 +1771,19 @@ def main():
pass_list.append(sphere_ffd_def_bspline.run_def())
test_list.append(sphere_ffd_def_bspline)

# Inviscid NACA0012 (triangles)
naca0012_cst = TestCase('naca0012_cst')
naca0012_cst.cfg_dir = "deformation/cst"
naca0012_cst.cfg_file = "naca0012.cfg"
naca0012_cst.test_iter = 10
naca0012_cst.test_vals = [0.000386] #residual
pcarruscag marked this conversation as resolved.
Show resolved Hide resolved
naca0012_cst.command = TestCase.Command("mpirun -n 2", "SU2_DEF")
naca0012_cst.timeout = 1600
naca0012_cst.tol = 1e-8

pass_list.append(naca0012_cst.run_def())
test_list.append(naca0012_cst)

# 2D FD streamwise periodic cht, avg temp obj func
fd_sp_pinArray_cht_2d_dp_hf = TestCase('fd_sp_pinArray_cht_2d_dp_hf')
fd_sp_pinArray_cht_2d_dp_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d"
Expand Down
Loading