Page 1 of 1

Crash at boundary initilisation of a new user defined transported scalar variable

Posted: Tue Jul 20, 2021 12:41 pm
by kenneth
Hi all,

I am trying to use Code_Saturne 7.0.0 to compute an additional transported scalar. This scalar transported variable is defined using the GUI (please see attached XML file).

When I introduce this variable, the solver crashes due to an assert statement in function cs_boundary_conditions_compute in file cs_boundary_conditions.c. The assert statement checks that the associated variable ID is >= 0, but the ID returned for the user scalar variable is -2. I have attached my XML file in case the issue is there.

Thank you and kind regards,

Kenneth

Re: Crash at boundary initilisation of a new user defined transported scalar variable

Posted: Tue Jul 20, 2021 2:25 pm
by Yvan Fournier
Hello,

Could you also post a small mesh matching this ? Do you have user subroutines ?

I do not reproduce the issue on the v7.0 branch with just the XML file and an "arbitrary" mesh.

Regards,

Yvan

Re: Crash at boundary initilisation of a new user defined transported scalar variable

Posted: Tue Jul 20, 2021 3:57 pm
by kenneth
Hi Yvan,

Thank you for the prompt reply. Yes, I do have subroutines. Please find attached a small working test case, which produces the error. The mesh and subroutines used are included.

Please note, typically the model requires SYRTHES, but I have suppressed these bits. However, it may crash past the boundary initialisation issue (when resolved).

Thank you for your help & kind regards,

Kenneth

Re: Crash at boundary initilisation of a new user defined transported scalar variable

Posted: Wed Jul 21, 2021 1:34 am
by Yvan Fournier
Hello,

Thanks for the bug report.

This is now fixed in the master and v7.0 branches, and the GitHub mirror updated.

Best regards,

Yvan

Re: Crash at boundary initilisation of a new user defined transported scalar variable

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

Actually, the fix caused other issues, and was reverted.

Checking again, I see the issue is actually caused by your calling cs_parameters_create_added_properties in cs_user_model. The cs_parameters_create_added_properties is not intended to be called directly by the user, but at at specific places in the initialization sequence. So if you remove that call, your added properties will be added later (model fields are created first, and the creation of your added fields is delayed), but it solves the issue.

There is another crash when I remove that call, in referring to some specific diffusivity fields for physical properties, but I assume this is related to your partially simplified model.

Best regards,

Yvan

Re: Crash at boundary initilisation of a new user defined transported scalar variable

Posted: Thu Jul 22, 2021 10:53 am
by kenneth
Hi Yvan,

Thank you very much for your help and explanation. Removing cs_parameters_create_added_properties has solved the issue.

Kind regards,

Kenneth