Gradient reconstruction

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

Gradient reconstruction

Post by James McNaughton »

I often get the warning in my listing non convergence of gradrc which I have been combating by changing IMRGRA to equal 1, I'm not getting good results though and I've been advised to alter the number of sweeps, I've tried this by changing NSWRGY in usini1 but it has no effect. The listing still reports the same warning but with 100 as the sweeps done (I had changed it to 1000).
How do I change the number of sweeps for my gradients? To be honest the cells seem alright in my mesh, it's a simple 2D aerofoil but I'm stuck trying to get convergence.
 
Thanks,
James
David Monfort

Re: Gradient reconstruction

Post by David Monfort »

Hi James,
The variable you used is indeed the number of sweeps for the gradient reconstruction, but only when calculating the wall-distance (thus the Y letter at the end). If you want to change the number of sweeps for the variable ivar, you need to change the value of nswrgr(ivar).
Regarding your convergence issue, on which variable is it happening ? I would advise you to try imrgra = 0 or 2, 3 depending on the mesh quality, but to avoid 1 (often too few neighbor cells are taken into account for the least-square method).
David
James McNaughton

Re: Gradient reconstruction

Post by James McNaughton »

Thanks David, makes more sence when you're changing the right variable in the code!
I increased the sweeps to 1000 but still can't get GRDRC convergence. I imagined the 100 preset should be around the value that we should use anyway so guess something's going wrong. I tried imrgra = 2 and 3 and had no gradrc convergence issues (although the solutions were both different).
The problem appears to be the k variable (I performed a different number of sweeps for each ivar to find this. It says PARAMETER IVAR = 0 in the listing by the warning, does 0 correspong to k?).
Could the problem be arising from specifying an incorrect lengthscale or something else?
 
Thanks,
James
David Monfort

Re: Gradient reconstruction

Post by David Monfort »

The 0 variable number is generally used when do not compute the gradient of a predefined variable. In your case, the problem might arise in the calculation of the gradient of "rho.k".
Could you attach the listing file of the calculation ? (possibly with iwarni(ik(1))=3 in usini1.f90 to get more information)
David
James McNaughton

Re: Gradient reconstruction

Post by James McNaughton »

Here's the listing for one time-step with iwarni set in usini1. Thanks for looking at it,

James
Attachments
listing-07051311.txt
(37.34 KiB) Downloaded 288 times
James McNaughton

Re: Gradient reconstruction

Post by James McNaughton »

Also I have done some tests myself, thinking the problem may have been Reynolds number dependant, and the problem does occur with density. For one mesh I tried everything is fine at rho = 344 but not for larger values. A second mesh had a similar problem - I didn't find the exact value but it's in the range 150-200.
Does this sound like a common problem? As I am only looking at a Reynolds number dependant case here I can easily work around this problem, but I would like to know exactly what is going wrong and where so I can fix it in the future if you have any suggestions?
 
Thanks again,
James
David Monfort

Re: Gradient reconstruction

Post by David Monfort »

Hi James,
Actually, I think you can forget this non-convergence issue. The right hand-side is already quite low (around 10e-11) but not enough to be below 10e-12 (the epzero variable) and the algorithm cannot make the residual lower than the criterion... That's why the gradient calculation isn't converging under the given criterion, but that does not mean that the result is bad.
The only issue is that the gradient calculation will be quite long :-(
David
James McNaughton

Re: Gradient reconstruction

Post by James McNaughton »

Hi David,
Thanks for your reply, I'm a bit stuck as to what to do with my simulation in this situation, what would your advice be? I really don't think it's a meshing issue, the warning's dependence on density alterations is slightly confusing (to me at least!).
When you say the gradient calculation will be quite long, how likely is this to effect my overall calculation speed? This is a 2d aerofoil case and so perhaps the speed will not be noticed. However, on an unsteady calculation running ~1million cells will this be a major issue?
Cheers,
James
 
Post Reply