Skip to content

Commit 79e6e43

Browse files
committed
add example and regression
1 parent 7ff35d7 commit 79e6e43

3 files changed

Lines changed: 138 additions & 0 deletions

File tree

TestCases/hybrid_regression.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,14 @@ def main():
178178
turb_oneram6.test_vals = [-2.388851, -6.689340, 0.230320, 0.157649]
179179
test_list.append(turb_oneram6)
180180

181+
# ONERA M6 Wing - Newton-Krylov
182+
turb_oneram6_nk = TestCase('turb_oneram6_nk')
183+
turb_oneram6_nk.cfg_dir = "rans/oneram6"
184+
turb_oneram6_nk.cfg_file = "turb_ONERAM6_nk.cfg"
185+
turb_oneram6_nk.test_iter = 100
186+
turb_oneram6_nk.test_vals = [-7.015278, -6.587369, -10.394193, 0.271661, 0.019845, 4, -0.626403, 2.8101e+02]
187+
test_list.append(turb_oneram6_nk)
188+
181189
# NACA0012 (SA, FUN3D finest grid results: CL=1.0983, CD=0.01242)
182190
turb_naca0012_sa = TestCase('turb_naca0012_sa')
183191
turb_naca0012_sa.cfg_dir = "rans/naca0012"
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2+
% %
3+
% SU2 configuration file %
4+
% Case description: Turbulent flow, ONERA M6, Newton-Krylov solver %
5+
% File Version 7.1.0 "Blackbird" %
6+
% %
7+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8+
9+
SOLVER= RANS
10+
KIND_TURB_MODEL= SA
11+
MATH_PROBLEM= DIRECT
12+
RESTART_SOL= NO
13+
14+
% ------------------------- NEWTON-KRYLOV PARAMETERS --------------------------%
15+
%
16+
% --- Things that matter ---
17+
NEWTON_KRYLOV= YES
18+
19+
% Iterations and tolerance for the Krylov part, it is important not to
20+
% "over solve", tolerance should be as high as possible.
21+
LINEAR_SOLVER_ITER= 5
22+
LINEAR_SOLVER_ERROR= 0.25
23+
24+
% For "n0" iterations or "r0" residual reduction, the normal quasi-Newton iterations
25+
% are used. Then, they become the preconditioner for the NK iterations with "np" linear
26+
% iterations or "tp" tolerance, with "np"=0 the linear preconditioner (e.g. ILU) is
27+
% used directly (this may be enough for unsteady).
28+
% The tolerance for NK iterations is initially relaxed by factor "ft", and reaches
29+
% LINEAR_SOLVER_ERROR after "rf" residual reduction (additional to "r0").
30+
% The Jacobian-free products are based on finite differences with step "e".
31+
NEWTON_KRYLOV_IPARAM= (0, 3, 2) % n0, np, ft
32+
NEWTON_KRYLOV_DPARAM= (-1.0, 0.1, -6.0, 1e-5) % r0, tp, rf, e
33+
34+
CFL_ADAPT= YES % it's needed
35+
CFL_NUMBER= 10
36+
CFL_ADAPT_PARAM= ( 0.8, 1.1, 5, 1000 ) % no point using NK with low CFL values
37+
38+
% It is important (more than usual) to have similar magnitude variables
39+
REF_DIMENSIONALIZATION= FREESTREAM_VEL_EQ_MACH
40+
41+
USE_VECTORIZATION= YES % compile the code for AVX and mixed precision or it will be slow!
42+
TIME_DISCRE_FLOW= EULER_IMPLICIT % what else
43+
LINEAR_SOLVER_PREC= ILU % or LU_SGS
44+
45+
% --- Things that don't ---
46+
MGLEVEL= 0 % NK replaces MG
47+
LINEAR_SOLVER= FGMRES % It will be FGMRES regardless
48+
49+
% -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------%
50+
%
51+
MACH_NUMBER= 0.8395
52+
AOA= 3.06
53+
SIDESLIP_ANGLE= 0.0
54+
55+
FREESTREAM_TEMPERATURE= 288.15
56+
REYNOLDS_NUMBER= 11.72E6
57+
REYNOLDS_LENGTH= 0.64607
58+
59+
% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------%
60+
%
61+
FLUID_MODEL= STANDARD_AIR
62+
GAMMA_VALUE= 1.4
63+
GAS_CONSTANT= 287.058
64+
ACENTRIC_FACTOR= 0.035
65+
66+
% --------------------------- VISCOSITY MODEL ---------------------------------%
67+
%
68+
VISCOSITY_MODEL= SUTHERLAND
69+
MU_CONSTANT= 1.716E-5
70+
MU_REF= 1.716E-5
71+
MU_T_REF= 273.15
72+
SUTHERLAND_CONSTANT= 110.4
73+
74+
% ---------------------- REFERENCE VALUE DEFINITION ---------------------------%
75+
%
76+
REF_ORIGIN_MOMENT_X = 0.25
77+
REF_ORIGIN_MOMENT_Y = 0.00
78+
REF_ORIGIN_MOMENT_Z = 0.00
79+
REF_LENGTH= 0.64607
80+
REF_AREA= 0
81+
82+
% -------------------- BOUNDARY CONDITION DEFINITION --------------------------%
83+
%
84+
MARKER_HEATFLUX= ( WING, 0.0 )
85+
MARKER_FAR= ( FARFIELD )
86+
MARKER_SYM= ( SYMMETRY )
87+
MARKER_PLOTTING= ( WING )
88+
MARKER_MONITORING= ( WING )
89+
90+
% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------%
91+
%
92+
NUM_METHOD_GRAD= GREEN_GAUSS
93+
CONV_NUM_METHOD_FLOW= ROE
94+
MUSCL_FLOW= YES
95+
SLOPE_LIMITER_FLOW= VAN_ALBADA_EDGE
96+
97+
% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------%
98+
%
99+
CONV_NUM_METHOD_TURB= SCALAR_UPWIND
100+
MUSCL_TURB= NO
101+
TIME_DISCRE_TURB= EULER_IMPLICIT
102+
103+
% --------------------------- CONVERGENCE PARAMETERS --------------------------%
104+
%
105+
CONV_CRITERIA= RESIDUAL
106+
CONV_RESIDUAL_MINVAL= -11
107+
CONV_STARTITER= 10
108+
ITER= 2000
109+
110+
% ------------------------- INPUT/OUTPUT INFORMATION --------------------------%
111+
%
112+
MESH_FILENAME= mesh_ONERAM6_turb_hexa_43008.su2
113+
MESH_FORMAT= SU2
114+
TABULAR_FORMAT= CSV
115+
SOLUTION_FILENAME= solution.dat
116+
RESTART_FILENAME= restart.dat
117+
SOLUTION_ADJ_FILENAME= solution_adj.dat
118+
RESTART_ADJ_FILENAME= restart_adj.dat
119+
VOLUME_FILENAME= flow
120+
VOLUME_ADJ_FILENAME= adjoint
121+
SURFACE_FILENAME= surface_flow
122+
SURFACE_ADJ_FILENAME= surface_adjoint
123+
OUTPUT_FILES=(RESTART, PARAVIEW, SURFACE_PARAVIEW)
124+
OUTPUT_WRT_FREQ= 10000
125+
SCREEN_OUTPUT = (INNER_ITER, WALL_TIME, RMS_DENSITY, RMS_ENERGY, RMS_NU_TILDE, LIFT, DRAG, LINSOL_ITER, LINSOL_RESIDUAL, AVG_CFL)
126+
CONV_FILENAME= history
127+

config_template.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,6 +1091,9 @@ CENTRAL_JACOBIAN_FIX_FACTOR= 4.0
10911091
%
10921092
% Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT)
10931093
TIME_DISCRE_FLOW= EULER_IMPLICIT
1094+
%
1095+
% Use a Newton-Krylov method on the flow equations, see TestCases/rans/oneram6/turb_ONERAM6_nk.cfg
1096+
NEWTON_KRYLOV= NO
10941097

10951098
% ------------------- FEM FLOW NUMERICAL METHOD DEFINITION --------------------%
10961099
%

0 commit comments

Comments
 (0)