CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Main CFD Forum (http://www.cfd-online.com/Forums/main/)
-   -   Second order upwind problem (http://www.cfd-online.com/Forums/main/108552-second-order-upwind-problem.html)

shardiali October 26, 2012 05:49

Second order upwind problem
 
Dear friends,

I am simulating the laminar convection, conjugate heat transfer in a microchannel and I am a new user of the Cadalyzer software. I have deep doubts about the method that I am using now. I have done a simulation with upwind scheme for all parameters and with 1000 iterations I got a good convergence for all parameters. However I have noticed first order upwind scheme is not really trustable in convection heat tranfer(right??!) and I changed my enthalpy scheme to second order and pooof! the computational cost increased to 100 hours! which is really high. what should I do!? stick with upwind or do sth like coarser mesh, less iteration,..to decrease the calcualtion time!? Please help me I am a beginner and need your kind help,

Info:
Mesh grid : 1.3 million
relaxation: slow convergence for enthalpy , rather fast for flow

cdegroot October 26, 2012 13:23

First order methods do generally converge better than higher order methods for several reasons (more dissipative, higher order terms tend to bounce around between iterations, etc). If you want an accurate solution you should use a second order method.

Some things to address though. Does your mesh need to be 1.3 million elements? You should always start with a coarse mesh and refine until you see the solution isn't changing much. Also, energy equations can sometimes take longer to converge because they involve longer timescales. I don't know about the software you are using, but does it use a time step or some type of under-relaxation to progress from iteration to iteration? Either way you should play with those parameters to see if you can accelerate convergence. If it uses time stepping, you can probably try increasing it to speed up convergence as long as the solution is still stable (doesn't diverge).

shardiali October 29, 2012 05:28

Dear Cdegroot,

Thanks for the reply. My software uses under relaxation parameters and I can get a faster convergence by changing the relaxation parameteres specially for the energy equation but I wonder if it affects my results since I curb the solver to small changes in every iteration. Moreover, what you mean by "If you want an accurate solution you should use a second order method." is that I should use the second order for all parameters (P,T,H,..) or just for the enthalpy? I think using second order for all parameters will increase the computational time to one week or so! :( , I am not 100% sure! but I think what you mean by making the mesh finer gradually and see the changes in the results, is that I have to start the simulation from the beginning for each refined mesh grid to investigate the independence. Am I right?
Sorry for being a naive! :o and again thank you.

flotus1 October 29, 2012 08:47

Normally, higher order methods should not increase the computational cost drastically. If this happens in your simulation, these are rather stability issues.

Changing the under relaxation factors should not alter the final solution, provided that the solution is converged.

And yes, checking for mesh independency is usually done starting from a coarse grid.

Ford Prefect October 29, 2012 09:02

Quote:

Originally Posted by shardiali (Post 389033)
Dear Cdegroot,

Thanks for the reply. My software uses under relaxation parameters and I can get a faster convergence by changing the relaxation parameteres specially for the energy equation but I wonder if it affects my results since I curb the solver to small changes in every iteration. Moreover, what you mean by "If you want an accurate solution you should use a second order method." is that I should use the second order for all parameters (P,T,H,..) or just for the enthalpy? I think using second order for all parameters will increase the computational time to one week or so! :( , I am not 100% sure! but I think what you mean by making the mesh finer gradually and see the changes in the results, is that I have to start the simulation from the beginning for each refined mesh grid to investigate the independence. Am I right?
Sorry for being a naive! :o and again thank you.

The converged results should be similar regardless of your under-relaxation parameter. However it might need (a lot) more iterations to reach the same residual level. Regarding the order of discretization, sometimes the system uncertainty as well as the model uncertainty (turbulence models) might be larger than the error caused by numerical dissipation. So just by setting the discretization to second order does not mean you get an accurate solution. ;)

shardiali October 29, 2012 09:25

Quote:

Originally Posted by flotus1 (Post 389063)
Normally, higher order methods should not increase the computational cost drastically. If this happens in your simulation, these are rather stability issues.

Changing the under relaxation factors should not alter the final solution, provided that the solution is converged.

And yes, checking for mesh independency is usually done starting from a coarse grid.

Dear folk,

It does happen in my simulation and if this very huge difference in computational time between first order and second order is not normal, what steps would you suggest me to find the problem in my simulation? it is a steady state, conjugated heat transfer(fluid/solid in a microchannel), laminar convection. Merci.

shardiali October 29, 2012 09:31

[QUOTE=Ford Prefect;389066]The converged results should be similar regardless of your under-relaxation parameter. However it might need (a lot) more iterations to reach the same residual level.


That is a good point to know.:) Thankx.

cdegroot October 29, 2012 09:45

Quote:

Originally Posted by shardiali (Post 389033)
Dear Cdegroot,

Thanks for the reply. My software uses under relaxation parameters and I can get a faster convergence by changing the relaxation parameters specially for the energy equation but I wonder if it affects my results since I curb the solver to small changes in every iteration. Moreover, what you mean by "If you want an accurate solution you should use a second order method." is that I should use the second order for all parameters (P,T,H,..) or just for the enthalpy? I think using second order for all parameters will increase the computational time to one week or so! :( , I am not 100% sure! but I think what you mean by making the mesh finer gradually and see the changes in the results, is that I have to start the simulation from the beginning for each refined mesh grid to investigate the independence. Am I right?
Sorry for being a naive! :o and again thank you.

Although you might need to apply a lot of relaxation in the beginning to avoid divergence, this might be part of the reason you are experiencing convergence issues. Try using less relaxation to see if this speeds up convergence without causing numerical instabilities. In general you should use second order methods for all equations for accuracy, but as someone else pointed out, this does not guarantee accuracy.

With regards to the long computational time: you are using a pretty big grid without having shown that it is necessary. One of the first steps in running CFD calculations is a grid sensitivity study. Basically, start with a coarse grid and run through the full calculation. Then (approximately) double the number of control volumes until you are satisfied that the grid density is not affecting the results. To be honest, I think your problem does not sound overly complex, so I think your grid is most likely much finer than it needs to be.

On the topic of grids, make sure your grid has decent quality because this can impact convergence as well.

shardiali October 29, 2012 10:01

Basically, start with a coarse grid and run through the full calculation. Then (approximately) double the number of control volumes until you are satisfied that the grid density is not affecting the results.

that was so helpful. I will try what you said and hopefully this resolves my problem. I dont have access to the software now but I will surely update you ASAP. Thank you buddy. Still eager to hear other's ideas.

Ali

flotus1 October 29, 2012 10:03

Quote:

Originally Posted by shardiali (Post 389070)
Dear folk,

It does happen in my simulation and if this very huge difference in computational time between first order and second order is not normal, what steps would you suggest me to find the problem in my simulation? it is a steady state, conjugated heat transfer(fluid/solid in a microchannel), laminar convection. Merci.

I would suggest you solve the flow field with first order accuracy and use the final solution as an initial condition for the higher order solution. This can suppress stability issues.
The point with mesh quality already mentioned here is also important. If it is low, higher order schemes are more likely to cause stability problems.

shardiali October 29, 2012 10:24

Quote:

Originally Posted by flotus1 (Post 389079)
I would suggest you solve the flow field with first order accuracy and use the final solution as an initial condition for the higher order solution. This can suppress stability issues.
The point with mesh quality already mentioned here is also important. If it is low, higher order schemes are more likely to cause stability problems.

This sounds pretty nice, but there are some issues I am thinking about:
1-is this as accurate as the second order scheme? (when you use it from the beginning)
2-would it be possible to get divergence in the second part of your calculation (using the second order after first order) after reaching the convergence in the first part!?:confused:
3- would it be the case that the second part of calculation does not change your results much? ( not much of increase in the accuracy)

Thank you for the info,

cdegroot October 29, 2012 10:37

There should be practically no difference between running a second order calculation from the beginning versus using first order data as an initial guess. You are just giving it a better initial guess.

Divergence could still occur. You'll have to play with the relaxation factors to make sure it doesn't.

If the second order corrections are small, the result won't change much. That depends on both the grid and your flow field. In general though I think the changes should be noticeable.

flotus1 October 29, 2012 11:31

Quote:

Originally Posted by shardiali (Post 389082)
This sounds pretty nice, but there are some issues I am thinking about:
1-is this as accurate as the second order scheme? (when you use it from the beginning)
2-would it be possible to get divergence in the second part of your calculation (using the second order after first order) after reaching the convergence in the first part!?:confused:
3- would it be the case that the second part of calculation does not change your results much? ( not much of increase in the accuracy)

Thank you for the info,

1) The final solution is independent of the initial conditions. Thus the solution will be the same as on obtained with higher order schemes from the beginning.
2) Divergence can still occur. with the method described, you only improve the initial conditions, which improves stability. There can still be other issues (e.g. mesh quality) that cause the solution to diverge.
3) Dont understand the question exactly :confused:

shardiali October 31, 2012 06:53

Quote:

Originally Posted by flotus1 (Post 389100)
1) The final solution is independent of the initial conditions. Thus the solution will be the same as on obtained with higher order schemes from the beginning.
2) Divergence can still occur. with the method described, you only improve the initial conditions, which improves stability. There can still be other issues (e.g. mesh quality) that cause the solution to diverge.
3) Dont understand the question exactly :confused:

Merci. I almost got my answers. I am still trying to implement what I have learned. Thank you all folks. I will let you know about the results.
Ali

AYOUB November 8, 2012 23:22

microchannel
 
Hi
I am studying roughness in microchannel, but I have problem for thermall fully developed. would you pleas help me?

cdegroot November 8, 2012 23:41

Start a new thread and state a more specific question and I'm sure you will get some help.

AYOUB November 8, 2012 23:56

fully developed
 
Thank you
I want to study roughness in microchannel 2D
D=100microchannel,L=1mm,working fluid is water,q for wall is constant,Tin=293
I can not reach to fully develop(thermally)
would you pleas help me?

cdegroot November 9, 2012 00:01

This has nothing to do with second order upwind schemes. Start a new discussion.

shardiali November 9, 2012 04:04

Quote:

Originally Posted by shardiali (Post 389429)
Merci. I almost got my answers. I am still trying to implement what I have learned. Thank you all folks. I will let you know about the results.
Ali

Dear fellows,
I ran my simulation with upwind and compared to those of second order. I saw no sizable differences in my results and considering the very long computational time, I've decided to continue with the first order scheme. I deeply appreciate your answers that helped me a lot.
Success.
Ali


All times are GMT -4. The time now is 08:50.