CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Different results with icoFoam and simpleFoam..why??? (http://www.cfd-online.com/Forums/openfoam-solving/79979-different-results-icofoam-simplefoam-why.html)

 nileshjrane September 10, 2010 05:43

Different results with icoFoam and simpleFoam..why???

Hello all,

I am solving mixing of two jets in a chamber flow. I solved the case with icoFoam and simpleFoam, with same BCs and same fvschemes (turbulence was switched off in simplefoam). But strengely i am getting different flowfield for the two solvers. I am confused.. Can anyone think of any reason for this???

 nileshjrane September 10, 2010 07:29

I tried pisoFoam as well. It runs for laminar case. (I think laminar pisoFoam is same as icoFoam, correct me if i am wrong). But as soon as i switch on turbulence the solution blows in 3-4 iterations itself..i m specifying k and eps values based on turbulent intensity and length scale. I dont understand what is happening...:confused:

 alberto September 11, 2010 14:23

More details needed to answer :D

For example, for how long did you simulate with pisoFoam? Are both the solutions converged?

Best,

 nileshjrane September 11, 2010 15:12

I ran laminar pisoFoam simulation. This is the last timestep output:
Quote:
 Time = 0.190269 Courant Number mean: 0.0280662 max: 0.46523 DILUPBiCG: Solving for Ux, Initial residual = 0.000465129, Final residual = 7.29107e-08, No Iterations 1 DILUPBiCG: Solving for Uz, Initial residual = 0.000304322, Final residual = 5.17427e-08, No Iterations 1 DICPCG: Solving for p, Initial residual = 0.00160079, Final residual = 0.000157785, No Iterations 10 time step continuity errors : sum local = 6.8602e-09, global = 1.75327e-10, cumulative = 1.53384e-07 DICPCG: Solving for p, Initial residual = 0.000229767, Final residual = 9.70914e-07, No Iterations 154 time step continuity errors : sum local = 4.22184e-11, global = 6.43781e-13, cumulative = 1.53385e-07 ExecutionTime = 122.17 s ClockTime = 122 s
The values are going down so i suppose it will converge without any glitch.

for icoFoam i ran case till about same time:

Quote:
 Time = 0.197402 Courant Number mean: 0.0141889 max: 0.42272 DILUPBiCG: Solving for Ux, Initial residual = 8.74097e-09, Final residual = 8.74097e-09, No Iterations 0 DILUPBiCG: Solving for Uz, Initial residual = 2.66859e-08, Final residual = 2.66859e-08, No Iterations 0 DICPCG: Solving for p, Initial residual = 1.02221e-06, Final residual = 9.10455e-07, No Iterations 1 time step continuity errors : sum local = 1.22993e-11, global = -1.66116e-12, cumulative = 4.25772e-08 DICPCG: Solving for p, Initial residual = 9.17487e-07, Final residual = 9.17487e-07, No Iterations 0 time step continuity errors : sum local = 1.23943e-11, global = -1.72819e-12, cumulative = 4.25755e-08 ExecutionTime = 9769.2 s ClockTime = 9874 s
geometry, BCs identical and both cases laminar.

 nileshjrane September 11, 2010 15:25

3 Attachment(s)
Here are the case files.

As soon as switch on turbulence, the solution diverges. Same thing is happening for simpleFoam.

Quote:
 Time = 114 DILUPBiCG: Solving for Ux, Initial residual = 0.772595, Final residual = 0.0213943, No Iterations 1 DILUPBiCG: Solving for Uz, Initial residual = 0.63506, Final residual = 0.0144294, No Iterations 1 DICPCG: Solving for p, Initial residual = 6.20921e-34, Final residual = 6.20921e-34, No Iterations 0 time step continuity errors : sum local = 7.6134e+45, global = -2.00193e+29, cumulative = -2.00193e+29 DILUPBiCG: Solving for epsilon, Initial residual = 0.00202807, Final residual = 2.96562e-10, No Iterations 1 bounding epsilon, min: -8.64629e+80 max: 5.5278e+84 average: 6.60167e+80 DILUPBiCG: Solving for k, Initial residual = 0.422706, Final residual = 2.26954e-07, No Iterations 4 ExecutionTime = 5.59 s ClockTime = 5 s

The continuity error kills the solution..:confused:

There is some error for sure as whem i run potentialFoam for initialisation it gives me this massege:

Quote:
 Create time Create mesh for time = 0 Reading field p Reading field U Calculating potential flow DICPCG: Solving for p, Initial residual = 1, Final residual = 0.409896, No Iterations 1 continuity error = 762907 Interpolated U error = 47.2242 ExecutionTime = 0.2 s ClockTime = 0 s End
Please note that BCs are identical for all.

 alberto September 11, 2010 18:56

Hi,

the solution is not converging also if the flow is assumed to be laminar.

Your linear solvers settings are not good. The relTol to 0.5 on p is definetly not a good idea. Set the relTol to zero, and your conservation error will go to machine precision :D

Adding a couple of non-orthogonal corrector steps allows a quicker reduction of the residuals on p.

Relax k, eps with a factor of 0.2.

P.S. Are data in m/s? Velocities seem quite high.

Best,

 nileshjrane September 12, 2010 03:38

Hello Alberto,

Your corrections seem to be working..:D I will post the progress ASAP.

Well, couple of quick questions:

1) what does relTol exactly means??? I guess i havnt got the correct idea. Say my relTol is 0.5 then what dies it mean??

