• No results found

Numerical solution control

In document Star CCM+ User Guide (Page 27-33)

Numerical solution control

Proper control of the numerical solution process applied to the transport equations is highly important, both for acceptable computational efficiency and, sometimes, in order to achieve a solution at all. By necessity, the means of controlling the process depend heavily on the particular numerical techniques employed so no universal guidelines can be given. Thus, the recommended settings vary with the particular algorithm selected and the circumstances of application.

Selection of solution procedure

The basic selection should be based on a correct assessment of the nature of the problem and will be either

a transient calculation, starting from well-defined initial and boundary conditions and proceeding to a new state in a series of discrete time steps; or

a steady-state calculation, where an unchanging flow/deformation pattern under a given set of boundary conditions is arrived at through a number of numerical iterations.

PISO and SIMPLE are the two alternative solution procedures available in

STAR-CD. PISO is the default for unsteady calculations and is sometimes preferred for steady-state ones, in cases involving strong coupling between dependent variables such as buoyancy driven flows. SIMPLE is the default algorithm for steady-state solutions and works well in most cases.

SIMPLE is also used for transient calculations in the case of free surface and cavitating flows, where it is the only option. In most other transient flow problems, PISO is likely to be more efficient due to the fact that PISO correctors are usually cheaper than outer iterations on all variables within a time step of the transient SIMPLE algorithm. However, there are situations in which PISO would require many correctors or even fail to converge unless the time step is reduced, whereas SIMPLE may allow larger time steps with a moderate number of outer iterations per time step. This is the case when the flow changes very little but certain slow transients are present in the behaviour of scalar variables (e.g. slow heating up of solid structures in the case of solid-fluid heat transfer problems, deposition of chemical species on walls in after-treatment of exhaust gases, etc.). In such cases, transient SIMPLE can be used to save on computing time.

When doubts exist as to whether the problem considered actually possesses a steady-state solution or when iterative convergence is difficult to achieve, it is better to perform the calculations using the transient option.

Transient flow calculations with PISO

As stated in“The PISO algorithm” on page 7-2of the Methodology volume, PISO performs at each time (or iteration) step, a predictor, followed by a number of correctors, during which linear equation sets are solved iteratively for each main dependent variable. The decisions on the number of correctors and inner iterations (hereafter referred to as ‘sweeps’, to avoid confusion with outer iterations

performed as part of the steady-state solution mode) are made internally on the basis of the splitting error and inner residual levels, respectively, according to prescribed tolerances and upper limits. The default values for the solver tolerances and

Numerical solution control

maximum correctors and sweeps are given inTable 1-1. Normally, these will only require adjustment by the user in exceptional circumstances, as discussed below.

The remaining key parameter in transient calculations with PISO is the size of the time increment . This is normally determined by accuracy considerations and may be varied during the course of the calculation. The step should ideally be of the same order of magnitude as the smallest characteristic time for convection and diffusion, i.e.

(1-1)

Here, U andΓ are a characteristic velocity and diffusivity, respectively, and is a mean mesh dimension. Typically, it is possible to operate with and still obtain reasonable temporal accuracy. Values significantly above this may lead to errors and numerical instability, whereas smaller values will lead to increased computing times.

During the course of a calculation, the limits given inTable 1-1may be reached, in which case messages to this effect will be produced. This is most likely to occur during the start-up phase but is nevertheless acceptable if, later on, the warnings either cease entirely or only appear occasionally, and the predictions look

reasonable. If, however, the warnings persist, corrective actions should be taken.

The possible actions are:

• Reduction in time step by, say, an initial factor of 2 — if this improves matters, then the cause may simply be an excessively large .

• Increase in the sweep limits — if measure 1 fails, then this should be tried, only on the variable(s) whose limit(s) have been reached. Again, twofold changes are appropriate.

• Pressure under-relaxation — a value of 0.8 for pressure correction

under-relaxation, using PISO, may be helpful for some difficult cases (e.g. for severe mesh distortion or flows with Mach numbers approaching 1).

• Corrector step tolerance — this may be set to a lower value but consult Table 1-1: Standard Control Parameter Settings for Transient PISO

Calculations

Parameter Variable

Velocity Pressure Turbulence Enthalpy Mass fraction Solver

tolerance 0.01 0.001 0.01 0.01 0.01

Sweep limit 100 1000 100 100 100

Pressure under-relaxation factor = 1.0 Corrector limit = 20

Corrector step tolerance = 0.25

δt

Numerical solution control

CD adapco first.

Steady-state flow calculations with PISO

