+ All Categories
Home > Documents > PHOENICS SEGREGATED SOLVER

PHOENICS SEGREGATED SOLVER

Date post: 25-Feb-2016
Category:
Upload: joanna
View: 51 times
Download: 0 times
Share this document with a friend
Description:
PHOENICS SEGREGATED SOLVER. Initial data & Boundary Conditions. To get a converged numerical solution the solver visits each transport equation separately. Consider for example a 2D (XY plane) flow case with energy equation and laminar regime. - PowerPoint PPT Presentation
Popular Tags:
50
PHOENICS SEGREGATED SOLVER To get a converged numerical solution the solver visits each transport equation separately. Consider for example a 2D (XY plane) flow case with energy equation and laminar regime. The solver does a loop visiting the momentum equations, energy equation and ,at last, the mass (pressure) equation and return. A SWEEP is completed after the Solver has worked on each transport equation. Initial data & Boundary Conditions Solver U1 Solver V1 Solver TEM1 Solver P1 (mass conserved field) Compare residuals against a reference End Sweep
Transcript
Page 1: PHOENICS SEGREGATED SOLVER

PHOENICS SEGREGATED SOLVER

• To get a converged numerical solution the solver visits each transport equation separately. • Consider for example a 2D (XY plane) flow case with energy equation and laminar regime. • The solver does a loop visiting the momentum equations, energy equation and ,at last, the mass (pressure) equation and return. • A SWEEP is completed after the Solver has worked on each transport equation.

Initial data & Boundary Conditions

Solver U1

Solver V1

Solver TEM1

Solver P1(mass conserved field)

Compare residuals against a reference

EndSw

eep

Page 2: PHOENICS SEGREGATED SOLVER

Solver Sweeping Direction(1)

• Each transport equation is visited by the solver individually;• The computational domain is not tackled at once by the solver. It slices the domain in slabs (XY plane) along the Z direction.• The sweep starts from low Z to high Z, or IZ = 1 to IZ = last.

• The solver sweeping direction has a direct influence on the computer time and some times on the convergency rate. • For 3D simulation align the Z direction along the main flow direction. This practice propagates faster the upstream information to the downstream direction

Page 3: PHOENICS SEGREGATED SOLVER

Solver’ sweeping direction: two dimensional cases (2)

• For 2D cases employ the XY plane; the solution is faster because the solver has only one slab to sweep. Furthermore, it solves at once the whole slab .

X

Y

Z

1 swee

p

X

Y

Z

4 sw

eeps

• Workshop #1: compare the CPU time for the cylinder in cross flow using the XY and YZ planes. One can download the q1XY and q1YZ.

Page 4: PHOENICS SEGREGATED SOLVER

CO

MEN

TS C

ase

2D• Both simulations have the same inlet values, fluid properties, grid size and reference residuals. •The XY plane requires 5200 sweeps to fall below the threshold level and stop simulation. The YZ plane doesn’t reach threshold even after the 8000 sweeps• XY CPU time = 22sec (5200 sweeps) YZ CPU time = 222s (8000 sweeps); it is a 10 times faster if one uses the XY plane.• One concludes that using XY plane reduces the CPU time and also speeds convergence!

• The Z direction is the Phoenics natural choice to be the axis parallel to the coordinate system axial direction.

• For 3D it is highly recommended to choose the main flow direction coincident with the Z axis.

• For 3D BFC it is mandatory that the main flow direction be coincident with the Z axis. BFC two dimensional cases one must choose the XY plane only.C

ilind

rical

-Pol

ar, 3

D

Cas

es a

nd B

FC

Page 5: PHOENICS SEGREGATED SOLVER

•The next sections introduces Phoenics’ tools to access and control convergence.

• The type and the use of these new tools are closely related to the solver’s segregated structure.

Initial data & Boundary Conditions

Solver U1

Solver V1

Solver TEM1

Solver P1(mass conserved field)

Compare residuals against a reference

EndSw

eep

Page 6: PHOENICS SEGREGATED SOLVER

Getting a Numerical Solution is a Difficult Task1. Grid independent - if you increase the number of nodes the

solution does not change significantly.2. Convergence– the solution achieves a constant value, it does

not oscillates neither changes with further interactions;3. Negligible Residuals – if the mass, momentum, energy (and

other variables) residuals are negligible one can say the numerical solution satisfies GLOBALLY the conservation equations.

