CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   How to find a good time scale strategy? (https://www.cfd-online.com/Forums/cfx/101319-how-find-good-time-scale-strategy.html)

StefanG May 1, 2012 03:05

How to find a good time scale strategy?
 
2 Attachment(s)
Dear CFD-Online community,

I have the following problem finding an appropriate time scale strategy in order to get a converged solution for my simulation. In picture 1 you see the geometry I am using. Due to the boundary conditions the air flow Mach number in my flow channel varies significantly (see also picture 1). Due to experiment results the estimated Mach number in the divergent part of the nozzle will be supersonic (up to Mach = 1.6), but way down the nozzle, in the flow channel (total lenght incl. nozzle: 1.5m), the flow will be subsonic and the mean Mach number even smaller than 0.4. Also I expect a recirculation zone right after smallest section of the nozzle, near the wall.
The setup of the simulation is the following:

· Material: air ideal gas
· Reference pressure: 100.000 Pa
· Heat transfer: isothermal 600 Kelvin
· No turbulence
· Inlet: relative total pressure: 163.000 Pa
· Outlet: Mass flow: 0.38 kg/s
· Automatic initialization
· By now, NO mesh adaption for near wall modeling

As I have failed to obtain convergence by now, I want to ask for some advice for a strategy finding a good time scale setting for my problem.
By now the following steps dealing with time steps have been performed:

1. By choosing the automatic time step option, the simulation crashed due to “overflow”.

2. Afterwards I chose a physical time scale of 1E-4, with the result that there was no convergence after 100 iterations. The behavior of the residual plotting was quite bouncy. Also the p-mass imbalance between inlet and outlet was quite big, more than 11.8%. So I got the impression there is problem that the solver can’t “push through” the information of the fixed mass flow at the outlet through the whole domain from the outlet to the inlet. What could be the problem for this?

3. Then I increased the time scale to automatic and used the results obtained before as the initial guess for the simulation. But also with this strategy I couldn’t obtain convergence. I even got a very high Mach number (> 13) at the outlet.

4. Then I set a very small time scale of 1E-6 (automatic initialization), the simulation is still running (actual accumulated time step 500) but the residuals of the mass flow stabilized around 1E-3 (see picture 2). The other residuals are also still not converging, in addition there was build an artificial wall at the inlet in order to prevent fluid leaving the domain. Also in this case, I see in CFX-Post that the information of the fixed mass flow at the outlet will be pushed through the domain, but very very slowly. The information hasn’t yet arrived at the inlet. How can I accelerate this? By increasing the time scale?

Is there a possible to set a time scale that fits to the small high velocity region in the divergent part of the nozzle and at the same time to the small flow velocities in the flow channel after the nozzle?

For example using a local time scale factor? How does this method work? What does this factor do? Does he divide the automatic time scale by the value of this factor, and then for regions of high velocity, the automatic time scale divided by this factor will be used? I am sorry I didn’t find this information in the ANSYS help.

I would be very thankful for some advice on my problem obtaining convergence in this case. In my opinion, the main problem is the time scale choice, but if you have also other ideas how to improve convergence in this case, I would be pleased to get some hints.

Thank you very much in advance,

StefanG

ghorrocks May 1, 2012 19:33

Some general comments first:
1) You are using an isothermal model. You need to the total energy option to do compressible flow.
2) Your inlet boundary is far too close to the action. You need to move your inlet boundary upstream.

On your questions:
1) Automatic is just a starting point. It does not always work.
2) http://www.cfd-online.com/Wiki/Ansys...gence_criteria
3, 4 and later comments) Your inlet is far to close, that is causing convergence issues. I suspect your mesh is not too good either, try to improve mesh quality. When these issues are resolved I suspect you will find this converges nicely.

StefanG May 2, 2012 04:56

Dear Glenn,

Thank you very much for your reply!

