CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Very Small Time Step (https://www.cfd-online.com/Forums/openfoam-solving/103122-very-small-time-step.html)

stealth June 11, 2012 14:01

Very Small Time Step
 
2 Attachment(s)
Hello OpenFoam Users,

I am a bit new to OpenFoam. I am trying to create droplet formation (in the simplest case worked well using a TJunction) using InterFoam. I made it little complex for by adding few more inputs, this leads to very small time step (of order of 1.0e-12). Courant Number also falls down. Please let me know if it could be a problem due to type of mesh I used (Please have a look at the attachment). I also attach the input files (tar.gz).

If mesh is okay, please let me know what could be the possible reasons for such problem.

Thanks,

A. Sharma

colinB June 12, 2012 03:28

Hi there,

the problem you described indeed could be a meshing issue.

Unfortunately I don't have an OF computer at the hand to have a detailed
look at your mesh, but the picture you attached shows some significant
variation of the cell size for adjunct cells, so below that triangle you modelled
below the cut-out.

To be sure about meshing issues could you please run checkMesh and post
the results here, probably this will give us the answers we need.

As a rule of thumb, try to create as smooth meshes as possible without
abrupt changes in mesh size and direction at the same time.

I hope I could contribute

regards
Colin

kmooney June 12, 2012 09:24

Howdy,

A while back I posted a code snipit that might help you out. If you swap out

Code:

#include CourantNo.H
in the top level solver with the code that I posted it will write out a Co field with a difference value for each cell. It might point out a few trouble cells or perhaps eliminate the mesh as a potential culprit.

Post #4 on this thread:
http://www.cfd-online.com/Forums/ope...-cylinder.html

Let me know if you have any trouble with it, I wouldn't mind helping you out.

Cheers,
Kyle

stealth June 14, 2012 13:10

1 Attachment(s)
Hello Colin,

Thank you very much for your response. As you said I tried running "checkMesh" and found out some errors. Then I decided to use Salome for creating mesh and it worked well i.e. gives no problem when I run checkMesh (as shown in figure attached).
Time Step now remains of the order of 1.e-6 and stable. Is it possible to even improve it to much higher value? All other parameters I kept same as before.


Thanks again,

Regards,

A. Sharma







Quote:

Originally Posted by colinB (Post 365944)
Hi there,

the problem you described indeed could be a meshing issue.

Unfortunately I don't have an OF computer at the hand to have a detailed
look at your mesh, but the picture you attached shows some significant
variation of the cell size for adjunct cells, so below that triangle you modelled
below the cut-out.

To be sure about meshing issues could you please run checkMesh and post
the results here, probably this will give us the answers we need.

As a rule of thumb, try to create as smooth meshes as possible without
abrupt changes in mesh size and direction at the same time.

I hope I could contribute

regards
Colin


stealth June 14, 2012 13:18

Hello Kyle,

Thanks a lot for your response. Your old post looks quiet good. But, I didn't get everything out of it. It will be great if you can elaborate your part a bit for. eg: where exactly to make changes as you described.
And do I need to recompile the code again etc.

I tried to recreate mesh using Salome, it worked well (gives no problem with checkMesh, as shown in figure on my last post). Time Step now stays at 1.e-6. Can I make it even bigger ?

What could be other possible reasons for still smaller step ?

Thank You again.

Regards,

A. Sharma







Quote:

Originally Posted by kmooney (Post 366011)
Howdy,

A while back I posted a code snipit that might help you out. If you swap out

Code:

#include CourantNo.H
in the top level solver with the code that I posted it will write out a Co field with a difference value for each cell. It might point out a few trouble cells or perhaps eliminate the mesh as a potential culprit.

Post #4 on this thread:
http://www.cfd-online.com/Forums/ope...-cylinder.html

Let me know if you have any trouble with it, I wouldn't mind helping you out.

Cheers,
Kyle


colinB June 19, 2012 10:12

Hi

since you have chosen adjustable run time the time step is calculated with
the courant number.

C = (u * deltaT) / deltaX and hence

deltaT = (C * deltaX ) / u

where u is the velocity in a certain cell deltaX the length of a cell and
deltaT the desired time step.

so increasing the courant number it would increase also your timestep.

Currently yours is set to 0.2 both mean and max. you could slowly try to go up to .5 or maybe even .8 but you should have a close look at your
calculation.

You can do these changes during the calculation, simply open your
controlDict, change the values and save them. In the next timestep OF
will reread the controlDict and implement the changes.

regards
Colin

giack June 6, 2013 10:49

Hi to all,
I have a similar problem whit the performance of inteFoam. My problem concern a circular pipe filled with liquid and closed to both extremity. At initial time the right wall of the pipe is opened and gas allowing gas to go inside and liquid outside. My aim is to validate OpenFOAM for this kind of problem so I compared its performance with Fluent.
The comparison seems very good but there is a strange difference.
In my simulations I use a fixed Courant number and adaptive time step. The difference between is that Fluent give me a deltaT around 10e-04 while OpenFOAM give me a deltaT around 10e-6.So the simulation run very slow with OpenFOAM...Why this different behavior?There i a way to speed simulation?
I obtain a little accelerate through decreasing tolerance but I would obtain i larger time step if possibile and kwon why there is this difference between two code.
Note that in my case Courant number is set to 0.25 and that a bigger Courant number increase the time step but give me a fluctuating solution. So I can't increase my Courant number

thanks to all

fredo490 June 7, 2013 02:24

I suppose you run with the same exact mesh on both case ?

You can try to plot modify your solver and plot the Courant number to check where is the highest point. Maybe you have only 1 or 2 cells that are problematic.

giack June 10, 2013 04:30

thanks for your reply.
Yes,I run the same mesh in both simulations. I make a clerical error and the time step in OpenFoam is about 1e-05,so the difference between two codes is 1 order of magnitudes. To increase time step I can set Co number to 0.8 and set nAlphasubcycles=3, in this way the Co in the interface remain 0.25 and I redouble the time step. Someone suggests me to set maxCo=2 and maxAlphaCo=1 with nAlphasubcycles=4. In this way I increase my time step considerably but I have a question:
InterFoam is an explicit solver, with a maxCo=2 there is the possibility that solution diverge?

fredo490 June 10, 2013 04:37

You have the possibility of a divergence but also of an "unphysical" result (the solver sometimes doesn't crash but gives inaccurate data). You need to check your data and see if there is any "mistake".


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