TAGGED: python, python-scripts, udf-in-fluent
-
-
April 20, 2025 at 2:56 pm
s.sethuraman
SubscriberHi,Â
I have a question regarding writing and implementing UDFs for Fluent in Python. I understand that it is only available in the Beta Feature in 2025R1. But I have a hard time implementing them.Â
The Link (33.1. Fluent GPU Solver Beta Features) explains how to implement them and since they are in beta version, you can only use TUI command. I used this command (
(rpsetvar 'gpuapp/python-udf-files '("myudf.py"))
) with my UDF. I think the scheme command hooks my UDF, but the UDF is never implemented during iteration. With the above command, I don't encounter any errors either. So, I think there is no error in UDF.py. But Fluent silently ignores the UDF?
In addition, I observed that only a handful of functions are currently available in Python UDF (Table 33.5: Supported Hookup Functions). I cannot seem to find any relevant function which is equivalent to DEFINE_NET_REACTION_RATE (name, c, t, particle, pressure, temp, yi, rr, jac) in C UDFs.Â
If anyone has experience in handling the above two issues, please let me know.Â
Any suggestion is highly helpful. :)
Thank you!
-
April 22, 2025 at 9:16 am
Rob
Forum ModeratorAs it's a beta feature there's a good chance it's not fully functional. Additionally, the gpu solver hasn't (yet) got all of the additional models available: so the chemistry UDFs may simply not be available (yet).Â
What is your UDF trying to do?Â
-
April 23, 2025 at 5:46 am
s.sethuraman
SubscriberHi, Rob.Â
The main purpose of the UDF is to define net reaction rate for every species in the model. As premilinary test, I was trying a Python UDF to perform logging of velocity components, but it did not work as I expected. The model case is fairly simple - Laminar Combustion.
I guess I could perform the same in C. But I wanted to implement it in Python since my Custom Chemistry Calculation program is in Python.Â
Thanks in advance!
-
April 23, 2025 at 8:49 am
Rob
Forum ModeratorI suspect that's not available in the gpu solver at present. The fact you needed a rpsetvar to switch something on generally means it's not quite ready.Â
-
April 23, 2025 at 9:12 am
Rob
Forum ModeratorAnd for once the person I needed was in the same time zone and available. It's not quite there yet: keep watching the release notes as it's a rapidly evolving solver.Â
-
- You must be logged in to reply to this topic.
-
3019
-
971
-
857
-
767
-
599
© 2025 Copyright ANSYS, Inc. All rights reserved.