CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > SU2

Change Design Variables

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 12, 2022, 13:09
Exclamation Change Design Variables
  #1
New Member
 
Zahra
Join Date: May 2022
Posts: 5
Rep Power: 2
Zahra_m is on a distinguished road
Hi everyone,

I am trying to optimize an airfoil with my own mesh to minimize Cd with fixed CL.

I completed the optimization, which has 20 points as design variables (DEFINITION_DV) on each surface, and it worked well.
Now I want to change the number of design variables to 10 points and 25 points.

So I just changed the "DEFINITION_DV" with the same mesh and same code. But it does not work anymore.
Do you have any idea about how can I deal with this problem? Do I need to change any other thing rather than DEFINITION_DV?

% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------%
%
% Physical governing equations (EULER, NAVIER_STOKES,
% WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY,
% POISSON_EQUATION)
SOLVER= RANS
%
% Specify turbulent model (NONE, SA, SA_NEG, SST)
KIND_TURB_MODEL= SA
%
% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT)
MATH_PROBLEM= DIRECT
%
% Restart solution (NO, YES)
RESTART_SOL= YES

% -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------%
%
% Mach number (non-dimensional, based on the free-stream values)
MACH_NUMBER= 0.754
%
% Angle of attack (degrees, only for compressible flows)
AOA= 2.57
%
% Free-stream temperature (288.15 K by default)
FREESTREAM_TEMPERATURE= 288.15
%
% Reynolds number (non-dimensional, based on the free-stream values)
REYNOLDS_NUMBER= 6.2E6
%
% Reynolds length (1 m by default)
REYNOLDS_LENGTH= 1.0

% -------------------------- CL DRIVER DEFINITION -----------------------------%
%
% Activate fixed lift mode (specify a CL instead of AoA, NO/YES)
FIXED_CL_MODE= YES
%
% Target coefficient of lift for fixed lift mode (0.80 by default)
TARGET_CL= 0.71
%
% Estimation of dCL/dAlpha (0.2 per degree by default)
DCL_DALPHA= 0.2
%
% Maximum number of iterations between AoA updates
UPDATE_AOA_ITER_LIMIT= 100
%
% Number of iterations to evaluate dCL/dAlpha at the end of the simulation
ITER_DCL_DALPHA= 500
%
% Evaluate dObjFunc/dCL during runtime (YES) or use the value stored in the
% direct solution file (NO).
EVAL_DOF_DCX= NO

% ---------------------- 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 non-dimensional moment
REF_LENGTH= 1.0
%
% Reference area for force coefficients (0 implies automatic calculation)
REF_AREA= 1.0

% -------------------- BOUNDARY CONDITION DEFINITION --------------------------%
%
% Navier-Stokes wall boundary marker(s) (NONE = no marker)
MARKER_HEATFLUX= ( AIRFOIL, 0.0 )
%
% 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
%
% Courant-Friedrichs-Lewy condition of the finest grid
CFL_NUMBER= 5.0
%
% Number of total iterations
ITER= 200000
%
% Objective function in gradient evaluation (DRAG, LIFT, SIDEFORCE, MOMENT_X,
% MOMENT_Y, MOMENT_Z, EFFICIENCY)
OBJECTIVE_FUNCTION= DRAG