• Usually if you get convergence but not get negligible residuals your solution is converged to a non-physical (wrong) solution!

– A number of devices are provided in PHOENICS to monitor and control the convergence of the solution. They are fully described at ´Convergence Monitoring´ link and are briefly presented now.

Page 7: PHOENICS SEGREGATED SOLVER

1. STUDYING RESIDUALS

Page 8: PHOENICS SEGREGATED SOLVER

THE RESIDUALS & CONVERGENCE MONITORING • The residuals are the quantities used in PHOENICS to monitor the

convergence procedure. These are the imbalances in the FVE, defined as:

• During the computation, the residuals are printed by Earth to the VDU, or are displayed graphically.

• The frequency of display update is controlled by the PIL variable TSTSWP, which is set in the menu from the Monitoring controls/Residuals display frequency panel. • The default value of 1 prints to the screen, which is suitable for batch

operation. A setting TSTSWP = -1 activates the graphical display.

Page 9: PHOENICS SEGREGATED SOLVER

THE SPOT VALUE (GROUP 22)

• In addition to the display of residuals to the screen, the values

of chosen variables for a single cell can also be displayed.

• A monitoring location (or cell) is selected in the Q1 file, or from

the menu by setting the variables IXMON, IYMON, IZMON to the

values of IX, IY and IZ of the cell to be monitored.

• The monotoring spot can be set on VR/Output box.

 

Page 10: PHOENICS SEGREGATED SOLVER

MONITORING SPOT VALUES AND RESIDUALS ON SCREEN

SPOT VALUES RESIDUALS

Page 11: PHOENICS SEGREGATED SOLVER

• The quantities printed out are, in fact:

                                                      

where the sum is extended to the current slab (in PARABolic cases) or to the whole field (in elliptic cases).

• When the sum of errors divided by RESREF falls below 1.0, solution for that variable stops. When this happens for all variables, sweeping stops.

• EARTH can calculate values for RESREF, based on the net sum of fluxes for a variable, if the PIL variable SELREF=T.

• The supplementary variable RESFAC acts as a tolerance - a setting of 0.01 means that sweeping stops when the errors are 1% of the reference fluxes.

NORMALIZING THE RESIDUALS

Page 12: PHOENICS SEGREGATED SOLVER

RESREF , RESFAC & SELREF (GROUP 15)

• RESREF, the reference-residual for a solved-for variable

• It is evaluated by RESREF = RESFAC*(Typical flow rate of the variable)

• The "typical flow rate" is the sum of the absolute values, for all cell volumes and cell faces, of the convection fluxes, diffusion fluxes, sources and transient terms.

• If SELREF = T Earth evaluates internally RESREF

• If SELREF = F RESREF is user set.

• Users should be aware that the employment of SELREF=T, with a value of RESFAC which is the same for all variables, is a convenient but crude method of controlling the cut-off point of the solution procedure. To set SELREF = F, and set the individual RESREFs for themselves may be safer, when obtaining a well-converged solution is especially important.

Page 13: PHOENICS SEGREGATED SOLVER

VR SETTINGS: SWEEPS RESFAC SELREF

Page 14: PHOENICS SEGREGATED SOLVER

1.1 WORKSHOP#2: ANALYSING RESIDUALS

Page 15: PHOENICS SEGREGATED SOLVER

WORKSHOP NOTES – CONVERGENCE AND CONTROL #2

• Load core library case 240. This case deals with the entry flow in a 2-D parallel walls channel.

• Now make the changes:– y size from 1 m to 0.5 m; –NY = 10 and NZ = 15; –set the domain to material 67 (water); –LSWEEP = 200 ;– Turn off the Energy Equation–and finally make WIN = 0.01 m/s instead of 5 m/s

Page 16: PHOENICS SEGREGATED SOLVER

WORKSHOP NOTES – CONVERGENCE AND CONTROL #2

• Run EARTH.

• Inspect the RESULT file to check the assigned RESREF values.

variable resref (res sum)/resref (res sum) P1 5.018E-04 4.528E-04 2.272E-07 V1 1.213E-08 8.297E+03 1.006E-04 W1 4.693E-06 7.178E+01 3.369E-04

• Can you give a physical meaning to them?

