1. M6机翼
M6是ONERA设计的一种机翼模型。该模型在跨声速条件下进行了一系列风洞试验。试验马赫数在 0.7-0.92之间,攻角区间为度,雷诺数Re(参考长度为平均气动弦长c)约为。尽管M6机翼几何外形简单,但是其涉及的跨声速流动却十分复杂,包含局部超音速流动、激波和边界层分离等。M6机翼具备三维可压缩流动的典型特征,因此被大量论文选为CFD代码的验证算例。本文以M6为测试算例,检验SU2在可压缩流场模拟方面的计算效率和计算精度。
图1M6机翼风洞试验模型
M6是一种无扭曲的后掠机翼,其基本翼型为ONERA D section对称翼型。M6机翼几何外形和参数见图2。试验时,在7个展向截面上布置了压力传感器,测得的压力数据可用于与计算结果进行对比。
展长b | 1.1963m |
平均气动弦长c | 0.64607m |
前缘倾斜角 | 30.0 deg |
后缘倾斜角 | 15.8 deg |
图2 M6机翼几何外形及参数
稀网格为NASA网站上公开发布的一种C型结构化网格。(https://www.grc.nasa.gov/www/wind/valid/m6wing/m6wing01/m6wing.x.fmt)该网格由4个网格块组成,表1列出了各块网格的节点分布,总共316932个网格点。
表1网格分区及节点分布
网格分区 | 网格节点数 | 网格量 |
1 | 25 x 49 x 33 | 40425 |
2 | 73 x 49 x 33 | 118041 |
3 | 73 x 49 x 33 | 118041 |
4 | 25 x 49 x 33 | 40425 |
密网格为CFL3d程序提供的M6算例结构化网格。(https://cfl3d.larc.nasa.gov/Cfl3dv6/3DTestcases/ONERA_M6/ONERA_M6.tar.Z)该网格仅有1个网格块,网格节点分布为i×j×k = 289×65×49,总共920465个网格点,网格量为稀网格的三倍。
稀网格和密网格均为plot3d格式,需要将其转换为SU2求解器能够读取的网格存储格式。我们采用Pointwise V18.1 R1软件进行格式转换。具体步骤如下:
1)用文本编辑器(推荐采用notepad++)打开m6wing.x.fmt,将其中的逗号全部替换为空格,将文件保存为m6wing.x;
2)打开Pointwise V18.1 R1软件,导入网格;
3)将求解器设置为SU2,并设置边界条件;
4)对网格进行旋转、缩放等操作。
5)导出su2格式文件。
SU2是一个用C ++和Python编写的开源软件工具集,通过采用先进的数值方法分析非结构化网格上的偏微分方程(PDE)和PDE约束优化问题。SU2早期主要用于是CFD和气动外形优化,目前已扩展到处理更一般的方程,如电动力学和化学反应流动。在全球用户和开发人员的不断努力下,SU2现已成为计算科学领域的一个成熟工具,广泛适用于航空、航天、航海、汽车和可再生能源行业。
SU2的主要能力包括:
SU2求解器计算仅需提供两个文件:后缀为su2的网格文件和后缀为cfg的配置文件。cfg文件包含流场计算所需的网格之外的全部信息。cfg文件一般通过对相关的CASE模板文件作适当修改得到。SU2程序根目录下的config_template.cfg文件提供了详细的配置信息。下面以马赫数为0.84、攻角为3.06°、湍流模型为SST的计算工况为例,简要介绍cfg文件如何编写。
1)问题定义
% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) PHYSICAL_PROBLEM= NAVIER_STOKES %不考虑粘性选EULER,考虑粘性选NAVIER_STOKES % % Specify turbulence model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SST %一般选一方程模型SA或两方程模型SST % % Mathematical problem (DIRECT, CONTINUOUS_ADJOINT) MATH_PROBLEM= DIRECT %不做优化选DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO %重启动计算选YES,同时需要在后面设置重启动文件% Restart flow input file SOLUTION_FLOW_FILENAME |
2)自由来流参数设置
% -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % % Mach number (non-dimensional, based on the free-stream values) MACH_NUMBER= 0.8395 %自由来流马赫数 % % Angle of attack (degrees, only for compressible flows) AOA= 0.0 %来流攻角,注意SU2定义X+为流向(机头指向机尾方向),Y+为侧向(翼展方向),Z+为法向(垂直于翼面的方向)。由于网格文件的Y轴和Z轴于SU2定义不同,所以需要将攻角(AOA)和侧滑角(SIDESLIP_ANGLE)调换。 % % Side-slip angle (degrees, only for compressible flows) SIDESLIP_ANGLE= 3.06 %侧滑角,在本次算例中,SIDESLIP_ANGLE值实际为攻角 % % Init option to choose between Reynolds (default) or thermodynamics quantities % for initializing the solution (REYNOLDS, TD_CONDITIONS) INIT_OPTION= REYNOLDS % REYNOLDS,根据雷诺数计算自由来流参数;TD_CONDITIONS,根据温度和密度参数计算自由来流参数 % % Free-stream option to choose between density and temperature (default) for % initializing the solution (TEMPERATURE_FS, DENSITY_FS) FREESTREAM_OPTION= TEMPERATURE_FS %给定自由来流静温还是静密度 % % Free-stream temperature (288.15 K by default) FREESTREAM_TEMPERATURE= 2.629383E+02 %自由来流静温值 % % Reynolds number (non-dimensional, based on the free-stream values) REYNOLDS_NUMBER= 11.72E6 %参考长度为REYNOLDS_LENGTH(单位米)的自由来流雷诺数(无量纲) % % Reynolds length (1 m by default) REYNOLDS_LENGTH= 0.64607 %雷诺数参考长度,单位:米 |
3)气体常数(一般不作修改)
% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% % % Different gas model (STANDARD_AIR, IDEAL_GAS, VW_GAS, PR_GAS) FLUID_MODEL= STANDARD_AIR % % Ratio of specific heats (1.4 default and the value is hardcoded % for the model STANDARD_AIR) GAMMA_VALUE= 1.4 % % Specific gas constant (287.058 J/kg*K default and this value is hardcoded % for the model STANDARD_AIR) GAS_CONSTANT= 287.058 |
4)粘性常数(一般不作修改)
% --------------------------- VISCOSITY MODEL ---------------------------------% % % Viscosity model (SUTHERLAND, CONSTANT_VISCOSITY). VISCOSITY_MODEL= SUTHERLAND % % Sutherland Viscosity Ref (1.716E-5 default value for AIR SI) MU_REF= 1.716E-5 % % Sutherland Temperature Ref (273.15 K default value for AIR SI) MU_T_REF= 273.15 % % Sutherland constant (110.4 default value for AIR SI) SUTHERLAND_CONSTANT= 110.4 |
5)热传导常数(一般不作修改)
% --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% % % Conductivity model (CONSTANT_CONDUCTIVITY, CONSTANT_PRANDTL). CONDUCTIVITY_MODEL= CONSTANT_PRANDTL % % Laminar Prandtl number (0.72 (air), only for CONSTANT_PRANDTL) PRANDTL_LAM= 0.72 % % Turbulent Prandtl number (0.9 (air), only for CONSTANT_PRANDTL) PRANDTL_TURB= 0.90 |
6)参考值设置
% ---------------------- REFERENCE VALUE DEFINITION ---------------------------% % % Reference origin for moment computation 力矩参考点 REF_ORIGIN_MOMENT_X = 0.00 REF_ORIGIN_MOMENT_Y = 0.00 REF_ORIGIN_MOMENT_Z = 0.00 % % Reference length for pitching, rolling, and yawing non-dimensional moment用于力矩系数计算的参考长度 REF_LENGTH= 0.64607 % % Reference area for force coefficients (0 implies automatic calculation) 用于升阻力系数计算的参考面积 REF_AREA= 0 % % Compressible flow non-dimensionalization (DIMENSIONAL, FREESTREAM_PRESS_EQ_ONE, % FREESTREAM_VEL_EQ_MACH, FREESTREAM_VEL_EQ_ONE) %流场计算结果的无量纲方式 REF_DIMENSIONALIZATION= FREESTREAM_VEL_EQ_ONE |
7)边界条件设置
% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % % Navier-Stokes wall boundary marker(s) (NONE = no marker) %物面边界 MARKER_HEATFLUX= ( WING, 0.0 ) %远场边界 % Far-field boundary marker(s) (NONE = no marker) MARKER_FAR= ( FARFIELD ) %对称边界 % Symmetry boundary marker(s) (NONE = no marker) MARKER_SYM= ( SYMMETRY ) % % Marker(s) of the surface to be plotted or designed %标记用于后处理或设计的边界 MARKER_PLOTTING= ( WING ) % % Marker(s) of the surface where the functional (Cd, Cl, etc.) will be evaluated %标记用于升阻力系数监测的边界 MARKER_MONITORING= ( WING ) |
8)数值求解通用参数
% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % % Numerical method for spatial gradients (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES) %梯度计算方法 NUM_METHOD_GRAD= GREEN_GAUSS % % Courant-Friedrichs-Lewy condition of the finest grid %最密层网格上的CFL数 CFL_NUMBER= 25.0 % % Adaptive CFL number (NO, YES) %是否采用自适应CFL CFL_ADAPT= NO % % Parameters of the adaptive CFL number (factor down, factor up, CFL min value, % CFL max value ) CFL_ADAPT_PARAM= ( 1.5, 0.5, 25.0, 100000.0 ) % % Runge-Kutta alpha coefficients %RK方法系数 RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations %最大迭代步数 EXT_ITER= 999999 |
9)迭代参数
% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % % Linear solver for the implicit (or discrete adjoint) formulation (BCGSTAB, FGMRES) %迭代方法 LINEAR_SOLVER= FGMRES % % Preconditioner of the Krylov linear solver (NONE, JACOBI, LINELET) LINEAR_SOLVER_PREC= ILU % % Min error of the linear solver for the implicit formulation LINEAR_SOLVER_ERROR= 1E-6 % % Max number of iterations of the linear solver for the implicit formulation LINEAR_SOLVER_ITER= 65 |
10)多重网格参数
% -------------------------- MULTIGRID PARAMETERS -----------------------------% % % Multi-Grid Levels (0 = no multi-grid) %采用几重网格 MGLEVEL= 0 % % Multi-grid cycle (V_CYCLE, W_CYCLE, FULLMG_CYCLE) MGCYCLE= V_CYCLE % % Multi-grid pre-smoothing level MG_PRE_SMOOTH= ( 1, 1, 1, 1 ) % % Multi-grid post-smoothing level MG_POST_SMOOTH= ( 0, 0, 0, 0 ) % % Jacobi implicit smoothing of the correction MG_CORRECTION_SMOOTH= ( 0, 0, 0, 0 ) % % Damping factor for the residual restriction MG_DAMP_RESTRICTION= 0.7 % % Damping factor for the correction prolongation MG_DAMP_PROLONGATION= 0.7 |
11)流场计算数值格式
% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % % Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, HLLC, % TURKEL_PREC, MSW) %对流项格式 CONV_NUM_METHOD_FLOW= JST % % Spatial numerical order integration (1ST_ORDER, 2ND_ORDER, 2ND_ORDER_LIMITER) %重构格式 MUSCL_FLOW= YES % % Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, % BARTH_JESPERSEN, VAN_ALBADA_EDGE) %限制器 SLOPE_LIMITER_FLOW= 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 % % 2nd and 4th order artificial dissipation coefficients for % the JST method ( 0.5, 0.02 by default ) %JST格式系数 JST_SENSOR_COEFF= ( 0.5, 0.02 ) % % Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) %时间推进格式 TIME_DISCRE_FLOW= EULER_IMPLICIT % % Relaxation coefficient RELAXATION_FACTOR_FLOW= 0.95 |
12)湍流计算数值格式
% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% % % Convective numerical method (SCALAR_UPWIND) %湍流对流项格式 CONV_NUM_METHOD_TURB= SCALAR_UPWIND % % Monotonic Upwind Scheme for Conservation Laws (TVD) in the turbulence equations. % Required for 2nd order upwind schemes (NO, YES) %湍流重构格式 MUSCL_TURB= NO % % Slope limiter (VENKATAKRISHNAN, MINMOD) %限制器 SLOPE_LIMITER_TURB= VENKATAKRISHNAN % % Time discretization (EULER_IMPLICIT) %湍流项推进格式 TIME_DISCRE_TURB= EULER_IMPLICIT |
13)收敛准则
% --------------------------- CONVERGENCE PARAMETERS --------------------------% % % Convergence criteria (CAUCHY, RESIDUAL) % CONV_CRITERIA= CAUCHY % % Residual reduction (order of magnitude with respect to the initial value) RESIDUAL_REDUCTION= 8 % % Min value of the residual (log10 of the residual) RESIDUAL_MINVAL= -12 % % 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= 1E-6 % % Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, % SENS_MACH, DELTA_LIFT, DELTA_DRAG) CAUCHY_FUNC_FLOW= DRAG CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY |
14)输入输出设置
% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % % Mesh input file %网格输入文件 MESH_FILENAME= M6-SU2-909K.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_FLOW_FILENAME= restart_flow.dat % % Restart adjoint input file %重启动伴随输入文件 SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) %输出文件格式 OUTPUT_FORMAT= TECPLOT_BINARY % % 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 flow (w/o extension) variables %流场体数据输出文件名 VOLUME_FLOW_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_FLOW_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint %文件输出频率 % Writing solution file frequency WRT_SOL_FREQ= 200 %残差信息输出频率 % Writing convergence history frequency WRT_CON_FREQ= 1 % |
15)外形优化设计参数
% --------------------- OPTIMAL SHAPE DESIGN DEFINITION -----------------------% % % List of design variables (Design variables are separated by semicolons) % From 1 to 99, Geometrycal design variables. % - 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 | FFD_BoxTag, i_Ind, j_Ind, k_Ind, x_Mov, y_Mov, z_Mov ) % - FFD_DIHEDRAL_ANGLE ( 8, Scale | Mark. List | FFD_BoxTag, x_Orig, y_Orig, z_Orig, x_End, y_End, z_End ) % - FFD_TWIST_ANGLE ( 9, Scale | Mark. List | FFD_BoxTag, x_Orig, y_Orig, z_Orig, x_End, y_End, z_End ) % - FFD_ROTATION ( 10, Scale | Mark. List | FFD_BoxTag, x_Orig, y_Orig, z_Orig, x_End, y_End, z_End ) % - FFD_CAMBER ( 11, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind ) % - FFD_THICKNESS ( 12, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind ) % - FFD_VOLUME ( 13, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind ) % From 100 to 199, Flow solver design variables. % - MACH_NUMBER ( 101, Scale | Markers List ) % - AOA ( 102, Scale | Markers List ) DEFINITION_DV= ( 1, 0.001 | airfoil | 0, 0.1 ); ( 1, 0.001 | airfoil | 0, 0.2 ) |
(a) Z/b=0.20 | (b)Z/b=0.44 |
(c) Z/b=0.65 | (d)Z/b=0.80 |
(e) Z/b=0.90 | (f) Z/b=0.95 |
(g)Z/b=0.99 |
图3 M6机翼表面压力分布SU2和OpenFOAM计算结果对比
图4SU2计算残差曲线
表2 SU2和OpenFOAM对比
求解器 | SU2 | OpenFOAM-rhoCentralFoam |
定常or非定常 | 定常 | 非定常 |
CFL数 | 25 | 0.4 |
网格量 | 92万 | 31万 |
湍流模型 | SST | SST |
并行计算cpu个数 | 48 | 24 |
计算时长 | 32小时 | 140小时 |
图3展示了SU2和OpenFOAM两种求解器计算的M6机翼表面压力分布(Ma=0.84,AoA=3.06°)。可以看出两种求解器获得的压力分布与试验结果均符合较好。主要差异在于,OpenFOAM计算得到的两个激波间距在靠近翼根处比试验结果偏大(见图3a和3b),SU2计算得到的两个激波间距在靠近翼尖处比试验结果偏小(见图3c和3d)。
从计算效率上来说,OpenFOAM需要采用非定常计算求解可压缩问题,受显式时间推进格式影响,CFL数需控制在0.4以内,计算效率低。而SU2采用伪时间步计算定常方程,能够采用较大的CFL数,通过并行求解能在一天左右的时间得到收敛结果,降低收敛要求或采用多重网格方法还能大幅缩短计算时长,能够满足工程应用需求。
(a) Z/b=0.20 | (b)Z/b=0.44 |
(c) Z/b=0.65 | (d)Z/b=0.80 |
(e) Z/b=0.90 | (f) Z/b=0.95 |
(g)Z/b=0.99 |
图5 M6机翼表面压力分布稀网格和密网格计算结果对比
图5展示了SU2求解器分别采用稀网格和密网格计算的M6机翼表面压力分布(Ma=0.84,AoA=3.06°)。可以看到网格加密有助于提高激波分辨率,进一步改善计算结果精度。
(a) Z/b=0.20 | (b)Z/b=0.44 |
(c) Z/b=0.65 | (d)Z/b=0.80 |
(e) Z/b=0.90 | (f) Z/b=0.95 |
(g)Z/b=0.99 |
图6 M6机翼表面压力分布SA模型和SST模型计算结果对比
图6展示了SU2求解器分别采用SA模型和SST模型计算的M6机翼表面压力分布(Ma=0.84,AoA=3.06°)。可以看到,两种模型的计算结果几乎重合,仅在激波间断区域附近有较小差异,表明两种湍流模型都能较好地模拟M6机翼流场。
1)SU2采用伪时间步方法求解定常可压缩问题,能够采用较大的CFL数,求解效率高,能够满足工程应用需求。而OpenFOAM则显式时间推进格式影响,计算效率低。
2)增加网格密度,有助于提高激波分辨率,改善计算结果精度。
3)SA湍流模型和SST湍流模型都能较好地模拟M6机翼流场。
免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删