CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

How to ensure the convergence

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 3, 2020, 07:35
Default How to ensure the convergence
  #1
Senior Member
 
MA
Join Date: Mar 2020
Posts: 163
Rep Power: 6
mazhar16823 is on a distinguished road
Hi,

As it's obvious and mostly recommended to have residuals below 10^-4 for the converged solution. But what if the parameter you are calculating is experiencing very small fluctuations meanwhile the residuals constantly switch between 10^-3, 10^-4 and 10^-5 instead of getting lower and lower. Would you stop the simulation by knowing that the variable does not change much? Or you would still depend on residuals to get lower instead of fluctuating?
mazhar16823 is offline   Reply With Quote

Old   June 3, 2020, 08:47
Default
  #2
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,849
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by mazhar16823 View Post
Hi,

As it's obvious and mostly recommended to have residuals below 10^-4 for the converged solution. But what if the parameter you are calculating is experiencing very small fluctuations meanwhile the residuals constantly switch between 10^-3, 10^-4 and 10^-5 instead of getting lower and lower. Would you stop the simulation by knowing that the variable does not change much? Or you would still depend on residuals to get lower instead of fluctuating?



That means nothing if you do not specify if the residuals are normalized.

Are we talking about the residuals in the solved steady equations or the evaluation of the time derivatives?
FMDenaro is offline   Reply With Quote

Old   June 3, 2020, 10:44
Default
  #3
Senior Member
 
Gerry Kan's Avatar
 
Gerry Kan
Join Date: May 2016
Posts: 362
Rep Power: 11
Gerry Kan is on a distinguished road
Dear Mazhar:

You will find that the residual will eventually level off after some iterations. Assuming your CFD code is properly coded, how low this goes will depend on your cell size and time step.

From your description, it seems that the problem might be a problem in the mesh. Particularly when you have highly irregular wall distances (e.g., using Cartesian cut cells to cover a curve surface like a round pipe), the shear stress is no longer smooth on the surface, which causes the residual to change drastically from one iteration to another.

If you are certain that the results still reasonably reflect the physics, you might want to use an additional criteria (monitoring point) to gauge convergence. Of course, if you could, you should inspect your mesh and ensure it is reasonable.

Hope that helps, Gerry.
Gerry Kan is offline   Reply With Quote

Old   June 3, 2020, 16:33
Default
  #4
Senior Member
 
MA
Join Date: Mar 2020
Posts: 163
Rep Power: 6
mazhar16823 is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
That means nothing if you do not specify if the residuals are normalized.

Are we talking about the residuals in the solved steady equations or the evaluation of the time derivatives?

I don't understand what do you mean by normalized? I am talking about the conservation equations i.e. continuity, momentum, energy etc. I have attached the figure for reference.
Attached Images
File Type: jpg image (2).jpg (70.0 KB, 17 views)
mazhar16823 is offline   Reply With Quote

Old   June 3, 2020, 16:44
Default
  #5
Senior Member
 
MA
Join Date: Mar 2020
Posts: 163
Rep Power: 6
mazhar16823 is on a distinguished road
Quote:
Originally Posted by Gerry Kan View Post
Dear Mazhar:

You will find that the residual will eventually level off after some iterations. Assuming your CFD code is properly coded, how low this goes will depend on your cell size and time step.

From your description, it seems that the problem might be a problem in the mesh. Particularly when you have highly irregular wall distances (e.g., using Cartesian cut cells to cover a curve surface like a round pipe), the shear stress is no longer smooth on the surface, which causes the residual to change drastically from one iteration to another.

If you are certain that the results still reasonably reflect the physics, you might want to use an additional criteria (monitoring point) to gauge convergence. Of course, if you could, you should inspect your mesh and ensure it is reasonable.

Hope that helps, Gerry.
Thanks a lot Gerry. That could be a possibility. However, to stress a bit more:

I am running implicit unsteady case.

Blade span (R) is 40 m. I used base size for the mesh = 12 m (since my domain is 8Rx3R).

For default controls (boundary types except the blade geometry): Target Surface size = 12 m; Min. cell size is 3.6 m.
For blade mesh customization: Target surface size is 0.05 m and Mini. cell size is 0.006 m.

Is not the blade mesh fine enough for Gamma-ReTheta model? Recently, I studied that for blade mesh, the target surface size should be 0.5% of the chord. But I don't know which chord it refers to. Since, I have different chord values along the blade.
mazhar16823 is offline   Reply With Quote

Old   June 4, 2020, 11:55
Default
  #6
Senior Member
 
Gerry Kan's Avatar
 
