Page 1 of 2

Error run LES when restart from RANS

Posted: Thu Jul 01, 2021 2:36 pm
by Ruonan
Dear developers,

Please could you help me with this problem:

I'm trying to run an LES solution, restart from a converged RANS solution, to make the LES solution converge quickly. But one error occurred: "Invalid (not-a-number) values detected for a field".
error.png
I checked the log file, guess maybe it's because of an error when restarting LES from the previous RANS result. I have no problem when restarting an LES solution from a previous LES result, or restarting RANS from RANS.

Another thing need to mention is that, the previous RANS mesh is coarse, and the current LES mesh is refined. But the CFD model is the same. So I ticked the "Different mesh" box, and choose the .csm file from the previous RANS checkpoint folder. Also, in "Advanced options", I didn't tick the "Read the auxiliary restart file" box.
Start Restart.PNG
Could you please suggest to me, if the setting is correct or not? And how to deal with this error? Thank you so much for your help!

Best regards,
Ruonan

Re: Error run LES when restart from RANS

Posted: Thu Jul 01, 2021 2:40 pm
by Ruonan
Please find the xml and log files here. Thank you!

Best regards,
Ruonan

Re: Error run LES when restart from RANS

Posted: Thu Jul 01, 2021 4:21 pm
by Yvan Fournier
Hello,

I received another bug report and test case for a similar issue, probably the same one as here. I located the error (exponential in RANS to LES term, with negative R_00 value in some cells; in src/turb/cs_les_synthetic_eddy_method.c, line 1670 for current master branch), and an checking with colleagues which formula should be used there instead of the current one. So I should have a fix very soon.

Best regards,

Yvan

Re: Error run LES when restart from RANS

Posted: Thu Jul 01, 2021 4:29 pm
by Ruonan
Hello Yvan,

Thank you very much! I will follow your updates on GitHub.

Best regards,
Ruonan

Re: Error run LES when restart from RANS

Posted: Sun Jul 18, 2021 10:47 pm
by Yvan Fournier
Hello,

This has been fixed on the master and v7.0 branches a few days ago.

Best regards,

Yvan

Re: Error run LES when restart from RANS

Posted: Tue Jul 20, 2021 3:55 pm
by Gen
Hello Yvan,

I got the fixed version from Git but I still received the same error as Ruonan mentioned before, when I tried to restart LES from RANS.
src/base/cs_log_iteration.c:842: Fatal error.

Invalid (not-a-number) values detected for a field.
Did I make a mistake? Looking forward to your reply, thank you so much!

Best regards,
Gen

Re: Error run LES when restart from RANS

Posted: Tue Jul 20, 2021 7:35 pm
by Yvan Fournier
Hello,

There might be another bug. Do you have a small test case on which I could try to reproduce this ?
If your cas is large, the other option would be to run it on your side with a debug build, which would detect the cause of the "NaN" earlier and help locate the issue.

Best regards,

Yvan

Re: Error run LES when restart from RANS

Posted: Wed Jul 21, 2021 2:06 pm
by Gen
Hello Yvan,

Please kindly find the setup file and the mesh of my test case in the attachment. It's a simple channel flow, I first tested it with k-omega model than I tried to run Smagorinsky model based on the previous checkpoint result.
In the meanwhile I will try to fix it by my side with the debug mode.
Thank you so much for your help!Bonne journée!

Best regards,
Gen

Re: Error run LES when restart from RANS

Posted: Wed Jul 21, 2021 3:35 pm
by Gen
As for debug build, shall I perform a separate installation? Could I just modify setup file like this when I install saturne.py?
# Install Code_Saturne with debugging symbols
#--------------------------------------------------------
debug yes
And if I use other code_saturne versions, I will always get the following error:
READING THE MAIN RESTART FILE

Start reading

Warning: the number of variables or properties has been changed
relative to the restart file.

current: 4 model and 0 user variables
17 model and 0 user properties
previous: 5 model and 0 user variables
12 model and 0 user properties

The computation continues, with a partial restart.
Reading dimensions complete
Reading the previous time step number (restarting computation) NTPABS = 80000
Reading the previous time step number (restarting computation) TTPABS = 0.8000E+01
Reading options complete
restart/main.csc: section "wall_yplus::vals::0" not present.

Warning: the turbulence model has been changed
relative to the restart file.

current model: 40
previous model: 60

The computation continues, with a partial an/or adapted restart.
restart/main.csc: section "epsilon::vals::0" not present.

SIGFPE signal (floating point exception) intercepted!
I will be really thankful if you could give me some help. Merci beaucoup!

Best regards,
Gen

Re: Error run LES when restart from RANS

Posted: Thu Jul 22, 2021 9:36 am
by Yvan Fournier
Hello,

Yes, to install a debug version, you can change the setting in the installer.

Debug builds are usually about 3x slower than regular builds, so I personally prefer to do a second install an another (adjacent) path, so as to always be able to access both versions.

In any case, the SIGFPE you observe and the "Not a Number" mentioned in a previous post are probably related.
Running your case under a debugger, it seems "epsilon" is zero, and e divide by that.

So I assume the omega->epsilon conversion is missing here, and the restart would probably work from a k-epsilon computation. I'll check if I can fix this myself for k-omega or see with colleagues more exert in this part of the code.

Best regards,

Yvan

Edit: I fixed to bug on the master and v7.0 branches. The GitHub mirror has been synchronized.