diff --git a/AUTHORS.md b/AUTHORS.md index c4392afcab7..9249aef50a1 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -137,6 +137,7 @@ VivaanKhatri Wally Maier Y. Chandukrishna Zan Xu +Zcaic aaronyicongfu aeroamit anilvar diff --git a/Common/src/grid_movement/CSurfaceMovement.cpp b/Common/src/grid_movement/CSurfaceMovement.cpp index ea9dc6f374c..e875800f2a6 100644 --- a/Common/src/grid_movement/CSurfaceMovement.cpp +++ b/Common/src/grid_movement/CSurfaceMovement.cpp @@ -556,7 +556,8 @@ vector > 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) ---*/ @@ -586,6 +587,14 @@ vector > 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: diff --git a/TestCases/deformation/cst/Mesh Deformation Comparison.png b/TestCases/deformation/cst/Mesh Deformation Comparison.png new file mode 100644 index 00000000000..2dd70194f0a Binary files /dev/null and b/TestCases/deformation/cst/Mesh Deformation Comparison.png differ diff --git a/TestCases/deformation/cst/Readme.md b/TestCases/deformation/cst/Readme.md new file mode 100644 index 00000000000..0cc90457fd8 --- /dev/null +++ b/TestCases/deformation/cst/Readme.md @@ -0,0 +1,3 @@ +run ```SU2_DEF naca0012.cfg``` or ```mpiexec -n 4 SU2_DEF naca0012.cfg```
+the **CST** deformation result as below:
+![cst result](Mesh%20Deformation%20Comparison.png "mesh") diff --git a/TestCases/deformation/cst/naca0012.cfg b/TestCases/deformation/cst/naca0012.cfg new file mode 100644 index 00000000000..fa5bf0d35c3 --- /dev/null +++ b/TestCases/deformation/cst/naca0012.cfg @@ -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 --------------------------% +% +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 +% \ No newline at end of file diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 41eb39ba981..f26049592b8 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -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.000385514] #residual + 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"