Gerry Kan
Join Date: May 2016
Posts: 362
Rep Power: 11
Gerry Kan is on a distinguished road
Ah ... Good ol' Star-CCM+

My experience with it is that if you are using their native mesh generator (i.e., Trimmer or Polyhedral), residuals are going to be pretty crappy because not all cells will have good topology, and numerical errors arise from it.

You might want to impose a quality condition in your mesh generation, or even add a few more prism layers around the turbine blade (to, say 20 - 30 layers) to make sure wall shear stress distribution will be smooth and highly resolved, but I don't imagine you will get text-book convergence behavior.
Alternatively, try your case with a coarse mesh, and see if it reaches convergence in the manner you are expecting, and gradually refine the mesh.

For commercial codes like that, a more reasonable way to gauge convergence is to pick a few point probes in critical regions and make sure the scalars in these values are steady. If your residual is "low enough" in addition, then you can claim that the code has reached convergence.

Gerry.

P.S. - "Normalized" residual simply means that the residual is relative to the initial residual. That is, a relative residual of 10^-3 means that the residual has gone down 1000 times from the initial level. Unless otherwise stated, residuals are normalized, though in some commercial codes (like Fluent) you could still switch between absolute and relative residuals.
Gerry Kan is offline   Reply With Quote

Old   June 4, 2020, 12:13
Default
  #7
Senior Member
 
MA
Join Date: Mar 2020
Posts: 163
Rep Power: 6
mazhar16823 is on a distinguished road
Quote:
Originally Posted by Gerry Kan View Post
Ah ... Good ol' Star-CCM+

My experience with it is that if you are using their native mesh generator (i.e., Trimmer or Polyhedral), residuals are going to be pretty crappy because not all cells will have good topology, and numerical errors arise from it.

You might want to impose a quality condition in your mesh generation, or even add a few more prism layers around the turbine blade (to, say 20 - 30 layers) to make sure wall shear stress distribution will be smooth and highly resolved, but I don't imagine you will get text-book convergence behavior.
Alternatively, try your case with a coarse mesh, and see if it reaches convergence in the manner you are expecting, and gradually refine the mesh.

For commercial codes like that, a more reasonable way to gauge convergence is to pick a few point probes in critical regions and make sure the scalars in these values are steady. If your residual is "low enough" in addition, then you can claim that the code has reached convergence.

Gerry.

P.S. - "Normalized" residual simply means that the residual is relative to the initial residual. That is, a relative residual of 10^-3 means that the residual has gone down 1000 times from the initial level. Unless otherwise stated, residuals are normalized, though in some commercial codes (like Fluent) you could still switch between absolute and relative residuals.
Thanks Gerry. I am already using 20 prism layers. In the beginning, I had a fine mesh with 10 M cells which provided the residuals up to 10^-5 but the parameters of interest showed highly steady and sinosuidal fluctuations throughout.
Then I moved to a bit coarse mesh with 8 M cells (here I refer to mesh on the domain whereas blade mesh is the same), and now I see that residuals switch between 10^-3 and 10^-4 however the parameters that I am calculating, show steady and gradual increase/decrease unlike wavy fluctuations in the previous case.

However, my question ''Recently, I studied that for blade mesh, the target surface size should be 0.5% of the chord. But I don't know which chord it refers to. Since, I have different chord values along the blade'' remains unanswered
mazhar16823 is offline   Reply With Quote

Old   June 4, 2020, 17:43
Default
  #8
Senior Member
 
Gerry Kan's Avatar
 
Gerry Kan
Join Date: May 2016
Posts: 362
Rep Power: 11
Gerry Kan is on a distinguished road
The chord refers to the centerline of the blade. So your rule of thumb is to base your cell size as a percentage of this chord length.

If your 'fine' mesh is giving you good residual convergence but an oscillating probe values, it might be that your solver is sjedding vortices. Confirm with the flow field. In that case you are okay.

From 10 M to 8M cells is not much of a coarsening. I would keep your fine mesh setup but increase your reference length by a factor of two, assuming your grid setup is relative to this reference value. This will give you a more reasonable coarse mesh.

Gerry.

Last edited by Gerry Kan; June 5, 2020 at 07:46.
Gerry Kan is offline   Reply With Quote

Old   June 5, 2020, 06:16
Default
  #9
Senior Member
 
Gerry Kan's Avatar
 
Gerry Kan
Join Date: May 2016
Posts: 362
Rep Power: 11
Gerry Kan is on a distinguished road
Quote:
I was still confused in the notion of chord length.

