4.6. NASA 网格生成程序

NASA Turbulence Modeling Resource 提供了大量实验和数值模拟数据。其中, 3D Hemisphere Cylinder Validation Case3D ONERA M6 Wing Validation Case 两个示例中提供了三维网格的生成程序 Fortran 代码。

4.6.1. 代码说明和示例

以 ONERA M6 机翼为例 (图 4.6.1), NASA 提供了 图 4.6.2 所示的网格生成程序。 该程序在 AIAA-2018-1101 中进行了介绍。 报告 Hemisphere/Wing Grid Generation Codes 中也对以上程序进行了介绍。 代码链接为 wing_release_072319.tar.gz

Note

此代码只能生成对称翼型的后掠机翼(结构、非结构)网格。

This code generates a 3D grid over a wing generated by a NACA00XX airfoil or by an airfoil defined by a set of discrete points (e.g., OM6 wing).

The wing grids are topologically equivalent to the hemisphere-cylinder grids.

In the mesh generation process, a surface mesh for a full-geometry hemisphere-cylinder configuration is generated first. This surface mesh is then mapped onto a wing: the cylinder is mapped onto the main wing and the hemisphere is mapped onto the wing tip. Each surface node is projected onto the airfoil section profile.

# Compile the HC-family grid generation program
gfortran -o hcf_wing hcf_wing_v5p0.f90

# Compile the coarsening program
gfortran -o hc_coarsening hcf_coarsening_v3p9.f90

# Generate a fine structured grid
# read in input.nml
./hcf_wing

# Generate coarse grids from the grid just generated
# read in input_coarsen.nml
./hcf_coarsening

# Convert .ugrid+.mapbc file to a CGNS file,
# where $HOME/cgnslib/ is the directory of the CGNS library installed.
%$HOME/cgnslib/bin/cgnstools/aflr3_to_cgns xxx.b8.ugrid xxx.cgns
../../_images/view-of-ONERA-M6.jpg

图 4.6.1 ONERA M6

../../_images/onera-m6-grid.jpg

图 4.6.2 ONERA M6 Grid

4.6.2. 控制文件

控制文件示例参见网站 3D ONERA M6 Wing Validation Case

机翼网格生成的控制文件 input.nml:

&input_parameters
          target_reynolds_number = 14.6e6                       !Target Reynolds number based on the root chord (=1.0 in the grid).
                   target_y_plus = 0.5                          !Target y-plus value
                      igrid_type = 5                            !1=prsm, 2=tets, 3=prsm/tets, 4=prsm/hex, 5=Strct
                    airfoil_type = 0                            !airfoil_type: =0 discrete airfoil data, =1 NACA00XX
               airfoil_data_file = "om6_wing_section_sharp.dat" !Datafile for the discrete airfoil data ; not used if airfoil_type = 1
                              tr = 0.5625159852668158           !Taper ratio = (tip chord)/(root chord)
                            beta = 29.9990                      !Swept angle of LE line in degrees (not too large, please: e.g., < 40).
                         R_outer = 100                          !Distance to outer boundary (=radius of the outer hemisphere)
           nnodes_cylinder_input = 192                          !Elements along the semi-wingspan
                               b = 1.476017976219800            !b = semi-span: per unit root chord.
                           nr_gs = 64                           !# of Elements across the rounded tip /2 (-> HC: x=0 to 0.5)
                             nre = 704                          !# of Elements in the radial direction (from wing to farfield)
                       wing_side = 2                            !wing_side: =1 for left wing, =2 for right wing.
                       root_le_x = 0.0                          !root_le_x: = x coordinate of the LE at the root.
    stretching_tanh_towards_lete = 4.5                          !Cluster points to LE/TE by a larger value.
             generate_ugrid_file = T                            !T = Write a .ugrid file. (required by the coarsening program)
          ugrid_file_unformatted = T                            !T = unformatted .ugrid/.ufmt, F = formatted .ugrid/.p3d
          generate_p3d_ufmt_file = T                            !T = Write p3d file for a structured grid (only for 5=Strct).
           generate_su2grid_file = F                            !T = Write a .su2 file (the native grid-format for Stanford's SU2).
                 generate_k_file = T                            !T = Write a 'k'-file  (required by the coarsening program)
              k_file_unformatted = T                            !T = unformatted .k file, F = formatted .k file.
           generate_line_file_nc = T                            !T = Write node line files  (required by the coarsening program)
           generate_line_file_cc = T                            !T = Write cell line files  (required by the coarsening program)
             generate_tec_file_b = T                            !T = Write a boundary grid (Tecplot)
             generate_tec_file_v = F                            !T = Write a volume grid (Tecplot)
/


! NOTE: The above parameters will generate a grid over an ONERA M6 wing.

! NOTE: Root chord will be normalized as 1.0 for any input airfoil data.

! NOTE: wing-side-change/root_le_x-shifting will be applied after
!       a grid with unit wing-root chord is generated.

! NOTE: # of elements around the wing-section is automatically set as
!          6*(Elements along the hemisphere).

! NOTE: For regular coarsening, choose the input values such that
!       (# of Elements along the the semi-wingspan) = 2^l
!     6*(# of Elements along the rounded tip)       = 2^n
!       (# of Elements in the radial direction)     = 2^m
!       where l, n, and m are integers.

! NOTE: To generate a .su2 grid file, set 
!          generate_su2grid_file = T
!

稀网格转换的控制文件 input_coarsen.nml:

&input_parameters
                         project = 'wing_strct'
                       tet2prism = F
          ugrid_file_unformatted = T
              k_file_unformatted = T
            rmp_file_unformatted = T
        prolong_file_unformatted = T
           generate_su2grid_file = F  !T = Write a .su2 file (the native grid-format for Stanford's SU2).
           generate_tec_file_b   = T
           generate_tec_file_vol = F
   generate_ntrl_partition_files = T  !T = write natural-partition files.
        generate_heff_vol_report = F  !T = write volume and mesh spacing information file.
       generate_nc_prolong_file  = T  !T = write NC prolongation information files.
               generate_rmp_file = T  !T = write files containing removed nodes.
        generate_cc_prolong_file = T  !T = write CC prolongation information files.
          check_negative_elm_vol = T  !T = check the negative element volumes.
             check_non_planarity = T  !T = check non-planarity for quad faces.
/

! NOTE: To generate a .su2 grid file, set 
!          generate_su2grid_file = T
!

! Input parameters below must match those in the input file used to generate the fine grid:
! 
!  ugrid_file_unformatted
!      k_file_unformatted
!