Flow Solver Tutorials

Flow Solver Tutorial #1
Inviscid flow solve

Intent: Demonstrate simple inviscid execution of the baseline flow solver

This tutorial will describe how to set up and execute a simple inviscid flow solve using FUN3D.

Grid files are included in the standard FUN3D distribution. Note that the grids for this case are very coarse and are intended for demonstration, rather than accurate aerodynamic analysis. The geometry consists of a stand-alone ONERA M6 (OM6) wing. Half-plane symmetry is assumed.

The reader should be familiar with the flow solver inputs (See Flow Solver Namelist Input).

Compilation and linking

(See Compiling).

Files

The standard FUN3D distribution contains a top-level directory “GnuTestCase/Grids” containing a very coarse inviscid mesh for the OM6 geometry. For organizational purposes, create a case directory and copy the following files to it.

% cd your_case_directory
% cp {...}/FUN3D/GnuTestCase/Grids/om6inviscid.fgrid .
% cp {...}/FUN3D/GnuTestCase/Grids/om6inviscid.fastbc .

A namelist file must be created as “fun3d.nml” to control the execution of the solver (initial conditions, physical models, etc.). The following is a very simple example for basic execution. There are more aggressive strategies available as this is only academic.

Create the FUN3D namelist input file as “fun3d.nml” similar to the following (this file is also available for download and should be saved as “fun3d.nml”). This example namelist file relies on defaults and only modifies values relevant to this case.

 &project
    project_rootname = "om6inviscid" 
    case_title = "OM6 Simple Inviscid Flow Solve Tutorial" 
 /

 &governing_equations
    viscous_terms = "inviscid" 
 /

 &reference_physical_properties
    mach_number =   0.700000000000000     
    angle_of_attack =    2.00000000000000     
 /

 &force_moment_integ_properties
    area_reference =    1.06763400000000
    x_moment_length =    0.67370000000000
    y_moment_length =    1.02000000000000
    x_moment_center =   0.168425000000000
 /

 &nonlinear_solver_parameters
    schedule_cfl =    10.0000000000000        200.000000000000     
 /

 &code_run_control
    steps =           1000
    stopping_tolerance =   1.000000000000000E-015
    restart_write_freq =          1000
    restart_read = "off" 
    jacobian_eval_freq =            3
 /

Although it is not necessary, we will assume that the the pre/post processor (`party`) and the flow solver (`nodet`) executables are in the case directory to simplify the discussion to follow. Therefore, we will not reference an installed path to these executables, but instead simply invoke with ”./”.

Pre-process the mesh

Sequential pre-processing:

% ./party
...
 Enter your selection:
1

 Enter the Project Name
om6inviscid

 puns3d_read_ilump; iwhere =            1
  Boundary Grouping Options
  -----------------------------------------------
      0       Do not group boundaries

      1       Group boundaries of similar BC type
0

...
 How many partitions do you want?
1

Parallel pre-processing (8 processors):

% ./party
...
 Enter your selection:
1

 Enter the Project Name
om6inviscid

 puns3d_read_ilump; iwhere =            1
  Boundary Grouping Options
  -----------------------------------------------
      0       Do not group boundaries

      1       Group boundaries of similar BC type
0

...
 How many partitions do you want?
8

Note the only difference here between sequential and parallel processing is the number of partitions to generate.

Execute the flow solver

For sequential execution, the flow solver is simply invoked as

% ./nodet

 Date/Time: 01/21/2009 at 18:07:46.523 (hhmmss.sss)

Contents of file fun3d.nml below------------------------------------------------
  &project
     project_rootname = "om6inviscid" 

...

 Writing om6inviscid_flow.* (version   4.40000000000000      )
 Done.

For parallel execution, the flow solver is invoked through `mpirun`. It is assumed that your system is configured to successfully use MPI and that all processors have access to the case directory and the `nodet_mpi` executable.

