2d ffd
Hi to everyone. I'm trying to solve the tutorial i found in testcases about the Euler steady NACA0012 with FFD. The problem is that when i generate the FFD box the SU2_DEF automatically creates control points with z non costant component:
FFD_CONTROL_POINTS= 24 0 0 0 0 0.08 0.5 0 0 1 0 0.08 0.5 0 1 0 0 0.08 0.5 0 1 1 0 0.08 0.5 1 0 0 0.2 0.08 0.5 1 0 1 0.2 0.08 0.5 1 1 0 0.2 0.08 0.5 1 1 1 0.2 0.08 0.5 2 0 0 0.4 0.08 0.5 2 0 1 0.4 0.08 0.5 2 1 0 0.4 0.08 0.5 2 1 1 0.4 0.08 0.5 3 0 0 0.6 0.08 0.5 3 0 1 0.6 0.08 0.5 3 1 0 0.6 0.08 0.5 3 1 1 0.6 0.08 0.5 4 0 0 0.8 0.08 0.5 4 0 1 0.8 0.08 0.5 4 1 0 0.8 0.08 0.5 4 1 1 0.8 0.08 0.5 5 0 0 1 0.08 0.5 5 0 1 1 0.08 0.5 5 1 0 1 0.08 0.5 5 1 1 1 0.08 0.5 I can't understand where is the mistake. I'm using the mesh i found in the testcases. Sorry for my english,hope you understand the problem. 
Quote:
You have not made a mistake  this is how the FFD box is made in 2D. The mesh format assumes that for 2D the mesh is in the XY plane, and at "0" in the Z direction. Please post again if there are further problems. 
Thank you for your answer. I've done the optimization of the multi element profile with DRAG as objective function and some constrains using the FFD method. Now i'm trying to use LIFT as objective function on a single NACA0012 but it doesn't work. If i keep DRAG as objective function and i use a lift constrain to maximixe the vertical force it works well. Do you have any suggestions?Here i attach the .cfg with LIFT as obj funct.
%  DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION % % % Physical governing equations (EULER, NAVIER_STOKES, % TNE2_EULER, TNE2_NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, LINEAR_ELASTICITY, % POISSON_EQUATION) PHYSICAL_PROBLEM= EULER % % % Mathematical problem (DIRECT, ADJOINT, LINEARIZED) MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO %  COMPRESSIBLE FREESTREAM DEFINITION % % % Mach number (nondimensional, based on the freestream values) MACH_NUMBER= 0.8 % % Angle of attack (degrees, only for compressible flows) AoA= 1.25 % % Freestream temperature (288.15 K by default) FREESTREAM_TEMPERATURE= 288.15 % % Freestream pressure (101325.0 N/m^2 by default, only Euler flows) FREESTREAM_PRESSURE= 101325.0 %  REFERENCE VALUE DEFINITION % % % Reference origin for moment computation REF_ORIGIN_MOMENT_X = 0.25 REF_ORIGIN_MOMENT_Y = 0.00 REF_ORIGIN_MOMENT_Z = 0.00 % % Reference length for pitching, rolling, and yawing nondimensional moment REF_LENGTH_MOMENT= 1.0 % % Reference area for force coefficients (0 implies automatic calculation) REF_AREA= 1.0 % % Reference pressure (101325.0 N/m^2 by default, only for compressible flows) REF_PRESSURE= 1.0 % % Reference temperature (273.15 K by default, only for compressible flows) REF_TEMPERATURE= 1.0 % % Reference density (1.2886 Kg/m^3 by default, only for compressible flows) REF_DENSITY= 1.0 % %  BOUNDARY CONDITION DEFINITION % % % NavierStokes wall boundary marker(s) (NONE = no marker) MARKER_EULER= ( airfoil ) % % Farfield boundary marker(s) (NONE = no marker) MARKER_FAR= ( farfield ) % % Marker(s) of the surface to be plotted or designed MARKER_PLOTTING= ( airfoil ) % % Marker(s) of the surface where the functional (Cd, Cl, etc.) will be evaluated MARKER_MONITORING= ( airfoil ) %  COMMON PARAMETERS DEFINING THE NUMERICAL METHOD % % % Numerical method for spatial gradients (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES) %NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES NUM_METHOD_GRAD= GREEN_GAUSS % % CourantFriedrichsLewy condition of the finest grid CFL_NUMBER= 1 % % Adaptive CFL number (NO, YES) CFL_ADAPT= NO % % Parameters of the adaptive CFL number (factor down, factor up, CFL min value, % CFL max value ) CFL_ADAPT_PARAM= ( 2.0, 1.5, 0.0001, 20 ) % % Number of total iterations EXT_ITER= 99999 % % Linear solver for the implicit formulation (BCGSTAB, FGMRES) LINEAR_SOLVER= FGMRES % % Preconditioner of the Krylov linear solver (NONE, JACOBI, LINELET, LUSGS) LINEAR_SOLVER_PREC= LU_SGS % % Min error of the linear solver for the implicit formulation LINEAR_SOLVER_ERROR= 1E4 % % Max number of iterations of the linear solver for the implicit formulation LINEAR_SOLVER_ITER= 5 %  MULTIGRID PARAMETERS % % % MultiGrid Levels (0 = no multigrid) MGLEVEL= 2 % % MultiGrid Cycle (V_CYCLE, W_CYCLE) MGCYCLE= V_CYCLE % % Multigrid presmoothing level MG_PRE_SMOOTH= ( 1, 2, 3, 3 ) % % Multigrid postsmoothing level MG_POST_SMOOTH= ( 2, 2, 2, 2 ) % % Jacobi implicit smoothing of the correction MG_CORRECTION_SMOOTH= ( 0, 0, 0, 0 ) % % Damping factor for the residual restriction MG_DAMP_RESTRICTION= 0.75 % % Damping factor for the correction prolongation MG_DAMP_PROLONGATION= 0.75 % %  FLOW NUMERICAL METHOD DEFINITION % % % Convective numerical method (JST, LAXFRIEDRICH, CUSP, ROE, AUSM, HLLC, % TURKEL_PREC, MSW) CONV_NUM_METHOD_FLOW= JST % % Spatial numerical order integration (1ST_ORDER, 2ND_ORDER, 2ND_ORDER_LIMITER) % SPATIAL_ORDER_FLOW= 2ND_ORDER_LIMITER % % Slope limiter (VENKATAKRISHNAN, MINMOD) SLOPE_LIMITER_FLOW= VENKATAKRISHNAN % % Coefficient for the limiter (smooth regions) %LIMITER_COEFF= 10.0 % % 1st, 2nd and 4th order artificial dissipation coefficients AD_COEFF_FLOW= ( 0.15, 0.5, 0.02 ) % % Time discretization (RUNGEKUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) TIME_DISCRE_FLOW= EULER_IMPLICIT %  ADJOINTFLOW NUMERICAL METHOD DEFINITION % % Adjoint problem boundary condition (DRAG, LIFT, SIDEFORCE, MOMENT_X, % MOMENT_Y, MOMENT_Z, EFFICIENCY, % EQUIVALENT_AREA, NEARFIELD_PRESSURE, % FORCE_X, FORCE_Y, FORCE_Z, THRUST, % TORQUE, FREE_SURFACE) OBJECTIVE_FUNCTION= LIFT % % Convective numerical method (JST, LAXFRIEDRICH, ROE1ST_ORDER, % ROE2ND_ORDER) CONV_NUM_METHOD_ADJFLOW= JST % % Slope limiter (VENKATAKRISHNAN, SHARP_EDGES) SLOPE_LIMITER_ADJFLOW= VENKATAKRISHNAN % % Coefficient for the sharp edges limiter SHARP_EDGES_COEFF= 8.0 % % 1st, 2nd, and 4th order artificial dissipation coefficients AD_COEFF_ADJFLOW= ( 0.15, 0.0, 0.02 ) % % Time discretization (RUNGEKUTTA_EXPLICIT, EULER_IMPLICIT) TIME_DISCRE_ADJFLOW= EULER_IMPLICIT % % Reduction factor of the CFL coefficient in the adjoint problem CFL_REDUCTION_ADJFLOW= 0.8 % % Limit value for the adjoint variable LIMIT_ADJFLOW= 1E6 % % Remove sharp edges from the sensitivity evaluation (NO, YES) SENS_REMOVE_SHARP= YES % % Sensitivity smoothing (NONE, SOBOLEV, BIGRID) SENS_SMOOTHING= NONE % % Multigrid adjoint problem (NO, YES) MG_ADJFLOW= YES %  GEOMETRY EVALUATION PARAMETERS % % % Geometrical evaluation mode (FUNCTION, GRADIENT) GEO_MODE= FUNCTION % % Marker(s) of the surface where geometrical based func. will be evaluated GEO_MARKER= (airfoil) %  TURBULENT NUMERICAL METHOD DEFINITION % % % Convective numerical method (SCALAR_UPWIND) %CONV_NUM_METHOD_TURB= SCALAR_UPWIND % % Spatial numerical order integration (1ST_ORDER, 2ND_ORDER, 2ND_ORDER_LIMITER) % %SPATIAL_ORDER_TURB= 1ST_ORDER % % Slope limiter (VENKATAKRISHNAN, MINMOD) %SLOPE_LIMITER_TURB= VENKATAKRISHNAN % % Time discretization (EULER_IMPLICIT) %TIME_DISCRE_TURB= EULER_IMPLICIT %  PARTITIONING STRATEGY % % Write a tecplot/paraview file for each partition (NO, YES) %VISUALIZE_PART= NO %  CONVERGENCE PARAMETERS % % % Convergence criteria (CAUCHY, RESIDUAL) % CONV_CRITERIA= RESIDUAL % % Residual reduction (order of magnitude with respect to the initial value) RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) RESIDUAL_MINVAL= 8 % % Start convergence criteria at iteration number STARTCONV_ITER= 10 % % Number of elements to apply the criteria CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence CAUCHY_EPS= 1E6 % % Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, % SENS_MACH, DELTA_LIFT, DELTA_DRAG) CAUCHY_FUNC_FLOW= DRAG % % Adjoint function to apply the convergence criteria (SENS_GEOMETRY, SENS_MACH) CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY % % Epsilon for full multigrid method evaluation %FULLMG_CAUCHY_EPS= 1E4 %  INPUT/OUTPUT INFORMATION % % % Mesh input file MESH_FILENAME= NACA0012_FFD.su2 % % Mesh input file format (SU2, CGNS, NETCDF_ASCII) MESH_FORMAT= SU2 % % Divide rectangles into triangles (NO, YES) DIVIDE_ELEMENTS= NO % % Convert a CGNS mesh to SU2 format (YES, NO) CGNS_TO_SU2= NO % % Mesh output file MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file SOLUTION_FLOW_FILENAME= restart_flowALE.dat % % Restart linear flow input file SOLUTION_LIN_FILENAME= solution_lin.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) OUTPUT_FORMAT= TECPLOT % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow RESTART_FLOW_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file linear flow RESTART_LIN_FILENAME= restart_lin.dat % % Output file flow (w/o extension) variables VOLUME_FLOW_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint % % Output file linearized (w/o extension) variables VOLUME_LIN_FILENAME= linearized % % Output objective function gradient (using continuous adjoint) GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) SURFACE_FLOW_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint % % Output file surface linear coefficient (w/o extension) SURFACE_LIN_FILENAME= surface_linear % % Writing solution file frequency WRT_SOL_FREQ= 1000 % % Writing convergence history frequency WRT_CON_FREQ= 1 %  GRID DEFORMATION PARAMETERS % % % Kind of deformation (FFD_SETTING, HICKS_HENNE, PARABOLIC, NACA_4DIGITS, % DISPLACEMENT, ROTATION, FFD_CONTROL_POINT, % FFD_DIHEDRAL_ANGLE, FFD_TWIST_ANGLE, % FFD_ROTATION, FFD_CAMBER, FFD_THICKNESS, FFD_VOLUME % SURFACE_FILE) DV_KIND= FFD_CONTROL_POINT_2D % % Marker of the surface to which we are going apply the shape deformation DV_MARKER= ( airfoil ) % % Parameters of the shape deformation %  HICKS_HENNE ( Lower Surface (0)/Upper Surface (1)/Only one Surface (2), x_Loc ) %  FFD_CONTROL_POINT_2D ( FFD_BoxTag, i_Ind, j_Ind, x_Disp, y_Disp ) %  NACA_4DIGITS ( 1st digit, 2nd digit, 3rd and 4th digit ) %  PARABOLIC ( Center, Thickness ) %  DISPLACEMENT ( x_Disp, y_Disp, z_Disp ) %  ROTATION ( x_Orig, y_Orig, z_Orig, x_End, y_End, z_End ) %  OBSTACLE ( Center, Bump size ) %  FFD_CONTROL_POINT ( Chunk ID, i_Ind, j_Ind, k_Ind, x_Disp, y_Disp, z_Disp ) %  FFD_DIHEDRAL_ANGLE ( Chunk ID, x_Orig, y_Orig, z_Orig, x_End, y_End, z_End ) %  FFD_TWIST_ANGLE ( Chunk ID, x_Orig, y_Orig, z_Orig, x_End, y_End, z_End ) %  FFD_ROTATION ( Chunk ID, x_Orig, y_Orig, z_Orig, x_End, y_End, z_End ) %  FFD_CAMBER ( Chunk ID, i_Ind, j_Ind ) %  FFD_THICKNESS ( Chunk ID, i_Ind, j_Ind ) %  FFD_VOLUME ( Chunk ID, i_Ind, j_Ind ) DV_PARAM= ( wing, 1, 0, 0, 1 ) % % New value of the shape deformation DV_VALUE= 0.0001 % % Number of smoothing iterations for FEA mesh deformation DEFORM_LINEAR_ITER= 500 % % Number of nonlinear deformation iterations (surface deformation increments) DEFORM_NONLINEAR_ITER= 1 % % Print the residuals during mesh deformation to the console (YES, NO) DEFORM_CONSOLE_OUTPUT= YES % % Factor to multiply smallest cell volume for deform tolerance (0.001 default) DEFORM_TOL_FACTOR = 0.001 % % Type of element stiffness imposed for FEA mesh deformation (INVERSE_VOLUME, % WALL_DISTANCE, CONSTANT_STIFFNESS) DEFORM_STIFFNESS_TYPE= INVERSE_VOLUME % % Visualize the deformation (NO, YES) VISUALIZE_DEFORMATION= YES % %  OPTIMAL SHAPE DESIGN DEFINITION % % Available Objective functions % DRAG, LIFT, SIDEFORCE, PRESSURE, FORCE_X, FORCE_Y, % FORCE_Z, MOMENT_X, MOMENT_Y, MOMENT_Z, EFFICIENCY, % EQUIVALENT_AREA, THRUST, TORQUE, FREESURFACE % Optimization objective function with optional scaling factor % ex= Objective * Scale OPT_OBJECTIVE= LIFT * 0.0001 % Optimization constraint functions with scaling factors, separated by semicolons % ex= (Objective = Value ) * Scale, use '>','<','=' OPT_CONSTRAINT= ( DRAG < 0.032 ) * 0.001 % List of design variables (Design variables are separated by semicolons) %  HICKS_HENNE ( 1, Scale  Mark. List  Lower(0)/Upper(1) side, x_Loc ) %  NACA_4DIGITS ( 4, Scale  Mark. List  1st digit, 2nd digit, 3rd and 4th digit ) %  DISPLACEMENT ( 5, Scale  Mark. List  x_Disp, y_Disp, z_Disp ) %  ROTATION ( 6, Scale  Mark. List  x_Axis, y_Axis, z_Axis, x_Turn, y_Turn, z_Turn ) %  FFD_CONTROL_POINT ( 7, Scale  Mark. List  Chunk, i_Ind, j_Ind, k_Ind, x_Mov, y_Mov, z_Mov ) %  FFD_DIHEDRAL_ANGLE ( 8, Scale  Mark. List  Chunk, x_Orig, y_Orig, z_Orig, x_End, y_End, z_End ) %  FFD_TWIST_ANGLE ( 9, Scale  Mark. List  Chunk, x_Orig, y_Orig, z_Orig, x_End, y_End, z_End ) %  FFD_ROTATION ( 10, Scale  Mark. List  Chunk, x_Orig, y_Orig, z_Orig, x_End, y_End, z_End ) %  FFD_CAMBER ( 11, Scale  Mark. List  Chunk, i_Ind, j_Ind ) %  FFD_THICKNESS ( 12, Scale  Mark. List  Chunk, i_Ind, j_Ind ) %  FFD_VOLUME ( 13, Scale  Mark. List  Chunk, i_Ind, j_Ind ) % FFD_CONTROL_POINT_2D ( 15, Scale  Mark. List  FFD_BoxTag, i_Ind, j_Ind, x_Mov, y_Mov ) DEFINITION_DV= ( 15, 1.0  airfoil  wing, 1, 0, 0, 1 ); ( 15, 1.0  airfoil  wing, 2, 0, 0, 1 ); ( 15, 1.0  airfoil  wing, 3, 0, 0, 1 ); ( 15, 1.0  airfoil  wing, 4, 0, 0, 1 ); ( 15, 1.0  airfoil  wing, 5, 0, 0, 1 ); ( 15, 1.0  airfoil  wing, 6, 0, 0, 1 ); ( 15, 1.0  airfoil  wing, 7, 0, 0, 1 ); ( 15, 1.0  airfoil  wing, 8, 0, 0, 1 ); ( 15, 1.0  airfoil  wing, 9, 0, 0, 1 ); ( 15, 1.0  airfoil  wing, 10, 0, 0, 1 ); ( 15, 1.0  airfoil  wing, 11, 0, 0, 1 ); ( 15, 1.0  airfoil  wing, 12, 0, 0, 1 ); ( 15, 1.0  airfoil  wing, 13, 0, 0, 1 ); ( 15, 1.0  airfoil  wing, 14, 0, 0, 1 ); ( 15, 1.0  airfoil  wing, 15, 0, 0, 1 ); ( 15, 1.0  airfoil  wing, 16, 0, 0, 1 ); ( 15, 1.0  airfoil  wing, 17, 0, 0, 1 ); ( 15, 1.0  airfoil  wing, 18, 0, 0, 1 ); ( 15, 1.0  airfoil  wing, 19, 0, 0, 1 ); ( 15, 1.0  airfoil  wing, 20, 0, 0, 1 ); ( 15, 1.0  airfoil  wing, 21, 0, 0, 1 ); ( 15, 1.0  airfoil  wing, 22, 0, 0, 1 ); ( 15, 1.0  airfoil  wing, 23, 0, 0, 1 ); ( 15, 1.0  airfoil  wing, 24, 0, 0, 1 ); ( 15, 1.0  airfoil  wing, 25, 0, 0, 1 );( 15, 1.0  airfoil  wing, 1, 1, 0, 1 ); ( 15, 1.0  airfoil  wing, 2, 1, 0, 1 ); ( 15, 1.0  airfoil  wing, 3, 1, 0, 1 ); ( 15, 1.0  airfoil  wing, 4, 1, 0, 1 ); ( 15, 1.0  airfoil  wing, 5, 1, 0, 1 ); ( 15, 1.0  airfoil  wing, 6, 1, 0, 1 ); ( 15, 1.0  airfoil  wing, 7, 1, 0, 1 ); ( 15, 1.0  airfoil  wing, 8, 1, 0, 1 ); ( 15, 1.0  airfoil  wing, 9, 1, 0, 1 ); ( 15, 1.0  airfoil  wing, 10, 1, 0, 1 ); ( 15, 1.0  airfoil  wing, 11, 1, 0, 1 ); ( 15, 1.0  airfoil  wing, 12, 1, 0, 1 ); ( 15, 1.0  airfoil  wing, 13, 1, 0, 1 ); ( 15, 1.0  airfoil  wing, 14, 1, 0, 1 ); ( 15, 1.0  airfoil  wing, 15, 1, 0, 1 ); ( 15, 1.0  airfoil  wing, 16, 1, 0, 1 ); ( 15, 1.0  airfoil  wing, 17, 1, 0, 1 ); ( 15, 1.0  airfoil  wing, 18, 1, 0, 1 ); ( 15, 1.0  airfoil  wing, 19, 1, 0, 1 ); ( 15, 1.0  airfoil  wing, 20, 1, 0, 1 ); ( 15, 1.0  airfoil  wing, 21, 1, 0, 1 ); ( 15, 1.0  airfoil  wing, 22, 1, 0, 1 ); ( 15, 1.0  airfoil  wing, 23, 1, 0, 1 ); ( 15, 1.0  airfoil  wing, 24, 1, 0, 1 ); ( 15, 1.0  airfoil  wing, 25, 1, 0, 1 ) 
I'm not sure exactly what you mean about it not working, but I can offer a couple of tips:
1. Check that the initial point is feasible, aka that the drag does not violate the constraint. Optimization routines often act in undesired ways if the initial point violates a constraint. 2. Alter the balance between the weight of the constraint and the objective. These weights serve two purposes: on the objective, a smaller weight can prevent the optimization from taking too large of a step on the first iteration. Too small of a scale can correspondingly lead the optimizer to take only very small steps and converge slowly. The balance between weights on several objectives and/or constraints tells the optimizer which to prioritize. Right now, the optimizer is prioritizing the drag constraint over the lift objective. 3. The sign of the objective is controlled within the python tools, where objectives that are traditionally maximized have been multiplied by 1, so you do not need the negative sign on the scale. 
With "not working" i mean that after two evaluation the deformation diverges, and when i visualize the deformation i only see a vertical line. I've multiplied by 1 the lift because i'm doing this test case for the automotive field and i've to create more downforce (or negative lift). I really appreciate your help, i'll try your suggestions.

Quote:
The divergence could be due to either to the constraint being violated (where the optimizer would try to fix it so that it satisfies the constraint but doesn't have any information on how to do that on the first iteration), or due to the scaling factor being too large. 
Quote:
I tested a grid deformation with FFD_CONTROL_POINT_2D but the output mesh is disordered. I set the DV like this DV_KIND= FFD_CONTROL_POINT_2D DV_MARKER= ( airfoil ) DV_PARAM= ( wing, 12.0, 1.0, 0.0, 1.0) DV_VALUE= 0.001 as you see,a small change with one ffd point.However,the output mesh is such a disordered mesh. The detailed discuss you can see at http://www.cfdonline.com/Forums/su2...imization.html. Sorry to bother you! Many thanks! 
All times are GMT 4. The time now is 09:17. 