Skip to content

Commit 605839a

Browse files
committed
Apply suggestions from Code Review
1 parent 59a142b commit 605839a

4 files changed

Lines changed: 41 additions & 168 deletions

File tree

SU2_CFD/src/iteration/CFluidIteration.cpp

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -329,23 +329,17 @@ void CFluidIteration::SetWind_GustField(CConfig* config, CGeometry** geometry, C
329329

330330
su2double Uinf = solver[MESH_0][FLOW_SOL]->GetVelocity_Inf(0); // Assumption gust moves at infinity velocity
331331

332-
Gust = new su2double[nDim];
333-
NewGridVel = new su2double[nDim];
334-
for (iDim = 0; iDim < nDim; iDim++) {
335-
Gust[iDim] = 0.0;
336-
NewGridVel[iDim] = 0.0;
337-
}
332+
Gust = new su2double[nDim]();
333+
NewGridVel = new su2double[nDim]();
334+
GustDer = new su2double[nDim+1]();
338335

339336
// Print some information to check that we are doing the right thing. Not sure how to convert the index back to a string...
340-
if (rank == MASTER_NODE) cout << endl << "Setting up a wind gust type " << Gust_Type << " with amplitude of " << gust_amp << " in direction " << GustDir << endl;
341-
if (rank == MASTER_NODE) cout << " U_inf = " << Uinf << endl;
342-
if (rank == MASTER_NODE) cout << " Physical_t = " << Physical_t << endl;
343-
su2double loc_x = (xbegin + L + Uinf * (Physical_t - tbegin));
344-
if (rank == MASTER_NODE) cout << " Location_x = " << loc_x << endl;
345-
346-
GustDer = new su2double[nDim+1];
347-
for (unsigned short i = 0; i < nDim+1; i++) {
348-
GustDer[i] = 0.0;
337+
if (rank == MASTER_NODE) {
338+
cout << endl << "Setting up a wind gust type " << Gust_Type << " with amplitude of " << gust_amp << " in direction " << GustDir << endl;
339+
cout << " U_inf = " << Uinf << endl;
340+
cout << " Physical_t = " << Physical_t << endl;
341+
su2double loc_x = (xbegin + L + Uinf * (Physical_t - tbegin));
342+
cout << " Location_x = " << loc_x << endl;
349343
}
350344

351345
// Vortex variables

SU2_CFD/src/numerics/flow/flow_sources.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ CNumerics::ResidualType<> CSourceWindGust::ComputeResidual(const CConfig* config
790790
residual[2] = 0.0;
791791
residual[3] = 0.0;
792792
residual[4] = 0.0;
793-
}
793+
}
794794

795795
/*--- For now the source term Jacobian is just set to zero ---*/
796796
//bool implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT);
Lines changed: 13 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,26 @@
1+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2+
% %
3+
% SU2 configuration file %
4+
% Case description: Cosine gust in z-direction of a 3D mesh %
5+
% Author: Arne Voß %
6+
% Institution: DLR %
7+
% Date: 25.05.2023 %
8+
% File Version 7.5.1 "Blackbird" %
9+
% %
10+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11+
112
% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------%
213
%
3-
% Solver type (EULER, NAVIER_STOKES, RANS,
4-
% INC_EULER, INC_NAVIER_STOKES, INC_RANS,
5-
% NEMO_EULER, NEMO_NAVIER_STOKES,
6-
% FEM_EULER, FEM_NAVIER_STOKES, FEM_RANS, FEM_LES,
7-
% HEAT_EQUATION_FVM, ELASTICITY)
814
SOLVER= EULER
9-
%
10-
% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT)
1115
MATH_PROBLEM= DIRECT
1216
%
13-
% Restart solution (NO, YES)
1417
RESTART_SOL= YES
15-
%
16-
% Iteration number to begin unsteady restarts
1718
RESTART_ITER= 72
1819
%
1920
% ------------------------------- SOLVER CONTROL ------------------------------%
2021
%
21-
% Maximum number of inner iterations
2222
INNER_ITER= 30
23-
%
24-
% Min value of the residual (log10 of the residual)
2523
CONV_RESIDUAL_MINVAL= -6
26-
%
27-
% Start convergence criteria at iteration number
2824
CONV_STARTITER= 0
2925
%
3026
% ------------------------- UNSTEADY SIMULATION -------------------------------%
@@ -49,124 +45,67 @@ GUST_PERIODS= 1.0
4945
GUST_AMPL= 2.37
5046
%
5147
GUST_BEGIN_TIME= 0.0
48+
% Gust is placed 5m ahead of the wing
5249
GUST_BEGIN_LOC=-10.0
5350
% -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------%
5451
%
55-
% Mach number (non-dimensional, based on the free-stream values)
5652
MACH_NUMBER= 0.2
57-
%
58-
% Angle of attack (degrees, only for compressible flows)
5953
AOA= 0.0
60-
%
61-
% Side-slip angle (degrees, only for compressible flows)
6254
SIDESLIP_ANGLE= 0.0
63-
%
64-
% Free-stream option to choose between density and temperature (default) for
65-
% initializing the solution (TEMPERATURE_FS, DENSITY_FS)
6655
FREESTREAM_OPTION= DENSITY_FS
67-
%
68-
% Free-stream pressure (101325.0 N/m^2, 2116.216 psf by default)
6956
FREESTREAM_PRESSURE= 101325.0
70-
%
71-
% Free-stream density (1.2886 Kg/m^3, 0.0025 slug/ft^3 by default)
7257
FREESTREAM_DENSITY= 1.225
73-
%
74-
% Free-stream temperature (288.15 K, 518.67 R by default)
7558
FREESTREAM_TEMPERATURE= 288.15
7659
%
7760
% ---------------------- REFERENCE VALUE DEFINITION ---------------------------%
7861
%
79-
% Reference origin for moment computation (m or in)
8062
REF_ORIGIN_MOMENT_X = 0.25
8163
REF_ORIGIN_MOMENT_Y = 0.00
8264
REF_ORIGIN_MOMENT_Z = 0.00
83-
%
84-
% Reference length for moment non-dimensional coefficients (m or in)
8565
REF_LENGTH= 1.0
86-
%
87-
% Reference area for non-dimensional force coefficients (0 implies automatic
88-
% calculation) (m^2 or in^2)
8966
REF_AREA= 3.0
90-
%
91-
% Aircraft semi-span (0 implies automatic calculation) (m or in)
9267
SEMI_SPAN= 1.5
93-
%
94-
% Flow non-dimensionalization (DIMENSIONAL, FREESTREAM_PRESS_EQ_ONE,
95-
% FREESTREAM_VEL_EQ_MACH, FREESTREAM_VEL_EQ_ONE)
9668
REF_DIMENSIONALIZATION= DIMENSIONAL
9769

