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

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
kenneth
Posts: 11
Joined: Sun Jul 18, 2021 9:23 pm

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

Post 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
Attachments
setup.xml
(10.44 KiB) Downloaded 104 times
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

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

Post 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
kenneth
Posts: 11
Joined: Sun Jul 18, 2021 9:23 pm

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

Post 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
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

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

Post 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
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

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

Post 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
kenneth
Posts: 11
Joined: Sun Jul 18, 2021 9:23 pm

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

Post 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
Post Reply