DOWNLOAD WKSH Q1

Page 17: PHOENICS SEGREGATED SOLVER

WORKSHOP #2 NOTE (1)Whole-field residuals before solution with RESREF values determined by EARTH & RESFAC = 1.00E-03 & TIME/(VARIABLES*CELLS*TSTEPS*SWEEPS*ITS = 9E-05 sec.

variable resref (res sum)/resref (res sum) P1 5.018E-04 4.528E-04 2.272E-07 V1 1.213E-08 8.297E+03 1.006E-04 W1 4.693E-06 7.178E+01 3.369E-04

1- the 4th column means that the sum of residuals of pressure, for example, is nearly 2.3E-7 (kg/s). Similarly to the other variables.

2- The meaning of the 2nd column is a reference flux. Thus for pressure (mass conservation) it is 5.0E-04 kg/s, and for V1 and W1 it is the mass flux times a reference velocity, 1.0E-08 kgm/s2 (N) and 4.7E-06 kgm/s2 (N).

3- How big or small these fluxes are? One have to compare against some characteristic value of the problem.

4- Inlet mass flux = RHO1*WIN*H = 5 kg/s; W1 momentum flux = 5E-02 N, V1 momentum flux (very small, boundary layer)

5- The mass imbalance (sum of residuals) is 2.3E-07 kg/s or 5-10 % of the mass inlet! If the run had stopped at (res sum)/resref = 1, then the global mass imbalance would correspond to 0.01% of the mass inlet. The same reasoning applied to W1 and V1 one sees that the residuals are far from satisfy the convergence criterion.

Page 18: PHOENICS SEGREGATED SOLVER

WORKSHOP NOTES – CONVERGENCE AND CONTROL #2

• Open q1 file and edit the following lines:–SELREF=F–RESREF(V1) = 5.0E-06 kg.m/s2 [N], –RESREF(W1) = 5.0E-06 kg.m/s2 [N] and –RESREF(P1) = 5.0E-04 kg/s.

• These changes can not be made using VR, you have to edit q1 file directly. (there is a hint on editing in note 2). Compare with the actual ´run performance´ with the one from last case.

variable resref (res sum)/resref (res sum) P1 5.018E-04 4.528E-04 2.272E-07 V1 1.213E-08 8.297E+03 1.006E-04 W1 4.693E-06 7.178E+01 3.369E-04

Page 19: PHOENICS SEGREGATED SOLVER

WORKSHOP #2 NOTE (2)• Edit GROUP 15 in q1 file using the notepad: ************************************************************ Group 15. Terminate Sweeps LSWEEP = 200 RESREF(P1 ) = 5.000000E-04 ;RESREF(V1 ) = 5.000000E-06 RESREF(W1 ) = 5.000000E-06; SELREF = F •Save and close notepad•DO NOT FORGET: RELOAD WORKING FILE

•Whole-field residuals with resref values set by the user variable resref (res sum)/resref (res sum) P1 5.000E-04 5.016E-04 2.508E-07 V1 5.000E-06 3.409E+01 1.704E-04 W1 5.000E-06 1.758E+02 8.788E-04 •The criteria to stop V1 was eased. As a consequence the solution for W1 got worse probably because the V1 residuals were too coarse.• One may use the SELREF =T or decide by himself the reference residuals, this is the most important convergence criterion.

Page 20: PHOENICS SEGREGATED SOLVER

2. PROMOTING & ACHIEVING CONVERGENCE

Page 21: PHOENICS SEGREGATED SOLVER

• What if your numerical solution blows up?• What if the residuals of your numerical solution does not

fall bellow a specified threshold value ?• Phoenics has several commands to control the

numerical convergency rate which are represented by : 1. Control of the number of iteration per variable and

the termination criteria;

2. The prescription for a variable of the range of values it can take;

3. The use of relaxation;

Page 22: PHOENICS SEGREGATED SOLVER

ASSESING CONVERGENCE

• There are several guidelines to follow and observe when trying to assess whether a run has converged or not. These are:

• Have the values at the monitor point stopped changing? • Have the residuals reached the cut-off point, or reduced by several orders

of magnitude in any case? • Do the sums of sources printed in the RESULT file balance? • Are plots taken from PHI files dumped, say 200, sweeps apart essentially