9870
% -------------------- BOUNDARY CONDITION DEFINITION --------------------------%
9971
%
100-
% Euler wall boundary marker(s) (NONE = no marker)
101-
% Implementation identical to MARKER_SYM.
10272
MARKER_EULER= ( wing, tip)
103-
%
104-
% Far-field boundary marker(s) (NONE = no marker)
10573
MARKER_FAR= ( far_away )
10674

10775
% ------------------------ SURFACES IDENTIFICATION ----------------------------%
10876
%
109-
% Marker(s) of the surface in the surface flow solution file
11077
MARKER_PLOTTING = ( wing, tip )
111-
%
112-
% Marker(s) of the surface where the non-dimensional coefficients are evaluated.
11378
MARKER_MONITORING = ( wing, tip )
11479

11580
% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------%
11681
%
117-
% CFL number (initial value for the adaptive CFL number)
11882
CFL_NUMBER= 1000.0
119-
%
120-
% Adaptive CFL number (NO, YES)
12183
CFL_ADAPT= YES
12284
%
12385
% -------------------------- MULTIGRID PARAMETERS -----------------------------%
12486
%
125-
% Multi-grid levels (0 = no multi-grid)
12687
MGLEVEL= 3
127-
%
128-
% Multi-grid cycle (V_CYCLE, W_CYCLE, FULLMG_CYCLE)
12988
MGCYCLE= W_CYCLE
13089