1) I am using a hexa mesh generated with ICEM. The smallest orthogonal angle in my meshing is 38.4 degrees, the max. aspect ratio is less than 11 and the worst expansion factor is 4. Do you think it should be even better? Especially the angle criteria?

2) How far upstream should be my inlet boundary? Can you give me some basic rule/estimation for this?

3) Following the hints for obtaining convergence in ANSYS help and the FAQ of CFD-Online, my aim was to reduce the complexity of the simulation by using the isothermal option and no turbulence to get a first initial guess for my later simulations with Totel Energy heat transfer and the SST-model for turbulence. I know, that concerning compressible flow this is quite a big mistake for obtaining a final result, but is this strategy in my case absolutely wrong?

ghorrocks May 2, 2012 18:23

1) Mesh quality requirements depend on the model. These figures sound OK for general modelling, but you have transonic flow and that is harder to converge. But I think in your case the main issue is the inlet proximity. Fix that first.

2) Far enough away that it does not affect results. Do a sensitivity check - keep moving it further away and check the effects on convergence and output results. Once it starts asymptoting then you are far enough away.

3) Isothermal means it is an incompressible flow. This will be totally meaningless. No turbulence (ie laminar) means the flow does not have the additional dissipation required to supress turbulent structure and will be harder to converge. If the flow is turbulent then run a turbulence model. Running without one does not simplify the flow, it makes convergence harder!

I would run compressible flow with SST right from the start. To simplify things start with a coarse mesh and when that converges then start mesh refinement to get accuracy.

Far May 10, 2012 02:11

I am sure that with inlet placed far away from nozzle, will improve the convergence considerably.

StefanG May 10, 2012 05:50

5 Attachment(s)
Thank you for your helpful replies so far!

As Glenn recommended me, I moved the inlet farer away from the nozzle. In addition, I modified the geometry at the end of my nozzle (see picture 1). The reason for this modification was that the vertical wall at the end of the flow channel caused a strange recirculation zone in the right upper corner. Furthermore I moved the outlet farer away from the most right redirection of the flow channel.

On top of all this is, I went on with my meshing. By now the min. angle is slightly bigger than 40.05. The maximum aspect ratio is 57.3 and the min. quality is higher than 0.64.

All these tasks didn’t help me to get a converged solution. Although moving the inlet farer away from the nozzle made it possible to get my simulation started without overflow with automatic time step settings. Before, it was necessary to choose a very small time step, around 5E-6 to get it started.
But still the Residuals of U-Mom and H-Energy start oscillating before reaching the convergence criteria which is 1E-5 (picture 2 and 3).

The setup of the simulation is the following:

·Material: air ideal gas
·Reference pressure: 100.000 Pa
·Heat transfer: Total Energy
·SST-model for turbulence
·Inlet: relative total pressure: 163.000 Pa
·Outlet: Mass flow: 0.38 kg/s
·Automatic initialization
·Automatic time scale for all cases

Due to these parameters I should have a choked nozzle (according to Q1D-theory and test bench results), but it seems that the information of a mass flow set at the outlet doesn’t arrive in the smallest section of my nozzle, so it isn’t choked. The mass flow in the critical section is 0.376583 kg/s per second, which is too low (avearea(Tt)=599.97 K and avearea(Pt)=160138 Pa).

In the next step I launched two similar simulations, in which I only changed the boundary conditions:

First modified case:

Inlet: mass flow 0.38 kg/s Outlet: average relative static pressure 80.000 Pa
Also with this case I didn’t obtain a converged solution, but at least the nozzle was chocked. I compared my basic case with this first modified case visually and as you see in the attached pictures 4 and 5 the main difference is that in the unchoked basic case the flow follows the upper wall of the flow channel and in the choked case the wall on the down side. In picture 6 you see the residuals starting oscillating after quite good convergence in the first 90 iterations. The imbalance between inlet and outlet of p-mass and h-energy is below 0.06%. The mass flow around the critical section is correct and equal to 0.38 kg/s.

Second modified case:

