CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   How to get better convergence in transient simulation (https://www.cfd-online.com/Forums/cfx/116316-how-get-better-convergence-transient-simulation.html)

sjtusyc April 17, 2013 01:44

How to get better convergence in transient simulation
 
I'm doing a transient multi-phase simulation with time-dependent pressure inlet.
I found it was difficult to converge with my desired time step. If smaller time step was used ,it'll cost time. So what should i do to get better convergence with relatively bigger time step.
1.Will the initial value influence the transient convergence as i use the steady-state result as initial value? Should i start with a better converged steady result?

2. Should i start the simulation with smaller time step and then increase the time
step as my simulation is periodic ?


Thank you in advance.

ghorrocks April 17, 2013 08:43

Yes, the initial conditions will affect convergence. The closer the initial condition is to the real condition, and the smoother it is the better the convergence.

And yes, starting with a small time step and increasing it as the simulation progresses is standard practise.

sjtusyc April 17, 2013 09:34

Thank you for your reply.
I have a few more questions.
1)I have done the mesh sensitivity analysis when i was doing steady state simulation. Should i do it again when i do the transient one as i use the steady result as the initial value for the transient simulation.
2)I use adaptive time step when i was doing the transient simulation. In the first several iterations it didn't converge to my criteria.Will this affect the overall accuracy? My simulation is periodic ,i just want to get data of one cycle.

Thank you.

ghorrocks April 17, 2013 19:45

It is up to your judgement as to whether the mesh sensitivity done on steady state is applicable to a transient run. It probably is, but you need to think through what has changed and if it makes a difference to the mesh. Of course, if you want to be safe you can repeat the mesh sensitivity on the transient simulation.

If all you are interested in is the repeating periodic pattern then it does not matter if a few initial time steps do not fully converge.

sjtusyc April 17, 2013 21:49

If all you are interested in is the repeating periodic pattern then it does not matter if a few initial time steps do not fully converge.[/QUOTE]

So i just select the later cycles that are fully converged?

ghorrocks April 18, 2013 07:14

Yes, that is correct.

sjtusyc April 18, 2013 07:45

Thank you so much.

sjtusyc April 20, 2013 04:26

Quote:

Originally Posted by ghorrocks (Post 421481)
Yes, that is correct.

Glenn,CFD is not easy, sometimes it exhausted me.
A few questions occur.
As i previous said, i wanna to select the latter cycles that are fully converged as my data. But i found as the frequency of the inlet pressure increase(i set the inet total pressure as "Press = 1.0[MPa]+0.3[MPa]*sin(2*pi *f[Hz]*t" ),the simulation will go wrong at the latter cycles. I monitored massflow of the atomizer as the massflow is the physical parameter i care about.

What causes to this problem? Will the timestep is the reason?
I first set the timestep as "timestep=(1/f/8)[s]" and use the adaptive timestep to find the suitable timestep.
As the f increase, few points are calculated in a cycle, as the timestep for the high frequency cycles is small.

Can i just select the cycles which seems reasonable as my data ?

sjtusyc April 20, 2013 04:39

5 Attachment(s)
Attachment 20931

Attachment 20932

Attachment 20933

Attachment 20934

Attachment 20935

oj.bulmer April 20, 2013 08:20

The periodic plots of higher frequencies are dodgy. Either the flow is chaotic, or the timescales haven't been adequately resolved.

Some clarifications: Are you doing separate solution for every frequency? If yes, do you start with 1/8f as the timestep, with f being frequency?

If both are yes, and if you are using adaptive timestep, then perhaps the smallest timestep value in adaptive settings need to be further reduced. How about keeping it 1e-8 s with largest timestep being say 1000 s? If smallest and largest timesteps are not smal/large enough, the adpative timestepping can not home in on adequate timestep that lies outside these values.

As long as you use adaptive timestepping, it doesn't matter what timestep you start with, as Solver quickly adjusts it to meet the given convergence criterai.

OJ

ghorrocks April 20, 2013 08:26

Quote:

Can i just select the cycles which seems reasonable as my data ?
That is very unwise.

Your graphs seem to show that the flow is in fact not periodic for a few configurations modelled. This may well be real. There is a transition from periodic to non-periodic at some input value you have used.

sjtusyc April 21, 2013 04:19

Thanks i will try with a smaller starting timestep.

ghorrocks April 21, 2013 08:37

Rather than just arbitrarily reducing the tiem step, how about doing a time step sensitivity study so you work out what time step size you actually need. Or even better, use adaptive timestepping, homing in on 3-5 coeff loops per iteration and let the solver work it out for itself.

sjtusyc April 22, 2013 10:41

Thanks,this simulation seems tricky. I am doing the sensitive analysis, and confused by a few results.
I will try to sort it out and then ask you for help.
Thanks for help.