identical? • If the answers the first three questions are all yes, then the run has almost

definitely converged. The fourth test can be used just to make sure, if you are not convinced. Intermediate PHI files can be dumped from the EARTH interrupt, or by appropriate settings in the Q1.

 

Page 23: PHOENICS SEGREGATED SOLVER

2.1 - MATRIX SOLVER CONTROLER:

NUMBER OF ITERATIONS PER VARIABLE AND

TERMINATION CRITERIA

Page 24: PHOENICS SEGREGATED SOLVER

MATRIX SOLVER CONTROLER:NUMBER OF ITERATIONS PER VARIABLE AND TERMINATION CRITERIA

Each variable is visited by the solver LITER times before the solver moves to the next one. LITER(phi)....maximum number of iterations which are to be performed by the linear-equation solver for the variable phi, when such a solver is being employed for it.

ENDIT----- Real array; default= 1.E-3; Satellite Help - When greater than zero, ENDIT influences the termination of iterations in the built-in linear-equation solver by requiring that, before termination can occur, the average change of value is less than ENDIT times the average change at the first iteration (unless LITER iterations have been performed).

Initial data & Boundary Conditions

Solver U1

Solver V1

Solver TEM1

Solver P1(mass conserved field)

End

Swee

p

Compare residuals against a reference

LITERENDIT

Page 25: PHOENICS SEGREGATED SOLVER

MATRIX SOLVER CONTROLER:NUMBER OF ITERATIONS PER VARIABLE AND TERMINATION CRITERIA

The convergence process is interactive. The solver visits one variable at a time.

Therefore is not necessary to get a error free solution at the beginning of the process since the other variables are not fully converged. This means:

• LITER large will demand large machine time to get a solution;

• LITER small probably will not guarantee a converged solution since the intermediate solutions are not well resolved;

• ENDIT small will use all the sweeps specified in the LITER;

• ENDIT big will cause the solver leave the variable without a ´reasonable´ solution;

Page 26: PHOENICS SEGREGATED SOLVER

VR SETTINGS UNDER NUMERICS ENTRY

Page 27: PHOENICS SEGREGATED SOLVER

2.2 - MATRIX SOLVER CONTROLER:

LIMITING THE RANGE OF VALUES

Page 28: PHOENICS SEGREGATED SOLVER

VARIABLE CONTROLLIMITING THE RANGE OF VALUES (GROUP 18)

• A variable can be prevented from overshooting, during the iteration procedure, the range of physically-realistic values by using the PIL commands VARMIN (variable) and VARMAX(variable) to prescribe that range.

• Then, PHOENICS will use those values as lower and upper bounds for the field of the variable. It is usefull for solved variables such as Turbulent Kinetic Energy and Dissipation which have always positive values!

• The use of VARMIN and VARMAX is not limited to solved for variables; it can also be used with any STOREd one.

• For example, after STOREing the density or the turbulent viscosity, VARMIN can be used to avoid negative values during the iteration process.

• Note, however, that if any values are left at VARMIN or VARMAX in the converged flow-field, the flow is NOT converged. The limits must be eased, and the run continued.

Page 29: PHOENICS SEGREGATED SOLVER

VR SETTINGS UNDER NUMERICS ENTRY & q1 COMMAND LINES

Page 30: PHOENICS SEGREGATED SOLVER

2.3 - MATRIX SOLVER CONTROLER:

RELAXATION (very important)

Page 31: PHOENICS SEGREGATED SOLVER

RELAXATION • Relaxation is a commonly-used device that promotes convergence by "slowing down" ("relaxing") the (sometimes excessive) changes made to the values of the variable during the solution procedure. • Relaxation involves, therefore, changing the values obtained from the solution algorithm, so that they are closer to the pre-existing ones. • How the values are changed gives rise to two kinds of relaxation:

1.Linear relaxation

2.False time-step (or inertial) relaxation • Both options are available in PHOENICS (PIL group 17 or the menu), and their activation is discussed next. • However, before proceeding with the discussion, it must be stressed that relaxation does NOT change the converged solution, but only the RATE at which the solution is achieved.

Initial data & Boundary Conditions

Solver U1

Solver V1

Solver TEM1

Solver P1(mass conserved field)

Compare residuals against a reference

End

Swee

p

relax