% mpirun -machinefile your.machines -np 8 ./nodet_mpi

 Date/Time: 01/21/2009 at 18:07:46.523 (hhmmss.sss)

Contents of file fun3d.nml below------------------------------------------------
  &project
     project_rootname = "om6inviscid" 

...

 Writing om6inviscid_flow.* (version   4.40000000000000      )
 Done.

Post-process the results

The following is a representative convergence history for this case. The residual information is available in the file “om6inviscid_hist.tec” and is in the Tecplot format. The residual values (R_1, R_2, R_3, R_4, R_5) represent the convergence of the 5 equations of state (density, x-momentum, y-momentum, z-momentum, and energy respectively). They are plotted using a Log scale below.

Sample Inviscid Residual Plot

To post process the results we again use `party` using option 20. For this case we will generate a Tecplot surface solution file.

% ./party
...
 Enter your selection:
20

 Enter project name for input file
om6inviscid
 How many partitions does your mesh have?
8
...

 Enter  2 to generate VTK volume grid files.
 Enter  1 to generate FAST solution and grid files.
 Enter  0 for no FAST or VTK solution or grid files.
0
 Option 0: do nothing... acknowledged.

 Enter  1 to generate Fieldview Version 7 (2.5) ASCII solution (q) file.
 Enter  2 to generate Fieldview Version 7 (2.5) unformatted solution (q) file.
 Enter  3 to generate Fieldview Version 7 (2.5)
 ASCII eddy viscosity (amut) file.
 Enter -3 to generate Fieldview Version 7 (2.5) ASCII turb file.
 Enter  4 to generate Fieldview Version 7 (2.5)
 unformatted eddy viscosity (amut) file.
 Enter -4 to generate Fieldview Version 7 (2.5) unformatted turb file.
 Enter  5 to generate Fieldview Version 7 (2.5)
 unformatted solution (q) file from FELISA .unkX.
 Enter  6 to generate Fieldview Version 7 (2.5) ASCII solution (qtavg) file.
 Enter  7 to generate Fieldview Version 7 (2.5)
 unformatted solution (qtavg) file.
 Enter  0 for no Fieldview output.
0

 Enter  1 to generate a Tecplot surface solution file.
 Enter  2 to generate a Tecplot surface solution file with skin friction, yplus,
             and off-surface velocities projected to the surface (for viscous ru
 ns).
 Enter  3 to generate a Tecplot surface file for MASSOUD
 Enter  4 to generate a Tecplot volume solution file.
 Enter  5 to generate a Tecplot volume file of solution plus amut and turb file.
 Enter  7 to generate a Tecplot surface file for interfacing with CDISC.
 Enter  8 to generate a Tecplot lineplot file for 2D cases (z,Cp,Cf,yplus vs x)
 Enter  9 to generate a Tecplot lineplot file for near-wall velocity profiles al
 ong
             lines constructed away from surface points (for viscous runs)
 Enter 10 to generate a Tecplot lineplot file for
             boundary segments (2D only)
 Enter 14 to generate a Tecplot surface file for DDFDRIVE
 Enter  0 for no Tecplot output.
1
 Writing ASCII Tecplot file...

 Enter 1 to output a flow variable for use in adaptation.
 Enter 0 for no adaptation output.
0

The result of the above execution of `party` will generate the Tecplot file “om6inviscid_soln.tec” for examination.

Flow Solver Tutorial #2
Turbulent flow solve

Intent: Demonstrate simple turbulent execution of the baseline flow solver

This tutorial will describe how to set up and execute a simple turbulent flow solve using FUN3D.

Grid files are included in the standard FUN3D distribution. Note that the grids for this case are very coarse and are intended for demonstration, rather than accurate aerodynamic analysis. The geometry consists of a stand-alone ONERA M6 (OM6) wing. Half-plane symmetry is assumed.

The reader should be familiar with the flow solver inputs (See Flow Solver Namelist Input).

