user-defined functions

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
hiba
Posts: 8
Joined: Wed Apr 10, 2024 2:23 pm

user-defined functions

Post 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.
Attachments
setup.xml
(8.06 KiB) Downloaded 5 times
hiba
Posts: 8
Joined: Wed Apr 10, 2024 2:23 pm

Re: user-defined functions

Post by hiba »

here is run_solver.log
Attachments
run_solver.log
(3.83 MiB) Downloaded 7 times
hiba
Posts: 8
Joined: Wed Apr 10, 2024 2:23 pm

Re: user-defined functions

Post by hiba »

Please find also the med file.
Mesh_1.med
(3.34 MiB) Downloaded 3 times
Yvan Fournier
Posts: 4085
Joined: Mon Feb 20, 2012 3:25 pm

Re: user-defined functions

Post 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
hiba
Posts: 8
Joined: Wed Apr 10, 2024 2:23 pm

Re: user-defined functions

Post 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.
Attachments
boundary forces.png
Yvan Fournier
Posts: 4085
Joined: Mon Feb 20, 2012 3:25 pm

Re: user-defined functions

Post by Yvan Fournier »

Hello,

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

Best regards,

Yvan
hiba
Posts: 8
Joined: Wed Apr 10, 2024 2:23 pm

Re: user-defined functions

Post 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.
Attachments
setup.xml
(8.24 KiB) Downloaded 3 times
run_solver.log
(7.29 MiB) Downloaded 6 times
Yvan Fournier
Posts: 4085
Joined: Mon Feb 20, 2012 3:25 pm

Re: user-defined functions

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