Different convective schemes for different zones

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Mohammad
Posts: 114
Joined: Thu Oct 25, 2018 12:18 pm

Different convective schemes for different zones

Post by Mohammad »

Hello,

I need to use the 1st order upwind scheme in a specific zone of the domain (for example x<5) in order to remove unphysical oscillations of the centeral difference scheme. And for the other zones of the domain, I want to set the central difference scheme for more accuracy .
I know that it is possible to set the schemes using blencv over the whole domain in the cs_user_parameters.f90 file, but is it possible to set two schemes for different zones of the domain?

Thank you in advance.

Best Regards

Mohammad
Luciano Garelli
Posts: 280
Joined: Fri Dec 04, 2015 1:42 pm

Re: Different convective schemes for different zones

Post by Luciano Garelli »

Hello,

Did you try with another convective scheme like SOLU (ischcv). Also, you can set different limiters (isstpc)

Regards,
Luciano
Mohammad
Posts: 114
Joined: Thu Oct 25, 2018 12:18 pm

Re: Different convective schemes for different zones

Post by Mohammad »

Hello and thank you Luciano,

I'm doing LES and the accuracy of the results is very important because I want to compare the results of different sub-grid scale models. I don't know how accurate is SOLU in comparison to CDS (Centeral Differencing Scheme) and it's effect on the results of the near wall region and gradients. As you may know the CDS is often used in LES because of its non-dissipative and energy-conserving properties does SOLU have this property?

As I noticed, isstpc does a slope test and decides whether to change the second order to first order upwind. Is that right?

Regards,

Mohammad
Luciano Garelli
Posts: 280
Joined: Fri Dec 04, 2015 1:42 pm

Re: Different convective schemes for different zones

Post by Luciano Garelli »

Hello

Ok, but setting different blencv in your domain you are mixing first and second order schemes. May be the ischcv = 3 ( Blending between Second Order Linear Upwind and Centered scheme) is what you need, because your will be using two second order schemes and the unphysical oscillations can be removed.

Regards,
Luciano
Mohammad
Posts: 114
Joined: Thu Oct 25, 2018 12:18 pm

Re: Different convective schemes for different zones

Post by Mohammad »

Hello,

Thanks a lot Luciano.

I think blending can also affect the results specially in near-wall region. Please correct me if I'm wrong.
I'm simulation a high Reynolds airfoil and as you may know, the grid is coarse at the inlet and outlet and central difference schemes are also known to produce odd-even oscillations (grid-to-grid oscillations or wiggles) when the resolution is poor and this can affect the downstream flow.
I was reading about three articles and all of them used pure CDS over the airfoil and blending scheme in upstream as you can see in image below:
Image

I think while the code can do a slope test on the cells and decide whether to use CDS or not on the cell, why not let the user select the scheme over specific cells?

Regards,
Mohammad
Yvan Fournier
Posts: 4069
Joined: Mon Feb 20, 2012 3:25 pm

Re: Different convective schemes for different zones

Post by Yvan Fournier »

Hello,

In case it is useful, ther is a field keyword (slope_test_upwind_id) which allows defining a field on interior faces where the upwinding can be determined. I do not remember whether this is just visualization of the slope test result or can be used to define a local blencv value, so I recommend searching for that keyword im the source code to find and check the relevant parts of the code (I am posting from my phone so it is not as practical to check right now).

Quite a few limiter options were added in code_saturne v6.0 but I am not familiar with their use.

In any case from what I remember from discussions with our LES specialists, any sort of upwind can degrade the energy conservation of the numerical scheme, so using just enough to avoid divergence is recommended (a few percent).

Best regards,

Yvan
Mohammad
Posts: 114
Joined: Thu Oct 25, 2018 12:18 pm

Re: Different convective schemes for different zones

Post by Mohammad »

Hello,

Thank you very much Yvan, I'll check that.

Regards,

Mohammad
Mohammad
Posts: 114
Joined: Thu Oct 25, 2018 12:18 pm

Re: Different convective schemes for different zones

Post by Mohammad »

Hello,

I made it happen by editing cs_convection_diffusion.c source file according to the cell center's location, but I think this would be a good idea to add this option to the next versions as in LES there are some small regions where the CDS is very unstable and causes diverging. Also Slope test option does not give the user any options to limit the use of it where the quantities must be calculated in CDS for more accurate results.

Regards,
Mohammad
Yvan Fournier
Posts: 4069
Joined: Mon Feb 20, 2012 3:25 pm

Re: Different convective schemes for different zones

Post by Yvan Fournier »

Hello,

Yes, ideally, we should be able to compute some quantities or limiters in a zone-based manner, but for the legacy algorithms, this would involve quite significant developments, so I do not know in which time frame this is feasible.

We'll remember that it can be useful though.

Also, I am not familiar with the improved choice of limiters that are now available, but it might be interesting to test some of them on your case.

I see that with the beta limiter, if you set a field's "convection_limiter_id" keyword to 1, a field name "<base_name>_conv_lim" will be created and allow you to define the limiter locally (on cells). So it is probably close to what you need, even though the documentation is "limited".

Best regards,

Yvan
Post Reply