Inlet: rel. total pressure 163.000 Pa Outlet: average rel. stat. pressure 80.000 Pa
Like in the first modified case I could not reach convergence in this simulation (see picture 7). But also in this case I obtained a choked nozzle (see picture 8). The imbalance between inlet and outlet is smaller than 0.03% for p-mass and smaller than 0.6% for h-energy. The calculated mass flow is equal to 0.37865 kg/s.

This is my situation now. I’m asking myself what could be the reason for not reaching my convergence criteria. Right now I am running again the second modified case with a large time scale of 1E-2 compared to the automatic time scale of this case equal to 1.3E-4. As initialization I used the former unconverged results. By now, no improvement.

Due to the oscillations of the residuals, I’m considering now the possibility, that my problem is a transonic and transient problem. How can I be sure that my problem needs to be run as a transient simulation? Could I for example save backup files at a peak value of my oscillating residuals and at the smallest value of one residual oscillation and then afterwards watch in CFX Post, whether my jet is moving?

Which next steps would recommend me? Try a transient run? Or other suggestions?

Thank you in advance for your support!


Best regards,

Stefan

StefanG May 10, 2012 05:52

3 Attachment(s)
Attached the missing pictures.

ghorrocks May 10, 2012 06:45

This question is a FAQ:
http://www.cfd-online.com/Wiki/Ansys...gence_criteria

Far May 10, 2012 06:59

Try transient solution as last option.

What is the Yplus on the walls? make sure yplus is below 10 with at least 10-15 nodes in boundary layer.

Are you sure that the overall length dimensions are correct?

StefanG May 10, 2012 08:55

Thanks for your ongoing support!

I checked Yplus. At the wall in the region of the smallest section of the nozzle the maximum value is about 54. I will change this. In the region of the boundary layer i have about 15 nodes. But do you think that can have such huge effect on the convergence?

What do you mean by overall length dimensions, Far?

Far May 10, 2012 09:30

Quote:

I checked Yplus. At the wall in the region of the smallest section of the nozzle the maximum value is about 54. I will change this. But do you think that can have such huge effect on the convergence?
For minor separation this may not be the big problem. But for massively separating boundary layer, you may get the numerical stiffness. In this you need yplus less than 10 (please note .


Quote:

What do you mean by overall length dimensions, Far?
May be you have problem of units. I mean instead of 100 mm (say length in x direction) you are solving 100 m or vice-versa.

Far May 10, 2012 09:38

It may be good idea to use the slip boundary for the extended domain walls (just a idea)

StefanG May 10, 2012 11:08

you mean slip wall instead of no slip wall?

Far May 10, 2012 12:26

yes slip wall.

StefanG June 5, 2012 05:17

Dear CFD-Community,

now that I have some first results that aren't too bad, I wanna describe what was the problem, why I couldn't reach convergence in my problem.

The first reason was, the choice of the boundary conditions.
Instead of setting a mass flow at the outlet, I now chose a static pressure, which gaves me much better results.

The second reason is concerning the reference pressure, which I set equal to zero, which results in overflow after a certain number of iterations.

Furthermore, I made a first calculation with a higher Total pressure at the inlet and used these quite well converged results for my case of interest with a lower total pressure.

All these three points helped me to reach convergence in my case.

I also studied meshes with different element numbers and it was harder to reach convergence with the finest one. I had to use a physical timescale of 1e-5 sec and the high resolution scheme for the SST model. Has anybody an idea what could be the reason for this?

All these three points helped me to reach convergence in my case.

Right now I am analizing the results and will go on reporting here.


Thank you for your support so far!


Greetings,

Stefan

Far June 5, 2012 06:13

Quote:

Instead of setting a mass flow at the outlet, I now chose a static pressure, which gaves me much better results.
Average static pressure is also another form of specifying the mass flow rate but with better mathematical definition. see this http://www.cfd-online.com/Forums/cfx...ressure-2.html
http://www.cfd-online.com/Forums/cfx...machinery.html
http://www.cfd-online.com/Forums/cfx...essor-map.html

Quote:

I also studied meshes with different element numbers and it was harder to reach convergence with the finest one. I had to use a physical timescale of 1e-5 sec and the high resolution scheme for the SST model. Has anybody an idea what could be the reason for this?
Numerical scheme becomes stiff with extra fine mesh. Because you have stretched cells (higher aspect ratio), which requires low time step to converge it properly.

Quote:

The second reason is concerning the reference pressure, which I set equal to zero, which results in overflow after a certain number of iterations.
Why? It is normal practice in compressible flow simulation.

Quote:

high resolution scheme for the SST model
You should always use this option. It is better than 1st order and equivalent (most of the time) to 2nd order scheme.

Quote:

Thank you for your support so far!
Are you talking about me (far! or Far! ;))