When PISO operates in this mode, the inner residual tolerances are decreased and under-relaxation is introduced on all variables, apart from pressure, temperature and mass fraction. However, the last two variables may need to be under-relaxed for buoyancy driven problems. The standard, default values for these parameters and the sweep limits, which are unchanged from the transient mode, are given inTable 1-2.

.

These settings should, all being well, result in near-monotonic decrease in the global residuals during the course of the calculations, depending on mesh density and other factors. If, thereafter, one or more of the global residuals do not fall, then remedial measures will be necessary. In some instances, the offending variable(s) can be identified from the behaviour of the global residuals.

The main remedies now available are:

• Reduction in relaxation factor(s) — this should be done in decrements of between 0.05 and 0.10 and should be applied to the velocities if the momentum and/or mass residuals are at fault.

• Decrease in solver tolerances — as in the transient case, this may prove beneficial, especially in respect of the pressure tolerance and its importance to the flow solution. A twofold reduction should indicate whether this measure will work.

• Increase in sweep limits — if warning messages about the limits being reached appear and are not suppressed by measures 1 and 2, then it may be worthwhile increasing the limit(s) on the offending variables.

• Under-relaxation of density and effective viscosity — use of this method for density can be advantageous where significant variations occur,

e.g. compressible flows, combustion, and mixing of dissimilar gases.

Effective viscosity oscillations can arise in turbulent flow and non-Newtonian fluid flow and can be similarly damped by this device.

Table 1-2: Standard Control Parameter Settings for Steady PISO Calculations

Parameter Variable

Velocity Pressure Turbulence Enthalpy Mass fraction Solver

tolerance 0.1 0.05 0.1 0.1 0.1

Sweep limit 100 1000 100 100 100

Relaxation

factor 0.7 1.0 0.7 0.95 1.0

Corrector limit = 20 Corrector step tolerance = 0.25

Rφ

Numerical solution control

Steady-state flow calculations with SIMPLE

As noted previously, the control parameters available for SIMPLE are similar to those for PISO, except that, in the case of the former, a single corrector stage is always used and pressure is under-relaxed. The standard (default) settings are given inTable 1-3.

.

In the event of failure to obtain solutions with the standard values, then the measures to be taken are essentially the same as those for iterative PISO, given in the previous section. However, here, reduction of the pressure relaxation factor is an additional device for overcoming convergence problems. The problems usually arise either from a highly distorted mesh, or from highly complex physics (many variables affecting each other). If the grid is distorted, one should reduce the relaxation factor for pressure from the beginning of the run (e.g. to 0.1). If convergence problems are still encountered, a substantial reduction of the under-relaxation factor for velocities and turbulence model variables should be tried (e.g. to 0.5). If this does not help, the problem may lie in severe mesh defects or errors in the set-up. Further reduction of under-relaxation factors may be tried if the grid is severely distorted and cannot be improved; otherwise, improving the mesh quality can be of much greater help.

Note that the pressure under-relaxation factor needs to be adjusted within the limits of some range to make the iteration process converge, where the number of iterations required to reach such convergence is mainly dictated by the

corresponding factors for velocities (and for scalar variables when strongly coupled to the flow). In the case of well-behaved flows and reasonable meshes, the

relaxation factor for pressure can be selected as (1.0 - relaxation factor for

velocities), e.g. 0.2 for pressure and 0.8 for velocities. Usually, for a given velocity relaxation factor, the one for pressure can be varied within some range without affecting the total number of iterations and computing time, but outside this range the iterative process would diverge. The lower the relaxation factor for velocities, the wider the range of pressure relaxation factors that can be used (e.g. between 0.05 and 0.8 if the velocity factor is low, say around 0.5). On the other hand, this range becomes narrower when the mesh is distorted.

The limit to which the velocity relaxation factor can be increased is both problem- and mesh-dependent. When many similar problems need to be solved, it is worth trying to work near the optimum as this may save a lot of computing time.

Table 1-3: Standard Control Parameter Settings for Steady SIMPLE Calculations

Parameter Variable

Velocity Pressure Turbulence Enthalpy Mass fraction Solver

tolerance 0.1 0.05 0.1 0.1 0.1

Sweep limit 100 1000 100 100 100

Relaxation

factor 0.7 0.3 0.7 0.95 1.0

Numerical solution control

On the other hand, for an one-off analysis, it may be more efficient to use a conservative setting.