% ----------- SLOPE LIMITER AND DISSIPATION SENSOR DEFINITION -----------------%
%
% Monotonic Upwind Scheme for Conservation Laws (TVD) in the flow equations.
% Required for 2nd order upwind schemes (NO, YES)
MUSCL_FLOW= YES
%
% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG,
% BARTH_JESPERSEN, VAN_ALBADA_EDGE)
SLOPE_LIMITER_FLOW= VENKATAKRISHNAN
%
% Monotonic Upwind Scheme for Conservation Laws (TVD) in the turbulence equations.
% Required for 2nd order upwind schemes (NO, YES)
MUSCL_TURB= NO
%
% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG,
% BARTH_JESPERSEN, VAN_ALBADA_EDGE)
SLOPE_LIMITER_TURB= VENKATAKRISHNAN
%
% Monotonic Upwind Scheme for Conservation Laws (TVD) in the adjoint flow equations.
% Required for 2nd order upwind schemes (NO, YES)
MUSCL_ADJFLOW= YES
%
% Slope limiter (NONE, VENKATAKRISHNAN, BARTH_JESPERSEN, VAN_ALBADA_EDGE,
% SHARP_EDGES, WALL_DISTANCE)
SLOPE_LIMITER_ADJFLOW= VENKATAKRISHNAN
%
% Monotonic Upwind Scheme for Conservation Laws (TVD) in the turbulence adjoint equations.
% Required for 2nd order upwind schemes (NO, YES)
MUSCL_ADJTURB= NO
%
% Slope limiter (NONE, VENKATAKRISHNAN, BARTH_JESPERSEN, VAN_ALBADA_EDGE)
SLOPE_LIMITER_ADJTURB= VENKATAKRISHNAN
%
% Coefficient for the Venkat's limiter (upwind scheme). A larger values decrease
% the extent of limiting, values approaching zero cause
% lower-order approximation to the solution (0.05 by default)
VENKAT_LIMITER_COEFF= 0.05
%
% Coefficient for the adjoint sharp edges limiter (3.0 by default).
ADJ_SHARP_LIMITER_COEFF= 3.0
%
% Freeze the value of the limiter after a number of iterations
LIMITER_ITER= 999999
%
% 1st order artificial dissipation coefficients for
% the Lax–Friedrichs method ( 0.15 by default )
LAX_SENSOR_COEFF= 0.15
%
% 2nd and 4th order artificial dissipation coefficients for
% the JST method ( 0.5, 0.02 by default )
JST_SENSOR_COEFF= ( 0.5, 0.02 )
%
% 1st order artificial dissipation coefficients for
% the adjoint Lax†"Friedrichs method ( 0.15 by default )
ADJ_LAX_SENSOR_COEFF= 0.15
%
% 2nd, and 4th order artificial dissipation coefficients for
% the adjoint JST method ( 0.5, 0.02 by default )
ADJ_JST_SENSOR_COEFF= ( 0.5, 0.02 )

% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------%
%
% Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, HLLC,
% TURKEL_PREC, MSW)
CONV_NUM_METHOD_FLOW= JST
%
% Entropy fix coefficient (0.0 implies no entropy fixing, 1.0 implies scalar
% artificial dissipation)
ENTROPY_FIX_COEFF= 0.001
%
% Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT)
TIME_DISCRE_FLOW= EULER_IMPLICIT

% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------%
%
% Convective numerical method (SCALAR_UPWIND)
CONV_NUM_METHOD_TURB= SCALAR_UPWIND
%
% Time discretization (EULER_IMPLICIT)
TIME_DISCRE_TURB= EULER_IMPLICIT
%
% Reduction factor of the CFL coefficient in the turbulence problem
CFL_REDUCTION_TURB= 1.0

% ---------------- ADJOINT-FLOW NUMERICAL METHOD DEFINITION -------------------%
%
% Convective numerical method (JST, LAX-FRIEDRICH, ROE)
CONV_NUM_METHOD_ADJFLOW= JST
%
% Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT)
TIME_DISCRE_ADJFLOW= EULER_IMPLICIT
%
% Relaxation coefficient
RELAXATION_FACTOR_ADJOINT= 1.0
%
% Reduction factor of the CFL coefficient in the adjoint problem
CFL_REDUCTION_ADJFLOW= 0.8
%
% Limit value for the adjoint variable
LIMIT_ADJFLOW= 1E6

% ----------------------- 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, FUSELAGE)
GEO_DESCRIPTION= AIRFOIL
%
% Geometrical evaluation mode (FUNCTION, GRADIENT)
GEO_MODE= FUNCTION

% --------------------------- CONVERGENCE PARAMETERS --------------------------%
%
% Min value of the residual (log10 of the residual)
CONV_RESIDUAL_MINVAL= -20
%
% Start convergence criteria at iteration number
CONV_STARTITER= 10
%
% Number of elements to apply the criteria
CONV_CAUCHY_ELEMS= 100
%
% Epsilon to control the series convergence
CONV_CAUCHY_EPS= 1E-6
%

