Floating point error in Saturne

More
15 years 11 months ago #1939 by Claus
Floating point error in Saturne was created by Claus
hi - I've been playing around with an example from the tutorials in preparation of my project - but changing some parameters results in the following error:

claus@kafka:~/saturne/Noyau/ncs-1.3.1/doc/TUTORIAL/TEST_CASES/STRATIFIED_JUNCTION/CAS5/DATA$ cat /home/claus/tmp_Saturne/STRATIFIED_JUNCTION.CAS5.04291508/erreur
Signal SIGFPE (exception en virgule flottante) intercept� !

Pile d'appels :
1: 0xb7f1e420 ? (?)
2: 0x8070471 <reslin_+0x3f1> (cs13.exe)
3: 0x811fcc0 <invers_+0x2c0> (cs13.exe)
4: 0x8112e95 <codits_+0x1025> (cs13.exe)
5: 0x80fe8db <turbke_+0x41f7> (cs13.exe)
6: 0x80f8e5e <tridim_+0x5b16> (cs13.exe)
7: 0x80915a1 <caltri_+0x2c99> (cs13.exe)
8: 0x805c4b2 <main+0x426> (cs13.exe)
9: 0xb7945450 <__libc_start_main+0xe0> (libc.so.6)
10: 0x805c031 ? (?)
Fin de la pile

This happens at the 5th timestep, and happens regardless of using 1 or 2 processors.

What could the problem be?

Code_Aster release : STA11.4 on OpenSUSE 12.3 64 bits - EDF/Intel version

Please Log in or Create an account to join the conversation.

More
15 years 10 months ago #1986 by Claus
Replied by Claus on topic Re:Floating point error in Saturne
forum will not allow me to post more than this line...<br /><br />Post edited by: Claus, at: 2008/05/14 22:25

Code_Aster release : STA11.4 on OpenSUSE 12.3 64 bits - EDF/Intel version

Please Log in or Create an account to join the conversation.

More
15 years 10 months ago #1987 by Claus
Replied by Claus on topic Re:Floating point error in Saturne
Hi again - I'm still having problems with Saturne, now with 1.3.2 which I just compiled from scratch to match my system.

It is a fairly simple case and again I cannot understand what the problem is.
[code:1]
pastebin dot com/f3471a796
[/code:1]

now with 'strace cs13 etc.':
[code:1]
pastebin dot com/f647580ff
[/code:1]
any hints? - my project deadline is closing in :(

Post edited by: Claus, at: 2008/05/14 22:37<br /><br />Post edited by: Claus, at: 2008/05/15 22:40

Code_Aster release : STA11.4 on OpenSUSE 12.3 64 bits - EDF/Intel version

Please Log in or Create an account to join the conversation.

More
15 years 10 months ago #1988 by David Monfort
Replied by David Monfort on topic Re:Floating point error in Saturne
Hello,

I am afraid I do not understand what you quoted in your previous post... Is this an error you got from Code_Saturne ? If so, i am afraid I shall not be of any help :(

Besides, to come back to your first post, your run is stopped by a floating point exception (like a division by zero) during the linear solver phase, i.e. the reslin function. That may be a clue that your computation is not converging. You might have a look at the listing file, especially at the lines beginning for example with c VitesseX (the c stands for convergence, and VitesseX is the x velocity in french...) to be sure.

As regards your project, could please give us a bit more details on your study ?
  • Is there any particular physics (combustion, lagrangian particule tracking, ...) ?
  • Are you using the Graphical user Interface, or Fortrans user files, or both ?
  • Anything you think relevant...
If you still run into problems, you may contact the Code_Saturne support at the following e-mail This email address is being protected from spambots. You need JavaScript enabled to view it., I shall make sure you will be answered as soon as possible.

Regards,
David

Please Log in or Create an account to join the conversation.

More
15 years 10 months ago #1996 by Claus
Replied by Claus on topic Re:Floating point error in Saturne
Okay - I will see if I can get a hold of that book (Computation of Fluid..), I really need more theory on CFD - but in a combination of curiosity and the deadline, I decided to jump into the deep end.

I know this is a very large topic and asking for a simple answer might be a bit too much to ask; but what could the reasons for a non-converging solution be?

Unfortunately I deleted the case that produced the error, but I've had countless others in the meantime. I'll have a look at the 'listings' next time and have Bablefish help me.

About my project: My fellow students and I have done a calculation of the behavior of steam in a steam blow-off pipe on a L211-class container-ship. Our calculations (via MathCAD and our thermodynamics book) have several shortcomings, which is fine, but I would like to present a physical approximation as well, with the help of Code_Saturne.

The behavior of the steam is two-phased, which means a lot of variables like density, temp, velocity etc. This is very hard to handle with hand-calculations.

I just can't find any example-cases with variable Cp, rho etc - it seems to me that the Saturne userbase is very small, either that or they aren't sharing :)

Thanks for your time :)