13190
% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------%
13291
%
133-
% Convective numerical method (JST, JST_KE, JST_MAT, LAX-FRIEDRICH, CUSP, ROE, AUSM,
134-
% AUSMPLUSUP, AUSMPLUSUP2, AUSMPWPLUS, HLLC, TURKEL_PREC,
135-
% SW, MSW, FDS, SLAU, SLAU2, L2ROE, LMROE)
13692
CONV_NUM_METHOD_FLOW= JST
137-
%
138-
% Max number of iterations of the linear solver for the implicit formulation
13993
LINEAR_SOLVER_ITER= 20
14094
%
14195
% ------------------------- SCREEN/HISTORY VOLUME OUTPUT --------------------------%
14296
%
143-
% Screen output fields (use 'SU2_CFD -d <config_file>' to view list of available fields)
14497
SCREEN_OUTPUT= (TIME_ITER, INNER_ITER, RMS_DENSITY, LIFT, MOMENT_X, MOMENT_Y, MOMENT_Z)
145-
%
146-
% History output groups (use 'SU2_CFD -d <config_file>' to view list of available fields)
14798
HISTORY_OUTPUT= (ITER, RMS_RES, AERO_COEFF, CAUCHY, WALL_TIME)
14899
%
149100
% ------------------------- INPUT/OUTPUT FILE INFORMATION --------------------------%
150101
%
151-
% Mesh input file
152102
MESH_FILENAME= mesh_rectangular_wing.su2
153-
%
154-
% Mesh input file format (SU2, CGNS)
155103
MESH_FORMAT= SU2
156-
%
157-
% Restart flow input file
158104
SOLUTION_FILENAME= restart_gust.dat
159105
RESTART_FILENAME= restart_gust.dat
160106
SURFACE_FILENAME= surface_gust
161107
VOLUME_FILENAME= volume_gust
162108
CONV_FILENAME= history_gust
163-
%
164-
% Output tabular file format (TECPLOT, CSV)
165109
TABULAR_FORMAT= CSV
166-
%
167-
% Files to output
168-
% Possible formats : (TECPLOT, TECPLOT_BINARY, SURFACE_TECPLOT,
169-
% SURFACE_TECPLOT_BINARY, CSV, SURFACE_CSV, PARAVIEW, PARAVIEW_BINARY, SURFACE_PARAVIEW,
170-
% SURFACE_PARAVIEW_BINARY, MESH, RESTART_BINARY, RESTART_ASCII, CGNS, SURFACE_CGNS, STL)
171110
OUTPUT_FILES= (RESTART, RESTART_ASCII)
172-
111+
%
Lines changed: 18 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
1+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2+
% %
3+
% SU2 configuration file %
4+
% Case description: Cosine gust combined with mesh deformation %
5+
% Author: Arne Voß %
6+
% Institution: DLR %
7+
% Date: 25.05.2023 %
8+
% File Version 7.5.1 "Blackbird" %
9+
% %
10+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11+
112
% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------%
213
%
3-
% Solver type (EULER, NAVIER_STOKES, RANS,
4-
% INC_EULER, INC_NAVIER_STOKES, INC_RANS,
5-
% NEMO_EULER, NEMO_NAVIER_STOKES,
6-
% FEM_EULER, FEM_NAVIER_STOKES, FEM_RANS, FEM_LES,
7-
% HEAT_EQUATION_FVM, ELASTICITY)
814
SOLVER= EULER
9-
%
10-
% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT)
1115
MATH_PROBLEM= DIRECT
12-
%
1316
% ------------------------------- SOLVER CONTROL ------------------------------%
1417
%
15-
% Maximum number of inner iterations
1618
INNER_ITER= 100
17-
%
18-
% Min value of the residual (log10 of the residual)
1919
CONV_RESIDUAL_MINVAL= -6
20-
%
21-
% Start convergence criteria at iteration number
2220
CONV_STARTITER= 0
2321
%
2422
% ------------------------- UNSTEADY SIMULATION -------------------------------%
@@ -39,11 +37,10 @@ GUST_TYPE= ONE_M_COSINE
3937
GUST_DIR= Y_DIR
4038
GUST_WAVELENGTH= 5.0
4139
GUST_PERIODS= 1.0
42-
% Gust amplitude corresponds to ~2.0 deg AoA
4340
GUST_AMPL= 1.0
44-
%
4541
GUST_BEGIN_TIME= 0.0
4642
GUST_BEGIN_LOC=-5.0
43+
%
4744
% --------------------------- MESH DEFORMATION--------------------------------%
4845
% Type of dynamic surface movement (NONE, DEFORMING, MOVING_WALL,
4946
% AEROELASTIC, AEROELASTIC_RIGID_MOTION EXTERNAL, EXTERNAL_ROTATION)
@@ -60,123 +57,66 @@ SURFACE_PLUNGING_AMPL= 0.0 0.0001 0.0
6057
%
6158
% Move Motion Origin for marker moving (1 or 0)
6259
MOVE_MOTION_ORIGIN = 0
60+
%
6361
% -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------%
6462
%
65-
% Mach number (non-dimensional, based on the free-stream values)
6663
MACH_NUMBER= 0.2
67-
%
68-
% Angle of attack (degrees, only for compressible flows)
6964
AOA= 0.0
70-
%
71-
% Side-slip angle (degrees, only for compressible flows)
7265
SIDESLIP_ANGLE= 0.0
73-
%
74-
% Free-stream option to choose between density and temperature (default) for
75-
% initializing the solution (TEMPERATURE_FS, DENSITY_FS)
7666
FREESTREAM_OPTION= DENSITY_FS
77-
%
78-
% Free-stream pressure (101325.0 N/m^2, 2116.216 psf by default)
7967
FREESTREAM_PRESSURE= 101325.0
80-
%
81-
% Free-stream density (1.2886 Kg/m^3, 0.0025 slug/ft^3 by default)
8268
FREESTREAM_DENSITY= 1.225
83-
%
84-
% Free-stream temperature (288.15 K, 518.67 R by default)
8569
FREESTREAM_TEMPERATURE= 288.15
8670
%
8771
% ---------------------- REFERENCE VALUE DEFINITION ---------------------------%
8872
%
89-
% Reference origin for moment computation (m or in)
9073
REF_ORIGIN_MOMENT_X = 0.25
9174
REF_ORIGIN_MOMENT_Y = 0.00
9275
REF_ORIGIN_MOMENT_Z = 0.00
93-
%
94-
% Reference length for moment non-dimensional coefficients (m or in)
9576
REF_LENGTH= 1.0
96-
%
97-
% Reference area for non-dimensional force coefficients (0 implies automatic
98-
% calculation) (m^2 or in^2)
9977
REF_AREA= 1.0
100-
%
101-
% Aircraft semi-span (0 implies automatic calculation) (m or in)
10278
SEMI_SPAN= 1.0
103-
%
104-
% Flow non-dimensionalization (DIMENSIONAL, FREESTREAM_PRESS_EQ_ONE,
105-
% FREESTREAM_VEL_EQ_MACH, FREESTREAM_VEL_EQ_ONE)
10679
REF_DIMENSIONALIZATION= DIMENSIONAL
107-
80+
%
10881
% -------------------- BOUNDARY CONDITION DEFINITION --------------------------%
10982
%
110-
% Euler wall boundary marker(s) (NONE = no marker)
111-
% Implementation identical to MARKER_SYM.
11283
MARKER_EULER= ( airfoil )
113-
%
114-
% Far-field boundary marker(s) (NONE = no marker)
11584
MARKER_FAR= ( farfield )
116-
85+
%
11786
% ------------------------ SURFACES IDENTIFICATION ----------------------------%
11887
%
119-
% Marker(s) of the surface in the surface flow solution file
12088
MARKER_PLOTTING = ( airfoil )
121-
%
122-
% Marker(s) of the surface where the non-dimensional coefficients are evaluated.
12389
MARKER_MONITORING = ( airfoil )
124-
90+
%
12591
% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------%
12692
%
127-
% CFL number (initial value for the adaptive CFL number)
12893
CFL_NUMBER= 100.0
129-
%
130-
% Adaptive CFL number (NO, YES)
13194
CFL_ADAPT= YES
13295
%
13396
% -------------------------- MULTIGRID PARAMETERS -----------------------------%
13497
%
135-
% Multi-grid levels (0 = no multi-grid)
13698
MGLEVEL= 3
137-
%
138-
% Multi-grid cycle (V_CYCLE, W_CYCLE, FULLMG_CYCLE)
13999
MGCYCLE= W_CYCLE
140-
100+
%
141101
% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------%
142102
%
143-
% Convective numerical method (JST, JST_KE, JST_MAT, LAX-FRIEDRICH, CUSP, ROE, AUSM,
144-
% AUSMPLUSUP, AUSMPLUSUP2, AUSMPWPLUS, HLLC, TURKEL_PREC,
145-
% SW, MSW, FDS, SLAU, SLAU2, L2ROE, LMROE)
146103
CONV_NUM_METHOD_FLOW= JST
147-
%
148-
% Max number of iterations of the linear solver for the implicit formulation
149104
LINEAR_SOLVER_ITER= 20
150105
%
151106
% ------------------------- SCREEN/HISTORY VOLUME OUTPUT --------------------------%
152107
%
153-
% Screen output fields (use 'SU2_CFD -d <config_file>' to view list of available fields)
154108
SCREEN_OUTPUT= (TIME_ITER, INNER_ITER, RMS_DENSITY, LIFT, MOMENT_Z)
155-
%
156-
% History output groups (use 'SU2_CFD -d <config_file>' to view list of available fields)
157109
HISTORY_OUTPUT= (ITER, RMS_RES, AERO_COEFF, CAUCHY, WALL_TIME)
158110
%
159111
% ------------------------- INPUT/OUTPUT FILE INFORMATION --------------------------%
160112
%
161-
% Mesh input file
162113
MESH_FILENAME= mesh_NACA0012_inv.su2
163-
%
164-
% Mesh input file format (SU2, CGNS)
165114
MESH_FORMAT= SU2
166-
%
167-
% Restart flow input file
168115
SOLUTION_FILENAME= restart_gust.dat
169116
RESTART_FILENAME= restart_gust.dat
170117
SURFACE_FILENAME= surface_gust
171118
VOLUME_FILENAME= volume_gust
172119
CONV_FILENAME= history_gust
173-
%
174-
% Output tabular file format (TECPLOT, CSV)
175120
TABULAR_FORMAT= CSV
176-
%
177-
% Files to output
178-
% Possible formats : (TECPLOT, TECPLOT_BINARY, SURFACE_TECPLOT,
179-
% SURFACE_TECPLOT_BINARY, CSV, SURFACE_CSV, PARAVIEW, PARAVIEW_BINARY, SURFACE_PARAVIEW,
180-
% SURFACE_PARAVIEW_BINARY, MESH, RESTART_BINARY, RESTART_ASCII, CGNS, SURFACE_CGNS, STL)
181121
OUTPUT_FILES= (NONE)
182-
122+
%

0 commit comments

Comments
 (0)