I know that chord length is a line connecting leading edge to trailing edge for an airfoil (blade section).

But each section has different chord length and it varies along the length of the blade so which chord you are talking about? Is that near-root, mid-section or near tip?
Dear Mazhar:

You should realize that these gridding guidelines are simply guidelines. In no way do they guarantee the fidelity or trustworthiness of your solution, and there is no right or wrong way to interpreting or applying these guidelines.

For engineering applications there will always be a trade-off between the two and, in general, your goal is to use the finest grid possible to generate solution you feel confident in the smallest possible computational effort. Do not forget that.

I would suggest you use your judgement to generate your initial mesh, and adjust accordingly. As long as you are confident with the results, then this mesh is good, whether you stick with these guidelines or not.

Gerry.
FMDenaro and mazhar16823 like this.

Last edited by Gerry Kan; June 5, 2020 at 07:41.
Gerry Kan is offline   Reply With Quote

Old   June 5, 2020, 06:28
Default
  #10
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,849
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
I would add that if we are talking about RANS formulation, the lack in convergence is quite common and often depends on the type of turbulence model.
Gerry Kan and mazhar16823 like this.
FMDenaro is offline   Reply With Quote

Old   June 5, 2020, 09:51
Default
  #11
Senior Member
 
MA
Join Date: Mar 2020
Posts: 163
Rep Power: 6
mazhar16823 is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
I would add that if we are talking about RANS formulation, the lack in convergence is quite common and often depends on the type of turbulence model.
Yes. On the one hand, it's RANS CFD and that with implicit unsteady approach.
mazhar16823 is offline   Reply With Quote

Old   June 6, 2020, 09:17
Default
  #12
Senior Member
 
MA
Join Date: Mar 2020
Posts: 163
Rep Power: 6
mazhar16823 is on a distinguished road
Quote:
Originally Posted by Gerry Kan View Post
Dear Mazhar:

You will find that the residual will eventually level off after some iterations. Assuming your CFD code is properly coded, how low this goes will depend on your cell size and time step.

From your description, it seems that the problem might be a problem in the mesh. Particularly when you have highly irregular wall distances (e.g., using Cartesian cut cells to cover a curve surface like a round pipe), the shear stress is no longer smooth on the surface, which causes the residual to change drastically from one iteration to another.

If you are certain that the results still reasonably reflect the physics, you might want to use an additional criteria (monitoring point) to gauge convergence. Of course, if you could, you should inspect your mesh and ensure it is reasonable.

Hope that helps, Gerry.
Hi Gerry,

I defined the stopping criteria based on the Cm and Cd monitors after 459 time-steps (2291 iterations) until 689 time-steps, to observe the range in which moment and drag coefficient are changing in between and I took the average for both. So, now I have following results:

Cm (overall) = -0.030854075; Cm (after monitor-based stopping criterion)= -0.042382109. Both are not acceptable in my case.

Cd (overall) = 0.808781829; Cd = 0.836339014 (not reasonable)

I have attached the graphs for both coefficients. I consider this as unconverged solution. Now, I have two questions:

1. Is it advisable to reduce the under-relaxation factor for implicit unsteady case as now I have URF for velocity and pressure 0.9 and 0.2 respectively however I saw one example on ''Rotating Fan'' in STARCCM+ userguide, they have used URF 0.9 for both.

2. Is it advisable to reduce the time-step size, since I have used time-step size 0.01 s based on the fact that my blade takes 5 sec to complete one full revolution.

I have also attached the screenshot for 1 and 2 example. Thanks for your time.
Attached Images
File Type: png cds .png (21.6 KB, 8 views)
File Type: png cms .png (20.4 KB, 7 views)
File Type: png image (6).png (48.6 KB, 6 views)
mazhar16823 is offline   Reply With Quote

Old   June 8, 2020, 04:31
Default
  #13
Senior Member
 
Gerry Kan's Avatar
 
Gerry Kan
Join Date: May 2016
Posts: 362
Rep Power: 11
Gerry Kan is on a distinguished road
Dear Mazhar:

I don't know your geometry and what are you trying to do so I have to make a few guesses here. Be aware that I could be completely wrong.

I agree with you, the results you showed me do not seem to indicate that your run has reached any kind of convergence.

Are you running a geometry involving a rotating blade, and would like to extract the Cd and Cm values once the flow has reached some kind of cyclic steady state? If so you need to let it run for a few revolutions (3 to 5) and take, say the results from the last revolution.

