CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

How to find a good time scale strategy?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Far

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 1, 2012, 03:05
Default How to find a good time scale strategy?
  #1
New Member
 
Join Date: Mar 2012
Posts: 27
Rep Power: 14
StefanG is on a distinguished road
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
Attached Images
File Type: jpg picture 1.jpg (41.3 KB, 532 views)
File Type: jpg picture 2.jpg (65.1 KB, 448 views)
StefanG is offline   Reply With Quote

Old   May 1, 2012, 19:33
Default
  #2
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,701
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
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.
ghorrocks is online now   Reply With Quote

Old   May 2, 2012, 04:56
Default
  #3
New Member
 
Join Date: Mar 2012
Posts: 27
Rep Power: 14
StefanG is on a distinguished road
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?
StefanG is offline   Reply With Quote

Old   May 2, 2012, 18:23
Default
  #4
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,701
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
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.
ghorrocks is online now   Reply With Quote

Old   May 10, 2012, 02:11
Default
  #5
Far
Super Moderator
 
Sijal
Join Date: Mar 2009
Location: Islamabad
Posts: 4,553
Blog Entries: 6
Rep Power: 54
Far has a spectacular aura aboutFar has a spectacular aura about
Send a message via Skype™ to Far
I am sure that with inlet placed far away from nozzle, will improve the convergence considerably.
Far is offline   Reply With Quote

Old   May 10, 2012, 05:50
Default
  #6
New Member
 
Join Date: Mar 2012
Posts: 27
Rep Power: 14
StefanG is on a distinguished road
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
Attached Images
File Type: jpg Picture_1_complete_flow_channel.jpg (37.0 KB, 221 views)
File Type: jpg Picture_2_basic_case_res_mom_and_mass.jpg (43.6 KB, 215 views)
File Type: jpg Picture_3_basic_case_res_h_energy.jpg (36.8 KB, 200 views)
File Type: jpg Picture_4_basic_case_Mach_number.jpg (52.4 KB, 228 views)
File Type: jpg Picture_5_First_mod_case_Mach_number.jpg (52.9 KB, 181 views)
StefanG is offline   Reply With Quote

Old   May 10, 2012, 05:52
Default
  #7
New Member
 
Join Date: Mar 2012
Posts: 27
Rep Power: 14
StefanG is on a distinguished road
Attached the missing pictures.
Attached Images
File Type: jpg Picture_6_First_mod_case_residuals.jpg (58.8 KB, 99 views)
File Type: jpg Picture_7_second_mod_case_residuals.jpg (57.3 KB, 107 views)
File Type: jpg Picture_8_Second_mod_case_Mach_number.jpg (53.0 KB, 100 views)
StefanG is offline   Reply With Quote

Old   May 10, 2012, 06:45
Default
  #8
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,701
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
This question is a FAQ:
http://www.cfd-online.com/Wiki/Ansys...gence_criteria
ghorrocks is online now   Reply With Quote

Old   May 10, 2012, 06:59
Default
  #9
Far
Super Moderator
 
Sijal
Join Date: Mar 2009
Location: Islamabad
Posts: 4,553
Blog Entries: 6
Rep Power: 54
Far has a spectacular aura aboutFar has a spectacular aura about
Send a message via Skype™ to Far
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?
Far is offline   Reply With Quote

Old   May 10, 2012, 08:55
Default
  #10
New Member
 
Join Date: Mar 2012
Posts: 27
Rep Power: 14
StefanG is on a distinguished road
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?

Last edited by StefanG; May 10, 2012 at 09:29.
StefanG is offline   Reply With Quote

Old   May 10, 2012, 09:30
Default
  #11
Far
Super Moderator
 
Sijal
Join Date: Mar 2009
Location: Islamabad
Posts: 4,553
Blog Entries: 6
Rep Power: 54
Far has a spectacular aura aboutFar has a spectacular aura about
Send a message via Skype™ to Far
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 is offline   Reply With Quote

Old   May 10, 2012, 09:38
Default
  #12
Far
Super Moderator
 
Sijal
Join Date: Mar 2009
Location: Islamabad
Posts: 4,553
Blog Entries: 6
Rep Power: 54
Far has a spectacular aura aboutFar has a spectacular aura about
Send a message via Skype™ to Far
It may be good idea to use the slip boundary for the extended domain walls (just a idea)
Far is offline   Reply With Quote

Old   May 10, 2012, 11:08
Default
  #13
New Member
 
Join Date: Mar 2012
Posts: 27
Rep Power: 14
StefanG is on a distinguished road
you mean slip wall instead of no slip wall?
StefanG is offline   Reply With Quote

Old   May 10, 2012, 12:26
Default
  #14
Far
Super Moderator
 
Sijal
Join Date: Mar 2009
Location: Islamabad
Posts: 4,553
Blog Entries: 6
Rep Power: 54
Far has a spectacular aura aboutFar has a spectacular aura about
Send a message via Skype™ to Far
yes slip wall.
Far is offline   Reply With Quote

Old   June 5, 2012, 05:17
Default
  #15
New Member
 
Join Date: Mar 2012
Posts: 27
Rep Power: 14
StefanG is on a distinguished road
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
StefanG is offline   Reply With Quote

Old   June 5, 2012, 06:13
Default
  #16
Far
Super Moderator
 
Sijal
Join Date: Mar 2009
Location: Islamabad
Posts: 4,553
Blog Entries: 6
Rep Power: 54
Far has a spectacular aura aboutFar has a spectacular aura about
Send a message via Skype™ to Far
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! )
mrenergy likes this.
Far is offline   Reply With Quote

Old   June 5, 2012, 19:31
Default
  #17
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,701
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
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?
ghorrocks is online now   Reply With Quote

Old   June 8, 2012, 04:44
Default
  #18
New Member
 
Join Date: Mar 2012
Posts: 27
Rep Power: 14
StefanG is on a distinguished road
@ 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!

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!
StefanG is offline   Reply With Quote

Old   June 8, 2012, 08:37
Default
  #19
Far
Super Moderator
 
Sijal
Join Date: Mar 2009
Location: Islamabad
Posts: 4,553
Blog Entries: 6
Rep Power: 54
Far has a spectacular aura aboutFar has a spectacular aura about
Send a message via Skype™ to Far
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 is offline   Reply With Quote

Old   June 8, 2012, 08:41
Default
  #20
Far
Super Moderator
 
Sijal
Join Date: Mar 2009
Location: Islamabad
Posts: 4,553
Blog Entries: 6
Rep Power: 54
Far has a spectacular aura aboutFar has a spectacular aura about
Send a message via Skype™ to Far
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.
Far 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
How to write k and epsilon before the abnormal end xiuying OpenFOAM Running, Solving & CFD 8 August 27, 2013 15:33
Orifice Plate with a fully developed flow - Problems with convergence jonmec OpenFOAM Running, Solving & CFD 3 July 28, 2011 05:24
estimation of integral time scale Clementine FLUENT 0 February 28, 2008 11:29
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 18:07
time averaged heat transfer in oscillating flow Matthieu Ubas Main CFD Forum 2 November 5, 1999 14:20


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