
[Sponsors] 
May 21, 2013, 20:21 
Help! How much of the continuity error is acceptable for DNS?

#1 
Member
Ping
Join Date: Dec 2011
Posts: 63
Rep Power: 5 
Hi all,
I am simulating DNS channel flows based on the buoyantBuosinesqPimpleFoam. I found that if I set the the p tolerance=1e6 in system/fvSolution, the calculation is very slow and the problem is that the iteration No. for p is very large (more than 200 iterations!), which can be seen as follow. My time step is 0.001. I want to speed up the simulation. One possible way is to decrease the p tolerance to 1e5. But I want to know, if I do this, how can I ensure the continuity? I have no idea what time step continuity errors means, I check the source codes and it seems that this error also include time step value and there are sum local, global, and cumulative errors, which one is more important?? Anyway, my question is: how much of the continuity error is acceptable for a DNS simulation? Many thanks, guys! Code:
Courant Number mean: 0.288069 max: 0.61355 DILUPBiCG: Solving for Ux, Initial residual = 0.00630291, Final residual = 1.07118e07, No Iterations 3 DILUPBiCG: Solving for Uy, Initial residual = 0.0432376, Final residual = 6.85184e07, No Iterations 3 DILUPBiCG: Solving for Uz, Initial residual = 0.0399243, Final residual = 6.44705e07, No Iterations 3 DILUPBiCG: Solving for rho, Initial residual = 0.0135317, Final residual = 2.42912e07, No Iterations 3 DICPCG: Solving for p_rgh, Initial residual = 0.791976, Final residual = 4.79033e05, No Iterations 79 time step continuity errors : sum local = 2.55569e08, global = 5.12662e20, cumulative = 1.1254e19 DICPCG: Solving for p_rgh, Initial residual = 0.0616171, Final residual = 9.11894e07, No Iterations 219 time step continuity errors : sum local = 3.40954e10, global = 5.92299e20, cumulative = 1.7177e19 

May 22, 2013, 03:03 

#2 
Senior Member
Håkon Strandenes
Join Date: Dec 2011
Location: Norway
Posts: 111
Rep Power: 10 
I really do not think increasing the tolerances is a good idea. I have made some test (for the cases I am working on), and generally i need at least 1e7 for pressure and 1e6 for other quantities. If I increase to 1e6 for pressure, I get results that differs in the order of magnitude 10%.
I think you just have to face that the pressure equation is a tough nut to crack. It is by far the most timeconsuming part of the solution process, but on the other hand, having a good and correct pressure field is an absolute necessity. What I recommend you to do is to use the GAMG solver for the pressure instead of the PCG solver, unless you are doing large, parallel computations on a cluster with more than, say ~100 processes (for that case PCG is good). For normal workstations ans parallel computations with 14 compute nodes, GAMG is a lot faster. I have found the following settings to suit my needs pretty well: Code:
p { solver GAMG; preconditioner FDIC; tolerance 1e07; relTol 0.05; smoother symGaussSeidel; nPreSweeps 1; nPostSweeps 2; cacheAgglomeration true; nCellsInCoarsestLevel 50; agglomerator faceAreaPair; mergeLevels 2; } pFinal { solver GAMG; preconditioner FDIC; tolerance 1e07; relTol 0; smoother symGaussSeidel; nPreSweeps 1; nPostSweeps 2; cacheAgglomeration true; nCellsInCoarsestLevel 50; agglomerator faceAreaPair; mergeLevels 2; } 

May 22, 2013, 09:53 

#3  
Member
Ping
Join Date: Dec 2011
Posts: 63
Rep Power: 5 
Quote:
Excellent! I have tried the GAMG solver, I changed the smoother option to GaussSeidel because there is a error message if I used symGaussSeidel (my OF version is 2.1.1). Anyway, it worked very well! The iteration No. have decreased to about 50, much faster! Thanks for your recommendation! Best regards, Ping 

May 22, 2013, 11:33 

#4 
Senior Member
Håkon Strandenes
Join Date: Dec 2011
Location: Norway
Posts: 111
Rep Power: 10 
Glad I could help you. BTW: I do not think that you should care about the number of iterations needed to solve the equations at each time step. The PCG algorithm is completely different from the GAMG, and you cannot in any way compare the number of PCG iterations with the number of GAMG iterations. This is also true when it comes to the computational demand, if you reduce the number of iterations from 200 with PCG to 20 with GAMG, that does not mean that you are using less CPU cycles to solve the problem. This is because one GAMG cycle is more comprehensive and brings you closer to the "true" answer than one PCG cycle.


September 10, 2013, 10:24 
control solution

#5 
Member
Join Date: Oct 2012
Posts: 47
Rep Power: 4 
Hi
I dont know a bout some variables in fv solution What is nPreSweeps nPostSweeps nFinestSweeps ? Can you explain to me how these variables are defined? 

September 10, 2013, 12:11 

#6  
Member
Eysteinn Helgason
Join Date: Sep 2009
Location: Gothenburg, Sweden
Posts: 52
Rep Power: 7 
Quote:
I think this is what you are looking for. The User Guide: Sections 4.5.1.3 and 4.5.1.4 "The user must also pecify the number of sweeps, by the nSweeps keyword, before the residual is recalculated, following the tolerance parameters. " "The number of sweeps used by the smoother at different levels of mesh density are specified by the nPreSweeps, nPostSweeps and nFinestSweeps keywords. The nPreSweeps entry is used as the algorithm is coarsening the mesh, nPostSweeps is used as the algorithm is refining, and nFinestSweeps is used when the solution is at its finest level." /Eysteinn 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
How to write k and epsilon before the abnormal end  xiuying  OpenFOAM Running, Solving & CFD  8  August 27, 2013 15:33 
Upgraded from Karmic Koala 9.10 to Lucid Lynx10.04.3  bookie56  OpenFOAM Installation  8  August 13, 2011 04:03 
Convergence moving mesh  lr103476  OpenFOAM Running, Solving & CFD  30  November 19, 2007 15:09 
IcoFoam parallel woes  msrinath80  OpenFOAM Running, Solving & CFD  9  July 22, 2007 02:58 
Could anybody help me see this error and give help  liugx212  OpenFOAM Running, Solving & CFD  3  January 4, 2006 19:07 