sjtusyc April 27, 2013 04:10

1 Attachment(s)
1)Hi,I come here to ask for your help again:).
There some problems confuse me for some time, and i think i should explain it in detail.
1. Physical background
I am doing a simulation of a pressure-swirled atomizer where there is a air-cone in the outlet region.So it is a multi-phase problem.I want to study the dynamic response characteristic of the atomizer. I set the inlet total pressure as 1.0[Mpa]+0.3[Mpa]*sin*(2*pi*f*t),where f refer to the frequency. I care about the average mass flow rate of the atomizer in one cycle. How will it change with the pressure fluctuation frequency.
Homogeneous and free surface model was applied.
First i did the steay simulation, with the inlet total pressure as the 1.0Mpa.
Attachment 21207
a slice of the water volume fraction

sjtusyc April 27, 2013 04:23

1 Attachment(s)
2) When i was doing the steady state simulation, I did the sensitivity analysis of the mesh and convergence criteria and other things.
Based on the steady simulation, I start to do the transient simulation. I used the adaptive time step to let the solver to find appropriate time step.
But something weird happened.
1. surface tension
To my understanding, i think the surface tension in this problem is not important,
so i didn't take it in my consideration. I did confirmed it when i was doing steady state simulation. But has a big effect on the result in transient simulation.
Take f=10Hz as an example.
when the surface tension is considered, the transient mass flow rate is like Attachment 21197

sjtusyc April 27, 2013 04:27

1 Attachment(s)
3)As the picture tells, the averaged mass flow rate in the transient simulation is bigger than the steady simulation.
But when the surface tension is not considered it is not the case at all Attachment 21198
The averaged mass flow rate is almost equals the steady simulation.

sjtusyc April 27, 2013 04:41

1 Attachment(s)
4)double precision
And i found out the double precision have an big effect on the result too.
The previous data was got without double precision.
When i turned on the double precision and take the surface tension into consideration, the reulsts are:
Attachment 21199
And the averaged mass flow is again equals the steady state.

sjtusyc April 27, 2013 04:50

4 Attachment(s)
5)As the averaged mass flow rate is what i care about, these results really confused me.
Will the surface tension lead to error and double precision will alleviate it ?
And i check the pressure field.
1.When surface tension is considered with single precsion:
Attachment 21200
t=0s
Attachment 21201
t=0.01s
Attachment 21202
t=0.02s
Attachment 21203
t=0.05s
Attachment 21201
t=0.1s

sjtusyc April 27, 2013 04:56

3 Attachment(s)
6)
It seems that the pressure field is not good enough.
When double precision is turned on the free surface tension is considered too.
Attachment 21204
t=0s
Attachment 21205
t=0.02s
Attachment 21206
t=0.05s

It seems that the pressure field is better.

sjtusyc April 27, 2013 05:11

6)
so in conclusion , i'm really confused.
Whether should the surface tension should be considered and the double precision turned on. Whether the averaged mass flow rate in the transient simulation is larger than that in steady simulation.
I'm really confused.

Thanks in advance.

ghorrocks April 27, 2013 08:03

Quote:

To my understanding, i think the surface tension in this problem is not important
You are modelling a spray atomiser are you not? Then isn't surface tension critical to this process? If you do not understand a flow then you have no hope of modelling it.

I suggest you do some background research on spray formation, droplet formation and Rayliegh stability of liquid columns (eg http://www.maths.bris.ac.uk/~majge/PHF00941.pdf)

The glitches you saw in single precision look like classic numerical round-off problems. The fix is to run double precision, as you have found.

sjtusyc April 27, 2013 08:07

I simulated the internal flow of the atomizer, not the droplet formation.

sjtusyc April 27, 2013 08:10

What the "glitches" do you mean?
This simulation really confuse me ,may i hope you read it a little more carefully if you have time although i have no right to ask you to do so.
Thanks in advance

sjtusyc April 27, 2013 08:13

Quote:

Originally Posted by sjtusyc (Post 423502)
I simulated the internal flow of the atomizer, not the droplet formation.

The air is sucked in the atomizer, so ,the internal flow of the pressure-swirled atomizer is multiphase flow and where the free surface is not important.
But i found later as i said previous the free surface tension had a big influence on the result, will it be the numerical reason.

ghorrocks April 27, 2013 08:16

The glitches are the weird spots on post #19.

It might help if you drew a picture of what you expect the flow to do. The images you have posted do not clearly show what is happening.

sjtusyc April 27, 2013 08:39

2 Attachment(s)
There is a interface between the air and water just like that in the open channel.

Yes, there are weird spots on post #19. But why that will not happen if the surface tension is not considered though just single precision is used.
I mentioned that in the previous posts.

Attachment 21209
This is the computational field. Water flows in and cause low pressure near the atomizer exit and that lead to the air sucked in.
Attachment 21210

sjtusyc April 27, 2013 08:47

Quote:

Originally Posted by sjtusyc (Post 423476)
5)As the averaged mass flow rate is what i care about, these results really confused me.
Will the surface tension lead to error and double precision will alleviate it ?
And i check the pressure field.
1.When surface tension is considered with single precsion:
Attachment 21200
t=0s
Attachment 21201
t=0.01s
Attachment 21202
t=0.02s
Attachment 21203
t=0.05s
Attachment 21201
t=0.1s



