Page 1 of 1

user-defined functions

Posted: Wed Apr 24, 2024 4:56 pm
by hiba
Hello everyone,

I am trying a turbulent wind simulation around a solid, with a Re=2.6e7, as I run the calculation with a rans model (K-w) with no wall functions I get some warnings/errors (see run_solver.log) that I don't understand. Also I have a question about the general use of user-defined functions, I copied "cs_user_extra_operations-boundary_forces" for instance to my SRC folder in the study. However after the calculation is complete there are no related results to the forces or maybe I don't know how to get them.

Please find attached the setup and run_solver files.

Thank you in advance for any explanations and help.

Kind regards.

Re: user-defined functions

Posted: Wed Apr 24, 2024 4:59 pm
by hiba
here is run_solver.log

Re: user-defined functions

Posted: Thu Apr 25, 2024 8:46 am
by hiba
Please find also the med file.
Mesh_1.med
(3.34 MiB) Downloaded 10 times

Re: user-defined functions

Posted: Thu Apr 25, 2024 7:13 pm
by Yvan Fournier
Hello,

If you are a beginner with the code, I recommend generating the boundary forces output simply by selecting it from the GUI. With user-defined functions, you can do additional filtering, summation, ... but you need to first have the matching field activated, which is not well documented (but can be activated through the GUI).

Did you adapt the user-defined function to your case (i.e. selecting the required zones) ? Never simply copy an example if you cannot understand its basic steps. Examples are just that. Examples, which usually need adapting to your case/mesh/...

Also, you warnings seem to indicate you are selecting groups "2 or 3" but those are not present in you mesh. This may be related to the paragraph above...

Best regards,

Yvan

Re: user-defined functions

Posted: Fri Apr 26, 2024 9:46 am
by hiba
Hi Yvan,

Thank you for your reply, I am not sure how to generate the boundary forces using the gui do I select the user-function ?(see screenshot attached).

Kindly.

Re: user-defined functions

Posted: Fri Apr 26, 2024 7:23 pm
by Yvan Fournier
Hello,

Simply select the boundary forces output in the Postprocessing/Surface Solution control section.

Best regards,

Yvan

Re: user-defined functions

Posted: Mon Apr 29, 2024 4:34 pm
by hiba
Hello Yvan,

Thank you for your reply. When I run the calculation this time I do get the drag and lift forces after implementing a user-defined function in SRC. However, I still get the following error:


/softs/Saturne/source/code_saturne-8.0.2/src/base/cs_runaway_check.c:244: Fatal error
Runaway computation:
At least one field exceeded allowed bounds (see log)


Does it mean that the calculation diverges? I also tried changing the mpi ranks as explained in another thread.
Please find attached the latest versions of the setup and run_solver files.

Thank you in advance for your help.

Re: user-defined functions

Posted: Tue Apr 30, 2024 7:27 pm
by Yvan Fournier
Hello,

Yes the computation seems to diverge.
The code has a safety stop when velocity reaches 10000 m/s as that is out of physical bounds for incompressible flow, and stopping cleanly still allows for postprocessing.

Best regards,

Yvan