Solver Input File
A sample input list file for NSU3D is shown below.
This input list is separated into various regions which deal with the general run parameters (Lines 1 to 17), the coarse grid parameters (Lines 19 to 23), the turbulence model parameters (Lines 25 to 33), the flow conditions (Line 36), the force coefficient definitions (Line 40), and the input file name (Line 43). The numerical values given in the sample file are in most cases optimal and should be used as the baseline values.
Input File Description
Line 1: contains a title for the particular case.
Line 3: controls the restart function. RESTARTF = 1.0 instructs the solver to read the initial flow field from the restart directory listed on Line 5. If RESTARTF = 0.0, no restart directory name is required and the flow is initialized with freestream values. If RESTARTF = 1.0 and RESTARTT = 0.0, then the flow solution is restarted from the restart directory, but the turbulence values are reinitialized to zero and recomputed from scratch. If RESTARTF = 1.0 and RESTARTT = 1.0, then both flow and turbulence values are read in from the restart directory. RNTCYC denotes the number of solution cycles to be performed on the turbulence model (with the flow field frozen) just after the restart directory has been read in. This option can be used for example to pre-converge the turbulence model, particularly if a flow field is read in from the restart directory, but the turbulence values are not read in, possible because an alternate turbulence model has been selected.
Line 5: The name of the restart directory is specified on Line 5. If RESTARTF = 0.0, this entry is ignored.
Line 7: MMESH is use for mesh sequencing, i.e. running on various meshes of the multigrid sequence. This parameter actually determines the number of lines of type Line 9 that are to follow. It is to be used in conjunction with the NMESH (number of multigrid meshes) and MESHLEVEL (identifies the mesh on which solution is computed) parameters.
For example, a typical Full Multigrid (FMG) Mesh Sequencing algorithm would solve the flow on the coarsest mesh (MESHLEVEL = 4.0, for the case where four grid levels are available), using a single mesh in the multigrid sequence (NMESH = 1.0), and then interpolate the solution to the next finer mesh (MESHLEVEL = 3.0), solve the flow on this mesh using two meshes in the sequence (NMESH = 2.0), and then continue on each finer grid in this manner until the finest grid is reached (MESHLEVEL = 1.0). Each solution on a given grid level involves an entry of the type on Line 9, and the total of these entries must correspond to the MMESH value set here.
In actual fact, the MMESH facility is more general than simply one which offers the possibility of performing mesh sequencing. Any sequence of mesh solutions can be prescribed. For example, a partially converged solution on the finest mesh can first be achieved using the single (non-multigrid) algorithm, and then the multigrid algorithm on the finest mesh can be invoked afterwards by using MMESH = 2.0, with the first line containing NMESH = 1.0, MESHLEVEL = 1.0 and the second line containing NMESH = 4.0, MESHLEVEL = 1.0. Additionally, the value MESHLEVEL = -1.0 enables the solution of the first order discretization on the finest grid level. This may be useful for pre-converging cases which experience start-up problems, thus increasing overall robustness of the solver.
The example input file above shows an initial phase of full multigrid mesh sequencing, followed by a first order accurate multigrid solution phase on the finest mesh, followed by a single grid mesh solution phase on the finest grid, followed by the second order accurate multigrid solution on the finest grid, which yields the final result.
A good strategy for increasing robustness at startup is to perform 10 or 20 single grid cycles or first-order accurate multigrid cycles on the finest grid, followed by the second order accurate multigrid solution for several hundred cycles. Full multigrid mesh sequencing in general does not provide substantial convergence acceleration over the entire solution process, and is not often invoked. It can however be used to diagnose a problem with one of the agglomerated coarse levels. Thus, in general, a value MMESH = 2.0 is prescribed, while using only lines 9.5 and 9.6 (or 9.4 and 9.6).
NTHREAD denotes the number of OpenMP threads to be used during parallel execution. For a hybrid MPI-OpenMP run, this refers to the number of threads running under each MPI process. On some systems it may also be necessary to set the OMP_NUM_THREADS environment variable to enable the requested number of threads to be employed. If for such a reason NTHREAD threads cannot be spawned, nsu3d will terminate with a message to that effect.
Line 9: This line should be replicated (with changes) MMESH times. Each instance of this line refers to the solution on a particular mesh of the multigrid sequence, and defines the parameters required for that solution process.
NCYC specifies the number of (multigrid) cycles to be executed.
The maximum eddy viscosity computed throughout the entire flow field is printed out every NPRNT cycles.
N MESH specifies the number of multigrid levels (including the fine grid). The minimum value is 1, which reproduces a single grid algorithm, and the maximum value is NLEVELS + 1, where NLEVELS is the value specified in the AMG3D input list when constructing the *.amg file for this run.
MESHLEVEL specifies the mesh in the multigrid sequence on which the solution is to be obtained. This is used in grid sequencing or preconditioning the solution by performing single fine grid iterations and/or first-order accurate fine grid iterations. MESHLEVEL = 1.0 always refers to the finest grid of the sequence. MESHLEVEL = -1.0 also refers to the finest grid of the sequence, but switches the discretization to a first-order accurate form which is more rapidly converged. MESHLEVEL = 2.0 refers to the second mesh in the sequence, i.e. the first coarse multigrid mesh. MESHLEVEL = 3.0 refers to the next coarser level, and so on. Since the coarse multigrid levels are based on agglomeration, a full second order discretization on these coarse levels is not possible, so it is important to remember that all MESHLEVEL > 1.0 grids are only first order accurate.
CFLMIN and RAMPCYC are used to ramp up the CFL number for cases with start-up difficulty. The initial CFL number is given by CFLMIN, which is then ramped up to the final value CFL (Line 11) linearly over RAMPCYC cycles.
TURBFREEZE has the effect of freezing the turbulence model after TURBFREEZE multigrid cycles. A value TURBFREEZE = 0.0 omits any freezing action, while a value TURBFREEZE = -1.0 initiates freezing immediately after initialization.
Line 11 contains the following solver controls:
CFL is the CFL number, which scales the local time-step size. The particular CFL value depends on whether residual smoothing is used (SMOOP and NCYCSM), and the number of Runge-Kutta stages (C1-C6). A value of CFL = 1.0 has been found to work best with the 3-stage scheme shown in this example. An alternate 5-stage scheme (with coefficients : C(1-5) = 0.25, 0.16667, 0.375, 0.5, 1.0, and FIL(1-5) = 1.0, 0.0, 0.56, 0.0, 0.44) works well with the value CFL = 2.5.
CFLV is not functional in this version. Use the default value of 1000.
ITACC is not functional in this version.
INVBC selects the way in which the wall boundary condition is applied for slip velocity flows, such as those encountered in inviscid flows at walls, or when using wall functions. INVBC = 0.0 results in floating velocity vectors at the wall (not necessarily tangential), with vanishing normal flux specified through the wall, while INVBC = 1.0 explicitly sets the velocity vectors to be tangential to the wall at inviscid wall boundaries.
VIS1 and VIS2 specify the artificial dissipation. Generally, VIS1 specifies the coefficient of first order dissipation (based on second differences) used only in the vicinity of shock waves, and VIS2 defines the level of background 2nd order accurate dissipation (based on fourth differences). Because the first-order dissipation can severely degrade overall accuracy if it is triggered near leading edges, it is common practice to set VIS1 = 0.0 which may produce some shock oscillations. The values VIS1 = 0.0 and VIS2 = 20. generally produces good overall accuracy. These values are independent of whether the artificial dissipation discretization or the upwind (matrix dissipation) discretization schemes are employed.
HFACTOR specifies the amount of enthalpy damping to be used. Enthalpy damping is a technique to speed convergence for isenthalpic flows. For Navier-Stokes flow, enthalpy damping should be turned off: HFACTOR = 0.0 For inviscid flows, HFACTOR = 0.25 can be used.
SMOOP and NCYCSM are not active in the current version of the solver.
C1 - C6 specify the Runge-Kutta coefficients for the multi-stage time-stepping scheme. In general, the 3-stage scheme described in this example is used and the values of these coefficients need not be changed. An alternate 5-stage scheme contains the values: C(1-5) = 0.25, 0.16667, 0.375, 0.5, 1.0, and FIL(1-5) = 1.0, 0.0, 0.56, 0.0, 0.44, and CFL = 2.5
FIL1 - FIL6 specify the coefficients for the dissipative terms for the multi-stage time-stepping scheme. The values of these coefficients need not be changed as long as the 3-stage scheme is employed. The values depicted above can used for the 5-stage scheme.
CFLC (Line 21) defines the CFL number used on the coarse multigrid levels. Generally CFLC should have the same value as CFL.
CFLVC, SMOOPC and NSMOOC are not active in this version of the solver.
VIS0 determines the level of artificial dissipation on the coarse multigrid levels (first-order accurate only). Higher values of VIS0 will provide additional robustness at the expense of speed of convergence. The value VIS0 = 4.0 can be used almost exclusively, although values up to VIS0 = 6.0 can be used for additional robustness for difficult cases.
MGCYC determines the type of multigrid cycle to be employed. MGCYC = 1.0 corresponds to a multigrid V-cycle, while MGCYC = 2.0 corresponds to a multigrid W-cycle. MGCYC = 2.0 is generally delivers faster convergence overall.
SMOOMG and NSMOOMG determine the amount of smoothing applied to the coarse grid corrections after they are interpolated to the next finer grid level. This smoothing operation is similar to that employed for the implicit residual smoothing operation. SMOOMG and NSMOOMG therefore have meanings similar to SMOOP and NCYCSM. The optimal values have been found to be SMOOMG = 0.2 to 0.8, and NSMOOMG = 2.0. Higher values such as SMOOMG = 0.8 and NSMOOMG = 3.0 can occasionally be used for additional robustness (at the expense of speed of convergence).
ITURB selects the physical model or turbulence model to be used. ITURB = 0.0 results in an inviscid flow (Euler) computation. ITURB = 1.0 results in a laminar flow computation ( no turbulence effects). ITURB = 4.0 selects the Spalart-Allmaras one-equation turbulence model.
IWALL should aways be set = 0.0 in this version.
CT1 - CT6 are the stage coefficients for the turbulence model on the fine grid. The turbulence model is solved simultaneously but decoupled from the flow equations. At each stage in the multi-stage flow time-stepping, a turbulence model iteration can be performed. Using more turbulence iterations than flow solution stages is not permitted. Unlike those for the flow solver, these turbulence stage coefficients can only take on 3 values:
CT = 0.0 Omits time-stepping the turbulence equations at this stage.
CT = 1.0 selects the tridiagonal line solver for the turbulence model at this stage.
CT =-1.0 selects the point-wise solver for the turbulence model at this stage.
In general, the value CT = 1.0 should be use at every stage corresponding to a flow solution stage.
Line 31: CTC1 - CTC6 are the stage coefficients for the turbulence model on the coarse grids. These can take on the same values as described above for the CT fine grid coefficients. When all CTC = 0.0, only fine grid iterations are performed on the turbulence model.
VIST0 represents the amount of 1st order dissipation employed on the coarse grid levels for the turbulence model. This dissipation can make the multigrid procedure more robust by stabilizing coarse grid iterations, although this comes at the expense of slower overall convergence of the turbulence model. Values between 0.0 and 6.0 have been employed.
TSMOOMG and NTSMOOMG are analogous to the SMOOMG NSMOOMG parameters described on Line 23. They determine the amount of smoothing applied to the coarse grid corrections for the turbulence model after they are interpolated to the next finer grid level. The optimal values have been found to be TSMOOMG = 0.2 to 0.8, and NTSMOOMG = 2.0. Higher values such as TSMOOMG = 0.8 and NTSMOOMG = 3.0 can occasionally be used for additional robustness (at the expense of speed of convergence).
Line 36: sets the freestream flow conditions. For a new solution, the flow field is initialized as a uniform flow with these conditions, and the far-field boundary maintains these conditions throughout the solution phase. For a restarted solution, the outer boundary only is affected by these conditions. (Changing the Reynolds number affects the viscosity values in the simulation and is not related to boundary or initial conditions).
MACH : sets the freestream Mach number.
Z-ANGLE: sets the flow angle relative to the z-axis: for a coordinate system where y (or z) is spanwise, this corresponds to the yaw angle (or incidence angle).
Y-ANGLE: sets the flow angle relative to the y-axis: for a coordinate system where y (or z) is spanwise, this corresponds to the incidence angle (or yaw angle).
RE: sets the Reynolds number of the flow, based on the distance RE_LENGTH. Thus for RE_LENGTH = 1.0, a Reynolds number of RE per unit length in the grid dimensions is employed.
Line 40 defines the values for the force coefficient calculation. These include a reference area (REF_AREA) in grid dimensions (squared), a reference length (REF_LENGTH) in grid dimensions, the location of the point about which the moment coefficients are to be computed (XMOMENT, YMOMENT, ZMOMENT) and a definition of which coordinate is the spanwise coordinate (ISPAN = 2.0 for y-spanwise, ISPAN=3.0 for z-spanwise), since this affects the definition of lift, drag and side-force.
Line 43: specifies the directory for the partitioned grid files to be read by the solver. Only the directory name is specified here, not any individual files. The format is always set equal to 2.0.