Page 32: PHOENICS SEGREGATED SOLVER

1. Linear Relaxation When linear relaxation is applied to a variable f, the new value fnew for the variable at each cell is taken as:

fnew = (1 - a) fold + a f*

 where: fold is the current in-store value, resulting from the previous iteration; and f* is the value which results from the current iteration; and

a is the relaxation factor.

Obviously:

if a = 0, then fnew = fold (i.e., no change at all)

if a = 1, then fnew = f*    (i.e., no relaxation at all)

The PHOENICS command to activate linear relaxation for a variable is: RELAX( f , LINRLX , a )

Page 33: PHOENICS SEGREGATED SOLVER

2. False-Time-Step Relaxation False-time-step relaxation results from adding to the RHS of the FVE an extra term:

              where: fP is the cell-value of to be computed, f is the cell-value of resulting from the previous iteration, V is the cell volume and dtf is a user-set false-time-step • Large values of dtf, the added extra term is negligible, and

the solution of the equation is the same as the unrelaxed one.

• Small values of dtf, the solution is            (i.e., no change at all).

• The name false-time-step arouse because the extra added term has the same form as the one resulting from the transient term even if the problem is steady state.

Page 34: PHOENICS SEGREGATED SOLVER

False-Time-Step Relaxation - cont• dtf can be set finding a characteristic time scale of the phenomena:

Convective time scale: dtf ~ L/U

Difusive time scale: dtf ~ L2 /n

• The PHOENICS command to activate linear relaxation for a variable is:

RELAX ( f , FALSDT , time-step ) where time-step = dtf.

Page 35: PHOENICS SEGREGATED SOLVER

VR SETTINGS UNDER NUMERICS ENTRY & q1 COMMAND LINES

Page 36: PHOENICS SEGREGATED SOLVER

Expert Systems to Achieve Fast Convergency• EXPERT: A set of 'auto-pilot' devices have been introduced which make

'in- flight' adjustments to the numerical parameters (such as relaxation factors) in order to speed up the convergence of the solution procedure. Look after the Encyclopedia to activate Expert.

• SARAH (Self-Adjusting Relaxation AlgoritHm): Much in the same way that EARTH can calculate normalising factors for residuals when SELREF=T based on sums of fluxes, it can also calculate average time-scales for each variable. Look after the Encyclopedia to activate Expert.

• CONWIZ (Convergency Wizard): is a feature of PHOENICS 3.6 which is designed to ensure that PHOENICS solutions will converge, whenever the input data are sufficient and self-consistent. See entry at Encyclopedia

Page 37: PHOENICS SEGREGATED SOLVER

2.4 – WORKSHOP ON CONTROLING CONVERGENCY

Page 38: PHOENICS SEGREGATED SOLVER

WORKSHOP #3 – CONVERGENCE AND CONTROL

• Reload 2D rectangular channel flow .•Set the Auto Converg Control to OFF • Set FALSDT to W1 and V1 to 1• Set SWEEPS to 600•--------------------------------------------

DOWNLOAD WKSH Q1

•Comments:• The residuals are lower than previous case.• Return to the Auto-Convergence mode. • Set the reference velocity and scale to: 0.01m/s & 0.5m and run again the case.

Page 39: PHOENICS SEGREGATED SOLVER

WORKSHOP #4 – CONVERGENCE AND CONTROL

• Load core library case 252. This case deals with natural convection in an annular cavity.

• At the OUTPUT box activate the graphics monitor convergence; TSTSWP = -1

• At the NUMERICS box change the sweeps from 150 to 600; LSWEEP = 600

• After you completed these changes run EARTH. The solution must converge within the 300 sweeps.

Page 40: PHOENICS SEGREGATED SOLVER

WORKSHOP NOTES – CONVERGENCE AND CONTROL #1

•THE DANGER OF OVER-RELAXATION

•Now change the relaxation settings of U1, V1 and H1 to FALSDT = 1.0E+04 and watch the monitor plots (see NOTE 2 for help if you need).

• In many cases even moderate amounts of relaxation can speed up convergence dramatically. In other cases, it is the only difference between convergence and divergence!

Page 41: PHOENICS SEGREGATED SOLVER

WORKSHOP NOTES – CONVERGENCE AND CONTROL

THE DANGERS OF UNDER RELAXATION

