CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   SU2 (https://www.cfd-online.com/Forums/su2/)
-   -   CFG file Set Up (https://www.cfd-online.com/Forums/su2/239575-cfg-file-set-up.html)

Nicola_Fontana November 12, 2021 10:32

CFG file Set Up
 
Good evening,
I am new to CFD, I am working on different simultation for my master thesis, and I found some problem in the convergence of the solution, precisely in the section " CONVERGENCE PARAMETERS ". In the first attempt I encountered a problem with FMGRES convergence, as follow:

Quote:

FGMRES orthogonalization failed, linear solver diverged.
I was able to solve this switching off MULTIGRID option. But even so the program does not converge to a solution:

Quote:

Maximum number of iterations reached (ITER = 10000) before convergence.
I know that each situation has better convergence method that can lead to a faster ( and more precise ) solution. From test-case and other topic here in the forum I was able to find some suggestion and indication for few of all the methods listed in SU2, but for me is still difficul (almost impossible) understand how to choose the method and set the coefficient. I found papers describing the theory behind every method, and while it helped me understand the methods, it didn't help me understand how to choose.

Can someone suggest me a guide for understand how to make the choice of method and coefficient?


In general, I have the same problem with the section:

-COMMON PARAMETERS DEFINING THE NUMERICAL METHOD
-LINEAR SOLVER DEFINITION
-FLOW NUMERICAL METHOD DEFINITION

I would ask if anyone could help me, or suggest me a good way to learn and understand the use of the different method, thank you in adnvance,

Nicola

pcg November 12, 2021 19:03

Hi, right, in the context of an academic code, like SU2, these concepts require a lot of experimenting to gain a feel for how to setup the solver, more time than a master thesis allows I would say. But let me try to give you an answer.

Your first mission is getting the solver to converge, i.e. for the residuals to drop 5-6 orders of magnitude (for external aero starting from free-stream), and for relevant coefficients (lift, drag, etc.) to not be fluctuating or still changing significantly.
The common parameters (CFL, etc.) and linear solver settings help you achieve this for a given choice of numerical methods (you can find some advice here: https://su2code.github.io/docs_v7/Li...econditioners/)

The second objective is to get accurate results, and this is where numerical methods are important.
In general, you want a choice of methods (gradient methods, convective schemes, etc.) that has the lowest amount of numerical dissipation while still giving you a physical solution (i.e. without wiggles, spurious oscillations, carbuncle, etc.).

Needless to say, it is easier to get convergence with more numerical dissipation.

So, if you are approaching this without any experience you'd start with something very dissipative like ROE with MUSCL_FLOW= NO (i.e. 1st order convection) and GREEN_GAUSS gradients, and then try to improve upon it in the direction of MUSCL_FLOW= YES with WEIGHTED_LEAST_SQUARES gradients (2nd order convection with the most accurate gradients).

Then there are tuning parameters for the methods (like Roe's entropy fix) and auxiliary methods (in particular limiters) that help you operate close to the potentially more accurate end of the spectrum without instabilities...
A good compromise (in my experience with compressible subsonic cases) is to use the Venkatakrishnan-Wang limiter with a 0.05-0.15 constant, and Roe entropy correction of 1e-3.

This is all application-dependent as you can imagine, if you are interested in low-Mach, or supersonic, etc. you may need other schemes that try to cope with the particular challenges of those regimes.

P.S. This all assumes you have a good mesh for what you are doing :)

bigfootedrockmidget November 13, 2021 04:39

If you feel that you do not yet have a good understanding of CFD, then study a standard text book on the matter. This will help in understanding what is going on and it also helps in troubleshooting and making decisions regarding the setup.


Some suggestions:
Computational Fluid Dynamics - Jiri Blazek
Computational Fluid Dynamics, the basics with applications - J.D. Anderson

Computational Methods For Fluid Dynamics - Ferziger and Peric


There are maybe better books that are closer to what is implemented in su2.

pdp.aero November 13, 2021 09:14

I like this post and the general idea behind it and more than that I like the answer that Pedro gave. It is one of the best answer have heard in this community to the convergence issue. I would suggest to pin his answer or something similar for the newcomers. I have seen and heard quite a few students and users struggling with convergence of their simulation and in general setting up their case. And I don’t wanna hijack this thread/post but since it is a good one, I also want to give it a try in a very general way.

Regardless of solver ( e.g open/commercial) and it’s complexity one can have a CFD workflow through a series of questions whose answer will help successfully complete a simulation.

This is how I would start:

General:
1. Why do I need to do a CFD simulation?
(or why am I interested in doing a CFD simulation and not other numerical approaches?)

2. What am I looking for in the CFD simulation?
(i.e. what is my quantity of interest? Like aerodynamic coefficients, pressure and etc.)

3. How accurate do I need my quantity of interest to be in the CFD simulation?

4. How can I measure/validate my quantity of interest’s accuracy in the CFD simulation?


Physics related:
5. How well do I know the physical condition or the flow regime?

6. How well do I know my quantity of interest in this physical condition?
(Better one knows the physics, better it can be predicted. Even for simple lift and drag coefficients this could be complicated. For example, is lift inviscid!? :) What happens if I run inviscid and compare the lift and cp with experiments? Do they match? What kinda drag exists and are important in this physics? Like parasite, form, profile, interference, skin friction, wave, lift induced. ...)

7. Do I need to postprocess the CFD results to get my quantity of interest?

Mesh/geometry related:
8. Do I have a geometry requirement?
(What are the geometry requirement with respect to my quantity of interest for the CFD simulation?)

9. Do I have a mesh requirement?
(What are the mesh requirement with respect to my quantity of interest and its desirable accuracy for the CFD simulation?)

10.
Can I simplify the simulation?
(i.e. 2D assumption (no variation in third direction) or symmetric or axisymmetric properties of geometry and flow.)

11. How much CPU per time do I wanna spend on predicting my quantity of interest?

Initial and boundary conditions:
12. What is the flow condition in my simulation?

13. For this flow condition what is my initial condition?

14. How do I initialize my initial condition?

15. What are the right boundary conditions for this physics and with respect to my flow condition, initial condition and my geometry? Are my boundary conditions valid? How can I validate them? Like velocity inlet, pressure far-field and etc.

16. What are my reference values and what is my non-dimensionalization approach?

Numerics:

17. What solver do I need for my quantity of interest? (i.e. Euler, (U)RANS, …)

18.
Do I have to couple solvers for my multidisciplinary simulation?

19.
What linear solver? And what options for that linear solver?

20.
Do I need convergence acceleration techniques? Like multi-grid, warm-up solutions, …

21. What convective numerical method? And what options do I need for that convective method to predict the quantity of interest with desirable accuracy.

22. Do I have to use an option if I don’t know what it does or I am not sure if my simulation benefits from that? (like 10 levels of multigrid?)

23. How much do I need to be specific and get into details of my numerical approach to predict my quantity of interest correctly?

Convergence:
24. How will I know my simulation is converged?

25. What is the right convergence criteria for my simulation?

26. How can I apply the convergence criteria for my simulation?

Simulation:
27. Who is convergence? What is he/she trying to tell me? :)

28. Did my simulation converge?

29. If my simulation didn’t converge, did it diverge? What is partial convergence?

30.
If my simulation converged, does that mean my results are right?

31. If it doesn’t converge or my results are not right, is it related to physics, numerics, or geometry/mesh? Or is it just because of wrong initial condition or numerical assumption?

32.
If my results are right, does that mean my simulation is converged?

33.
Now that my simulation is converged and my results are right, how can I post-process the quantity of interest properly?

34.
Can I improve the results by improving numerics or mesh?

While one is cooking a CFD simulation, a little bit of spice might come handy:
:)

