Gradient Reconstruction

Miscellaneous discussion topics about Code_Saturne (development, ...)
Post Reply
AndrewH
Posts: 47
Joined: Thu Oct 02, 2014 11:03 am

Gradient Reconstruction

Post by AndrewH »

Hello,

For gradient reconstruction, there are two primary types: least-squares and iterative method. I have been using iterative method for stability and accuracy, but conducting numerical experiments with the least-squares method and the compressible algorithm that I'm writing, the least-squares method is computational cheaper. For a good quality-mesh, there appears to be no difference between least-squares or iterative method. However, the user guide notes that the least-squares method may yield poor results if used on a poor quality mesh, therefore the extended or partial-extended neighborhood option should be used. Using extended or partial-extended neighborhood with my compressible algorithm causes it to crash at a random point, it appears to be caused by the pressure or total energy. In the gradient reconstruction, do all gradient calculations use the same method or is there a way to calculate the gradient reconstructions with different methods? The user guide states that the pressure gradient is always calculated by iterative method, but looking at the source code, this appears not to be the case.

Regards,
Andrew
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Gradient Reconstruction

Post by Yvan Fournier »

Hello,

At a "low level", it would be easy to choose between least squares and iterative reconstruction.

Selecting between least squares with extended or standard neighborhood would be much more tricky, as some arrays (cocg) that are precomputed depend on the size of the neighborhood used. Switching dynamically between the two would require saving 2 sets, or recomputing parts (this is actually something that we would like to to in the future, but needs more thought).

Extended neighborhoods do not work well with some cases needing weighting, so you might be in such as case. At this stage, for the short term, we need to see which such cases we might have missed to prevent the use of the extended neighborhood in such cases.

Best regards,

Yvan
AndrewH
Posts: 47
Joined: Thu Oct 02, 2014 11:03 am

Re: Gradient Reconstruction

Post by AndrewH »

Hi Yvan,

What do you define as "low level?" Is 5% for the least-squares mesh test too much, or is it case specific and I would have to run two different tests to make a comparison?

Thank you,
Andrew
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Gradient Reconstruction

Post by Yvan Fournier »

Hello,

I mean "low-level" in a programming sense, where in stead of using global options, we can pass local arguments to gradient reconstruction calls.

Lowering the percentage (of anomax ?) may reduce the difference between extended neighborhood and simple neighborhood, but does not explain why you have a crash with a "usual" extended neighborhood (though I suspect weighted/nonweighted variant issues).

Regards,

Yvan
Post Reply