% ------------------------- INPUT/OUTPUT INFORMATION --------------------------%
%
% Mesh input file
MESH_FILENAME= ThreeT_v2.su2
%
% Mesh input file format (SU2, CGNS, NETCDF_ASCII)
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 file format (PARAVIEW, TECPLOT, STL)
TABULAR_FORMAT= CSV
%
% Output file convergence history (w/o extension)
CONV_FILENAME= history
%
% 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 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
%
% Writing solution file frequency
OUTPUT_WRT_FREQ= 10000
%
%
% Screen output
SCREEN_OUTPUT=(INNER_ITER, RMS_DENSITY, RMS_NU_TILDE, LIFT, DRAG)
%
% Output files
OUTPUT_FILES= (RESTART, PARAVIEW, SURFACE_PARAVIEW, SURFACE_CSV)
% ----------------------- DESIGN VARIABLE PARAMETERS --------------------------%
% Kind of deformation (FFD_SETTING, FFD_CONTROL_POINT_2D, FFD_CAMBER_2D, FFD_THICKNESS_2D,
% HICKS_HENNE, PARABOLIC,
% NACA_4DIGITS, DISPLACEMENT, ROTATION, FFD_CONTROL_POINT,
% FFD_NACELLE, FFD_TWIST, FFD_ROTATION,
% FFD_CAMBER, FFD_THICKNESS, SURFACE_FILE)
DV_KIND= HICKS_HENNE
%
% 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 )
% - 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 ( FFD_BoxTag ID, i_Ind, j_Ind, k_Ind, x_Disp, y_Disp, z_Disp )
% - FFD_DIHEDRAL_ANGLE ( FFD_BoxTag ID, x_Orig, y_Orig, z_Orig, x_End, y_End, z_End )
% - FFD_TWIST_ANGLE ( FFD_BoxTag ID, x_Orig, y_Orig, z_Orig, x_End, y_End, z_End )
% - FFD_ROTATION ( FFD_BoxTag ID, x_Orig, y_Orig, z_Orig, x_End, y_End, z_End )
% - FFD_CAMBER ( FFD_BoxTag ID, i_Ind, j_Ind )
% - FFD_THICKNESS ( FFD_BoxTag ID, i_Ind, j_Ind )
% - FFD_VOLUME ( FFD_BoxTag ID, i_Ind, j_Ind )
DV_PARAM= ( 1, 0.5 )
%
% New value of the shape deformation
DV_VALUE= 0.01

% --------------------- 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 scaling factor, separated by semicolons.
% To include quadratic penalty function: use OPT_CONSTRAINT option syntax within the OPT_OBJECTIVE list.
% ex= Objective * Scale
OPT_OBJECTIVE= DRAG
%
% Optimization constraint functions with pushing factors (affects its value, not the gradient in the python scripts), separated by semicolons
% ex= (Objective = Value ) * Scale, use '>','<','='
OPT_CONSTRAINT= ( MOMENT_Z < 0.093 ) * 0.001; ( AIRFOIL_THICKNESS > 0.12 ) * 0.001
%
% Factor to reduce the norm of the gradient (affects the objective function and gradient in the python scripts)
% In general, a norm of the gradient ~1E-6 is desired.
OPT_GRADIENT_FACTOR= 1E-6
%
% Factor to relax or accelerate the optimizer convergence (affects the line search in SU2_DEF)
% In general, surface deformations of 0.01'' or 0.0001m are desirable
OPT_RELAX_FACTOR= 1E2
%
% Maximum number of iterations
OPT_ITERATIONS= 100
%
% Requested accuracy
OPT_ACCURACY= 1E-10
%
% Optimization bound (bounds the line search in SU2_DEF)
OPT_LINE_SEARCH_BOUND= 1E6
%
% Upper bound for each design variable (bound in the python optimizer)
OPT_BOUND_UPPER= 1E10
%
% Lower bound for each design variable (bound in the python optimizer)
OPT_BOUND_LOWER= -1E10