Note that under some conditions, such as those inTutorial 13.1, a steady-state solution cannot be achieved due to the inherent unsteady character of the flow. This is often the case when the problem geometry possesses some form of symmetry but the Reynolds (or another equivalent) number is high and recirculation zones are present. In this case the residuals stop falling at some level and then continue to oscillate. The “solution” at that stage may be far from a valid solution of the governing equations and should not be interpreted as such unless the residual level is sufficiently small. An eddy-viscosity turbulence model (such as the standard k-e) combined with a first-order upwind scheme for convective fluxes may produce a steady-state solution, while a less diffusive turbulence model (such as Reynolds Stress and non-linear eddy-viscosity models) combined with a higher-order differencing scheme (such as central differencing) may not. In such cases, a transient simulation should be performed; the unsteady solution may oscillate around a mean steady state, in which case the quantities of interest (drag, lift, heat transfer coefficient, pressure drop, etc.) can be averaged over several oscillation periods.

Transient flow calculations with SIMPLE

The use of this algorithm in transient calculations essentially consists of repeating the steady-state SIMPLE calculations for each prescribed time step. The default control parameter settings are therefore as summarised inTable 1-4.

.

The main difference compared to the PISO algorithm lies in the fact that all linearizations and deferred correctors are updated within the outer iterations, by recalculating the coefficient matrix and source term. For this reason, solver tolerances do not need to be as tight as for PISO; they are actually identical to those used for steady-state computations. However, since the discretization of the transient term enlarges the central coefficient of the matrix in the same way as under-relaxation does, the relaxation factors for velocities and scalar variables can be increased (the smaller the time step, the larger the values that can be used for relaxation factors — 0.95 or even more).

The convergence criterion for outer iterations within each time step is by default Table 1-4: Standard Control Parameter Settings for Transient SIMPLE

Calculations

Parameter Variable

Velocity Pressure Turbulence Enthalpy Mass fraction Solver

tolerance 0.1 0.05 0.1 0.1 0.1

Sweep limit 100 1000 100 100 100

Relaxation

factor 0.9 0.3 0.7 1.0 1.0

Outer iteration limit = 5

Numerical solution control

the same as for steady-state flows. However, the number of outer iterations is also set to a default limit of 10; if substantially more iterations are needed to satisfy the convergence criterion, this is a sign that the time step is too large. In such a case, it is better to reduce the time step rather than allow more outer iterations for a larger time step, because this would lead to a more accurate solution at a comparable cost.

On the other hand, if residuals drop below the limit after only a few iterations, one may increase the time step; experience shows that optimum efficiency and accuracy are achieved if 5 to 10 outer iterations per time step are performed.

Note also that the reported mass residuals are computed before solving the pressure-correction equation; after this equation is solved and mass fluxes are corrected, the mass residuals are more than an order of magnitude lower. For this reason, one can accept mass residuals being somewhat higher than the convergence criterion when the limiting number of outer iterations is reached, provided that the residuals of all other equations have satisfied the criterion. In some cases, an increase in the under-relaxation factor for pressure (up to 0.8) can lead to a faster reduction of mass residuals. All these considerations are of course problem-dependent and if several simulations over a longer period need to be performed, it may prove useful to invest some time in optimizing the relaxation parameters.

Sometimes, it is necessary to select smaller time steps in the initial phase of a transient simulation than those at later stages. This is the case, for example, when starting with a fluid at rest and imposing a full-flow rate at the inlet, or full speed of rotation (in the absence of a better initial condition). This is equivalent to a sudden change of boundary conditions at a later time, which would also require that the time step be reduced. Another possibility of avoiding problems with abrupt starts from rest is to ramp the boundary conditions (e.g. a linear increase of velocity from zero to full speed over some period of time).

The transient SIMPLE algorithm allows you to select either the default fully-implicit Euler scheme or the three-time-level scheme for temporal discretisation, described inChapter 4, “Temporal Discretisation” of the

Methodology volume. The latter scheme is second-order accurate but is currently applied only to the momentum and continuity equations. It should be chosen when temporal variation of the velocity field is essential, e.g. in the case of a DES/LES type of analysis. While PISO would normally be the preferred choice for the latter, under some circumstances (e.g. the existence of very small cells, poor mesh quality etc.), transient SIMPLE may allow the use of larger time steps than PISO without loss of accuracy.

Effect of round-off errors

Efforts have been made to minimise the susceptibility of STAR-CD to the effects of machine round-off errors, but problems can sometimes arise when operating in single precision on 32-bit machines. They usually manifest themselves as failure of the iterative solvers to converge or, in extreme cases, in divergence leading to machine overflow.

If difficulties are encountered with problems of this kind, then it is clearly advisable to switch to double precision calculations. Instructions on how to do this are provided in the Installation Manual. As a general rule, however, you should try to avoid generating very small values for cell volumes and cell face areas by working with sensible length units. Alternatively, you could re-specify your

In document Star CCM+ User Guide (Page 27-33)