Page 1 of 1

simulation with cs_fan : missing fans_ids field

Posted: Fri Sep 02, 2016 3:52 pm
by sirlb
Hello,

In CS 4.3.0, i am trying to set up a case with a fan.
I have only added the cs_user_parameter-fan.c file in SRC and then run the case.

The computation fails with the following message :

Code: Select all

cs_field.c:2127: Fatal error.

Field "fans_ids" is not defined.


Call stack:
   1: 0x7fc782f23103 <cs_field_by_name+0x63>          (libsaturne.so.0)
   2: 0x7fc782f20391 <cs_fan_flag_cells+0x171>        (libsaturne.so.0)
   3: 0x7fc782f20589 <cs_fan_compute_flows+0x89>      (libsaturne.so.0)
   4: 0x7fc782fe59a2 <predvv_+0x5922>                 (libsaturne.so.0)
   5: 0x7fc782fd23fb <navstv_+0x2276>                 (libsaturne.so.0)
   6: 0x7fc783003619 <tridim_+0x4d79>                 (libsaturne.so.0)
   7: 0x7fc782ec82e5 <caltri_+0x2a55>                 (libsaturne.so.0)
   8: 0x7fc782e99ada <cs_run+0x48a>                   (libsaturne.so.0)
   9: 0x7fc782e9950f <main+0x12f>                     (libsaturne.so.0)
  10: 0x7fc7807c6af5 <__libc_start_main+0xf5>         (libc.so.6)
  11: 0x4008f9     <>                               (cs_solver)
End of stack

I understood that cs_fan_flag_cells function is calling cs_field_by_name with "fans_ids" name for the field but this one is not existing.

I tried to see in which part of the code this field could be initialized but didn't find so far.

Any ideas ? Is there another parameter file in which we have to declare fans and initialize fields ?

Thanks,

Re: simulation with cs_fan : missing fans_ids field

Posted: Fri Sep 02, 2016 5:40 pm
by sirlb
For information, I reconfigure my case for version 4.2.1 and simulation is running.
This seems to be a problem with version 4.3.0.

Has anybody observed the same behaviour ? or do i have a corrupted installation ?

Re: simulation with cs_fan : missing fans_ids field

Posted: Fri Sep 02, 2016 6:16 pm
by Yvan Fournier
Hello,

There seems to be a bug due to some renaming. We'll fix this in 4.3.1, but in the meantime you may edit src/base/cs_fan.c and replace cs_field_by_name("fans_ids") with cs_field_by_name("fan_id") where you find it.

Regards,

Yvan

Re: simulation with cs_fan : missing fans_ids field

Posted: Tue Sep 06, 2016 9:17 pm
by sirlb
Hello,

Yes this is working pretty well. Thanks for the fix.
I also notice a strange behaviour between 4.2.1 and 4.3.0 :

In 4.2.1, my fan model does not log any volume for my fan (adding extra code to report cell count show 0 cell in the fan). But computation results show that the fan is properly working and flow field seems ok.

In 4.3.0, the same model log the actual fan volume.

I don"t really understand why, but i guess i will switch back to 4.3.0 with your fix, so everything should be ok.

Best regards.

Re: simulation with cs_fan : missing fans_ids field

Posted: Wed Sep 07, 2016 1:15 pm
by sirlb
oh wrong info, this is not related to 4.2.1/4.3.0 because i also have wrong logging info in 4.3.0.
this must be caused by the code i've changed; but this is very curious since i didn't modified any of the lines dealing with fan cell flag or volume computation.

Re: simulation with cs_fan : missing fans_ids field

Posted: Thu Sep 08, 2016 12:44 am
by Yvan Fournier
Hello,

I seem to recall having added an or modified options for the postprocessing of fan placement visualization between 4.2 and 4.3 (would need to check git or the ChangeLog for details), so the difference is probably ony due to additional postprocessing/verification output; and so is probably related to this new "feature".

Regards,

Yvan

Re: simulation with cs_fan : missing fans_ids field

Posted: Thu Sep 08, 2016 8:35 am
by sirlb
Hello,

I still don"t understand why sometime the logging is correct and sometimes not. (both in v4.2.1 and v4.3.0.

I am interested in postprocessing the fan cells selection. For now I am stuck with 4.2.1 (v4.3.0 gives me full of NaN during computation for same settings).

My guess is that i have to use the function cs_fan_cells_select of cs_fan.c to create a mesh in cs_user_postprocess.c.

Is that correct ? Would you have any exemple available ?

Regards,

Re: simulation with cs_fan : missing fans_ids field

Posted: Thu Sep 08, 2016 5:04 pm
by Yvan Fournier
Hello,

You solution (using cs_fan_cells_select in cs_user_postprocess.c) should work, but requires a bit more work than the buil-in visualization, which should work.

If you have a small, non-confidential case which produces NaNs under version 4.3 but works under 4.2, could you post it here so we can debug it ?

Regards,

Yvan