Compilation and linking

(See Compiling).

Files

The standard FUN3D distribution contains a top-level directory “GnuTestCase/Grids” containing a very coarse viscous mesh for the OM6 geometry. For organizational purposes, create a case directory and copy the following files to it.

% cd your_case_directory
% cp {...}/FUN3D/GnuTestCase/Grids/om6viscous_symmetry.fgrid .
% cp {...}/FUN3D/GnuTestCase/Grids/om6viscous_symmetry.fastbc .

A namelist file must be created as “fun3d.nml” to control the execution of the solver (initial conditions, physical models, etc.). The following is a very simple example for basic execution. There are more aggressive strategies available as this is only academic.

Create the FUN3D namelist input file as “fun3d.nml” similar to the following (this file is also available for download and should be saved as “fun3d.nml”).

 &project
    project_rootname = "om6viscous_symmetry" 
    case_title = "OM6 Simple Turbulent Flow Solve Tutorial" 
 /

 &reference_physical_properties
    temperature_units = "Rankine" 
    mach_number =   0.700000000000000     
    reynolds_number =    3000000.00000000     
    temperature =    460.000000000000     
    angle_of_attack =    2.00000000000000     
 /

 &force_moment_integ_properties
    area_reference =    1.06763400000000     
    x_moment_length =    0.67370000000000     
    y_moment_length =    1.02000000000000     
    x_moment_center =   0.168425000000000     
 /

 &nonlinear_solver_parameters
    schedule_cfl =    10.0000000000000        200.000000000000     
    schedule_cflturb =    1.0000000000000        20.000000000000     
 /

 &code_run_control
    steps =           1000
    stopping_tolerance =   1.000000000000000E-015
    restart_write_freq =          1000
    restart_read = "off" 
    jacobian_eval_freq =            3
 /

Although it is not necessary, we will assume that the the pre/post processor (`party`) and the flow solver (`nodet`) executables are in the case directory to simplify the discussion to follow. Therefore, we will not reference an installed path to these executables, but instead simply invoke with ”./”.

Pre-process the mesh

Sequential pre-processing:

% ./party
...
 Enter your selection:
1

 Enter the Project Name
om6viscous_symmetry

 puns3d_read_ilump; iwhere =            1
  Boundary Grouping Options
  -----------------------------------------------
      0       Do not group boundaries

      1       Group boundaries of similar BC type
0

...
 How many partitions do you want?
1

Parallel pre-processing (8 processors):

% ./party
...
 Enter your selection:
1

 Enter the Project Name
om6viscous_symmetry

 puns3d_read_ilump; iwhere =            1
  Boundary Grouping Options
  -----------------------------------------------
      0       Do not group boundaries

      1       Group boundaries of similar BC type
0

...
 How many partitions do you want?
8

Note the only difference here between sequential and parallel processing is the number of partitions to generate.

Execute the flow solver

For sequential execution, the flow solver is simply invoked as

% ./nodet

 Date/Time: 01/21/2009 at 18:07:46.523 (hhmmss.sss)

Contents of file fun3d.nml below------------------------------------------------
  &project
     project_rootname = "om6viscous_symmetry" 

...

 Writing om6viscous_symmetry_flow.* (version   4.40000000000000      )
 Done.

For parallel execution, the flow solver is invoked through `mpirun`. It is assumed that your system is configured to successfully use MPI and that all processors have access to the case directory and the `nodet_mpi` executable.

% mpirun -machinefile your.machines -np 8 ./nodet_mpi

 Date/Time: 01/21/2009 at 18:07:46.523 (hhmmss.sss)

Contents of file fun3d.nml below------------------------------------------------
  &project
     project_rootname = "om6viscous_symmetry" 

...

 Writing om6viscous_symmetry_flow.* (version   4.40000000000000      )
 Done.

The resulting convergence history is represented in the following plot.

Sample Initial Turbulent Residual Plot

