Restart from k-eps tubulence model with spalart-allmaras one

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Cbarnaud
Posts: 36
Joined: Tue Oct 22, 2019 10:28 am

Restart from k-eps tubulence model with spalart-allmaras one

Post by Cbarnaud »

Hello,

I'm trying to improve one of my simulations changing the turbulence model in CS 6.0.0.
My simulation is very heavy and takes time to stabilize so I would rather make a restart from if.
The first simulation works with k-eps standard turbulence model and now I would like to use the spalart-allmaras model.
Yet I have this error when I tried it :

Code: Select all

 INSTANT    0.304425000E+00   TIME STEP NUMBER           60885
 =============================================================




/gpfs1/home/2006003/cbarna01/code_saturne-6.0.0/src/base/cs_field.c:1104: Fatal error.

Fortran pointer of rank 1 requested for values of field "velocity",
which have rank 2.


Call stack:
   1: 0x2b24317e4306 <cs_f_field_var_ptr_by_id+0x96>  (libsaturne-6.0.so)
   2: 0x2b2431eaaf21 <__field_MOD_field_get_val_s+0x21> (libsaturne-6.0.so)
   3: 0x401d60     <usvist_+0x53>                   (cs_solver)
   4: 0x2b24318bff17 <phyvar_+0x2e07>                 (libsaturne-6.0.so)
   5: 0x2b24318e5180 <tridim_+0xfb0>                  (libsaturne-6.0.so)
   6: 0x2b2431768412 <caltri_+0x20f2>                 (libsaturne-6.0.so)
   7: 0x2b24314bc8d5 <cs_run+0x5e5>                   (libcs_solver-6.0.so)
   8: 0x2b24314bc1b5 <main+0x175>                     (libcs_solver-6.0.so)
   9: 0x2b2435f56495 <__libc_start_main+0xf5>         (libc.so.6)
  10: 0x401249     <>                               (cs_solver)
End of stack

I attached my listing file, my setup file and the cs_user_physical_properties.f90 with my modifications (on viscosity calculation).
I think I miss something with the setup file but I don't know where exactly.

Thank a lot for your help.
Best regards,
Camille.
Attachments
cs_user_physical_properties.f90
(13.24 KiB) Downloaded 261 times
listing.txt
(27.22 KiB) Downloaded 264 times
setup.xml
(18.91 KiB) Downloaded 231 times
Yvan Fournier
Posts: 4221
Joined: Mon Feb 20, 2012 3:25 pm

Re: Restart from k-eps tubulence model with spalart-allmaras one

Post by Yvan Fournier »

Hello,

I checked a similar issue a few weeks ago for another user, and it seems one or two combinations are not handled correctly (in cs_restart_default.c).

I'll try to check this soon and provide a "clean" patch in a few days at most.

Best regards,

Yvan
Yvan Fournier
Posts: 4221
Joined: Mon Feb 20, 2012 3:25 pm

Re: Restart from k-eps tubulence model with spalart-allmaras one

Post by Yvan Fournier »

Hello,

Actually, the issue is in your user subroutines.

Never just copy routines from one mjor version (5.0) to another (6.0), as the arguments mays change slightly, but instead merge the file with the new reference (using a tool like meld for example).

In you case, the main problem is that in usvist, you try to access cvar_k and cvar_ep, which are probably initialized to 0 (they should be initialized to -1 for a clearer message). As 0 is the velocity field id if fields are defined in the standard order, this causes your error.

Best regards,

Yvan
Post Reply