资源描述
Convergence Monitoring and Control
Convergence Monitoring and Control
Contents
1. Convergence Monitoring
1.1 Residuals
1.2 RESREF
1.3 Spot Value
2. How to Assess Convergence
2.1 Nett source
2.2 Residuals
2.3 Spot values
3. How to use Graphical Monitor
4. How to Achieve Convergence
4.1 Linear Relaxation
4.2 False Time Step Relaxation
4.3 Advice on Relaxation
4.4 Automatic Relaxation
5. Other relaxation control
5.1 Solver Controls
5.2 Limiting Values
5.3 K-E Linearisation
6. Convert the residuals obtained with SELREF=T to residuals normalised by reference inflow quantities.
1. Convergence Monitoring
1.1 Residuals
The residuals are the quantities used in PHOENICS to monitor the convergence procedure.
These are the imbalances in the FVE, defined as:
ep = ap(f p) - S (ai(f i-f p)) - Sf
i=W,E,S,N,H,L,T
where W,E,S,N,H and L denote space directions; T denotes time-direction.
The aim of the computation is to reduce them to an acceptable magnitude.
During the computation, the residuals are printed by Earth to the VDU, or are displayed graphically as shown in Figure 4.
The frequency of display update is controlled by the PIL variable TSTSWP, which is set in the VR-editor Main menu / Output / Monitor update frequency panel. This panel also determines whether the data is shown graphically or in ASCII.
Figure 1 shows the panel when the Main menu/output is clicked in VR-Editor. “Monitor display mode”: GRAPHICS and “Monitor update frequency”: 1 indicate that during the computation, the residuals are displayed graphically on the screen and updated every iteration. The monitor-cell location for the spot values are also set here.
Please note that the monitor update frequency is internally calculated if LSWEEP is large and the user is not able to control the frequency.
Figure 1. Main menu/Output panel in VR-Editor
The PIL setting in a Q1 file should be:
TSTSWP = N where n is the update frequency. N >0 indicates that the residuals are printed to the VDU in ASCII; N<0 indicates that the residuals are displayed on the screen graphically
The quantities printed out are, in fact,
S |ep| / RESREF (f )
where the sum is extended to the whole field.
When the sum of errors divided by RESREF, which is to be explained below, falls below 1.0, solution for that variable stops. However, the residual continues to be computed for the variable, and should it rise above 1.0, the variable re-enters the solution cycle. When the residuals for all variables fall below 1.0, sweeping stops. Otherwise, the computation will stop when the last sweep (LSWEEP) is reached.
1. 2 RESREF
RESREF is a normalisation value and a PIL variable used in Q1 files.
EARTH can automatically calculate values for RESREF, based on the net sum of fluxes for a variable, if the PIL variable SELREF=T. Cases set through the VR-Editor have this as a default, but it is not set in all library cases.
The supplementary variable RESFAC acts as a tolerance. For example, a setting of 0.01 means that sweeping stops when the errors are 1% of the reference fluxes.
These two variables can be set from the VR-Editor Main menu / Numerics / Relaxation control panel as shown in Figure 2 where SELREF is set to T and RESFAC is set to 0.001.
Figure 2. Main menu/Numerics/Relaxation control panel
When SELREF is set to T, the value of RESREF calculated by EARTH is
RESREF(f ) = RESFAC*TOTFLO(f )/(NX*NY*NZ)
TOTFLO(f ) is the summation of all sources for variable f, including sources associated with convection and diffusion transport. It contains terms of the form:
SOURCES: SUM1[ SUM2[ Cf (Vf -f p) ]]
SUM1 is over all cells, SUM2 is for all sources
Cf is the coefficient
Vf the value
f p is the in-cell value of f
CONVECTION: SUMi[ (max(0,(Mdot*f I)) + time-flux)]
SUMi is for all directions
Mdot is the mass flow rate
time-flux for steady cases is zero, for transient is
(abs(Mdot*f )T - abs(Mdot*f )Told)/DT
DIFFUSION: SUMi[ (max(0,(G f *A*(f i - f p)/D )))]
sumi is for all directions
Gf is the diffusion coefficient
D the internodal distance
A is the cell-face area
For pressure, TOTFLO(P1) is SUMi[ MAX(0,(Mdot))], sumi is for all directions.
RESREF is updated at the end of each sweep, when IZSTEP=NZ. For W1 and W2, RESREF would be updated at the end of the sweep when IZSTEP=NZ-1.
If SELREF=F, the user is free to set their own values for RESREF for each variable. The default value of 1E-8 is small enough to ensure that sweeping does not stop before LSWEEP.
RESREF values can be set from the VR-Editor Main menu / Numerics / Iteration control panel (but only if SELREF is set to F in Numerics/Relaxation control panel) as shown in Figure 3.
Figure 3. RESREF values can be set from the VR-Editor Main menu/Numerics if RESREF=F
A suitable value for RESREF is often the inflow source for that variable. This can either be calculated in Q1, or obtained from the 'Net Sources' printout near the end of the RESULT file from an earlier run.
RESREF(f) would then be set to Tolerance*Inflow-Flux, where Tolerance can be say 0.01. Solution for the variable would stop when the sum of errors is less than 0.01 of the inflow flux of that variable.
The units of RESREF are always those of the equation in question. For the velocities, they are Newtons, for H1 or TEM1 they are Watts. The only exception is P1, where the error printed is a volume error, so RESREF(P1) has units of m3/s
1.3 Spot Values
Also visible on the screen (see Figure 1 above) is a display of variable values at a user-specified monitor location in the grid; this location can be changed during the simulation. If convergence has been achieved spot values at all locations must be unchanging.
2. How to Assess Convergence
There are three main tools that are used to determine whether reasonable convergence has been achieved:
· source balance
· residual behaviour
· spot value behaviour.
The three aspects can be checked by examination of the result file for source balance and of the graphical monitoring for residual and spot value behaviour as explained below.
2.1 Nett Source
Good source balance should give a discrepancy between the positive and negative sums (Nett source) that is a small percentage of either; values of <1% should usually be achieved, and considerably lower figures are not uncommon - but a law of diminishing returns applies, with the cost in CPU time of the extra convergence being rather greater than that required to get to a reasonable level.
Near the bottom of the RESULT file you will find the following Nett source printout given for all boundary conditions and source terms, including the reference inflow rates of each dependent variable:
Nett source of R1 at patch named: OB7 (INLET ) = 2.675E-02
Nett source of R1 at patch named: OB8 (OUTLET ) =-2.675E-02
pos. sum= 2.675250E-02 neg. sum=-2.675221E-02
nett sum= 2.905726E-07
Nett source of TEM1 at patch named: OB7 (INLET) = 7.878E+03
Nett source of TEM1 at patch named: OB8 (OUTLET) =-7.947E+03
Nett source of TEM1 at patch named: OC2 (WALL-L) = 1.000E+02
pos. sum= 7.977676E+03 neg. sum=-7.947496E+03
nett sum= 3.018018E+01
Check:
The above print-out from a case with the following input:
1. Inlet velocity : v=0.05m/s
2. Air density: 1.189kg/m3
3. Specific heat of Air: 1005 J/kg
3. Inlet temperature: 20C
3. Inlet area: 0.45 m2
The total mass inflow is: 0.05x1.189x0.45 = 0.0267525 kg/s which is the Nett Source of R1 at INLET.
Heat flux (W) = mass inflow x temperature x specific heat = 0.0267525x (273+20)x1005
= 7877.67 W which is the Nett Source of TEM1 at INLET.
The above printout shows that the mass inflow (R1) at INLET and outflow at OUTLET is well balance. The inflow carries a total heat of 7878W into the domain and the 100W heat transferred to flow from WALL-L; the outflow takes a total heat of 7947W out of the domain. There is 30W (<1%) heat imbalance.
<<Of course, not all variables can be expected to balance: the effect of solid obstructions enters the momentum equations through the pressure gradient, which is a built-in source rather than an externally imposed one - it does not therefore appear in the source balance. Typically, mass (R1/R2) and energy will balance, as will most other scalars, but care is still needed: if the value of a scalar is given a fixed value anywhere, the source required to preserve that value is NOT included in the source print-out. >>
Source imbalance is a clear indication that convergence has not yet been achieved; source balance does not, though, necessarily indicate that convergence has been achieved - residual and spot value behaviour should also be considered.
2.2 Residuals
Interpretation of residuals can be difficult and very subjective. What is certainly true is that residual values should typically go down by at least a factor of 100 from the value after the initial few sweeps (assuming that the calculation is starting from an arbitrary initial state). Eventually, the residuals are likely to level out, with small oscillations about a fairly constant value. This is usually an indication of convergence, but not always: too tight relaxation can sometimes suggest this sort of behaviour because variables are not able to change by much on each sweep, while too loose relaxation can prevent residuals falling further because the variable values are oscillating.
2.3 Spot Values
Spot value behaviour is therefore useful in determining whether or not the levelled residuals can be trusted! If the spot values in a representative region of the flow have settled down to a more-or-less constant value, it is reasonable to assume (if the residual behaviour looks promising) that convergence has been achieved; if the changes are still significant, convergence has not been achieved. Some care is still needed though: apparent settling down of spot values might be caused by too-tight relaxation, resulting in a very slow drift that can be mistaken for real convergence.
Both residuals and spot values can be monitored in graphical monitoring during calculations as shown in Figure 4 in the next section. The spot values are displayed on the left side and the residuals are displayed on the right of the graphical monitoring screen. Details about how to read and use the graphical monitoring will be explained in Section 3.
2. How to use Graphical Monitoring
The graphical display of convergence during calculations can be activated in the VR-Editor. A picture of graphical monitoring screen is shown in Figure 4 below.
Figure 4. Graphical monitoring screen
As seen from the picture, the following items can be monitored:
· the spot values at the selected monitor-cell location (IX=34, IY=2 and IZ=5) are displayed on the left. The current sport value of each solved variable and its change from the previous iteration is also displayed numerically. The names of these solved variables are shown in the middle of the screen under Variable.
· the residuals (error) is displayed on the right. The error has been explained in section 1.1. The error and its change from the previous iteration is also displayed numerically.
· .The total grid numbers, NX, NY and NZ used for the calculation are displayed on the left bottom corner.
· ISWEEP 263 indicates that the current iteration number is 263 during the calculation
· (m:s) est (4:12) is the estimated total time (4 minutes and 12 seconds) required for the calculation
· Time now (2:12) is the time has currently used
· Min and Max are the maximum and minimum values during the calculation. These values are used for normalisation of all the sport values
· A number ‘3’ (monitor update frequency) displayed on the upper right corner indicates that during the computation, the residuals are displayed graphically on the screen and updated every 3 iteration frequency.
As seen from the blue message on the monitoring screen, the user can press any character key on the key board to interrupt the calculation and several function buttons will appear on the screen as shown in Figure 5.
Figure 5. The calculation was interrupted by the user.
Reset
The user may press the Reset button is to check or change the relaxation factors during the calculation as shown in Figure 6.
Figure 6. The Reset panel
Dump
The user may press the Dump button to dump PHI or XYZ (BFC only) files at the current iteration as shown in Figure 7.
.Figure 7. The Dump panel
Monitor
The user may press the Monit button to change the monitor-cell location as shown in Figure 8.
Figure 8. The Monit panel
Endjob
If the Endjob button is pressed, the calculation will stop, but the results at the current iteration will be produced.
Abort
If the Abort button is pressed, the calculation will stop without producing any results.
Go
The Go button is for continuation of the calculation.
Figures on
The user can toggle between Figures on or Figures off to dispay or not to display numerical sport values and residuals. The latter may save calculation time for large cases.
end Pause on
The user can toggle between end Pause on or end Pause off . If end Pause is ON, the following picture shown in Figure 9 will appear on the screen when the last iteration is completed, but the calculation is paused before producing results until the user presses the orange-colour END button.
Figure 9. The calculation has completed the last iteration and paused.
If the Abort button on the above screen is pressed, the calculation will end without producing any results.
The calculation will end automatically if ‘end Pause off’ is selected.
This button has been designed for the user who may not watch the calculation, but may wish to examine the convergence before the convergence monitoring disappears on the screen. It is no longer necessary for PHOENICS V3.4 or later versions as the last picture of the convergence monitoring is always saved to the gxmoni.gif file.
Special
This button should not be used except for MFM library cases.
Important note:
· There is a file called CHAM.INI in the directory, /phoenics/d_allpro. The user may modify the settings in [Monitor] section as the default for graphical monitoring.
展开阅读全文