While overall convergence is good, we will restart the solution to continue to converge the solution to machine precision. For this we will need to modify the FUN3D namelist input file fun3d.nml. The modifications include: changing the CFL schedules (nonlinear_solver_parameters variables schedule_cfl and schedule_cflturb) as values were ramped to their maximum values in the initial run; and turning “on” the restart read (code_run_control variable restart_read). Note that the restart will again run another 1000 steps unless the density residual falls below the given threshold (1.0e-15).

 &project
    project_rootname = "om6viscous_symmetry" 
    case_title = "OM6 Simple Turbulent Flow Solve Tutorial" 
 /

 &reference_physical_properties
    temperature_units = "Rankine" 
    mach_number =   0.700000000000000     
    reynolds_number =    3000000.00000000     
    temperature =    460.000000000000     
    angle_of_attack =    2.00000000000000     
 /

 &force_moment_integ_properties
    area_reference =    1.06763400000000     
    x_moment_length =    0.67370000000000     
    y_moment_length =    1.02000000000000     
    x_moment_center =   0.168425000000000     
 /

 &nonlinear_solver_parameters
    schedule_cfl =    200.0000000000000        200.000000000000     
    schedule_cflturb =    20.0000000000000        20.000000000000     
 /

 &code_run_control
    steps =           1000
    stopping_tolerance =   1.000000000000000E-015
    restart_write_freq =          1000
    restart_read = "on" 
    jacobian_eval_freq =            3
 /

Execution of the flow solver using the above FUN3D namelist is conducted in the same manner as for the initial invocation. For example, parallel execution is invoked through `mpirun` as before.

% mpirun -machinefile your.machines -np 8 ./nodet_mpi

 Date/Time: 01/21/2009 at 18:07:46.523 (hhmmss.sss)

Contents of file fun3d.nml below------------------------------------------------
  &project
     project_rootname = "om6viscous_symmetry" 

...

 Writing om6viscous_symmetry_flow.* (version   4.40000000000000      )
 Done.

Post-process the results

The following is a representative convergence history for this case. The residual information is available in the file “om6viscous_symmetry_hist.tec” and is in the Tecplot format. The residual values (R_1, R_2, R_3, R_4, R_5, R_6) represent the convergence of the 5 equations of state (density, x-momentum, y-momentum, z-momentum, energy, and the 1 Eqn. SA model respectively). They are plotted using a Log scale below.

Sample Turbulent Residual Plot

To post process the results we again use `party` using option 20. For this case we will generate a Tecplot surface solution file with viscous related data.

% ./party
...
 Enter your selection:
20

 Enter project name for input file
om6viscous_symmetry
 How many partitions does your mesh have?
8
...

 Enter  2 to generate VTK volume grid files.
 Enter  1 to generate FAST solution and grid files.
 Enter  0 for no FAST or VTK solution or grid files.
0
 Option 0: do nothing... acknowledged.

 Enter  1 to generate Fieldview Version 7 (2.5) ASCII solution (q) file.
 Enter  2 to generate Fieldview Version 7 (2.5) unformatted solution (q) file.
 Enter  3 to generate Fieldview Version 7 (2.5)
 ASCII eddy viscosity (amut) file.
 Enter -3 to generate Fieldview Version 7 (2.5) ASCII turb file.
 Enter  4 to generate Fieldview Version 7 (2.5)
 unformatted eddy viscosity (amut) file.
 Enter -4 to generate Fieldview Version 7 (2.5) unformatted turb file.
 Enter  5 to generate Fieldview Version 7 (2.5)
 unformatted solution (q) file from FELISA .unkX.
 Enter  6 to generate Fieldview Version 7 (2.5) ASCII solution (qtavg) file.
 Enter  7 to generate Fieldview Version 7 (2.5)
 unformatted solution (qtavg) file.
 Enter  0 for no Fieldview output.