edit: I use the GUI and had a look at usphyv.F in users/base to activate the variable density etc. - but I don't understand it - and I've never seen this notation before:
[code:1] --- Coefficients des lois choisis et imposes par l'utilisateur
Les valeurs donnees ici sont fictives

VARA = -4.0668D-3
VARB = -5.0754D-2
VARC = 1000.9D0
[/code:1] could you briedly explain this? what's 'D-3'

Post edited by: Claus, at: 2008/05/15 23:08<br /><br />Post edited by: Claus, at: 2008/05/16 00:14

Code_Aster release : STA11.4 on OpenSUSE 12.3 64 bits - EDF/Intel version

Please Log in or Create an account to join the conversation.

More
15 years 10 months ago #1997 by David Monfort
Replied by David Monfort on topic Re:Floating point error in Saturne
Let's try to answer your different questions.

First, to clear up a bit the &quot;small&quot; user base of Code_Saturne, let's have a bit of history. ;)
It is an in-house CFD code developed at EDF, a French electricity provider (with a strong nuclear-based production). The development began 10 years ago, based on former in-house CFD codes, but has only been released open source (GPL licensed) last year. And the first validated and distributed on the web version is the 1.3.2.
That said you have to understand that, though the user base keeps growing (and CAELinux helps a lot there !), it has not yet reached a high level.
Moreover Code_Saturne web site is still under construction: neither a forum, nor a bug tracker yet ! But things will come... Second and more difficult issue for the user, part of the code, documentation and listings is still in French... sadly, but this will change as well.

All of that to say that, as there is yet no dedicated Code_Saturne forum, users remain quiet :)

For any issue or question, Code_Saturne support can help you and they do understand English ;)


Let's come back now to your project.

Firstly, you won't be able to run a two-phase simulation with Code_Saturne because it handles only single-phase flow. Nevertheless, you could perhaps approximate your two-phase flow by an homogeneous single-phase flow, assuming of course the homogeneous hypothesis remains physically correct!

Secondly, usphyv.F is indeed the right user file to use variable laws for Cp, Rho, ... You may find more information in the user manual. If you don't succeed in using this user file, please post the laws you wish to use and I'll try to fill the user file as an example. As for 2.01D-3 (for instance), this is a Fortran code meaning 0.00201, think about it as 2.01e1 in &quot;engineer&quot; notation but with a &quot;D&quot; which means that the real is coded in double precision (with 16 Bytes). You can code it as you want actually, but do not use the &quot;D&quot; notation within the GUI!

Lastly, the vast question of a non-converging simulation!

Well... this can arise because of a too large time-step. Imagine that if your time-step is too large -- this notion depends on your mesh and flow parameters (mainly velocity) -- , then a volume of fluid will go through several (too many!) cells during a single iteration ; so, your simulation won't be accurate and can diverge. A relevant parameter for stability (and convergence) is the Courant number, it is related to convection. The Fourier number would be another one, related to diffusion. In Code_Saturne listing, you can find these parameters by doing a grep on &quot;Courant max&quot;. This parameter is &quot;one&quot; of the most important and should not go beyond 1 to 1O, depending on the chosen turbulence model, ... The Fourier number can goes beyond that (typically from 10 to 100). Note that it's only orders of magnitude of these parameters, not rules that works in every configuration!

Another reason for a simulation for not converging is errors in user files. ;)


To sum up, CFD requires a bit of knowledge but mainly a lot of experience! That makes it very interesting, but can prove to be quite frustating sometimes :evil:

Please Log in or Create an account to join the conversation.

Moderators: catux
Time to create page: 0.178 seconds
Powered by Kunena Forum