• Run the case again. This time put in extremely heavy relaxation (FALSDT = 1.0E-8) and see how the solution behaves. Can you explain this behavior? See note 3 if you need help.

• Answer: you have introduced so much relaxation that the momentum equations can no longer change themselves. Pressure correction is still active, and will change the velocities so as to satisfy continuity. The P1 residual will therefore be very low, but the velocity residuals will be high and stuck. Setting FALSDT to 1.0E-8 is an extremely heavy under relaxation which will probably freeze the variables.

Page 42: PHOENICS SEGREGATED SOLVER

ADDTIONAL REMARKS

• When divergence occurs it is necessary to establish the cause. It may be found in the strength of the linkages between two or more sets of equations, which are being solved. in turn rather than simultaneously.

• For example in Free Convection heat transfer is a strongly coupled with the energy and the velocity field. They influence each other and may be a common source of divergence.

• Whether it is or not THE source in a particular case can be established by ´freezing´ the temperature field before the divergence has progressed too far and seeing if the divergence persists.

• If it DOES NOT, the velocity-temperature link can be regarded as the source of divergence; otherwise the cause must be sought in some other linkage.

Page 43: PHOENICS SEGREGATED SOLVER

PLAYING WITH RELAXATION

• Explore how different choices of relaxation factors affect the required number of SWEEPS to get convergence.• Fill in the Table below

P1 V1 U1 H1 SWEEPS-1 1 1 1

AUTO AUTO AUTO AUTO-1 2 2 10-1 200 200 100-1 0.1 0.1 0.1

Page 44: PHOENICS SEGREGATED SOLVER

CHANGING THE RESFAC

• Objective: evaluate the number of sweeps necessary to get CONVERGENCY by changing the RESFAC

• Fill in the Table below

RESFAC N. SWEEPS1%

0.1%0.01%

0.001%0.001 0.01 0.1 10

100

200

300

400

RESFAC (%)

SWEE

PS

Page 45: PHOENICS SEGREGATED SOLVER

PLAYING WITH LITER

• Explore how different choices of LITER affect the required number of SWEEPS and the CPU time to get convergence.• Use RESFAC = 0.1% and ENDIT = 1E-3• Fill in the Table below

P1 V1 U1 H1 SWEEPS CPU Time/Var20 10 10 2030 20 20 3010 5 5 102 1 1 2

Page 46: PHOENICS SEGREGATED SOLVER

LAST REMARK ON ‘CONVERGENCE AND NEGLIGIBLE RESIDUALS’

• After applying the available tools to access convergence and negligible residuals with no success consider REVIEW YOUR GRID. Try to work with coarse grids at start and then progressively refine them. Be alert to flow regions with steep gradients, typical of Boundary Layer. Try to refine the grid on these regions to capture the steep gradients. Avoid working with grids exhibiting large aspect ratios, i.e. larger than 20:1

Page 47: PHOENICS SEGREGATED SOLVER

END

Page 48: PHOENICS SEGREGATED SOLVER

PLAYING WITH RELAXATION

• Explore how different choices of relaxation factors affect the required number of SWEEPS to get convergence.• Fill in the Table below

P1 V1 U1 H1 SWEEPS-1 1 1 1 240

AUTO AUTO AUTO AUTO 569-1 2 2 10 54-1 200 200 100 no conv-1 0.1 0.1 0.1 too slow

Page 49: PHOENICS SEGREGATED SOLVER

CHANGING THE RESFAC

• Objective: evaluate the number of sweeps necessary to get CONVERGENCY by changing the RESFAC

• Fill in the Table below

RESFAC N. SWEEPS1%

0.1%0.01%

0.001%0.001 0.01 0.1 10

100

200

300

400

RESFAC (%)

SWEE

PS

Page 50: PHOENICS SEGREGATED SOLVER

PLAYING WITH LITER

• Explore how different choices of LITER affect the required number of SWEEPS and the CPU time to get convergence.• Use RESFAC = 0.1% and ENDIT = 1E-3• Fill in the Table below

P1 V1 U1 H1 SWEEPS CPU Time/Var20 10 10 20 240 2 2.08x10-5

30 20 20 30 238 2 2.10x10-5

10 5 5 10 245 2 2.04x10-5

2 1 1 2 260 5 4.80x10-5


Recommended