Problem : Add scalars without GUI Code-Saturne version 4.3

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
HTNguyen
Posts: 1
Joined: Tue Jun 13, 2017 10:50 am

Problem : Add scalars without GUI Code-Saturne version 4.3

Post by HTNguyen »

Hello,
I'm a newbie of code_saturne version 4. I now want to add scalars without using GUI. I defined a scalar in cs_user_ parameters.c as below:

Code: Select all

void
cs_user_model(void)
{
  /* If the GUI is used, user fields should preferably be defined with the GUI,
     so that associated numerical options, boundary conditions, initializations,
     and such may also be defined using the GUI. */

  if (cs_gui_file_is_loaded())
    return;
    cs_parameters_add_variable("tracer", 1);
}
and I got an error

Code: Select all

** SOLVING VARIABLE tracer          
      ----------------

 _iterative_vector_gradient: isweep = 2, normed residual: 3.069990e-13, norm: 3.645661e+04, var: velocity



cs_field.c:989: Fatal error.

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


Call stack:
   1: 0x7f49cb4a05b8 <cs_f_field_var_ptr_by_id+0x88>  (libsaturne.so.0)
   2: 0x7f49cba475b5 <__field_MOD_field_get_val_prev_s+0x21> (libsaturne.so.0)
   3: 0x7f49cb7b56c4 <divrit_+0x7fd>                  (libsaturne.so.0)
   4: 0x7f49cb46e4f0 <covofi_+0x3ab6>                 (libsaturne.so.0)
   5: 0x7f49cb571d9a <scalai_+0xb68>                  (libsaturne.so.0)
   6: 0x7f49cb57db9f <tridim_+0x5dff>                 (libsaturne.so.0)
   7: 0x7f49cb445854 <caltri_+0x27a4>                 (libsaturne.so.0)
   8: 0x7f49cb428d7a <cs_run+0x48a>                   (libsaturne.so.0)
   9: 0x7f49cb4287a5 <main+0x125>                     (libsaturne.so.0)
  10: 0x7f49caac7830 <__libc_start_main+0xf0>         (libc.so.6)
  11: 0x4047b9     <_start+0x29>                    (cs_solver)
End of stack
Does anyone have the solution?
Thanks in advance.
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

Re: Problem : Add scalars without GUI Code-Saturne version 4

Post by Yvan Fournier »

Hello,

The info is not sufficient to guess at the problem. Please follow the recommendations in the forum usage guidelines to see what to provide.

Also, v4.3 is obsolete and not maintained any more, so switching to v5.0 is recommended.

Regards,

Yvan
Post Reply