Compressible module "negative value of internal energy" error

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
roberto.bernetti
Posts: 35
Joined: Tue Apr 16, 2019 10:03 pm

Compressible module "negative value of internal energy" error

Post by roberto.bernetti »

I tried to run a compressible calculation on version 7.04 downloaded from the web site and installed on an ubuntu WSL2.
I would simulate pressure wave propagation away from the explosion source. I expect to have low mach number but need to take into account compressibility and chose the compressible module.
I got negative energy on the first step that I would use to have the initial condition set.

I summarize the run_solver file that I upload with the setup and mesh file
The header

Code: Select all

Local case configuration:

  Date:                Sun May  8 21:42:44 2022
  System:              Linux 5.10.16.3-microsoft-standard-WSL2 (Ubuntu 20.04 LTS)
  Machine:             
  Processor:           model name	: Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz
  Memory:              15900 MB
  User:                robber ()
  Directory:           
  MPI ranks:           4 (appnum attribute: 0)
  OpenMP threads:      1
  Processors/node:     8

  Compilers used for build:
    C compiler:        gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
    C++ compiler:      g++ (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
    Fortran compiler:  GNU Fortran (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0

  MPI version 3.1 (Open MPI 4.0.3)

  I/O read method:     collective MPI-IO (explicit offsets)
  I/O write method:    collective MPI-IO (explicit offsets)
  I/O rank step:        1
end the error message.

Code: Select all

   ** BOUNDARY MASS FLOW INFORMATION
      ------------------------------

---------------------------------------------------------------
Boundary type          Code    Nb faces           Mass flow
---------------------------------------------------------------
Sub. enth. inlet         11           0         0.000000000E+00
Ptot, Htot               10         394        -0.342931780E+04
Imp inlet/outlet          7           0         0.000000000E+00
Subsonic outlet           9           0         0.000000000E+00
Supersonic outlet         8         394        -0.398008119E+02
Wall                      5       29798         0.000000000E+00
Symmetry                  4        1302         0.000000000E+00
Undefined                 1           0         0.000000000E+00
User type                 3       13452         0.219639405E+04
---------------------------------------------------------------


   ** BOUNDARY CONDITIONS FOR SMOOTH WALLS
   ---------------------------------------
------------------------------------------------------------
                                         Minimum     Maximum
------------------------------------------------------------
   Rel velocity at the wall uiptn :  0.00000E+00 0.00000E+00
   Friction velocity        uet   :  0.10865E-02 0.51673E+00
   Friction velocity        uk    :  0.10865E-02 0.51673E+00
   Dimensionless distance   yplus :  0.44582E+01 0.63130E+03
   Friction thermal sca.    tstar :  0.00000E+00 0.00000E+00
   Dim-less thermal sca.    tplus :  0.33263E+01 0.19310E+02
   ------------------------------------------------------
   Nb of reversal of the velocity at the wall   :          0
   Nb of faces within the viscous sub-layer     :      29798
   Total number of wall faces                   :      29798
------------------------------------------------------------


Incoming flow detained for       2328 outlet faces on      13452


/home/robber/saturneCode/code_saturne-7.0.4/src/cfbl/cs_cf_thermo.c:248: Fatal error.

Error in thermodynamics computations for compressible flows
:
Negative values of the internal energy were encountered in 1 cells.



Call stack:
   1: 0x7fe7071a3dc5 <cs_cf_check_internal_energy+0x2d5> (libsaturne-7.0.so)
   2: 0x7fe70719a54e <cfener_+0x1863>                 (libsaturne-7.0.so)
   3: 0x7fe706ced154 <scalai_+0x6e5>                  (libsaturne-7.0.so)
   4: 0x7fe706cf7bd9 <tridim_+0x44a1>                 (libsaturne-7.0.so)
   5: 0x7fe706b666ff <caltri_+0x1c2f>                 (libsaturne-7.0.so)
   6: 0x7fe707a2bb97 <main+0x717>                     (libcs_solver-7.0.so)
   7: 0x7fe7068c10b3 <__libc_start_main+0xf3>         (libc.so.6)
   8: 0x56455a97808e <_start+0x2e>                    (cs_solver)
End of stack
Thank you in advance for any help.
Attachments
mesh.zip
(4.52 MiB) Downloaded 69 times
run_solver.log
(828.02 KiB) Downloaded 64 times
setup.xml
(10.57 KiB) Downloaded 69 times
Saluti
Roberto
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Compressible module "negative value of internal energy" error

Post by Yvan Fournier »

Hello,

The compressible model can be quite sensitive (and i am not an expert in that module).

Can you try reducing the time step to see if things improve ? If you have low compressiblilty, you might want to setup the case with an incompressible flow to adjust the time step so as to have a reasonable CFL number (around) 1 first, if you have not done that already.

Best regards,

Yvan
roberto.bernetti
Posts: 35
Joined: Tue Apr 16, 2019 10:03 pm

Re: Compressible module "negative value of internal energy" error

Post by roberto.bernetti »

Hi
Yvan Fournier wrote: Mon May 09, 2022 11:22 pm ..... If you have low compressiblilty, you might want to setup the case with an incompressible flow to adjust the time step so as to have a reasonable CFL number (around) 1 first, .....
Do you mean to run an incompressible solution and then change to a compressible model and run a restart?
Saluti
Roberto
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Compressible module "negative value of internal energy" error

Post by Yvan Fournier »

Hello,

Yes, I suggest this, at least if it can help you select a time step to get a reasonable time step. If you already know the time step you need, or simply try successively dividing it by 5 or 10 to see if the behavior improves, that step may not be necessary. But as the compressible model is less tested than the incompressible one, and you flow is only slightly compressible, so running an incompressible computation can make sense, it can provide a useful reference.

Best regards,

Yvan
Post Reply