2) what are local, global and cumulative errors?? i have seen cumulative error sometimes very high than the other two or sometimes very low (in different simulations of coarse).

Thank you for the help..:)

PS: the velocities are indeed very high. The fuel stream is at Ma=1 and air stream at Ma=0.3.

 alberto September 12, 2010 14:21

Quote:
 Originally Posted by nileshjrane (Post 274878) 1) what does relTol exactly means??? I guess i havnt got the correct idea. Say my relTol is 0.5 then what dies it mean??
http://www.openfoam.com/docs/user/fvSolution.php

Quote:
 2) what are local, global and cumulative errors?? i have seen cumulative error sometimes very high than the other two or sometimes very low (in different simulations of coarse).
Basically they are a measure of the continuity error you have. They are defined in continuityErrs.H (a search on the src directory will bring you there).

Quote:
 PS: the velocities are indeed very high. The fuel stream is at Ma=1 and air stream at Ma=0.3.
Then use a compressible code.

Best,

 nileshjrane September 12, 2010 17:52

I am going to use rhoSimpleFoam or rhoPisoFoam as you have already suggested to me in another thread, but as a starting point i am doing incompressible simulations. I thought it will be a good experience.

Thanks for the help and the support. The simpleFoam simulations are giving same results as icoFoam now. :D

 matejfor September 13, 2010 02:14

Hi, just a quick comment. To run a simulation with nonphysical settings (like incompressible at Ma=1) is not a good experience, it is a bad habit and you will not learn much from it. You should always model the physics as the N-S equations will not converge what ever numerical settings you will try.

If you want first guess results around sonic speeds, you'd better try Euler flow (without viscosity).

good luck
matej

 alberto September 13, 2010 10:39

I agree with matej, and unfortunately running with a non-physical setup seems to be a too common habit, at least judging from the questions on this forum. :(

A good part of the problems met by OpenFOAM users are due to their poor setup.

 nileshjrane September 13, 2010 15:08

Hello matej,

Thanks for your advice. Very true and i absolutely agree with you. I had started with rhoPisoFoam at first from Alberto's advice. By experience i didn't mean the 1st hand results. Its the 1st hand experience on OpenFoam. This is my 1st case with OF and using compressible solvers in a 3D simulation was leading me nowhere. Doing 2D incomressible simulation indeed helped me in the sense it gave me confidence that i can solve something in OpenFoam. First hurdle crossed. In that sense its a good learning experience. Anyway i am not giving the correct BCs in these simulations, i am not even specifying densities and pressures. I am not expecting the results to be correct. I'ld've done compressible inviscid simulation for 1st hand results.

@alberto:

You are correct, the problem is indeed the solver settings and BC for newbies. In fact i figured it out that its probably my BCs are unphysical. But thats part of the game in preliminary mechanical designs. You don't always know whether some BC gonna be unphysical or not or worse you have no other values to work with. By doing simulations only you improve on it. Leave apart BCs, but solvers, i would say its an uphill task getting hang of solver setting in OF. A bit difficult for beginners like me especially with inadequate documentation and c++ coding of OF.

actually I started with velocity of 3m/s, which is pretty much in the incompressible range and slowly increased the velocity. Thanks to you all expert guys on the forum newbies like me survive here.

PS: Today i read your wiki-guide on scalarTransportFoam. I wish we had somelike this for every solver. I will definitely try to write something like this when i'll become expert in OF. At least hoping so..:D

Thank you all for the help. I am gonna try rhoSimpleFoam and rhoPisoFoam now.:)

 All times are GMT -4. The time now is 00:39.