35. How can I contribute to the open-source community by providing accurate feedback and properly publishing my work to appreciate and value of the time and efforts of people who have been actually developing the tool?

Feel free to add more based on your thoughts and experience.

Best,
Pay

Nicola_Fontana November 15, 2021 12:20

Dear Pedro,
first of all thank you and the other people for the reply. Your answer was useful to understand how to move the first steps in this fields. I have a question regarding this part:
Quote:

Originally Posted by pcg (Post 816433)
So, if you are approaching this without any experience you'd start with something very dissipative like ROE with MUSCL_FLOW= NO (i.e. 1st order convection) and GREEN_GAUSS gradients, and then try to improve upon it in the direction of MUSCL_FLOW= YES with WEIGHTED_LEAST_SQUARES gradients (2nd order convection with the most accurate gradients).
Then there are tuning parameters for the methods (like Roe's entropy fix) and auxiliary methods (in particular limiters) that help you operate close to the potentially more accurate end of the spectrum without instabilities...
A good compromise (in my experience with compressible subsonic cases) is to use the Venkatakrishnan-Wang limiter with a 0.05-0.15 constant, and Roe entropy correction of 1e-3.

With this you mean that is better to restart the solution from the last point with different settings in the .cfg file, or to complet different simulation for understand which is the best configuration settings?
Thanks to all for your help,

Nicola

pcg November 16, 2021 12:48

Both actually, if you are dealing with a new type of problem for which you cannot find established best practices, you should test different settings (types of convective flux for example) because some may give you more physical answers than others.
In general you want to know how sensitive your results are to your modeling choices (mesh resolution, y+, flux scheme and its constants, limiters, etc.).
You want to base whatever numerical analysis you are doing on results that are mostly independent of modeling choices.

Of course, when doing any type of parametric study it helps to initialize the solver with previous results.

Incidentally, some modeling choices are easier/faster to converge than others (coarser grids, first order), and thus using them to initialize a more difficult simulation can be helpful (even if you already know from best-practices that those choices might not be accurate enough).

What I'm describing here is a subset of verification & validation (in case you want to follow up on it).


All times are GMT -4. The time now is 16:27.