Does my guess reasonable ?

ghorrocks April 27, 2013 08:56

I can make a key suggestions from your CCL: You are using incompressible air at room density, yet the inlet pressure is MPa. This does not sound very appropriate to me. Sounds like you need a compressible gas model to account for the large variation in density the air would undergo.

Surface tension is modelled as a momentum source on the element at the fluid surface. Small kinks in the surface then cause kinks in the surface tension and these can be spurious and lead to numerical problems. That is why surface tension models are more expensive to run.

So only use surface tension if you have to. And it is not clear to me at the moment what role surface tension plays in this device. Can you post an image of what the device looks like after it has been running for a while?

sjtusyc April 27, 2013 09:13

I don't know how to say many many many thanks in English,just thank you for your help.

It is the internal flow of the pressure-swirl atomizer.
This thesis may help you.:)
http://www.ilasseurope.org/ICLASS/il...papers/058.pdf

There is only water come in the atomizer through the inlet and air come in the atomizer through the outlet.

So the air is workind under the 1atm.

ghorrocks April 28, 2013 07:45

Glad to help.

OK, it you are confident the air does not change much from atmospheric pressure then incompressible air is good and will considerably simplify the simulation.

Sorry - another thing - are you using the reference pressure correctly? Your outlet should be 0 Pa with a reference pressure of 1 bar. It seems you might have an outlet pressure of 1bar and a reference pressure of 0. This will cause numerical round-off problems - like you have been seeing.

sjtusyc April 28, 2013 10:54

As i know, in this simulation,the pressure ranges from 1 bar to 1Mpa,so it will have little effect whether the reference pressure was set to 1bar or zero.

Is it right?

sjtusyc April 28, 2013 11:00

Glenn, did you see the pictures in post 16,17 and 18.
Why just a little change will lead to so much difference.
In post 16, the transient mass flow rate fluctuate upon 0.32(steady state mass flow rate), and its average mass flow is larger then the steady flow rate.And in post 17,18 transient mass flow rate fluctuate fluctuate from 0.24 to 0.38.
So its average mass flow equals the steady flow rate.

ghorrocks April 28, 2013 19:42

With such a large range in pressures in the water - but a small range of pressure in air - this is always going to be a tricky model for the numerics. So double precision is recommended. But if you use the reference pressure correctly then the small pressure range in air will be well resolved as it will be near zero, and yes, you have to compromise resolution on the water as it has such a large pressure range.

So yes, definitely use a reference pressure of 1 atm.

As for posts 16, 17, 18 - this just shows that single precision with the wrong reference pressure gives incorrect results. So you definitely need double precision and a correctly set reference pressure.

sjtusyc April 28, 2013 22:45

Thanks so much. Your help let me sort out the problem gradually.
I hadn't expected round-off errors will lead such a great problem.
1)I am little confused why the reference pressure helps to get better numerical result?
As i know in NS equations, there is only pressure difference term in momentum equation,so it seems that the pressure difference will not change whether the reference pressure set or not.

2)Judged from the post 17,if the surface tension is not considered, just single precision is enough. And from post 18, it may seem that if the surface tension is considered double precision should be used.
Is that a little weird?
The surface tension has a big influence on the result.

ghorrocks April 28, 2013 22:56

The reference pressure changes the magnitude of the pressure difference in the momentum equation. For instance, if the pressure range in the air is 1Pa, then with a reference pressure of 0 bar it is calculating the difference of 100001 - 100000 = 1Pa, but it took 6 digits of precision to do it. You only get 6 or 7 digits of precision in single precision so you have just about used up all your precision on this calculation. CFX does use some tricks to reduce this effect and it is actually a lot better than this, but the concept still holds.

The same situation with a 1 bar reference pressure set means that the pressure difference is 1-0=1Pa, but the difference is resolved with full accuracy of the precision of the numerics.

Your point 2 is not weird. This is exactly what you would expect. Surface tension tends to magnify small defects, so if the defect is numerical noise from round off errors it will get magnified. The defects in double precision are far smaller, so you get much better behaviour with surface tension.

sjtusyc April 29, 2013 00:19

Glenn, thank you so much.
I figured out my problem under your great help.
I find CFD is not easy,but it is interesting!
It is a great joy to solve problem.

Wish you have a good holiday.


All times are GMT -4. The time now is 06:23.