ghorrocks June 5, 2012 19:31

Quote:

The second reason is concerning the reference pressure, which I set equal to zero, which results in overflow after a certain number of iterations.
I am not sure what you mean here - did you use zero for the reference pressure before or now that it works? You need to set the reference pressure to a sensible value so the variations from the reference pressure are small in the simulation to reduce round off errors. You say the inlet pressure is 163kPa, but what is the lowest pressure in the simulation?

StefanG June 8, 2012 04:44

@ Far:

Quote:

Numerical scheme becomes stiff with extra fine mesh. Because you have stretched cells (higher aspect ratio), which requires low time step to converge it properly.
Actually, my aspect ratio was even better in the finer mesh. from the fine mesh I generated a coarse mesh in order to try some different settings.

Quote:

Are you talking about me (far! or Far! ;))
Indeed I am! :D

As you already compared the results of FLUENT and CFX for some of your cases, I also have a question concerning this:

At the moment I try to make the same simulation with the same settings in FLUENT as I did with CFX. But I am faced different problems:

I use the SIMPLEC solver with first order schemes. Unfortunately I don't get my siulation started. So first I turned off energy equation for the first 50 iterations and then set constant properties for air, the simulation started normally. After the first 50 iterations I switched on energy, but kept constant density for air. It worked. After 50 iterations I switched to ideal gas, but then after a view iterations it crashed. What could be the reason for this?

My reference pressure is 100.000 Pa as in CFX. and also the initialization was like in CFX.

Any ideas?

@ Glenn:

I first used zero for reference pressure, it didn't work. Then I used 100.000 bar and it worked. The inlet pressure was relative total pressure 163.000 Pa, so absolute 263.000 Pa. the smalles pressure in my simulations is about 8.000 Pa. Can you give me some hinds how to chose a good reference pressure? I always thought that for compressible flow with high pressure variation in the flow field 0 Pa is the best choice, but it didn't work in my case.


Thanks a lot so F/far! :)

Far June 8, 2012 08:37

Quote:

At the moment I try to make the same simulation with the same settings in FLUENT as I did with CFX.
Try coupled density based solver or coupled pressure based solver. For better convergence try "higher order term relaxation" option to accelerate the convergence. Also turn on the solution steering, for coupled density based solver, to automate the selection of cournt number.

Are you using 2nd order scheme in Fluent to compare with CFX?

Are you using SST model in Fluent as well?

It is know fact that CFX is good at internal flows and in my case I always got the good results with CFX for the some know reasons such as automatic wall treatment in CFX, better turbulence model in CFX, better interface handling in CFX etc. But after merger, things are pretty much same and improved in both codes, so I except there should be minimum difference.

Far June 8, 2012 08:41

Quote:

I first used zero for reference pressure, it didn't work. Then I used 100.000 bar
I am sure you have used 100.00 pa instead of 100 bar;). But the mimimum pressure 8000 pa is still very small value compared to 263000 pa. So I dont think using 0 or 8000pa should make the big difference.


All times are GMT -4. The time now is 22:29.