CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   STAR-CCM+ (https://www.cfd-online.com/Forums/star-ccm/)
-   -   Oscilating residuals and non convergence (https://www.cfd-online.com/Forums/star-ccm/241485-oscilating-residuals-non-convergence.html)

mvalentin March 1, 2022 20:52

Oscilating residuals and non convergence
 
4 Attachment(s)
Hi, this is the first time I am posting on this forum and I hope I am not breaking any rules.
I am a beginner and I followed the tutorials of star ccm to anlalyse the ship resistance of my own model.
I have a mesh with 900000 cells and the physical conditions are set as in the tutorial.
The residuals that I get are oscilating and the drag force resulting from the pressure are decreasing over time and not converging. The viscuos forces are fairly steady.
I already checked if the mass flow is the same at the inlet and outlet.
Images from results are in the attachments

cwl March 3, 2022 20:05

Quote:

The residuals that I get are oscilating
These oscillations represent residuals behavior over time steps - like in: high at the first inner iteration of a time step (not converged solution for a time step) and dropping as inner iterations progress.

Quote:

and the drag force resulting from the pressure are decreasing over time and not converging.
I have a guess that your total physical time is not enough to reach the convergence.

mvalentin March 3, 2022 20:24

Does this mean that as long as the residuals are slowly decreasing, oscilation is not a problem?


Thank you! I will try to run the simulation for a longer physical time

pi120 March 4, 2022 11:57

As they already said, it is normal in an unsteady implicit simulation to have residuals jumping to a high value at the beginning of each time step.
You should make sure however that they converge inside each time step, and it doesn't seem like this is the case for your simulation.

Try using a higher number of inner iterations (if you're using 50 go for 100) and make sure that inside each time step each residual drops and stays flat at the end of the inner iterations.
As they already suggested, also go for higher total physical time to get convergence of the drag coefficient.

fluid23 March 4, 2022 15:38

50 inner iterations is too much. Your time step is too big if you need anymore than 15, really 10 is a better limit, if not fewer.

pi120 March 5, 2022 07:03

Is it too much because it is not computationally efficient? Or because it leads to wrong results?
I cannot see how it can lead to wrong results as long as it converges (and as long as you are not interested in physic phenomena at lower time steps).

Considering what you wrote, would you suggest to always keep inner iterations to 15 max and, if not converging inside a time step, just decrease time step size (with Courant constant)?
Or is there an optimum value of inner iterations and time step size that depends from simulation to simulation?

fluid23 March 5, 2022 10:46

Both. "Converged" does not mean "correct". Choosing too coarse of a time step is both expensive and can lead to errors. Just because you think you care about something happening at a low frequency, doesn't mean you can ignore what is happening with the flow. You can effectively alias your flow like under sampling an electronic signal but since each successive time step assumes the previous time step result as it's initial guess, you end up compounding your problems.

There is no golden rule to setting inner iterations, but 50 is definitely too much. The time step is really the thing you have to watch for and there IS a golden rule there to be followed. The max CFL number for explicit unsteady simulations should be around 1, but I suspect that this is an implicit unsteady analysis which can tolerate higher max CFL values. The default value is 50 for implicit unsteady solver and I rarely ever exceed that.

The rule can be summarized simply by considering a 1-D case.

CFL max > U *dt/dx

Where U is velocity, dt is time step size and dx is cell size.

You would need to choose a time step size which satisfies this for every cell in your domain, and even then you may find that 50 is too high and causes you to miss something important. It is a little more complicated in 3D, but that is the gist.

https://www.cfd-online.com/Wiki/Cour...Lewy_condition

pi120 March 5, 2022 13:18

True, I didn't consider that high frequency effects might affect low frequency ones.

I agree that for explicit simulations, you just set a Courant number, and the solver automatically sets the time-step size at each time-step based on the velocity field at such time-step. In fact, when you select the explicit solver, you are not allowed to select any time-step size.

However in implicit simulations, you are free to set both Courant number and time-step size. I thought this was because the Courant number that you select is relative to the 'steady' simulation happening at each inner time-step, and not dependent on the time-step. From what you write however I understand that I should set my time-step size as

dt < CFL_max * (dx/U)_min

which sounds a bit counterintuitive as, if this was the case, I don't understand why they would let you freely choose any combination of Courant number and dt...


All times are GMT -4. The time now is 02:12.