0

 Enter  1 to generate a Tecplot surface solution file.
 Enter  2 to generate a Tecplot surface solution file with skin friction, yplus,
             and off-surface velocities projected to the surface (for viscous ru
 ns).
 Enter  3 to generate a Tecplot surface file for MASSOUD
 Enter  4 to generate a Tecplot volume solution file.
 Enter  5 to generate a Tecplot volume file of solution plus amut and turb file.
 Enter  7 to generate a Tecplot surface file for interfacing with CDISC.
 Enter  8 to generate a Tecplot lineplot file for 2D cases (z,Cp,Cf,yplus vs x)
 Enter  9 to generate a Tecplot lineplot file for near-wall velocity profiles al
 ong
             lines constructed away from surface points (for viscous runs)
 Enter 10 to generate a Tecplot lineplot file for
             boundary segments (2D only)
 Enter 14 to generate a Tecplot surface file for DDFDRIVE
 Enter  0 for no Tecplot output.
2
 Writing ASCII Tecplot file...

 Enter 1 to output a flow variable for use in adaptation.
 Enter 0 for no adaptation output.
0

The result of the above execution of `party` will generate the Tecplot file “om6viscous_symmetry_soln_visc.tec” for examination.

Flow Solver Tutorial #3
Merge VGRID mesh into mixed elements and run solution

Intent: Demonstrate how to merge tetrahedral VGRID mesh into mixed elements and run turbulent flow solution

This tutorial will describe how to merge a tetrahedral VGRID mesh into mixed elements and execute a turbulent flow solve using FUN3D.

Grid files for this example are obtained from the AIAA DPW-2 website. Note that the grids for this case are very coarse and are intended for demonstration, rather than accurate aerodynamic analysis. The geometry consists of a wing-body configuration. Half-plane symmetry is assumed.

The reader should be familiar with the flow solver inputs (See Flow Solver Namelist Input).

Compilation and linking

(See Compiling).

Files

Go to this website and grab the .bc, .mapbc, .cogsg, and .poin1 files:

ftp://cmb24.larc.nasa.gov/outgoing/DPW2/unst-NB-larc/wb/coarse/

You can either use your web browser, or the ‘wget’ command if you have it on your system:

% cd your_case_directory
% wget ftp://cmb24.larc.nasa.gov/outgoing/DPW2/unst-NB-larc/wb/coarse/f6wbnc.bc
% wget ftp://cmb24.larc.nasa.gov/outgoing/DPW2/unst-NB-larc/wb/coarse/f6wbnc.mapbc
% wget ftp://cmb24.larc.nasa.gov/outgoing/DPW2/unst-NB-larc/wb/coarse/f6wbnc.cogsg
% wget ftp://cmb24.larc.nasa.gov/outgoing/DPW2/unst-NB-larc/wb/coarse/f6wbnc.poin1

Note that you need to grab the .poin1 file for merging the grid – normally this file is not required to process the raw tetrahedral grid.

A namelist file must be created as “fun3d.nml” to control the execution of the solver (initial conditions, physical models, etc.). The following is a very simple example for basic execution. There are more aggressive strategies available as this is only academic.

Create the FUN3D namelist input file as “fun3d.nml” similar to the following (this file is also available for download and should be saved as “fun3d.nml”).

 &project
    project_rootname = "f6wbnc.merged" 
    case_title = "Merged DPW-2 Tutorial" 
 /

 &reference_physical_properties
    temperature_units = "Rankine" 
    mach_number =   0.750000000000000
    reynolds_number =    21246.500000000
    temperature =    460.000000000000
    angle_of_attack =    1.00000000000000
 /

 &force_moment_integ_properties
    area_reference =    72700.0000000000
    x_moment_length =    141.200000000000
    y_moment_length =    585.647000000000
    x_moment_center =   504.9000000000000
 /

 &nonlinear_solver_parameters
    schedule_cfl =    10.0000000000000        200.000000000000
    schedule_cflturb =    1.0000000000000        30.000000000000
 /

 &code_run_control
    steps =           1000
    stopping_tolerance =   1.000000000000000E-015
    restart_write_freq =          1000
    restart_read = "off" 
    jacobian_eval_freq =            3
 /

