Convergence (again)

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
James McNaughton

Convergence (again)

Post by James McNaughton »

It's all a bit vague, could someone explain the convergence criteria of code saturne? We set epsilo(ivar) for the precision of a variable, but what condition is tested with this? And what's the differencing with epsilo, epsrsm etc?
I am given the question "how does code saturne know when to move onto the next time-step" and I cannot answer with any confidence that I know what is going on, please could someone help?
James
Yvan Fournier

Re: Convergence (again)

Post by Yvan Fournier »

Hello,
epsilo is a per-variable convergence criteria for linear system resolution, while epsrsm is a similar criteria used for reconstruction of right-hand sides. Other parameters are nwrsm (maximum number of sweeps for right-hand side reconstruction) and the choice of time sub-stepping, such as nterup.
As the code uses a segregated solver, with variables resolved independently, and velocity-pressure coupling using a simplec algorithm, it is quite complex to describe what goes on without going into the full details (the IJVF reference article may be a good read here).
In any case, once all variables have been solved and pressure-velocity correction has been applied, the code will move to the next time step. There is no "smart" heuristic to determine when to move to the next time step (so checking the log and choosing a time step value ensuring that the CFL values are reasonable is important). In addition, the "derive" values in the log are not of much use, and should be improved.
I am not a specialist in this area of the code, so I'll let others give you more details or correct me if I made a mistake here.
Best regards,
  Yvan
 
James McNaughton

Re: Convergence (again)

Post by James McNaughton »

Hi Yvan,
Thanks it does help a bit, I've been looking around in the code too to get an idea, it's alright but gives a head ache when I think about it too much. I don't know of this IJVF reference that you mention could you let me know the full name?
Cheers,
James
Yvan Fournier

Re: Convergence (again)

Post by Yvan Fournier »

Hello,
the reference is:
« Code_Saturne : a Finite Volume Code for the Computation of
Turbulent Incompressible Flows - Industrial Applications, International
Journal on Finite Volumes, Vol. 1, 2004. »
Cheers,
  Yvan
James McNaughton

Re: Convergence (again)

Post by James McNaughton »

Thanks, Yvan
I did have that, and agree it is very helpful I've spent a lot of time going through it already.
Perhaps a developer could tell me if this is on the right lines:
preduv - velocity is predicted for each cell
inimas - mass flow calculated
resolp - pressure correction
recvmc - velocity correction
 
There are checks along the way, usually sqrt(b.b) < eps*sqrt(b'.b')
I am going in thie right direction??
 
James McNaughton

Re: Convergence (again)

Post by James McNaughton »

This is what I've got so far:
For all variables phi (except pressure):
The discretised equations are placed in matrix form A phi = b. Where A is ncelet x ncelet matrix of coefficients decided by the order of the scheme. phi is unknowns and we fill with an initial guess. b is known.
The matrix equation is rearranged into Jacobi form and solved iteratively:
At the first step of the loop we get where sum is over all cells.
variable rnormp = sqrt( sum[ phi(1).phi(1) ] )
At each step, k, we calculate
residu = sqrt( sum[ phi(k).phi(k) ] )
We then ask
epsilo(phi) > residu / rnormp
If this is true we are done, if not we loop.
 
Could one of the developers let me know if this is correct please?
I'm only really unsure about the square root of sums but it's easy to get lost in the code and would really appreciate any corrections.
Thanks,
James
Post Reply