Two further questions for you. (1) Where did you get the "nominal" Cd and Cm values? Are these measured values or results from someone else's CFD results (using another code, perhaps). (2) Are you expecting flow separation on the blade surface? You might want to use a different wall treatment (to low-Re k-e, for instance) but in my experience the default wall treatment from Star-CCM+ is already quite good, as long as you don't have flow separation.

Gerry.

P.S. - To answer your questions

1) The underrelaxation factors are too high. Use V ~ 0.5 / 0.6 and p ~ 0.2 / 0.3. This will reduce the oscillation in your previous convergence, and also makes your calculation more stable, though at the expense of potentially slowing down your convergence rate.

2) Based on what you wrote, the 1 deg per time step at 2000 RPM should be fine enough, if you there are no chemical reactions (i.e., combustion) involved. But mind you these guidelines are a compromise between performance and accuracy, though they should serve as a very good starting point.
Gerry Kan is offline   Reply With Quote

Old   June 8, 2020, 05:02
Default
  #14
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,849
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by mazhar16823 View Post
Hi Gerry,

I defined the stopping criteria based on the Cm and Cd monitors after 459 time-steps (2291 iterations) until 689 time-steps, to observe the range in which moment and drag coefficient are changing in between and I took the average for both. So, now I have following results:

Cm (overall) = -0.030854075; Cm (after monitor-based stopping criterion)= -0.042382109. Both are not acceptable in my case.

Cd (overall) = 0.808781829; Cd = 0.836339014 (not reasonable)

I have attached the graphs for both coefficients. I consider this as unconverged solution. Now, I have two questions:

1. Is it advisable to reduce the under-relaxation factor for implicit unsteady case as now I have URF for velocity and pressure 0.9 and 0.2 respectively however I saw one example on ''Rotating Fan'' in STARCCM+ userguide, they have used URF 0.9 for both.

2. Is it advisable to reduce the time-step size, since I have used time-step size 0.01 s based on the fact that my blade takes 5 sec to complete one full revolution.

I have also attached the screenshot for 1 and 2 example. Thanks for your time.





From a physical and numerical point of view, using the integral coefficients as parameter to judge the convergence towards a steady solution is definitely wrong.
FMDenaro is offline   Reply With Quote

Old   June 8, 2020, 05:35
Default
  #15
Senior Member
 
Gerry Kan's Avatar
 
Gerry Kan
Join Date: May 2016
Posts: 362
Rep Power: 11
Gerry Kan is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
From a physical and numerical point of view, using the integral coefficients as parameter to judge the convergence towards a steady solution is definitely wrong.
Fillippo:

I don't think he wants to judge convergence alone with Cm and Cd, but if neither has reached any kind of steady behavior, the run has definitely not reached convergence.

Gerry.
Gerry Kan is offline   Reply With Quote

Old   June 8, 2020, 06:36
Default
  #16
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,849
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Gerry Kan View Post
Fillippo:

I don't think he wants to judge convergence alone with Cm and Cd, but if neither has reached any kind of steady behavior, the run has definitely not reached convergence.

Gerry.



Gerry, we don't know...however, from the attached plots I can't see an oscillating behavior just an evolving trend
FMDenaro is offline   Reply With Quote

Old   June 8, 2020, 07:33
Default
  #17
Senior Member
 
MA
Join Date: Mar 2020
Posts: 163
Rep Power: 6
mazhar16823 is on a distinguished road
Quote:
Originally Posted by Gerry Kan View Post
Dear Mazhar:

I don't know your geometry and what are you trying to do so I have to make a few guesses here. Be aware that I could be completely wrong.

I agree with you, the results you showed me do not seem to indicate that your run has reached any kind of convergence.

Are you running a geometry involving a rotating blade, and would like to extract the Cd and Cm values once the flow has reached some kind of cyclic steady state? If so you need to let it run for a few revolutions (3 to 5) and take, say the results from the last revolution.

Two further questions for you. (1) Where did you get the "nominal" Cd and Cm values? Are these measured values or results from someone else's CFD results (using another code, perhaps). (2) Are you expecting flow separation on the blade surface? You might want to use a different wall treatment (to low-Re k-e, for instance) but in my experience the default wall treatment from Star-CCM+ is already quite good, as long as you don't have flow separation.

Gerry.

P.S. - To answer your questions

1) The underrelaxation factors are too high. Use V ~ 0.5 / 0.6 and p ~ 0.2 / 0.3. This will reduce the oscillation in your previous convergence, and also makes your calculation more stable, though at the expense of potentially slowing down your convergence rate.

2) Based on what you wrote, the 1 deg per time step at 2000 RPM should be fine enough, if you there are no chemical reactions (i.e., combustion) involved. But mind you these guidelines are a compromise between performance and accuracy, though they should serve as a very good starting point.