Although it is not necessary, we will assume that the the pre/post processor (`party`) and the flow solver (`nodet`) executables are in the case directory to simplify the discussion to follow. Therefore, we will not reference an installed path to these executables, but instead simply invoke with ”./”.

Pre-process the mesh

The first step is to use party to merge the native tetrahedral VGRID mesh into mixed elements. Do this by executing party with the ‘—merge_tets’ command line option.

% ./party --merge_tets
...
 Enter your selection:
2

 Enter the Project Name
f6wbnc

 puns3d_read_ilump; iwhere =            2
  Boundary Grouping Options                            
  -----------------------------------------------      
      0       Do not group boundaries                  

      1       Group boundaries of similar BC type      

      2       Group boundaries by GridTool family      
0
 puns3d_read_ilump; iwhere,ilump =            2           0
...
 Merging boundary layer tets...
 Max layers in poin1 file:           31
 Min layers in poin1 file:           22
 Layers unmerged:            2
 Pass Number            1
 Number of splayed-open cells requiring Steiner points =            0
 Number of tet-fans requiring Steiner points =         2433
 Number of pyramid conflicts requiring Steiner points =            0
 Searching for faces on boundary            1 of           49
 Searching for faces on boundary           10 of           49
 Searching for faces on boundary           20 of           49
 Searching for faces on boundary           30 of           49
 Searching for faces on boundary           40 of           49
 Done merging prism stacks:
 Before/after merging, number of nodes =      1121301     1123718
 Before/after merging, number of tets  =      6558758     3039656
 Before/after merging, number of pyrs  =            0        7337
 Before/after merging, number of przs  =            0     1172171
 Before/after merging, number of tris  =        77754       62166
 Before/after merging, number of quads =            0        7794

 Writing unformatted mixed element grid...

 Merging procedure produced f6wbnc.merged.ugrid and f6wbnc.merged.mapbc.
 You may now partition this mixed-element grid by using option 
 44 in party.  Note: It is potentially bad to rename this new 
 project name - it is advised to leave it as is.

Party will merge the grid and dump some statistics to the screen. In this case, the number of tetrahedra was reduced from 6,558,758 to 3,039,656, while 1,172,171 prisms and 7,337 pyramids were introduced. The total number of nodes in the mesh went from 1,121,301 to 1,123,718. The result of the merging process is an unformatted AFLR3 .ugrid file, with the same project name as the original grid, but with a ’.merged’ extension. It is advised that you do not change this new appended project name. You can now re-run party on this mesh using option #44 in the main menu:

% ./party
...
 Enter your selection:
44

 Enter the Project Name
f6wbnc.merged

 puns3d_read_ilump; iwhere =           44
  Boundary Grouping Options                            
  -----------------------------------------------      
      0       Do not group boundaries                  

      1       Group boundaries of similar BC type      
0
...
  --- user input requested ---
 How many partitions do you want?
32
...
 Creating grid partition           32 ...
 Writing grid partition to disk...
 Done.

When the partitioning phase is complete and party finishes, you may now view the resulting ‘f6wbnc.merged_geom.tec’ file using Tecplot. Zooming in on the symmetry plane, you will see that the triangular faces have become quad faces, indicating that the boundary layer grid now consists of prismatic elements.

View of prismatic boundary layer grid on the
symmetry plane

Execute the flow solver

You can now execute the flow solver as usual. The ‘—umuscl 0.5’ command line option should be used with all 3D mixed element cases:

% mpirun -machinefile your.machines -np 32 ./nodet_mpi --umuscl 0.5

The resulting convergence history is represented in the following plot.

Convergence of Merged Case