CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Newbie Question IcoFoam - Courant Number explodes (

sprobst76 November 18, 2010 11:55

Newbie Question IcoFoam - Courant Number explodes
1 Attachment(s)

I trying to simulate various problems with OpenFoam and I am still in the learing phase. Perhaps somebody can help me.

I have a structure with an inlet of 4x5mm connected with a larger block. Attached to the block is a very thin outlet (0.2mm). I have created the structure with netgen and it is related to a problem a colleague of mine has.

I tried a simulation with simpleFoam and icoFoam and both simulations did not work. So far the mesh is very coarse, but I tried it als with a finer mesh.

In the attached file the whole icoFoam case is included with the netgen geo file. Running the case leads to an exploding courant number.

Thank you for your help, this is useful for me to get more knowledge about OpenFOAM. :)

Best regards

tcarrigan November 18, 2010 14:20

I tried running your case, and indeed it does blow up. Could you please post a picture of your grid and/or geometry, I'm not quite sure what you're trying to simulate. To me it seems that it's a problem with your grid, not the numerics.

sprobst76 November 18, 2010 15:00

Pictures from NetGen
3 Attachment(s)
Here are pictures of the case. The real case is more complicated and with a fluid of high viscosity, but I first wanted to test with a simplified structure how this can be done at all.

Inlet (patch - 4x5mm)

Outlet (patch 18x0.2mm)

Middle (symmetryPlane)

All remaining boundarys are of type wall.

I know the grid is very coarse, but even with a finer grid produced by netgen the case is not running. Thank you for your help.

Best regards

tcarrigan November 18, 2010 15:19

I'm thinking the velocity is pretty high at the outlet causing the Courant number to blow up. You might want to try tightening up the grid spacing at the inlet and outlet. If you can, post some pics of your fine grid and I can take a look.

sprobst76 November 18, 2010 15:44

2 Attachment(s)
Thank you for your help! The pictures are taken directly from netgen. The geo file was included in the tar.gz file. Perhaps I am doing also something wrong with netgen.

Attached are two pictures of a finer mesh (perhaps still to coarse!?).

Best regards

tcarrigan November 18, 2010 15:53

Looks ok. I did just notice something. Did you check your units? Seems you specify the velocity to be 0.001 and nu=1e-6. However, you specify your grid in mm correct? This would meen that the velocity you specify would be 0.001 mm/s.

I wasn't sure you were trying to specify velocity to be 1 mm/s at the inlet or not.

UPDATE: Check following posts

tcarrigan November 18, 2010 16:00

Ok, I got it. I checked your mesh. In the fvSolution dictionary file, change the number of non orthogonal correctors to 2,

nNonOrthogonalCorrectors 2;

And it works just fine :)

tcarrigan November 18, 2010 16:01

If you run checkMesh, it will show that there are some non-orthogonal faces. Just bump up the number of non orthogonal correctors and should work just fine.

sprobst76 November 19, 2010 03:03

nNonOrthogonalCorrectors changed
First thank you for your help.

But I did not get it to run anyhow. Did you change more than the nNonOrthogonalCorrectors in the system/fvSolution.

I took again the case from the tar.gz file and did only change the system/fvSolution and tried to run the case. Again I got a exploding courant number

The last message of the icoFoam run with a nNonOrthogonalCorrectors of 2 is:

Time = 0.00044

Courant Number mean: 3.38566e+98 max: 1.27208e+102
DILUPBiCG: Solving for Ux, Initial residual = 0.998514, Final residual = 0.55014, No Iterations 1001
#0 Foam::error:: printStack(Foam::Ostream&) in "/opt/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccDPOpt/"
#1 Foam::sigFpe::sigFpeHandler(int) in "/opt/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccDPOpt/"
#2 ?? in "/lib64/"
#3 Foam::PBiCG::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const in "/opt/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccDPOpt/"
#4 Foam::fvMatrix<Foam::Vector<double> >::solve(Foam::dictionary const&) in "/opt/OpenFOAM/OpenFOAM-1.7.1/applications/bin/linux64GccDPOpt/icoFoam"
#5 main in "/opt/OpenFOAM/OpenFOAM-1.7.1/applications/bin/linux64GccDPOpt/icoFoam"
#6 __libc_start_main in "/lib64/"
#7 _start at /usr/src/packages/BUILD/glibc-2.10.1/csu/../sysdeps/x86_64/elf/start.S:116
I do not know, what I did differently than you. But I see that I learn more and more about OpenFOAM :)

Best regards

tcarrigan November 19, 2010 03:22

1 Attachment(s)
Yeah, sorry...I just noticed I did make a few changes to the fvSchemes and fvSolutions dictionaries.

For the divergence of velocity I chose the linearUpwindV scheme. It's a second order scheme tailored towards vectors rather than scalars. I also limited the laplacian and snGradSchemes.

As for the solver, I switched to the GAMG solver with a Gauss Seidel smoother for the pressure term, and a Gauss Seidel smooth solver for velocity.

I'll attach a new .tar.gz file with the entire case. This is the one that worked for me. Sorry for the confusion, I totally forgot about those changes.

Attachment 5499

sprobst76 November 19, 2010 12:22

Thank you very much for your help!

you helped me a lot. Now I got even the more complicated case running.

I try now to set the same case up with simpleFoam. Hopefully it works :)

Thanks again!

Best regards

All times are GMT -4. The time now is 12:16.