Thanks for your input. Yes. I have a rotating blade case. For coefficients, I know that I should get Cm in a range for horizontal axis wind turbine, but for Cd I don't have a reference value to compare with. Yes. I expect the flow separation that's my purpose to know the location of transition and I am using All y+ treatment by default.



On point 2) - considering the example provided in CCM+ for the time_step size, I used the time-step based on how long it takes the blade to complete one revolution in my case. Should I reduce the time-step size as well?


P.S: Please note that the above URFs and time-step size selection given in the attachment is an example from the user guide. Based on that example, I calculated the time-step size for my case but for me URFs were already 0.9 and 0.2 for velocity and pressure respectively.
mazhar16823 is offline   Reply With Quote

Old   June 8, 2020, 09:52
Default
  #18
Senior Member
 
Gerry Kan's Avatar
 
Gerry Kan
Join Date: May 2016
Posts: 362
Rep Power: 11
Gerry Kan is on a distinguished road
Quote:
Originally Posted by mazhar16823 View Post
Thanks for your input. Yes. I have a rotating blade case. For coefficients, I know that I should get Cm in a range for horizontal axis wind turbine, but for Cd I don't have a reference value to compare with. Yes. I expect the flow separation that's my purpose to know the location of transition and I am using All y+ treatment by default.

On point 2) - considering the example provided in CCM+ for the time_step size, I used the time-step based on how long it takes the blade to complete one revolution in my case. Should I reduce the time-step size as well?

P.S: Please note that the above URFs and time-step size selection given in the attachment is an example from the user guide. Based on that example, I calculated the time-step size for my case but for me URFs were already 0.9 and 0.2 for velocity and pressure respectively.
Predicting separation point is a very difficult task. You will probably want to go with something like low-Re k-e models.

You will also need to think hard about how you should validate your model. Trying to match section Cm / Cd on a 3D blade is not exactly a good idea.

Gerry.
Gerry Kan is offline   Reply With Quote

Old   June 8, 2020, 10:39
Default
  #19
Senior Member
 
MA
Join Date: Mar 2020
Posts: 163
Rep Power: 6
mazhar16823 is on a distinguished road
Quote:
Originally Posted by Gerry Kan View Post
Predicting separation point is a very difficult task. You will probably want to go with something like low-Re k-e models.

You will also need to think hard about how you should validate your model. Trying to match section Cm / Cd on a 3D blade is not exactly a good idea.

Gerry.
Actually, I have the domain 1/3 circle, and I have employed the periodic BCs. As far as transition is concerned it could be checked with TKE, Skin friction and intermittency plots I guess. However, the mesh independency should exist for any method like in my case I use RANS CFD so I have to do mesh independency anyhow to confirm the accuracy?

Last edited by mazhar16823; June 8, 2020 at 12:00.
mazhar16823 is offline   Reply With Quote

Old   June 9, 2020, 08:18
Default
  #20
Senior Member
 
Gerry Kan's Avatar
 
Gerry Kan
Join Date: May 2016
Posts: 362
Rep Power: 11
Gerry Kan is on a distinguished road
Dear Mazhar:

So that we are on the same page, by "transition" you mean "transition from laminar flow to turbulent flow." When I say separation, it's the existence of a location on your turbine blade where the shear stress becomes zero. This is a very difficult thing to predict, even for state-of-the-art turbulence models.

An easy way to tell whether separation occurs is to plot your wall shear stress. If it goes from positive to negative somewhere in your blade, then there is flow separation.

When you do your grid independence test, be aware that the results on successive grids might not show asymptotic behavior (i.e., getting "closer" and "closer" as your grid size decreases) due to the use of wall functions. This is much more clear when you use wall-bound values.

Gerry.

P.S. - If you are taking advantage of symmetry, is there a reason you have to use rotating subdomain? Wouldn't a radial velocity boundary on the blade suffice? In this case your run will be steady and the solver will run much faster.
Gerry Kan is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Low Mach number wing/body junction convergence Zen SU2 6 May 3, 2019 05:51
Problems with convergence with an easy system franzdrs Main CFD Forum 0 June 15, 2009 19:17
increasing mesh quality is leading to poor convergence tippo CFX 2 May 5, 2009 11:55
convergence parameters amv Phoenics 4 September 21, 2005 07:49
convergence problem with SIMPLER NURAY KAYAKOL Main CFD Forum 1 February 24, 1999 14:43


All times are GMT -4. The time now is 13:56.