% List of available design variables (Design variables are separated by semicolons)
%
% 2D Design variables
% FFD_CONTROL_POINT_2D ( 19, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind, x_Mov, y_Mov )
% FFD_CAMBER_2D ( 20, Scale | Mark. List | FFD_BoxTag, i_Ind )
% FFD_THICKNESS_2D ( 21, Scale | Mark. List | FFD_BoxTag, i_Ind )
% FFD_TWIST_2D ( 22, Scale | Mark. List | FFD_BoxTag, x_Orig, y_Orig )
% HICKS_HENNE ( 30, Scale | Mark. List | Lower(0)/Upper(1) side, x_Loc )
% ANGLE_OF_ATTACK ( 101, Scale | Mark. List | 1.0 )
%
% 3D Design variables
% FFD_CONTROL_POINT ( 11, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind, k_Ind, x_Mov, y_Mov, z_Mov )
% FFD_NACELLE ( 12, Scale | Mark. List | FFD_BoxTag, rho_Ind, theta_Ind, phi_Ind, rho_Mov, phi_Mov )
% FFD_GULL ( 13, Scale | Mark. List | FFD_BoxTag, j_Ind )
% FFD_CAMBER ( 14, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind )
% FFD_TWIST ( 15, Scale | Mark. List | FFD_BoxTag, j_Ind, x_Orig, y_Orig, z_Orig, x_End, y_End, z_End )
% FFD_THICKNESS ( 16, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind )
% FFD_ROTATION ( 18, Scale | Mark. List | FFD_BoxTag, x_Axis, y_Axis, z_Axis, x_Turn, y_Turn, z_Turn )
% FFD_ANGLE_OF_ATTACK ( 24, Scale | Mark. List | FFD_BoxTag, 1.0 )
%
% Global design variables
% TRANSLATION ( 1, Scale | Mark. List | x_Disp, y_Disp, z_Disp )
% ROTATION ( 2, Scale | Mark. List | x_Axis, y_Axis, z_Axis, x_Turn, y_Turn, z_Turn )
%
DEFINITION_DV= ( 30, 1.0 | AIRFOIL | 0, 0.10 ); ( 30, 1.0 | AIRFOIL | 0, 0.20 ); ( 30, 1.0 | AIRFOIL | 0, 0.30 ); ( 30, 1.0 | AIRFOIL | 0, 0.40 ); ( 30, 1.0 | AIRFOIL | 0, 0.50 ); ( 30, 1.0 | AIRFOIL | 0, 0.60 ); ( 30, 1.0 | AIRFOIL | 0, 0.70 ); ( 30, 1.0 | AIRFOIL | 0, 0.80 ); ( 30, 1.0 | AIRFOIL | 0, 0.90 ); ( 30, 1.0 | AIRFOIL | 1, 0.10 ); ( 30, 1.0 | AIRFOIL | 1, 0.20 ); ( 30, 1.0 | AIRFOIL | 1, 0.30 ); ( 30, 1.0 | AIRFOIL | 1, 0.40 ); ( 30, 1.0 | AIRFOIL | 1, 0.50 ); ( 30, 1.0 | AIRFOIL | 1, 0.60 ); ( 30, 1.0 | AIRFOIL | 1, 0.70 ); ( 30, 1.0 | AIRFOIL | 1, 0.80 ); ( 30, 1.0 | AIRFOIL | 1, 0.90 )
Zahra_m is offline   Reply With Quote

Old   July 17, 2022, 00:08
Default
  #2
Senior Member
 
Wally Maier
Join Date: Apr 2019
Posts: 104
Rep Power: 5
wallym is on a distinguished road
Hi Zahra,

Why doesn't it work anymore? What happens in the simulation?

How many points along the airfoil are present in the mesh?
You should only need to change the DEFINITION_DV, though the config you posted does not have 25 design variables ( I count 18).

Wally
wallym is offline   Reply With Quote

Old   July 21, 2022, 18:58
Default
  #3
New Member
 
Zahra
Join Date: May 2022
Posts: 5
Rep Power: 2
Zahra_m is on a distinguished road
Quote:
Originally Posted by wallym View Post
Hi Zahra,

Why doesn't it work anymore? What happens in the simulation?

How many points along the airfoil are present in the mesh?
You should only need to change the DEFINITION_DV, though the config you posted does not have 25 design variables ( I count 18).

Wally
Dear Walley,
Thank you so much for your reply.

The point is that I have produced a mesh, and when I run the optimization with my mesh, I can achieve 44 designs, and the code works when I define design variable points every 5%.
So when I have :

DEFINITION_DV= ( 30, 1.0 | AIRFOIL | 0, 0.05 ); ( 30, 1.0 | AIRFOIL | 0, 0.10 ); ... it works.

But with the same mesh when I change the point to DEFINITION_DV= ( 30, 1.0 | AIRFOIL | 0, 0.10 ); ( 30, 1.0 | AIRFOIL | 0, 0.20 ); ...

or

DEFINITION_DV= ( 30, 1.0 | AIRFOIL | 0, 0.04 ); ( 30, 1.0 | AIRFOIL | 0, 0.08 ); ...

It does not work and diverges after three designs.
The GNORM will be 1.912584E+124. and the direct simulation of the final design diverges.

Is there anything that we have to consider for mesh generation?
Or anything that we have to change as well as the "DEFINITION_DV" when we want to change the design variables point?

Many thanks again for your reply
Zahra
Zahra_m is offline   Reply With Quote

Reply

Tags
dv_definition, optimizaion, su2

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Issue on the design change when using the Ansys FLUENT adjoint-based shape optimizer zyao1 FLUENT 0 December 4, 2020 10:56
Change foamLog for Pimple iteration and new variables Magistrane OpenFOAM Post-Processing 1 April 26, 2019 05:26
Component update can be performed only in base design point Domenico83 CFX 0 March 10, 2017 06:48
JOB: Sr. Thermal/Mechanical Design Engineer Dee Dee Dial Main CFD Forum 0 April 1, 2003 19:49
CFD - Trends and Perspectives Jonas Larsson Main CFD Forum 16 August 7, 1998 17:27


All times are GMT -4. The time now is 19:21.